Compare commits

..
Author SHA1 Message Date
MickLesk 067ddf764e deCONZ: start in privileged Incus containers, skip an update with nothing new
The postinst gives /usr/bin/deCONZ the sys_time and sys_boot file caps; a
privileged Incus container lacks them in its bounding set, so exec failed
with 'Operation not permitted'. The service runs as root and needs none, so
an apt hook drops them after every dpkg run. The update now upgrades deconz
only when a newer version exists.
2026-11-17 14:52:21 +01:00
MickLesk 26a2c0b76f Fetch libssl1.1 for deCONZ over HTTPS on arm64 2026-11-17 14:16:58 +01:00
21 changed files with 117 additions and 862 deletions

No files matched your search

-36
View File
@@ -203,42 +203,6 @@
}
]
},
{
"title": "🛰️ Services",
"labels": [
"services"
],
"subCategories": [
{
"title": "🐞 Bug Fixes",
"labels": [
"bugfix"
],
"notes": []
},
{
"title": "✨ New Features",
"labels": [
"feature"
],
"notes": []
},
{
"title": "💥 Breaking Changes",
"labels": [
"breaking change"
],
"notes": []
},
{
"title": "🔧 Refactor",
"labels": [
"refactor"
],
"notes": []
}
]
},
{
"title": "❔ Uncategorized",
"labels": [
+4 -5
View File
@@ -324,14 +324,13 @@ jobs:
git commit -m "Archive old changelog entries"
git checkout -b $BRANCH_NAME || git checkout $BRANCH_NAME
git push origin $BRANCH_NAME --force
echo "HEAD_SHA=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
- name: Create pull request if not exists
if: env.changed == 'true'
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
PR_EXISTS=$(gh pr list --head "${BRANCH_NAME}" --state open --json number,isCrossRepository --jq '[.[] | select(.isCrossRepository == false)][0].number // empty')
PR_EXISTS=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
if [ -z "$PR_EXISTS" ]; then
gh pr create --title "[Github Action] Archive old changelog entries" \
--body "This PR is auto-generated by a Github Action to archive old changelog entries (older than 14 days) to .github/changelogs/YEAR/MONTH.md" \
@@ -347,8 +346,8 @@ jobs:
run: |
git config --global user.name "github-actions-automege[bot]"
git config --global user.email "github-actions-automege[bot]@users.noreply.github.com"
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --state open --json number,isCrossRepository --jq '[.[] | select(.isCrossRepository == false)][0].number // empty')
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
if [ -n "$PR_NUMBER" ]; then
gh pr review "$PR_NUMBER" --approve
gh pr merge "$PR_NUMBER" --squash --admin --match-head-commit "$HEAD_SHA"
gh pr review $PR_NUMBER --approve
gh pr merge $PR_NUMBER --squash --admin
fi
+67 -118
View File
@@ -118,63 +118,9 @@ jobs:
)
);
async function getScriptAuthors(pr) {
try {
const { data: files } = await github.rest.pulls.listFiles({
owner: context.repo.owner,
repo: "ProxmoxVE",
pull_number: pr.number,
per_page: 100,
});
const ctFile = files.find(file => file.status === "added" && /^ct\/[^/]+\.sh$/.test(file.filename));
if (!ctFile) return "";
const { data: script } = await github.rest.repos.getContent({
owner: context.repo.owner,
repo: "ProxmoxVE",
path: ctFile.filename,
ref: pr.merge_commit_sha,
});
const header = Buffer.from(script.content, "base64").toString("utf-8")
.split("\n").slice(0, 20)
.find(line => /^#\s*Authors?:/i.test(line));
if (!header) return "";
// "MickLesk (CanbiZ)" puts the handle first, "Slaviša Arežina (tremor021)" in the parentheses
const candidates = header.replace(/^#\s*Authors?:/i, "").split("|").map(part => {
part = part.trim().replace(/^[A-Za-z-]+:\s*/, "");
const match = part.match(/^([^(]*)\(([^)]*)\)/);
if (!match) return part;
const words = match[1].trim().split(/\s+/).filter(Boolean);
return words.length === 1 ? words[0] : match[2].trim();
});
// A display name used alone in a header; the GitHub account of that name is someone else
const authorAliases = { canbiz: "MickLesk" };
const logins = [];
for (let candidate of candidates) {
if (!/^[A-Za-z0-9-]+$/.test(candidate)) continue;
candidate = authorAliases[candidate.toLowerCase()] ?? candidate;
try {
const { data: user } = await github.rest.users.getByUsername({ username: candidate });
if (user.type === "User" && !logins.includes(user.login)) logins.push(user.login);
} catch (error) {
console.log(`No GitHub user ${candidate} (${ctFile.filename}): ${error}`);
}
}
return logins.map(login => `[@${login}](https://github.com/${login})`).join(", ");
} catch (error) {
console.error(`Could not read the author of #${pr.number}: ${error}`);
return "";
}
}
for (const pr of filteredPRs) {
const prLabels = pr.labels.map(label => label.name.toLowerCase());
const scriptAuthors = prLabels.includes("new script") ? await getScriptAuthors(pr) : "";
if (scriptAuthors) {
prNote = `- ${pr.title} ${scriptAuthors} ([#${pr.number}](${pr.html_url}))`;
} else if (pr.user.login.includes("push-app-to-main[bot]")) {
if (pr.user.login.includes("push-app-to-main[bot]")) {
const scriptName = pr.title;
try {
@@ -182,12 +128,11 @@ jobs:
owner: context.repo.owner,
repo: "DevScripts",
state: "all",
labels: ["Started Migration To ProxmoxVE"],
per_page: 100,
labels: ["Started Migration To ProxmoxVE"]
});
const matchingIssue = relatedIssues.find(issue =>
issue.title.trim().toLowerCase() === scriptName.trim().toLowerCase()
issue.title.toLowerCase().includes(scriptName.toLowerCase())
);
if (matchingIssue) {
@@ -267,70 +212,75 @@ jobs:
}
// ── Pull requests from other repositories ───────────────────────
const externalRepos = [
{ repo: "core", category: "💾 Core", prefix: "core" },
{ repo: "services", category: "🛰️ Services", prefix: "services" },
{ repo: "ProxmoxVE-Frontend", category: "🌐 Website", prefix: "website" },
];
const externalLabelAliases = {
bug: "bugfix",
bugfix: "bugfix",
enhancement: "feature",
feature: "feature",
refactor: "refactor",
"breaking change": "breaking change",
};
const externalPriority = ["breaking change", "bugfix", "feature", "refactor"];
// ── Engine pull requests ────────────────────────────────────────
// The engine lives in community-scripts/core, so its changes never
// show up in this repository's PR list -- and a fix there reaches
// every script here. The "💾 Core" category already existed for
// ProxmoxVE PRs labelled `core`; engine PRs land in the same place.
try {
const { data: corePulls } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: "core",
base: "main",
state: "closed",
sort: "updated",
direction: "desc",
per_page: 100,
});
for (const { repo, category: categoryTitle, prefix } of externalRepos) {
try {
const { data: externalPulls } = await github.rest.pulls.list({
owner: context.repo.owner,
repo,
base: "main",
state: "closed",
sort: "updated",
direction: "desc",
per_page: 100,
});
const coreCategory = categorizedPRs.find(category =>
category.title.includes("Core") || category.labels.includes("core"));
const category = categorizedPRs.find(c => c.title === categoryTitle);
// core carries GitHub's default label set, and most of its pull
// requests carry none at all, so map what maps and let the rest
// sit directly under the category.
const coreLabelAliases = {
bug: "bugfix",
bugfix: "bugfix",
enhancement: "feature",
feature: "feature",
refactor: "refactor",
"breaking change": "breaking change",
};
const corePriority = ["breaking change", "bugfix", "feature", "refactor"];
for (const pr of externalPulls) {
if (!pr.merged_at) continue;
if (new Date(pr.merged_at) <= latestDateInChangelog) continue;
for (const pr of corePulls) {
if (!pr.merged_at) continue;
if (new Date(pr.merged_at) <= latestDateInChangelog) continue;
const rawLabels = pr.labels.map(label => label.name.toLowerCase());
if (rawLabels.some(l => ["invalid", "wontdo", "wontfix", "duplicate", process.env.AUTOMATED_PR_LABEL].includes(l))) continue;
const rawLabels = pr.labels.map(label => label.name.toLowerCase());
if (rawLabels.some(l => ["invalid", "wontdo", "wontfix", "duplicate", process.env.AUTOMATED_PR_LABEL].includes(l))) continue;
if (!category) {
console.log(`No ${categoryTitle} category configured; skipping ${prefix}#${pr.number}`);
continue;
}
if (!coreCategory) {
console.log(`No Core category configured; skipping core#${pr.number}`);
continue;
}
// core#N rather than #N: a bare #N links to a pull request in this repository.
const note = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([${prefix}#${pr.number}](${pr.html_url}))`;
// core#N rather than #N: a bare number reads as a pull request
// in this repository, so the link would lead somewhere other
// than the text promises.
const coreNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([core#${pr.number}](${pr.html_url}))`;
const mapped = rawLabels.map(l => externalLabelAliases[l]).filter(Boolean);
let placed = false;
if (category.subCategories && category.subCategories.length > 0) {
for (const priorityLabel of externalPriority) {
if (!mapped.includes(priorityLabel)) continue;
const subCategory = category.subCategories.find(sub =>
sub.labels.includes(priorityLabel));
if (subCategory) {
subCategory.notes.push(note);
placed = true;
break;
}
const mapped = rawLabels.map(l => coreLabelAliases[l]).filter(Boolean);
let placed = false;
if (coreCategory.subCategories && coreCategory.subCategories.length > 0) {
for (const priorityLabel of corePriority) {
if (!mapped.includes(priorityLabel)) continue;
const subCategory = coreCategory.subCategories.find(sub =>
sub.labels.includes(priorityLabel));
if (subCategory) {
subCategory.notes.push(coreNote);
placed = true;
break;
}
}
if (!placed) category.notes.push(note);
}
} catch (error) {
console.error(`Could not read ${repo} pull requests: ${error}`);
if (!placed) coreCategory.notes.push(coreNote);
}
} catch (error) {
// The engine repository being unreachable must not cost this
// repository its changelog.
console.error(`Could not read core pull requests: ${error}`);
}
return categorizedPRs;
@@ -399,14 +349,13 @@ jobs:
git commit -m "Update CHANGELOG.md"
git checkout -b $BRANCH_NAME || git checkout $BRANCH_NAME
git push origin $BRANCH_NAME --force
echo "HEAD_SHA=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
- name: Create pull request if not exists
if: env.changed == 'true'
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
PR_EXISTS=$(gh pr list --head "${BRANCH_NAME}" --state open --json number,isCrossRepository --jq '[.[] | select(.isCrossRepository == false)][0].number // empty')
PR_EXISTS=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
if [ -z "$PR_EXISTS" ]; then
gh pr create --title "[Github Action] Update CHANGELOG.md" \
--body "This PR is auto-generated by a Github Action to update the CHANGELOG.md file." \
@@ -420,9 +369,9 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --state open --json number,isCrossRepository --jq '[.[] | select(.isCrossRepository == false)][0].number // empty')
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
if [ -n "$PR_NUMBER" ]; then
gh pr review "$PR_NUMBER" --approve
gh pr review $PR_NUMBER --approve
fi
- name: Approve pull request and merge
@@ -432,8 +381,8 @@ jobs:
run: |
git config --global user.name "github-actions-automege[bot]"
git config --global user.email "github-actions-automege[bot]@users.noreply.github.com"
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --state open --json number,isCrossRepository --jq '[.[] | select(.isCrossRepository == false)][0].number // empty')
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
if [ -n "$PR_NUMBER" ]; then
gh pr review "$PR_NUMBER" --approve
gh pr merge "$PR_NUMBER" --squash --admin --match-head-commit "$HEAD_SHA"
gh pr review $PR_NUMBER --approve
gh pr merge $PR_NUMBER --squash --admin
fi
+3 -25
View File
@@ -19,7 +19,6 @@ jobs:
run: sed -n '/^## /,$p' CHANGELOG.md > changelog_cleaned.md
- name: Extract relevant changelog section
id: extract
run: |
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
echo "Checking for changes on: $YESTERDAY"
@@ -27,24 +26,8 @@ jobs:
# Extract the section from "## $YESTERDAY" until the next "## YYYY-MM-DD"
sed -n "/^## $YESTERDAY/,/^## [0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}/p" changelog_cleaned.md | head -n -1 > changelog_tmp_full.md
# GitHub fills a release's Contributors only from bare @login mentions
sed -i -E 's#\[@([A-Za-z0-9-]+)\]\(https://github\.com/\1\)#@\1#g' changelog_tmp_full.md
# Keep whole lines up to 120000 characters (GitHub allows 125000)
export LC_ALL=C.UTF-8
SIZE=0
TRUNCATED=false
while IFS= read -r line || [ -n "$line" ]; do
SIZE=$((SIZE + ${#line} + 1))
if [ "$SIZE" -gt 120000 ]; then
TRUNCATED=true
break
fi
printf '%s\n' "$line"
done < changelog_tmp_full.md > changelog_tmp.md
if [ "$TRUNCATED" = true ]; then
printf '\nCut to fit the release size limit. The full list is in [CHANGELOG.md](https://github.com/community-scripts/ProxmoxVE/blob/main/CHANGELOG.md).\n' >> changelog_tmp.md
fi
# Truncate the extracted section to 5000 characters
head -c 5000 changelog_tmp_full.md > changelog_tmp.md
echo "=== Extracted Changelog ==="
cat changelog_tmp.md
@@ -53,17 +36,12 @@ jobs:
# Abort if no content was found
if [ ! -s changelog_tmp.md ]; then
echo "No changes found for $YESTERDAY, skipping release."
echo "skip=true" >> "$GITHUB_OUTPUT"
exit 0
fi
- name: Create GitHub release
if: steps.extract.outputs.skip != 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
PREVIOUS=$(gh release view --json tagName --jq .tagName 2>/dev/null || true)
if [ -n "$PREVIOUS" ]; then
printf '\n**Full Changelog**: https://github.com/community-scripts/ProxmoxVE/compare/%s...%s\n' "$PREVIOUS" "$YESTERDAY" >> changelog_tmp.md
fi
gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md
-48
View File
@@ -584,33 +584,12 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
</details>
## 2026-11-18
### 🆕 New Scripts
- Scrutiny [@MickLesk](https://github.com/MickLesk) ([#18827](https://github.com/community-scripts/ProxmoxVE/pull/18827))
### 🚀 Updated Scripts
- #### ✨ New Features
- OpenCloud: bump to v9.2.0 [@SimKaiLong](https://github.com/SimKaiLong) ([#18822](https://github.com/community-scripts/ProxmoxVE/pull/18822))
### 🧰 Tools
- Scrutiny Collector ([#18826](https://github.com/community-scripts/ProxmoxVE/pull/18826))
## 2026-11-17
### 🆕 New Scripts
- AIOStreams [@MrNRod](https://github.com/MrNRod) ([#18673](https://github.com/community-scripts/ProxmoxVE/pull/18673))
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- immichframe: move to .NET 10 (1.0.40.0 requires it) [@supersoju](https://github.com/supersoju) ([#18806](https://github.com/community-scripts/ProxmoxVE/pull/18806))
- LibreNMS: write a valid APP_KEY before migrating [@MickLesk](https://github.com/MickLesk) ([#18776](https://github.com/community-scripts/ProxmoxVE/pull/18776))
- #### ✨ New Features
@@ -620,41 +599,14 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
- #### 🔧 Refactor
- ITSM-NG: fetch the repo and key over HTTPS [@MickLesk](https://github.com/MickLesk) ([#18799](https://github.com/community-scripts/ProxmoxVE/pull/18799))
- Frigate: Fetch the OpenVINO model over HTTPS [@MickLesk](https://github.com/MickLesk) ([#18797](https://github.com/community-scripts/ProxmoxVE/pull/18797))
- Change Detection: replace Browserless with SockPuppetBrowser [@MickLesk](https://github.com/MickLesk) ([#18767](https://github.com/community-scripts/ProxmoxVE/pull/18767))
### 💾 Core
- Stop setting kernel.keys.maxkeys on Incus containers [@MickLesk](https://github.com/MickLesk) ([core#277](https://github.com/community-scripts/core/pull/277))
- Bound the template catalog lookup so a dead storage cannot hang the run [@MickLesk](https://github.com/MickLesk) ([core#275](https://github.com/community-scripts/core/pull/275))
- Record a failed command as written in the script [@MickLesk](https://github.com/MickLesk) ([core#274](https://github.com/community-scripts/core/pull/274))
- Let the Incus network wait ask again when its probe fails [@MickLesk](https://github.com/MickLesk) ([core#273](https://github.com/community-scripts/core/pull/273))
- Run the VM cleanup and Incus file pull tests in CI | Take files out of an Incus guest as a bounded stream into a private file [@MickLesk](https://github.com/MickLesk) ([core#272](https://github.com/community-scripts/core/pull/272))
### 🧰 Tools
- #### 🐞 Bug Fixes
- Arcane: show the generated admin password [@MickLesk](https://github.com/MickLesk) ([#18785](https://github.com/community-scripts/ProxmoxVE/pull/18785))
### 📚 Documentation
- Changelog: Credit script authors and list services and website changes [@MickLesk](https://github.com/MickLesk) ([#18809](https://github.com/community-scripts/ProxmoxVE/pull/18809))
- Merge only the changelog pull request the job opened [@MickLesk](https://github.com/MickLesk) ([#18804](https://github.com/community-scripts/ProxmoxVE/pull/18804))
### 🛰️ Services
- Let contributors read traces and open issues with a password of their own [@MickLesk](https://github.com/MickLesk) ([services#19](https://github.com/community-scripts/services/pull/19))
- Rework the dashboard around triaging failures [@MickLesk](https://github.com/MickLesk) ([services#18](https://github.com/community-scripts/services/pull/18))
- Serve failure text only to requests that carry the admin token [@MickLesk](https://github.com/MickLesk) ([services#17](https://github.com/community-scripts/services/pull/17))
- Number the notes in the testing message and show their type [@MickLesk](https://github.com/MickLesk) ([services#16](https://github.com/community-scripts/services/pull/16))
- Decide exit 255 by the command, not as dpkg [@MickLesk](https://github.com/MickLesk) ([services#14](https://github.com/community-scripts/services/pull/14))
### ❔ Uncategorized
- chore(ct): sync paperclip defaults with PocketBase [@github-actions[bot]](https://github.com/github-actions[bot]) ([#18820](https://github.com/community-scripts/ProxmoxVE/pull/18820))
## 2026-11-16
### 🆕 New Scripts
-91
View File
@@ -1,91 +0,0 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MrNRod
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/Viren070/AIOStreams
APP="AIOStreams"
var_tags="${var_tags:-media;streaming;stremio}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/aiostreams ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "aiostreams" "Viren070/AIOStreams" "" "" "v"; then
msg_info "Stopping Service"
systemctl stop aiostreams
msg_ok "Stopped Service"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "aiostreams" "Viren070/AIOStreams" "tarball" "latest" "" "" "v"
AIOSTREAMS_TAG="$CHECK_UPDATE_RELEASE"
PNPM_VERSION=$(sed -n 's/.*"packageManager": "pnpm@\([^"+]*\).*/\1/p' /opt/aiostreams/package.json)
NODE_VERSION="24" NODE_MODULE="pnpm@${PNPM_VERSION:-11.0.8}" setup_nodejs
msg_info "Building Application (Patience)"
cd /opt/aiostreams
export NODE_OPTIONS="--max-old-space-size=3072"
$STD pnpm install --frozen-lockfile
$STD pnpm run build
unset NODE_OPTIONS
cp -r /opt/aiostreams/packages/server/src/static /opt/aiostreams/packages/server/dist/static
msg_ok "Built Application"
msg_info "Generating Version Metadata"
mkdir -p /opt/aiostreams/resources
AIOSTREAMS_VERSION=$(jq -r '.version' /opt/aiostreams/package.json)
AIOSTREAMS_DESC=$(jq -r '.description' /opt/aiostreams/package.json)
AIOSTREAMS_COMMIT_INFO=$(curl -fsSL "https://api.github.com/repos/Viren070/AIOStreams/commits/${AIOSTREAMS_TAG}" 2>/dev/null || true)
AIOSTREAMS_COMMIT=$(jq -r '.sha[0:8] // empty' <<<"${AIOSTREAMS_COMMIT_INFO}")
AIOSTREAMS_COMMIT_TIME=$(jq -r '.commit.committer.date // empty' <<<"${AIOSTREAMS_COMMIT_INFO}")
cat <<EOF >/opt/aiostreams/resources/metadata.json
{
"version": "${AIOSTREAMS_VERSION}",
"description": $(jq -Rn --arg d "${AIOSTREAMS_DESC}" '$d'),
"tag": "${AIOSTREAMS_TAG}",
"channel": "stable",
"commitHash": "${AIOSTREAMS_COMMIT:-unknown}",
"buildTime": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)",
"commitTime": "${AIOSTREAMS_COMMIT_TIME:-$(date -u +%Y-%m-%dT%H:%M:%S.000Z)}"
}
EOF
msg_ok "Generated Version Metadata"
msg_info "Starting Service"
systemctl start aiostreams
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
echo -e "${INFO}${YW} No authentication is enabled by default.${CL}"
echo -e "${INFO}${YW} Set AIOSTREAMS_AUTH in /opt/aiostreams_data/.env to secure the dashboard.${CL}"
+19 -3
View File
@@ -29,11 +29,27 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
msg_info "Updating deCONZ"
msg_info "Updating Package Index"
apt_update_safe
$STD apt upgrade -y
msg_ok "Updated Package Index"
CURRENT=$(dpkg-query -W -f='${Version}' deconz 2>/dev/null)
CANDIDATE=$(apt-cache policy deconz | awk '/Candidate:/{print $2}')
if [[ -z "$CANDIDATE" || "$CANDIDATE" == "(none)" ]]; then
msg_error "No candidate version found for deconz"
exit
fi
if [[ "$CURRENT" == "$CANDIDATE" ]]; then
msg_ok "Already on latest version: ${CURRENT}"
exit
fi
msg_info "Updating deCONZ"
$STD apt install -y --only-upgrade deconz
setcap -r /usr/bin/deCONZ 2>/dev/null || true
systemctl restart deconz
msg_ok "Updated deCONZ"
msg_ok "Updated successfully!"
msg_ok "Updated successfully from ${CURRENT} to ${CANDIDATE}!"
exit
}
-61
View File
@@ -1,61 +0,0 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: William Lindholm (LindholmLabs)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://www.factorio.com/
APP="Factorio"
var_tags="${var_tags:-gaming}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
var_arm64="${var_arm64:-yes}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -x /opt/factorio/bin/$(arch_resolve "x64" "arm64")/factorio ]]; then
msg_error "No Factorio Installation Found!"
exit 1
fi
msg_info "Stopping Factorio"
systemctl stop factorio
msg_ok "Stopped Factorio"
create_backup /opt/factorio/config /opt/factorio/config-path.cfg \
/opt/factorio/server-settings.json /opt/factorio/saves /opt/factorio/mods \
/opt/factorio/player-data.json /opt/factorio/server-adminlist.json \
/opt/factorio/server-banlist.json /opt/factorio/server-whitelist.json
fetch_and_deploy_from_url "https://factorio.com/get-download/stable/headless/$(arch_resolve "linux64" "linux-arm64")" "/opt/factorio"
restore_backup
msg_info "Starting Factorio"
systemctl start factorio
msg_ok "Started Factorio"
msg_ok "Updated Factorio successfully!"
exit
}
start
build_container
description
msg_ok "Completed Factorio setup successfully!\n"
echo -e "${INFO}${YW}Connect in Factorio using the following address (UDP):${CL}"
echo -e "${GATEWAY}${BGN}${IP}:34197${CL}"
+6 -6
View File
@@ -31,12 +31,12 @@ function update_script() {
exit
fi
if ! dotnet --list-sdks 2>/dev/null | grep -q '^10\.'; then
msg_info "Installing .NET SDK 10.0"
if ! dotnet --list-sdks 2>/dev/null | grep -q '^8\.'; then
msg_info "Installing .NET SDK 8.0"
if [[ "$(arch_resolve)" == "arm64" ]]; then
curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh
$STD bash /tmp/dotnet-install.sh --channel 10.0 --install-dir /usr/lib/dotnet10
ln -sf /usr/lib/dotnet10/dotnet /usr/bin/dotnet
$STD bash /tmp/dotnet-install.sh --channel 8.0 --install-dir /usr/lib/dotnet8
ln -sf /usr/lib/dotnet8/dotnet /usr/bin/dotnet
rm -f /tmp/dotnet-install.sh
else
setup_deb822_repo \
@@ -45,9 +45,9 @@ function update_script() {
"https://packages.microsoft.com/debian/13/prod/" \
"trixie" \
"main"
$STD apt install -y dotnet-sdk-10.0
$STD apt install -y dotnet-sdk-8.0
fi
msg_ok "Installed .NET SDK 10.0"
msg_ok "Installed .NET SDK 8.0"
fi
if check_for_gh_release "immichframe" "immichFrame/ImmichFrame"; then
+1 -1
View File
@@ -40,7 +40,7 @@ function update_script() {
msg_ok "Allowed OpenCloud to embed Collabora"
fi
RELEASE="v9.2.0"
RELEASE="v9.1.1"
if check_for_gh_release "OpenCloud" "opencloud-eu/opencloud" "${RELEASE}" "each release is tested individually before the version is updated. Please do not open issues for this"; then
OLD_VERSION="$(cat ~/.opencloud 2>/dev/null)"
msg_info "Stopping services"
+1 -1
View File
@@ -9,7 +9,7 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_
APP="Paperclip"
var_tags="${var_tags:-ai;automation;dev-tools}"
var_cpu="${var_cpu:-4}"
var_ram="${var_ram:-10240}"
var_ram="${var_ram:-8192}"
var_disk="${var_disk:-20}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
-57
View File
@@ -1,57 +0,0 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/AnalogJ/scrutiny
APP="Scrutiny"
var_tags="${var_tags:-monitoring;smart;disk}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /opt/scrutiny/scrutiny ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "scrutiny" "AnalogJ/scrutiny"; then
msg_info "Stopping Scrutiny"
systemctl stop scrutiny
msg_ok "Stopped Scrutiny"
fetch_and_deploy_gh_release "scrutiny" "AnalogJ/scrutiny" "singlefile" "latest" "/opt/scrutiny" "scrutiny-web-linux-$(arch_resolve "amd64" "arm64")"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "scrutiny-web" "AnalogJ/scrutiny" "prebuild" "latest" "/opt/scrutiny/web" "scrutiny-web-frontend.tar.gz"
msg_info "Starting Scrutiny"
systemctl start scrutiny
msg_ok "Started Scrutiny"
msg_ok "Updated successfully!"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}:8080${CL}"
-97
View File
@@ -1,97 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MrNRod
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/Viren070/AIOStreams | Docs: https://docs.aiostreams.viren070.me/
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y \
build-essential \
python3 \
ffmpeg
msg_ok "Installed Dependencies"
fetch_and_deploy_gh_release "aiostreams" "Viren070/AIOStreams" "tarball" "latest" "" "" "v"
AIOSTREAMS_TAG="v$(cat ~/.aiostreams)"
PNPM_VERSION=$(sed -n 's/.*"packageManager": "pnpm@\([^"+]*\).*/\1/p' /opt/aiostreams/package.json)
NODE_VERSION="24" NODE_MODULE="pnpm@${PNPM_VERSION:-11.0.8}" setup_nodejs
msg_info "Configuring Application"
mkdir -p /opt/aiostreams_data
cp /opt/aiostreams/.env.sample /opt/aiostreams_data/.env
SECRET_KEY=$(openssl rand -hex 32)
sed -i \
-e "s|^BASE_URL=.*|BASE_URL=http://${LOCAL_IP}:3000|" \
-e "s|^SECRET_KEY=.*|SECRET_KEY=${SECRET_KEY}|" \
-e "s|^# PORT=3000|PORT=3000|" \
-e "s|^DATABASE_URI=sqlite://./data/db.sqlite|DATABASE_URI=sqlite:///opt/aiostreams_data/db.sqlite|" \
/opt/aiostreams_data/.env
msg_ok "Configured Application"
msg_info "Building AIOStreams (Patience)"
cd /opt/aiostreams
export NODE_OPTIONS="--max-old-space-size=3072"
$STD pnpm install --frozen-lockfile
$STD pnpm run build
unset NODE_OPTIONS
cp -r /opt/aiostreams/packages/server/src/static /opt/aiostreams/packages/server/dist/static
msg_ok "Built AIOStreams"
msg_info "Generating Version Metadata"
mkdir -p /opt/aiostreams/resources
AIOSTREAMS_VERSION=$(jq -r '.version' /opt/aiostreams/package.json)
AIOSTREAMS_DESC=$(jq -r '.description' /opt/aiostreams/package.json)
AIOSTREAMS_COMMIT_INFO=$(curl -fsSL "https://api.github.com/repos/Viren070/AIOStreams/commits/${AIOSTREAMS_TAG}" 2>/dev/null || true)
AIOSTREAMS_COMMIT=$(jq -r '.sha[0:8] // empty' <<<"${AIOSTREAMS_COMMIT_INFO}")
AIOSTREAMS_COMMIT_TIME=$(jq -r '.commit.committer.date // empty' <<<"${AIOSTREAMS_COMMIT_INFO}")
cat <<EOF >/opt/aiostreams/resources/metadata.json
{
"version": "${AIOSTREAMS_VERSION}",
"description": $(jq -Rn --arg d "${AIOSTREAMS_DESC}" '$d'),
"tag": "${AIOSTREAMS_TAG}",
"channel": "stable",
"commitHash": "${AIOSTREAMS_COMMIT:-unknown}",
"buildTime": "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)",
"commitTime": "${AIOSTREAMS_COMMIT_TIME:-$(date -u +%Y-%m-%dT%H:%M:%S.000Z)}"
}
EOF
msg_ok "Generated Version Metadata"
msg_info "Creating Service"
NODE_HEAP_MB=$(($(free -m | awk '/^Mem:/ {print $2}') / 2))
cat <<EOF >/etc/systemd/system/aiostreams.service
[Unit]
Description=AIOStreams
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/aiostreams
EnvironmentFile=/opt/aiostreams_data/.env
Environment="NODE_ENV=production"
Environment="NODE_OPTIONS=--max-old-space-size=${NODE_HEAP_MB} --max-semi-space-size=8 --expose-gc"
Environment="MALLOC_ARENA_MAX=2"
ExecStart=/usr/bin/node /opt/aiostreams/packages/server/dist/server.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now aiostreams
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc
+8 -3
View File
@@ -22,9 +22,14 @@ setup_deb822_repo \
msg_ok "Setup Phoscon Repository"
msg_info "Installing deConz"
pool="$(arch_resolve "https://security.ubuntu.com/ubuntu/pool/main/o/openssl/" "http://ports.ubuntu.com/ubuntu-ports/pool/main/o/openssl/")"
libssl=$(curl -fsSL --proto '=http,https' "$pool" | grep -o "libssl1\.1_1\.1\.1f-1ubuntu2\.2[^\"]*$(arch_resolve)\.deb" | head -n1)
curl -fsSL --proto '=http,https' "$pool$libssl" -o "$libssl"
# deCONZ runs as root; the file caps its postinst sets (sys_time, sys_boot) are
# outside a privileged Incus container's bounding set and make exec fail.
cat <<'EOF' >/etc/apt/apt.conf.d/99-deconz-no-filecaps
DPkg::Post-Invoke { "setcap -r /usr/bin/deCONZ 2>/dev/null || true"; };
EOF
pool="$(arch_resolve "https://security.ubuntu.com/ubuntu/pool/main/o/openssl/" "https://ports.ubuntu.com/ubuntu-ports/pool/main/o/openssl/")"
libssl=$(curl -fsSL --proto '=https' "$pool" | grep -o "libssl1\.1_1\.1\.1f-1ubuntu2\.2[^\"]*$(arch_resolve)\.deb" | head -n1)
curl -fsSL --proto '=https' "$pool$libssl" -o "$libssl"
$STD dpkg -i "$libssl"
$STD apt install -y deconz
rm -rf "$libssl"
-56
View File
@@ -1,56 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: William Lindholm (LindholmLabs)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://www.factorio.com/
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
fetch_and_deploy_from_url "https://factorio.com/get-download/stable/headless/$(arch_resolve "linux64" "linux-arm64")" "/opt/factorio"
msg_info "Configuring Factorio"
sed 's/"public":[[:space:]]*true/"public": false/' /opt/factorio/data/server-settings.example.json >/opt/factorio/server-settings.json
cat <<EOF >/opt/factorio/server-adminlist.json
[]
EOF
msg_ok "Configured Factorio"
msg_info "Creating Factorio Save"
mkdir -p /opt/factorio/saves
$STD /opt/factorio/bin/$(arch_resolve "x64" "arm64")/factorio --create /opt/factorio/saves/save.zip
msg_ok "Created Factorio Save"
msg_info "Creating Factorio Service"
cat <<EOF >/etc/systemd/system/factorio.service
[Unit]
Description=Factorio Headless Server
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/factorio
ExecStart=/opt/factorio/bin/$(arch_resolve "x64" "arm64")/factorio --start-server-load-latest --server-settings /opt/factorio/server-settings.json --server-adminlist /opt/factorio/server-adminlist.json
KillSignal=SIGINT
TimeoutStopSec=120
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now factorio
msg_ok "Created Factorio Service"
motd_ssh
customize
cleanup_lxc
+1 -1
View File
@@ -201,7 +201,7 @@ msg_ok "Installed OpenVino"
msg_info "Building OpenVino Model"
cd /models
curl_download "ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz" "https://storage.googleapis.com/download.tensorflow.org/models/object_detection/ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz"
curl_download "ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz" "http://download.tensorflow.org/models/object_detection/ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz"
$STD tar -zxf ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz --no-same-owner
if python3 /opt/frigate/docker/main/build_ov_model.py &>/dev/null; then
mkdir -p /openvino-model
+4 -4
View File
@@ -17,8 +17,8 @@ msg_info "Installing Dependencies"
if [[ "$(arch_resolve)" == "arm64" ]]; then
$STD apt install -y libicu-dev libssl-dev gettext-base
curl -fsSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh
$STD bash /tmp/dotnet-install.sh --channel 10.0 --install-dir /usr/lib/dotnet10
ln -sf /usr/lib/dotnet10/dotnet /usr/bin/dotnet
$STD bash /tmp/dotnet-install.sh --channel 8.0 --install-dir /usr/lib/dotnet8
ln -sf /usr/lib/dotnet8/dotnet /usr/bin/dotnet
rm -f /tmp/dotnet-install.sh
else
setup_deb822_repo \
@@ -31,8 +31,8 @@ else
libicu-dev \
libssl-dev \
gettext-base \
dotnet-sdk-10.0 \
aspnetcore-runtime-10.0
dotnet-sdk-8.0 \
aspnetcore-runtime-8.0
fi
msg_ok "Installed Dependencies"
+2 -2
View File
@@ -22,8 +22,8 @@ MARIADB_DB_NAME="itsmng_db" MARIADB_DB_USER="itsmng" MARIADB_DB_EXTRA_GRANTS="GR
msg_info "Installing ITSM-NG"
setup_deb822_repo \
"itsm-ng" \
"https://deb.itsm-ng.org/pubkey.gpg" \
"https://deb.itsm-ng.org/$(get_os_info id)/" \
"http://deb.itsm-ng.org/pubkey.gpg" \
"http://deb.itsm-ng.org/$(get_os_info id)/" \
"$(get_os_info codename)"
$STD apt install -y itsm-ng
cd /usr/share/itsm-ng
+1 -1
View File
@@ -70,7 +70,7 @@ $STD sudo -u cool coolconfig set-admin-password --user=admin --password="$COOLPA
echo "$COOLPASS" >~/.coolpass
msg_ok "Installed Collabora Online"
fetch_and_deploy_gh_release "OpenCloud" "opencloud-eu/opencloud" "singlefile" "v9.2.0" "/usr/bin" "opencloud-*-linux-$(arch_resolve)"
fetch_and_deploy_gh_release "OpenCloud" "opencloud-eu/opencloud" "singlefile" "v9.1.1" "/usr/bin" "opencloud-*-linux-$(arch_resolve)"
mv /usr/bin/OpenCloud /usr/bin/opencloud
msg_info "Configuring OpenCloud"
-101
View File
@@ -1,101 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/AnalogJ/scrutiny
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Setting up InfluxDB Repository"
setup_deb822_repo \
"influxdata" \
"https://repos.influxdata.com/influxdata-archive.key" \
"https://repos.influxdata.com/debian" \
"stable"
msg_ok "Set up InfluxDB Repository"
msg_info "Installing InfluxDB"
$STD apt install -y influxdb2
systemctl enable -q --now influxdb
for _ in {1..30}; do
curl -fsS http://127.0.0.1:8086/health >/dev/null 2>&1 && break
sleep 1
done
msg_ok "Installed InfluxDB"
msg_info "Configuring InfluxDB"
INFLUX_PASS="$(random_password)"
INFLUX_TOKEN="$(random_password 48)"
curl -fsS -X POST http://127.0.0.1:8086/api/v2/setup \
-H "Content-Type: application/json" \
-d "{\"username\":\"admin\",\"password\":\"${INFLUX_PASS}\",\"org\":\"scrutiny\",\"bucket\":\"metrics\",\"token\":\"${INFLUX_TOKEN}\"}" >/dev/null
mkdir -p /opt/scrutiny_data
cat <<EOT >/opt/scrutiny_data/.env
INFLUXDB_USER=admin
INFLUXDB_PASSWORD=${INFLUX_PASS}
INFLUXDB_TOKEN=${INFLUX_TOKEN}
EOT
chmod 600 /opt/scrutiny_data/.env
msg_ok "Configured InfluxDB"
fetch_and_deploy_gh_release "scrutiny" "AnalogJ/scrutiny" "singlefile" "latest" "/opt/scrutiny" "scrutiny-web-linux-$(arch_resolve "amd64" "arm64")"
fetch_and_deploy_gh_release "scrutiny-web" "AnalogJ/scrutiny" "prebuild" "latest" "/opt/scrutiny/web" "scrutiny-web-frontend.tar.gz"
msg_info "Configuring Scrutiny"
cat <<EOT >/opt/scrutiny_data/scrutiny.yaml
version: 1
web:
listen:
port: 8080
host: 0.0.0.0
basepath: ''
database:
location: /opt/scrutiny_data/scrutiny.db
src:
frontend:
path: /opt/scrutiny/web
influxdb:
scheme: 'http'
host: 127.0.0.1
port: 8086
token: '${INFLUX_TOKEN}'
org: 'scrutiny'
bucket: 'metrics'
retention_policy: true
log:
file: ''
level: INFO
EOT
chmod 600 /opt/scrutiny_data/scrutiny.yaml
msg_ok "Configured Scrutiny"
msg_info "Creating Service"
cat <<EOT >/etc/systemd/system/scrutiny.service
[Unit]
Description=Scrutiny
After=network-online.target influxdb.service
Requires=influxdb.service
[Service]
Type=simple
WorkingDirectory=/opt/scrutiny_data
ExecStart=/opt/scrutiny/scrutiny start --config /opt/scrutiny_data/scrutiny.yaml
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOT
systemctl enable -q --now scrutiny
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc
-145
View File
@@ -1,145 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/AnalogJ/scrutiny
source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/core.func")
source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/api/api.func") 2>/dev/null || true
source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/lib/tools.func")
load_functions
declare -f init_tool_telemetry &>/dev/null && init_tool_telemetry "scrutiny-collector" "pve"
set -Eeuo pipefail
APP="Scrutiny-Collector"
APP_TYPE="tools"
BIN="/usr/local/bin/scrutiny-collector-metrics"
CONFIG_DIR="/etc/scrutiny"
CONFIG="${CONFIG_DIR}/collector.yaml"
SERVICE="scrutiny-collector"
REPO="AnalogJ/scrutiny"
header_info
if [[ "$(id -u)" -ne 0 ]]; then
msg_error "Run this as root (sudo) on the machine that has the disks."
exit 1
fi
if systemd-detect-virt -cq 2>/dev/null; then
msg_warn "This looks like a container: only disks passed through to it can be read."
fi
if ! command -v apt &>/dev/null; then
msg_error "This tool needs a Debian or Ubuntu based host (apt)."
exit 1
fi
command -v whiptail &>/dev/null || $STD apt install -y whiptail
function deploy_binary() {
fetch_and_deploy_gh_release "scrutiny-collector-metrics" "$REPO" "singlefile" "latest" "/usr/local/bin" "scrutiny-collector-metrics-linux-$(arch_resolve "amd64" "arm64")"
# Only catch_errors' on_exit clears this marker, and tools run without it.
rm -f ~/.scrutiny-collector-metrics.pending
}
function install_collector() {
local url="${var_scrutiny_url:-}"
while true; do
if [[ -z "$url" ]]; then
url=$(whiptail --backtitle "Community Scripts" --title "Scrutiny URL" \
--inputbox "URL of your Scrutiny web UI, e.g. http://192.168.1.50:8080" 10 64 "" 3>&1 1>&2 2>&3)
fi
url="${url%/}"
[[ "$url" =~ ^https?://[A-Za-z0-9._-]+(:[0-9]{1,5})?(/.*)?$ ]] && break
whiptail --backtitle "Community Scripts" --title "Scrutiny URL" \
--msgbox "'${url}' is not a valid URL. Use http(s)://host:port" 8 64
url=""
done
if ! curl -fsS --max-time 5 "${url}/api/health" &>/dev/null; then
msg_warn "Scrutiny does not answer at ${url}/api/health yet; the collector will retry every 15 minutes."
fi
msg_info "Installing smartmontools"
$STD apt install -y smartmontools
msg_ok "Installed smartmontools"
deploy_binary
msg_info "Configuring ${APP}"
mkdir -p "$CONFIG_DIR"
cat <<EOF >"$CONFIG"
version: 1
host:
id: "$(hostname)"
api:
endpoint: "${url}"
EOF
cat <<EOF >/etc/systemd/system/${SERVICE}.service
[Unit]
Description=Scrutiny S.M.A.R.T. collector
Wants=network-online.target
After=network-online.target
[Service]
Type=oneshot
ExecStart=${BIN} run --config ${CONFIG}
EOF
cat <<EOF >/etc/systemd/system/${SERVICE}.timer
[Unit]
Description=Run the Scrutiny collector every 15 minutes
[Timer]
OnBootSec=2min
OnUnitActiveSec=15min
Persistent=true
[Install]
WantedBy=timers.target
EOF
systemctl daemon-reload
systemctl enable -q --now ${SERVICE}.timer
systemctl start --no-block ${SERVICE}.service
msg_ok "Configured ${APP}"
echo ""
msg_ok "The disks of $(hostname) show up in Scrutiny at ${BL}${url}${CL} after the first run."
msg_ok "Follow it with: ${BL}journalctl -u ${SERVICE} -f${CL}"
}
function update_collector() {
if check_for_gh_release "scrutiny-collector-metrics" "$REPO"; then
deploy_binary
msg_ok "Updated ${APP}"
else
msg_ok "${APP} is already up-to-date"
fi
}
function uninstall_collector() {
msg_info "Removing ${APP}"
systemctl disable -q --now ${SERVICE}.timer 2>/dev/null || true
systemctl stop ${SERVICE}.service 2>/dev/null || true
rm -f /etc/systemd/system/${SERVICE}.service /etc/systemd/system/${SERVICE}.timer "$BIN" ~/.scrutiny-collector-metrics
rm -rf "$CONFIG_DIR"
systemctl daemon-reload
msg_ok "Removed ${APP} (smartmontools stays installed)"
}
ACTION="${1:-}"
if [[ -z "$ACTION" && -x "$BIN" ]]; then
ACTION=$(whiptail --backtitle "Community Scripts" --title "${APP}" \
--menu "The Scrutiny collector is installed on this host." 12 58 2 \
"update" "Update the collector binary" \
"uninstall" "Remove the collector" 3>&1 1>&2 2>&3)
fi
case "${ACTION:-install}" in
install) install_collector ;;
update) update_collector ;;
uninstall) uninstall_collector ;;
*)
msg_error "Unknown action '${ACTION}'. Use install, update or uninstall."
exit 1
;;
esac