Compare commits

...
Author SHA1 Message Date
MickLesk 07909c82e1 Paperclip: type-check the server with one checker and a Go memory limit
v2026.1202.0's server tsc (TypeScript 7, Go) sits at the 10 GB container
limit with its default four checkers and never finishes; installs since
the release fail in pnpm build. One checker with GOMEMLIMIT=6GiB builds
in under 3 minutes with an 8.3 GB peak.
2026-12-05 14:43:00 +01:00
0059ca1815 MySQL: set up the repository with the current signing key (#19305)
RPM-GPG-KEY-mysql-2023 (B7B3B788A8D3785C) expired on 2025-10-22, so apt
rejects repo.mysql.com with EXPKEYSIG and `update` never upgrades MySQL.
Oracle re-issued the same key as RPM-GPG-KEY-mysql-2025 (valid until
2027-10-23).

- install: add the repository with setup_deb822_repo and the 2025 key
  instead of a hand-rolled keyring and sources file
- update: move installs still on /usr/share/keyrings/mysql.gpg to the
  same setup, keeping their release track

Co-authored-by: root <root@paperclip.pilz.dev>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-05 09:14:37 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 61e6cde880 Update CHANGELOG.md (#19292)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-05 00:11:33 +00:00
CanbiZ (MickLesk) a600ba6437 Authentik: bump to 2026.11 (#19298) 2026-12-05 00:10:11 +01:00
Commander DennisandCommander Dennis 16a82aef39 Wiki.js: rebuild SQLite in the application directory (#19299)
Co-authored-by: Commander Dennis <12292931+maniac79@users.noreply.github.com>
2026-12-04 11:57:02 +01:00
CanbiZ (MickLesk) 6a25aec144 Kyoo: install the FFmpeg build its transcoder needs (#19294)
* Kyoo: install the FFmpeg build its transcoder needs (#19290)

Since Kyoo 5.3.0 the transcoder passes HLS options that only exist in zoriya/ffmpeg. The prebuilt release goes to /opt/kyoo-ffmpeg and is linked into /usr/local/bin; Debian's ffmpeg stays for its libraries. The update fetches it too, so existing installs are repaired.

* Simplify FFmpeg installation in kyoo-install.sh

Removed comment about FFmpeg build and streamlined installation process.
2026-12-04 08:53:17 +01:00
CanbiZ (MickLesk) 92659c74df Frigate: stop the service cleanly (#19296)
bash was the unit's main process and the default KillMode signalled the
whole cgroup, so Frigate's multiprocessing helpers died first and its
shutdown hung until systemd killed it after 90 s. Python is now the main
process and only it gets SIGTERM.
2026-12-04 08:52:59 +01:00
thieneretandCanbiZ b42e66a49d Update authentik 2026.8.7 (#19051)
* authentik: wait for web UI readiness after install/update restart

The new PR test battery probes the authentik web UI right after the
script ends; on slower runners gunicorn workers are still booting and
answer 503 within the probe window. Poll https://127.0.0.1:9443/ for
up to 180s (200/302 accepted) after starting services in both the
install and update paths; warn instead of fail on timeout.

* authentik: move GeoIP auto-update from cron to systemd timer

The crontab call breaks incus builds (no cron package in the runner
image, exit 127) and overwrites the whole root crontab. Replace it in
the install script with an oneshot service + calendar timer pair
(same Thu/Sat 19:39 schedule, still disabled by default like the
previous commented-out crontab entry). In update_script, migrate
existing installs: create the units when missing and strip only
geoipupdate lines from the user's crontab, keeping other entries.

* authentik: conform to AGENTS.md script rules

No /dev/null redirections: readiness probes now capture the HTTP
status line via curl -I and sed; the crontab migration guards on the
/usr/bin/crontab file test and folds stderr into the captured
variable. No systemctl daemon-reload for the new units (systemctl
enable reloads them when the user opts in). Comments trimmed to the
single allowed line.

* authentik: take over active cron job, fix errexit-unsafe grep

If the crontab geoipupdate line was not commented out, the user
opted into auto-updates, so the migration now enables the timer.
grep -v returning no lines would abort the update under the
engine's errexit; guarded with || true. Validated end-to-end in a
simulated set -Eeuo pipefail environment with stub crontab/systemctl.

* authentik: state and extend readiness wait to 300s

Both readiness blocks now print their budget upfront and wait up to
300s (60 x 5s) before warning; slow runners needed longer than 180s
in CI.

* authentik: probe readiness via the engine ct_exec helper

Follow the #18949 host-side helper style (ct_exec wraps pct exec).

* authentik: update to 2026.8.7

2026.8.7 is the current stable patch of the 2026.8 line (2026.11.25).
Build inputs are unchanged versus 2026.8.6: container Dockerfile is
byte-identical (sha256), pyproject/package.json bump the version field
only, go.mod is unchanged, and the fips Makefile still pins xmlsec
1.3.13 (the pin line moved from L26 to L28, comment updated to match).

* Remove GeoIP auto-update cron migration logic

Removed GeoIP auto-update migration from cron to systemd timer.

* Remove GeoIP update service and timer setup

Removed GeoIP update service and timer configuration from the installation script.

---------

Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com>
2026-12-04 08:10:22 +01:00
CanbiZ (MickLesk) f6d75d7a33 Revert "Refactor AdGuard Home update process (#19291)" (#19293)
This reverts commit 681e168ff7.
2026-12-04 06:33:09 +01:00
Luca Comellini 681e168ff7 Refactor AdGuard Home update process (#19291) 2026-12-04 06:31:14 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] d5978beba9 Update CHANGELOG.md (#19273)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-04 00:15:50 +00:00
CanbiZ (MickLesk) 5e0c8163ba AFFiNE: run one server, update to 0.27.4 (#19283)
* AFFiNE: run one server, update to 0.27.4

affine-worker started a second all-in-one server (there is no --worker
flag), which fought affine-web for port 3010 and restarted every 10 s.
The update removes the unit from existing installs. Yarn now comes from
packageManager instead of a pinned 4.13.0, and the update no longer
copies the storage directory into the backup.

* Remove obsolete affine-worker

Removed comment about affine-worker conflict with affine-web.
2026-12-03 20:00:57 +01:00
CanbiZ (MickLesk) 0d581f318b ci: fix fork merges and issue locking, merge the drift-closed workflows (#19286)
Close Matching Issue ran on pull_request, so merged fork PRs had no
secrets and the PocketBase step connected to localhost. It now runs on
pull_request_target; it only checks out the merge commit.

Lock closed issues asked for up to 100 search pages, but search stops at
1000 results and the run failed with 422 whenever more were pending.

The Node.js, PHP and Python drift-closed workflows differed only in the
runtime name, and each skipped run cluttered every PR close.
2026-12-03 19:37:05 +01:00
Tobias e56e3d3d69 BentoPDF: use relative redirects in nginx (#19284) 2026-12-03 18:40:17 +01:00
CanbiZ (MickLesk) 0dee0a10e9 Docker/NPMplus (Alpine): use docker-cli-compose instead of a downloaded binary (#19278)
The Alpine installs put Compose into /root/.docker/cli-plugins by curl.
Nothing updated it afterwards (the update is apk -U upgrade), and the CLI
prefers that directory over the package path. Install docker-cli-compose
instead, and on update move existing containers to the package before
removing the old binary.
2026-12-03 10:40:53 +01:00
Sab44 df41ccbdb8 Include custom images in backup (#19276) 2026-12-03 09:21:39 +01:00
Tobias 0c08052a32 fix(ci): daily release fixes (drop Frontend, keep days apart) (#19274)
* ci: stop reading ProxmoxVE-Frontend pull requests in the daily release

The repository is private, so the request always failed with Not Found,
and website changes are not part of the changelog.

* ci: keep the changelog entries of different days apart

The sub-categories from the config were shared between all days, so with
more than one day in a run the notes of one day showed up in the other.
2026-12-03 08:29:24 +01:00
Tobias 27207e4684 ci: set GH_REPO in the release step of the daily release workflow (#19272)
The step runs from RUNNER_TEMP, outside the checkout, so gh could not
find the repository and gh release create failed.
2026-12-03 08:14:26 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 3c93581dd3 Update CHANGELOG.md (#19266)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-03 07:05:57 +01:00
CanbiZ (MickLesk) 9bb2a5e46a Refactor: ArchiveBox (#17495) 2026-12-03 00:18:58 +01:00
TobiasandClaude Sonnet 5.5 52bdc620b3 refactor(ci): merge changelog, archive and release workflows into one daily run (#19190)
* ci: merge changelog PR, archive and release into one daily workflow

Every merge to main used to trigger the changelog workflow, which opened,
approved and merged its own PR, so a busy day produced a changelog PR per
merge. A single workflow now runs once a day at 00:01 UTC: it collects the
pull requests merged during the previous UTC day, publishes the GitHub
release, and opens one CHANGELOG.md PR. On Sundays it also archives entries
older than 30 days in the same PR.

Replaces changelog-pr.yml, changelog-archive.yml and github-release.yml.
workflow_dispatch takes an optional date and an archive flag to redo a day.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: add a dry_run input to the daily release workflow

With dry_run the workflow builds the notes and prints the release body and
the CHANGELOG.md diff, but skips the app tokens, the release, the push and
the pull request.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* ci: keep one rolling changelog PR per day, merge it at 00:01 UTC

While the day is running, every merge to main and every merged core pull
request rebuilds the entries on the changelog branch, so the one pull request
shows the day's notes and a bad title can be fixed by renaming the pull
request it comes from. At 00:01 UTC the previous day is finished: the pull
request is rebuilt with the whole day, merged automatically, and the release
is created from the same notes.

The range starts at the newest entry in CHANGELOG.md, so a day that failed is
picked up by the next run. Notes are sorted by merge time so they do not
reshuffle between runs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-12-02 16:16:50 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] e5aebc6cf6 Update CHANGELOG.md (#19265)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-02 15:11:24 +00:00
CanbiZ (MickLesk) fd696a839f Martin: use the legacycpu build on CPUs below x86-64-v3 (#19264)
Martin 2.0's x86_64 builds need AVX2 and the rest of x86-64-v3; on older
CPUs such as the Celeron J and N series or Xeon E5 v1/v2 the binary would
not start after the update. Those now get the -legacycpu build, and an
update from 1.x points to the migration guide once. The default config
starts unchanged on 2.0.
2026-12-02 16:10:48 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] c9997ac852 Update CHANGELOG.md (#19263)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-02 12:30:54 +00:00
CanbiZ (MickLesk)andTobias 27045fef55 n8n: update with an empty npm cache and the service stopped (#19262)
* n8n: update with an empty npm cache and the service stopped

Reinstalling n8n over itself made npm peak at 3.9 GB with a warm cache and
1.4 GB with an empty one; with n8n still running beside it a 2 GB container
was killed (exit 137, six updates in five days). The update now stops n8n
and clears the npm cache first.

* refactor comment

---------

Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com>
2026-12-02 13:30:17 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] e7eaf9508e Update CHANGELOG.md (#19261)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-02 10:11:44 +00:00
deb17387c8 [tools.update-lxcs] feat: optional CLEAN_CACHE to remove downloaded packages after each update (#19192)
Co-authored-by: Matt Stein <matt@ninestone.ca>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 11:11:03 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 073eb20c52 Update CHANGELOG.md (#19260)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-02 09:58:27 +00:00
community-scripts-pr-app[bot]andgithub-actions[bot] b4b9a809e8 Update CHANGELOG.md (#19259)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-02 09:58:07 +00:00
CanbiZ (MickLesk) 4e338af9e9 Sure: set SECRET_KEY_BASE whatever the example holds (#19258)
Sure 2026.11.30 ships .env.example with an empty SECRET_KEY_BASE instead of
secret-value, so the substitution matched nothing, Rails had no key and
db:prepare stopped the service from starting. Every install since the
release failed (6 of 6).
2026-12-02 10:57:53 +01:00
CanbiZ (MickLesk) bdaeb11818 Pterodactyl Panel: switch PHP with setup_php (#19255)
The update moved older installs to PHP 8.4 by hand and failed in apt for
every one of them (4 runs on two hosts in five days). setup_php does the
same switch and carries the modules, the Apache module and FPM over;
tested from PHP 8.3 with Apache and FPM on Debian 12.
2026-12-02 10:57:42 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 199447191e Update CHANGELOG.md (#19257)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-02 10:57:40 +01:00
CanbiZ (MickLesk) a5e47e93e3 Frigate: fetch the Intel key for install_deps with retries (#19253)
install_deps.sh downloads Intel's key once with wget; when Intel's CDN
answered with no key, gpg found no OpenPGP data and the install stopped at
the HailoRT step (13 runs in five days). It now gets the key from
download_gpg_key, as the media driver build already does.
2026-12-02 10:57:32 +01:00
CanbiZ (MickLesk) e426f031ba ERPNext: raise the default RAM to 6 GB (#19252)
Frappe 16.60 builds its new Studio and Flow frontends with Vite inside
bench build. The parent esbuild process keeps its memory while they run,
so the build peaks at 3.9 GB on a 4 GB container and fails when the
kernel kills it.
2026-12-02 10:57:13 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 78f41464b6 Update CHANGELOG.md (#19256)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-02 09:57:02 +00:00
CanbiZ (MickLesk) 9052bfe253 Aurral: build without the exact Node minor check (#19251)
Aurral 3.2.0 wants node 26.13.x with engineStrict in pnpm-workspace.yaml.
The install already skipped that check, but pnpm run checks again, so every
install on NodeSource's 26.14.0 failed at the frontend build.
2026-12-02 10:56:51 +01:00
CanbiZ (MickLesk) 74c261575b Dreeve: follow FrankenPHP releases for PHP 8.6 (#19250)
Dreeve 5.9.3 requires PHP 8.6, but FrankenPHP was pinned to 1.12.7, which
ships PHP 8.5, so composer install failed. The pin worked around the argv
bug in 1.13.0, fixed in 1.13.1; 1.14.0 ships PHP 8.6. The update never
touched FrankenPHP, so existing installs would have failed the same way on
their next Dreeve update; it now updates FrankenPHP first.
2026-12-02 10:56:35 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 07b493e196 Update CHANGELOG.md (#19254)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-02 09:56:23 +00:00
CanbiZ (MickLesk) 41113474b4 cross-seed: reinstall when a Node.js upgrade broke better-sqlite3 (#19249)
The update moved Node from 24 to 26 and then ran cross-seed --version to
read the installed version, which failed on better-sqlite3 built for the
old ABI. The version now comes from package.json, and a cross-seed that no
longer starts is reinstalled at the same version.
2026-12-02 10:56:18 +01:00
CanbiZ (MickLesk) 19e5a7d99f Dispatcharr: consume the plugins and dvr queues like upstream (#19248)
Since 0.34 plugin actions go to a plugins queue, which no worker read, so
every plugin action timed out after 55 s. Recordings go to dvr, which older
installs never consumed. The main worker now reads celery,plugins and a
second thread-pool worker reads dvr, as upstream's images do. The update
migrates existing installs without waiting for a new release, since it
restored the old start script on every update.
2026-12-02 10:55:48 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 648bd56082 Update CHANGELOG.md (#19247)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-02 06:46:49 +00:00
community-scripts-pr-app[bot]andgithub-actions[bot] c0e8460b14 Update CHANGELOG.md (#19246)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-02 06:46:19 +00:00
push-app-to-main[bot] c41ba67552 Add docling-serve (ct) (#19237)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
2026-12-02 07:46:06 +01:00
push-app-to-main[bot] 521d244fce Add kopia (ct) (#19238)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
2026-12-02 07:45:49 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 75e19a0b92 Update CHANGELOG.md (#19245)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-01 20:38:23 +00:00
push-app-to-main[bot] 7184c758a4 Add xwiki (ct) (#19239)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
2026-12-01 21:37:41 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 9104918470 Update CHANGELOG.md (#19244)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-01 20:28:59 +00:00
push-app-to-main[bot]andCanbiZ b0fb363928 OpenWA (#19236)
* Add openwa (ct)

* Change default value of var_arm64 to 'yes'

---------

Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com>
2026-12-01 21:28:21 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 26aa7b5f77 Update CHANGELOG.md (#19242)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-01 19:20:10 +00:00
push-app-to-main[bot]andCanbiZ 119617d428 Alexandrie (#19240)
* Add alexandrie (ct)

* Set default value for var_arm64 to 'yes'

---------

Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com>
2026-12-01 20:19:40 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] d53877ae67 Update CHANGELOG.md (#19241)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-01 19:01:09 +00:00
push-app-to-main[bot] f4f3bfb2da Add netbird-server (vm) (#19215)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
2026-12-01 20:00:34 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] 31a8320732 Update CHANGELOG.md (#19234)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-12-01 06:36:57 +00:00
CanbiZ (MickLesk) 307701f2ca DroppedNeedle: build and update the Rust v3 (#18735)
* DroppedNeedle: build and update the Rust v3

3.0.0 replaced the Python backend with a Rust server and ships no binaries, so every update failed on the missing requirements.txt after the version was already recorded. Build both binaries with cargo and the web UI with pnpm as upstream's Dockerfile does, keep the v2 config and cache in place for v3's upgrade page, and put the old version back when a build fails.

* DroppedNeedle: say where the upgrade sign-in code is

* DroppedNeedle: install the prebuilt v3 release files

From v3.2.0 each release carries the server and droppedneedle-tool per
architecture and the web UI as archives, so the Rust toolchain, Node,
pnpm and the build are gone, and the resources go back to v2's. The
update wipes the old tree except the v2 data and the web UI, which the
second download replaces. TZ is set, since the server reads only TZ.
Until v3.2.0 has its files no release matches and the download fails.
2026-12-01 07:36:28 +01:00
62 changed files with 2857 additions and 1412 deletions

No files matched your search

-354
View File
@@ -1,354 +0,0 @@
name: Archive Old Changelog Entries
on:
schedule:
# Run every Sunday at 00:00 UTC
- cron: '0 0 * * 0'
workflow_dispatch:
jobs:
archive-changelog:
if: github.repository == 'community-scripts/ProxmoxVE'
runs-on: ubuntu-latest
env:
BRANCH_NAME: github-action-archive-changelog
AUTOMATED_PR_LABEL: "automated pr"
permissions:
contents: write
pull-requests: write
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.GHAPP_PR_ID }}
private-key: ${{ secrets.GHAPP_PR_PRIVATE_KEY }}
- name: Generate a token for PR approval and merge
id: generate-token-merge
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.GHAPP_MERGEBOT_ID }}
private-key: ${{ secrets.GHAPP_MERGEBOT_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Archive old changelog entries
uses: actions/github-script@v9
with:
script: |
const fs = require('fs').promises;
const path = require('path');
const KEEP_DAYS = 30;
const ARCHIVE_PATH = '.github/changelogs';
const CHANGELOG_PATH = 'CHANGELOG.md';
// Calculate cutoff date
const cutoffDate = new Date();
cutoffDate.setDate(cutoffDate.getDate() - KEEP_DAYS);
cutoffDate.setHours(0, 0, 0, 0);
console.log(`Cutoff date: ${cutoffDate.toISOString().split('T')[0]}`);
// Read changelog and normalize line endings
let content = await fs.readFile(CHANGELOG_PATH, 'utf-8');
content = content.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
const lines = content.split('\n');
// Parse entries
const datePattern = /^## (\d{4})-(\d{2})-(\d{2})$/;
let header = [];
let recentEntries = [];
let archiveData = {};
let currentDate = null;
let currentContent = [];
let inHeader = true;
let inOldHistory = false;
let historyDetailsDepth = 0;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
const match = line.match(datePattern);
// Detect the start of History section: <details> followed by line with 📜 History
if (inHeader && !inOldHistory && line.trim() === '<details>') {
// Look ahead to see if this is the History section
const nextLine = lines[i + 1] || '';
if (nextLine.includes('📜 History')) {
inOldHistory = true;
historyDetailsDepth = 1;
continue;
}
}
// Track nested details tags to find the end of History section
if (inOldHistory) {
if (line.trim() === '<details>') {
historyDetailsDepth++;
}
if (line.trim() === '</details>') {
historyDetailsDepth--;
if (historyDetailsDepth === 0) {
// We've closed the main History details tag
inOldHistory = false;
}
}
continue;
}
if (match) {
inHeader = false;
// Save previous entry
if (currentDate && currentContent.length > 0) {
const entryText = currentContent.join('\n').trim();
const dateObj = new Date(`${currentDate}T00:00:00Z`);
// Always add to archive (by month)
const year = currentDate.substring(0, 4);
const month = currentDate.substring(5, 7);
if (!archiveData[year]) archiveData[year] = {};
if (!archiveData[year][month]) archiveData[year][month] = [];
archiveData[year][month].push(`## ${currentDate}\n\n${entryText}`);
// Also add to recent entries if within cutoff
if (dateObj >= cutoffDate) {
recentEntries.push(`## ${currentDate}\n\n${entryText}`);
}
}
currentDate = `${match[1]}-${match[2]}-${match[3]}`;
currentContent = [];
} else if (inHeader) {
header.push(line);
} else if (currentDate) {
currentContent.push(line);
}
}
// Don't forget the last entry
if (currentDate && currentContent.length > 0) {
const entryText = currentContent.join('\n').trim();
const dateObj = new Date(`${currentDate}T00:00:00Z`);
// Always add to archive (by month)
const year = currentDate.substring(0, 4);
const month = currentDate.substring(5, 7);
if (!archiveData[year]) archiveData[year] = {};
if (!archiveData[year][month]) archiveData[year][month] = [];
archiveData[year][month].push(`## ${currentDate}\n\n${entryText}`);
// Also add to recent entries if within cutoff
if (dateObj >= cutoffDate) {
recentEntries.push(`## ${currentDate}\n\n${entryText}`);
}
}
console.log(`Recent entries: ${recentEntries.length}`);
console.log(`Years to archive: ${Object.keys(archiveData).length}`);
// Month names in English
const monthNames = {
'01': 'January', '02': 'February', '03': 'March', '04': 'April',
'05': 'May', '06': 'June', '07': 'July', '08': 'August',
'09': 'September', '10': 'October', '11': 'November', '12': 'December'
};
// Create/update archive files
for (const year of Object.keys(archiveData).sort().reverse()) {
const yearPath = path.join(ARCHIVE_PATH, year);
try {
await fs.mkdir(yearPath, { recursive: true });
} catch (e) {
// Directory exists
}
for (const month of Object.keys(archiveData[year]).sort().reverse()) {
const monthPath = path.join(yearPath, `${month}.md`);
// Read existing content if exists
let existingContent = '';
try {
existingContent = await fs.readFile(monthPath, 'utf-8');
// Normalize line endings to prevent regex issues
existingContent = existingContent.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
} catch (e) {
// File doesn't exist
}
// Parse existing entries into a Map (date -> content) for deduplication
const allEntries = new Map();
// Helper function to parse entries from content
const parseEntries = (content) => {
const entries = new Map();
const parts = content.split(/(?=^## \d{4}-\d{2}-\d{2}$)/m);
for (const part of parts) {
const trimmed = part.trim();
if (!trimmed) continue;
const dateMatch = trimmed.match(/^## (\d{4}-\d{2}-\d{2})/);
if (dateMatch) {
entries.set(dateMatch[1], trimmed);
}
}
return entries;
};
// Parse existing content
if (existingContent) {
const existingEntries = parseEntries(existingContent);
for (const [date, content] of existingEntries) {
allEntries.set(date, content);
}
}
// Add new entries (existing entries take precedence to avoid overwriting)
let addedCount = 0;
for (const entry of archiveData[year][month]) {
const dateMatch = entry.match(/^## (\d{4}-\d{2}-\d{2})/);
if (dateMatch && !allEntries.has(dateMatch[1])) {
allEntries.set(dateMatch[1], entry.trim());
addedCount++;
}
}
// Sort entries by date (newest first) and write
const sortedDates = [...allEntries.keys()].sort().reverse();
const sortedContent = sortedDates.map(date => allEntries.get(date)).join('\n\n');
if (addedCount > 0 || !existingContent) {
await fs.writeFile(monthPath, sortedContent + '\n', 'utf-8');
console.log(`Updated: ${monthPath} (${allEntries.size} total entries, +${addedCount} new)`);
}
}
}
// Build history section
let historySection = [];
historySection.push('');
historySection.push('<details>');
historySection.push('<summary><h2>📜 History</h2></summary>');
historySection.push('');
// Get all years from archive directory
let allYears = [];
try {
const archiveDir = await fs.readdir(ARCHIVE_PATH);
allYears = archiveDir.filter(f => /^\d{4}$/.test(f)).sort().reverse();
} catch (e) {
allYears = Object.keys(archiveData).sort().reverse();
}
for (const year of allYears) {
historySection.push('');
historySection.push('<details>');
historySection.push(`<summary><h3>${year}</h3></summary>`);
historySection.push('');
// Get months for this year
let months = [];
try {
const yearDir = await fs.readdir(path.join(ARCHIVE_PATH, year));
months = yearDir
.filter(f => f.endsWith('.md'))
.map(f => f.replace('.md', ''))
.sort()
.reverse();
} catch (e) {
months = Object.keys(archiveData[year] || {}).sort().reverse();
}
for (const month of months) {
const monthName = monthNames[month] || month;
const monthPath = path.join(ARCHIVE_PATH, year, `${month}.md`);
// Count entries in month file
let entryCount = 0;
try {
let monthContent = await fs.readFile(monthPath, 'utf-8');
monthContent = monthContent.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
entryCount = (monthContent.match(/^## \d{4}-\d{2}-\d{2}$/gm) || []).length;
} catch (e) {
entryCount = (archiveData[year]?.[month] || []).length;
}
const relativePath = `.github/changelogs/${year}/${month}.md`;
historySection.push('');
historySection.push('<details>');
historySection.push(`<summary><h4>${monthName} (${entryCount} entries)</h4></summary>`);
historySection.push('');
historySection.push(`[View ${monthName} ${year} Changelog](${relativePath})`);
historySection.push('');
historySection.push('</details>');
}
historySection.push('');
historySection.push('</details>');
}
historySection.push('');
historySection.push('</details>');
// Build new CHANGELOG.md (History first, then recent entries)
const newChangelog = [
...header,
'',
historySection.join('\n'),
'',
recentEntries.join('\n\n')
].join('\n');
await fs.writeFile(CHANGELOG_PATH, newChangelog, 'utf-8');
console.log('CHANGELOG.md updated successfully');
- name: Check for changes
id: verify-diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_ENV
- name: Commit and push changes
if: env.changed == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md .github/changelogs/
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')
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" \
--head $BRANCH_NAME \
--base main \
--label "$AUTOMATED_PR_LABEL"
fi
- name: Approve and merge pull request
if: env.changed == 'true'
env:
GH_TOKEN: ${{ steps.generate-token-merge.outputs.token }}
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')
if [ -n "$PR_NUMBER" ]; then
gh pr review "$PR_NUMBER" --approve
gh pr merge "$PR_NUMBER" --squash --admin --match-head-commit "$HEAD_SHA"
fi
-439
View File
@@ -1,439 +0,0 @@
name: Create Changelog Pull Request
on:
push:
branches: ["main"]
workflow_dispatch:
# Fired by community-scripts/core when an engine pull request is merged, so a
# change there does not wait for the next push here. Optional: engine PRs are
# collected on every run regardless, this only decides how soon.
repository_dispatch:
types: [core-pr-merged]
jobs:
update-changelog-pull-request:
if: github.repository == 'community-scripts/ProxmoxVE'
runs-on: ubuntu-latest
env:
CONFIG_PATH: .github/changelog-pr-config.json
BRANCH_NAME: github-action-update-changelog
AUTOMATED_PR_LABEL: "automated pr"
permissions:
contents: write
pull-requests: write
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.GHAPP_PR_ID }}
private-key: ${{ secrets.GHAPP_PR_PRIVATE_KEY }}
- name: Generate a token for PR approval and merge
id: generate-token-merge
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.GHAPP_MERGEBOT_ID }}
private-key: ${{ secrets.GHAPP_MERGEBOT_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Get latest dates in changelog
run: |
DATES=$(grep -E '^## [0-9]{4}-[0-9]{2}-[0-9]{2}' CHANGELOG.md | head -n 2 | awk '{print $2}')
LATEST_DATE=$(echo "$DATES" | sed -n '1p')
SECOND_LATEST_DATE=$(echo "$DATES" | sed -n '2p')
TODAY=$(date -u +%Y-%m-%d)
echo "TODAY=$TODAY" >> $GITHUB_ENV
if [[ "$LATEST_DATE" == "$TODAY" ]]; then
echo "LATEST_DATE=$SECOND_LATEST_DATE" >> $GITHUB_ENV
else
echo "LATEST_DATE=$LATEST_DATE" >> $GITHUB_ENV
fi
- name: Get categorized pull requests
id: get-categorized-prs
uses: actions/github-script@v9
with:
script: |
async function main() {
const fs = require('fs').promises;
const path = require('path');
const configPath = path.resolve(process.env.CONFIG_PATH);
const fileContent = await fs.readFile(configPath, 'utf-8');
const changelogConfig = JSON.parse(fileContent);
const categorizedPRs = changelogConfig.map(obj => ({
...obj,
notes: [],
subCategories: obj.subCategories ?? (
obj.labels.includes("update script") ? [
{ title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
{ title: "✨ New Features", labels: ["feature"], notes: [] },
{ title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] },
{ title: "🔧 Refactor", labels: ["refactor"], notes: [] },
] :
obj.labels.includes("maintenance") ? [
{ title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
{ title: "✨ New Features", labels: ["feature"], notes: [] },
{ title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] },
{ title: "📡 API", labels: ["api"], notes: [] },
{ title: "Github", labels: ["github"], notes: [] },
{ title: "📝 Documentation", labels: ["maintenance"], notes: [] },
{ title: "🔧 Refactor", labels: ["refactor"], notes: [] }
] :
obj.labels.includes("website") ? [
{ title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
{ title: "✨ New Features", labels: ["feature"], notes: [] },
{ title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] },
{ title: "Script Information", labels: ["json"], notes: [] }
] : []
)
}));
const latestDateInChangelog = new Date(process.env.LATEST_DATE);
latestDateInChangelog.setUTCHours(23, 59, 59, 999);
const { data: pulls } = await github.rest.pulls.list({
owner: context.repo.owner,
repo: "ProxmoxVE",
base: "main",
state: "closed",
sort: "updated",
direction: "desc",
per_page: 100,
});
const filteredPRs = pulls.filter(pr =>
pr.merged_at &&
new Date(pr.merged_at) > latestDateInChangelog &&
!pr.labels.some(label =>
["invalid", "wontdo", process.env.AUTOMATED_PR_LABEL].includes(label.name.toLowerCase())
)
);
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]")) {
const scriptName = pr.title;
try {
const { data: relatedIssues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: "DevScripts",
state: "all",
labels: ["Started Migration To ProxmoxVE"],
per_page: 100,
});
const matchingIssue = relatedIssues.find(issue =>
issue.title.trim().toLowerCase() === scriptName.trim().toLowerCase()
);
if (matchingIssue) {
const issueAuthor = matchingIssue.user.login;
const issueAuthorUrl = `https://github.com/${issueAuthor}`;
prNote = `- ${pr.title} [@${issueAuthor}](${issueAuthorUrl}) ([#${pr.number}](${pr.html_url}))`;
}
else {
prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
}
} catch (error) {
console.error(`Error fetching related issues: ${error}`);
prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
}
}else{
prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
}
if (prLabels.includes("new script")) {
const newScriptCategory = categorizedPRs.find(category =>
category.title === "New Scripts" || category.labels.includes("new script"));
if (newScriptCategory) {
newScriptCategory.notes.push(prNote);
}
} else {
let categorized = false;
const priorityCategories = categorizedPRs.slice();
// Priority order for content-type labels (highest priority first)
const subCategoryPriority = ["breaking change", "bugfix", "feature", "refactor"];
for (const category of priorityCategories) {
if (categorized) break;
if (category.labels.some(label => prLabels.includes(label))) {
if (category.subCategories && category.subCategories.length > 0) {
// Find subcategory by priority order instead of first match
let subCategory = null;
for (const priorityLabel of subCategoryPriority) {
if (prLabels.includes(priorityLabel)) {
subCategory = category.subCategories.find(sub =>
sub.labels.includes(priorityLabel)
);
if (subCategory) break;
}
}
// Fallback: check for any other subcategory match (api, github, json, etc.)
if (!subCategory) {
subCategory = category.subCategories.find(sub =>
sub.labels.some(label => prLabels.includes(label))
);
}
if (subCategory) {
subCategory.notes.push(prNote);
} else {
category.notes.push(prNote);
}
} else {
category.notes.push(prNote);
}
categorized = true;
}
}
// Fallback: Add to Uncategorized if no category matched
if (!categorized) {
const uncategorized = categorizedPRs.find(category =>
category.title.includes("Uncategorized") || category.labels.includes("needs triage"));
if (uncategorized) {
uncategorized.notes.push(prNote);
}
}
}
}
// ── 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"];
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 category = categorizedPRs.find(c => c.title === categoryTitle);
for (const pr of externalPulls) {
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;
if (!category) {
console.log(`No ${categoryTitle} category configured; skipping ${prefix}#${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}))`;
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;
}
}
}
if (!placed) category.notes.push(note);
}
} catch (error) {
console.error(`Could not read ${repo} pull requests: ${error}`);
}
}
return categorizedPRs;
}
return await main();
- name: Update CHANGELOG.md
uses: actions/github-script@v9
with:
script: |
const fs = require('fs').promises;
const path = require('path');
const today = process.env.TODAY;
const latestDateInChangelog = process.env.LATEST_DATE;
const changelogPath = path.resolve('CHANGELOG.md');
const categorizedPRs = ${{ steps.get-categorized-prs.outputs.result }};
console.log(JSON.stringify(categorizedPRs, null, 2));
let newReleaseNotes = `## ${today}\n\n`;
for (const { title, notes, subCategories } of categorizedPRs) {
const hasSubcategories = subCategories && subCategories.length > 0;
const hasMainNotes = notes.length > 0;
const hasSubNotes = hasSubcategories && subCategories.some(sub => sub.notes && sub.notes.length > 0);
if (hasMainNotes || hasSubNotes) {
newReleaseNotes += `### ${title}\n\n`;
}
if (hasMainNotes) {
newReleaseNotes += ` ${notes.join("\n")}\n\n`;
}
if (hasSubcategories) {
for (const { title: subTitle, notes: subNotes } of subCategories) {
if (subNotes && subNotes.length > 0) {
newReleaseNotes += ` - #### ${subTitle}\n\n`;
newReleaseNotes += ` ${subNotes.join("\n ")}\n\n`;
}
}
}
}
const changelogContent = await fs.readFile(changelogPath, 'utf-8');
const changelogIncludesTodaysReleaseNotes = changelogContent.includes(`\n## ${today}`);
const regex = changelogIncludesTodaysReleaseNotes
? new RegExp(`## ${today}.*(?=## ${latestDateInChangelog})`, "gs")
: new RegExp(`(?=## ${latestDateInChangelog})`, "gs");
const newChangelogContent = changelogContent.replace(regex, newReleaseNotes);
await fs.writeFile(changelogPath, newChangelogContent);
- name: Check for changes
id: verify-diff
run: |
git diff --quiet . || echo "changed=true" >> $GITHUB_ENV
- name: Commit and push changes
if: env.changed == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md
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')
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." \
--head $BRANCH_NAME \
--base main \
--label "$AUTOMATED_PR_LABEL"
fi
- name: Approve pull request
if: env.changed == 'true'
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')
if [ -n "$PR_NUMBER" ]; then
gh pr review "$PR_NUMBER" --approve
fi
- name: Approve pull request and merge
if: env.changed == 'true'
env:
GH_TOKEN: ${{ steps.generate-token-merge.outputs.token }}
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')
if [ -n "$PR_NUMBER" ]; then
gh pr review "$PR_NUMBER" --approve
gh pr merge "$PR_NUMBER" --squash --admin --match-head-commit "$HEAD_SHA"
fi
+1 -1
View File
@@ -579,7 +579,7 @@ jobs:
# "opened" — a label added a moment later can arrive too late.
#
# "keep-open" rather than "automated pr" for that exemption: both
# skip the template check, but changelog-pr.yml drops every PR
# skip the template check, but daily-release.yml drops every PR
# carrying "automated pr" (it marks its own PR with it), so that
# label would keep these bumps out of the changelog entirely.
# "update script" and "bugfix" place them under Updated Scripts →
+1 -1
View File
@@ -555,7 +555,7 @@ jobs:
# Labels go on at creation: they exempt the PR from the template check,
# which runs on "opened". "keep-open" rather than "automated pr", which
# changelog-pr.yml drops.
# daily-release.yml drops.
if url=$(gh pr create \
--title "${slug}: bump PHP from ${our} to ${upstream}" \
--body "$body" \
+1 -1
View File
@@ -524,7 +524,7 @@ jobs:
# Labels go on at creation: they exempt the PR from the template check,
# which runs on "opened". "keep-open" rather than "automated pr", which
# changelog-pr.yml drops.
# daily-release.yml drops.
if url=$(gh pr create \
--title "${slug}: bump Python from ${our} to ${upstream}" \
--body "$body" \
+3 -1
View File
@@ -1,6 +1,8 @@
name: Close Matching Issue on PR Merge
# pull_request_target so merged fork PRs get the secrets too. No PR code runs:
# the checkout is the merge commit on main.
on:
pull_request:
pull_request_target:
types:
- closed
+887
View File
@@ -0,0 +1,887 @@
name: Daily Changelog and Release
# One CHANGELOG.md pull request per day.
#
# While the day is running, every merge to main (and every merged core pull
# request) rebuilds the entry for the current UTC day on the changelog branch
# and keeps that one pull request up to date, so the entries are visible and a
# bad title can be fixed by renaming the pull request it comes from.
#
# At 00:01 UTC the previous day is finished: the pull request is rebuilt with
# the whole day, merged automatically, and the GitHub release is created from
# the same notes. On Sundays the entries older than 30 days are archived into
# .github/changelogs/ in that pull request.
#
# The range to build starts at the newest entry in CHANGELOG.md, so a day that
# failed is picked up by the next run.
on:
push:
branches: ["main"]
# Fired by community-scripts/core when an engine pull request is merged, so a
# change there shows up in the open pull request without waiting for the next
# push here.
repository_dispatch:
types: [core-pr-merged]
schedule:
- cron: '1 0 * * *' # Finishes the previous day at 00:01 UTC
workflow_dispatch:
inputs:
finalize:
description: "Finish the previous day: merge the pull request and create the release"
required: false
type: boolean
default: false
since:
description: "Rebuild from this day on (YYYY-MM-DD, UTC). Defaults to the newest entry in CHANGELOG.md."
required: false
type: string
archive:
description: "Archive old changelog entries even if it is not Sunday"
required: false
type: boolean
default: false
dry_run:
description: "Build the notes and show the changelog diff, but create no release, push nothing and open no pull request"
required: false
type: boolean
default: false
concurrency:
group: daily-release
cancel-in-progress: false
jobs:
daily-release:
if: github.repository == 'community-scripts/ProxmoxVE'
runs-on: ubuntu-latest
env:
CONFIG_PATH: .github/changelog-pr-config.json
BRANCH_NAME: github-action-update-changelog
AUTOMATED_PR_LABEL: "automated pr"
permissions:
contents: write
pull-requests: write
steps:
- name: Generate a token
id: generate-token
if: ${{ !inputs.dry_run }}
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.GHAPP_PR_ID }}
private-key: ${{ secrets.GHAPP_PR_PRIVATE_KEY }}
- name: Generate a token for PR approval and merge
id: generate-token-merge
if: ${{ !inputs.dry_run }}
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.GHAPP_MERGEBOT_ID }}
private-key: ${{ secrets.GHAPP_MERGEBOT_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Resolve the range to build
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_FINALIZE: ${{ inputs.finalize }}
INPUT_SINCE: ${{ inputs.since }}
INPUT_ARCHIVE: ${{ inputs.archive }}
INPUT_DRY_RUN: ${{ inputs.dry_run }}
run: |
if [[ "$INPUT_DRY_RUN" == "true" ]]; then
echo "DRY_RUN=true" >> $GITHUB_ENV
fi
MODE=update
if [[ "$EVENT_NAME" == "schedule" || "$INPUT_FINALIZE" == "true" ]]; then
MODE=finalize
fi
echo "MODE=$MODE" >> $GITHUB_ENV
TODAY=$(date -u +%Y-%m-%d)
YESTERDAY=$(date -u -d yesterday +%Y-%m-%d)
TOMORROW=$(date -u -d tomorrow +%Y-%m-%d)
LATEST=$(grep -m1 -E '^## [0-9]{4}-[0-9]{2}-[0-9]{2}' CHANGELOG.md | awk '{print $2}')
# The newest entry is built again when it is recent: it may have been merged
# while its day was still running and be missing the pull requests after that.
if [[ -n "$INPUT_SINCE" ]]; then
START=$(date -u -d "$INPUT_SINCE" +%Y-%m-%d) || exit 1
elif [[ -z "$LATEST" ]]; then
START=$YESTERDAY
elif [[ "$LATEST" > "$YESTERDAY" || "$LATEST" == "$YESTERDAY" ]]; then
START=$LATEST
else
START=$(date -u -d "$LATEST +1 day" +%Y-%m-%d)
fi
# Finishing a day only builds complete days; the day under way is left for
# the next one so that its entry is never merged half done.
if [[ "$MODE" == "finalize" ]]; then
END=$TODAY
else
END=$TOMORROW
fi
echo "TODAY=$TODAY" >> $GITHUB_ENV
echo "RANGE_START=${START}T00:00:00Z" >> $GITHUB_ENV
echo "RANGE_END=${END}T00:00:00Z" >> $GITHUB_ENV
echo "Mode: $MODE, building $START up to (not including) $END"
if [[ "$INPUT_ARCHIVE" == "true" || ( "$MODE" == "finalize" && "$(date -u +%u)" == "7" ) ]]; then
echo "RUN_ARCHIVE=true" >> $GITHUB_ENV
fi
- name: Get categorized pull requests
id: get-categorized-prs
uses: actions/github-script@v9
with:
script: |
async function main() {
const fs = require('fs').promises;
const path = require('path');
const configPath = path.resolve(process.env.CONFIG_PATH);
const fileContent = await fs.readFile(configPath, 'utf-8');
const changelogConfig = JSON.parse(fileContent);
const newCategories = () => changelogConfig.map(obj => ({
...obj,
notes: [],
// Copied per day, so a day never shares notes with another one
subCategories: (obj.subCategories ?? (
obj.labels.includes("update script") ? [
{ title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
{ title: "✨ New Features", labels: ["feature"], notes: [] },
{ title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] },
{ title: "🔧 Refactor", labels: ["refactor"], notes: [] },
] :
obj.labels.includes("maintenance") ? [
{ title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
{ title: "✨ New Features", labels: ["feature"], notes: [] },
{ title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] },
{ title: "📡 API", labels: ["api"], notes: [] },
{ title: "Github", labels: ["github"], notes: [] },
{ title: "📝 Documentation", labels: ["maintenance"], notes: [] },
{ title: "🔧 Refactor", labels: ["refactor"], notes: [] }
] :
obj.labels.includes("website") ? [
{ title: "🐞 Bug Fixes", labels: ["bugfix"], notes: [] },
{ title: "✨ New Features", labels: ["feature"], notes: [] },
{ title: "💥 Breaking Changes", labels: ["breaking change"], notes: [] },
{ title: "Script Information", labels: ["json"], notes: [] }
] : []
)).map(sub => ({ ...sub, notes: [] }))
}));
// One set of categories per UTC day, keyed YYYY-MM-DD
const days = {};
const categoriesFor = mergedAt => days[mergedAt.slice(0, 10)] ??= newCategories();
const rangeStart = new Date(process.env.RANGE_START);
const rangeEnd = new Date(process.env.RANGE_END);
// Closed pull requests come newest-update first, and a pull request merged
// in the range was updated at or after its merge. So once a page ends with
// one last updated before the range began, nothing further can belong to it.
async function listMergedPRs(repo) {
const merged = [];
for (let page = 1; ; page++) {
const { data } = await github.rest.pulls.list({
owner: context.repo.owner,
repo,
base: "main",
state: "closed",
sort: "updated",
direction: "desc",
per_page: 100,
page,
});
for (const pr of data) {
if (!pr.merged_at) continue;
const mergedAt = new Date(pr.merged_at);
if (mergedAt >= rangeStart && mergedAt < rangeEnd) merged.push(pr);
}
if (data.length < 100 || new Date(data[data.length - 1].updated_at) < rangeStart) {
// Newest merge first, so the notes do not reshuffle between runs
return merged.sort((a, b) => b.merged_at.localeCompare(a.merged_at) || b.number - a.number);
}
}
}
const filteredPRs = (await listMergedPRs("ProxmoxVE")).filter(pr =>
!pr.labels.some(label =>
["invalid", "wontdo", process.env.AUTOMATED_PR_LABEL].includes(label.name.toLowerCase())
)
);
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 categorizedPRs = categoriesFor(pr.merged_at);
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]")) {
const scriptName = pr.title;
try {
const { data: relatedIssues } = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: "DevScripts",
state: "all",
labels: ["Started Migration To ProxmoxVE"],
per_page: 100,
});
const matchingIssue = relatedIssues.find(issue =>
issue.title.trim().toLowerCase() === scriptName.trim().toLowerCase()
);
if (matchingIssue) {
const issueAuthor = matchingIssue.user.login;
const issueAuthorUrl = `https://github.com/${issueAuthor}`;
prNote = `- ${pr.title} [@${issueAuthor}](${issueAuthorUrl}) ([#${pr.number}](${pr.html_url}))`;
}
else {
prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
}
} catch (error) {
console.error(`Error fetching related issues: ${error}`);
prNote = `- ${pr.title} ([#${pr.number}](${pr.html_url}))`;
}
}else{
prNote = `- ${pr.title} [@${pr.user.login}](https://github.com/${pr.user.login}) ([#${pr.number}](${pr.html_url}))`;
}
if (prLabels.includes("new script")) {
const newScriptCategory = categorizedPRs.find(category =>
category.title === "New Scripts" || category.labels.includes("new script"));
if (newScriptCategory) {
newScriptCategory.notes.push(prNote);
}
} else {
let categorized = false;
const priorityCategories = categorizedPRs.slice();
// Priority order for content-type labels (highest priority first)
const subCategoryPriority = ["breaking change", "bugfix", "feature", "refactor"];
for (const category of priorityCategories) {
if (categorized) break;
if (category.labels.some(label => prLabels.includes(label))) {
if (category.subCategories && category.subCategories.length > 0) {
// Find subcategory by priority order instead of first match
let subCategory = null;
for (const priorityLabel of subCategoryPriority) {
if (prLabels.includes(priorityLabel)) {
subCategory = category.subCategories.find(sub =>
sub.labels.includes(priorityLabel)
);
if (subCategory) break;
}
}
// Fallback: check for any other subcategory match (api, github, json, etc.)
if (!subCategory) {
subCategory = category.subCategories.find(sub =>
sub.labels.some(label => prLabels.includes(label))
);
}
if (subCategory) {
subCategory.notes.push(prNote);
} else {
category.notes.push(prNote);
}
} else {
category.notes.push(prNote);
}
categorized = true;
}
}
// Fallback: Add to Uncategorized if no category matched
if (!categorized) {
const uncategorized = categorizedPRs.find(category =>
category.title.includes("Uncategorized") || category.labels.includes("needs triage"));
if (uncategorized) {
uncategorized.notes.push(prNote);
}
}
}
}
// ── Pull requests from other repositories ───────────────────────
const externalRepos = [
{ repo: "core", category: "💾 Core", prefix: "core" },
{ repo: "services", category: "🛰️ Services", prefix: "services" },
];
const externalLabelAliases = {
bug: "bugfix",
bugfix: "bugfix",
enhancement: "feature",
feature: "feature",
refactor: "refactor",
"breaking change": "breaking change",
};
const externalPriority = ["breaking change", "bugfix", "feature", "refactor"];
for (const { repo, category: categoryTitle, prefix } of externalRepos) {
try {
const externalPulls = await listMergedPRs(repo);
for (const pr of externalPulls) {
const category = categoriesFor(pr.merged_at).find(c => c.title === categoryTitle);
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;
}
// 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}))`;
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;
}
}
}
if (!placed) category.notes.push(note);
}
} catch (error) {
console.error(`Could not read ${repo} pull requests: ${error}`);
}
}
return days;
}
return await main();
- name: Build the changelog entries
id: notes
uses: actions/github-script@v9
with:
script: |
const fs = require('fs').promises;
const path = require('path');
const changelogPath = path.resolve('CHANGELOG.md');
const daysByDate = ${{ steps.get-categorized-prs.outputs.result }};
console.log(JSON.stringify(daysByDate, null, 2));
function renderDay(date, categorizedPRs) {
let hasNotes = false;
let text = `## ${date}\n\n`;
for (const { title, notes, subCategories } of categorizedPRs) {
const hasSubcategories = subCategories && subCategories.length > 0;
const hasMainNotes = notes.length > 0;
const hasSubNotes = hasSubcategories && subCategories.some(sub => sub.notes && sub.notes.length > 0);
if (hasMainNotes || hasSubNotes) {
hasNotes = true;
text += `### ${title}\n\n`;
}
if (hasMainNotes) {
text += ` ${notes.join("\n")}\n\n`;
}
if (hasSubcategories) {
for (const { title: subTitle, notes: subNotes } of subCategories) {
if (subNotes && subNotes.length > 0) {
text += ` - #### ${subTitle}\n\n`;
text += ` ${subNotes.join("\n ")}\n\n`;
}
}
}
}
return hasNotes ? text.trimEnd() + '\n' : null;
}
// Days without a merged pull request get no entry
const sections = {};
for (const [date, categorizedPRs] of Object.entries(daysByDate)) {
const text = renderDay(date, categorizedPRs);
if (text) {
sections[date] = text;
await fs.writeFile(path.join(process.env.RUNNER_TEMP, `section_${date}.md`), text);
}
}
const dates = Object.keys(sections).sort();
console.log(`Entries built: ${dates.join(", ") || "none"}`);
// Every finished day gets a release, unless it already has one. The pull
// request for the day under way is only an entry in CHANGELOG.md.
const releaseDays = process.env.MODE === "finalize" ? dates : [];
core.setOutput('release_days', releaseDays.join(" "));
// CHANGELOG.md is a preamble followed by one entry per day, newest first.
// An entry that is built again replaces the old one, a new one goes in order.
const original = await fs.readFile(changelogPath, 'utf-8');
const parts = original.split(/^(?=## \d{4}-\d{2}-\d{2}$)/m);
const preamble = /^## \d{4}-\d{2}-\d{2}$/m.test(parts[0]) ? "" : parts.shift();
const entries = new Map(parts.map(part => [part.slice(3, 13), part]));
for (const date of dates) {
entries.set(date, sections[date]);
}
const body = [...entries.keys()].sort().reverse()
.map(date => entries.get(date).trimEnd())
.join("\n\n");
const updated = `${preamble}${body}${original.endsWith('\n') ? '\n' : ''}`;
if (updated !== original) {
await fs.writeFile(changelogPath, updated);
}
- name: Create GitHub releases
if: steps.notes.outputs.release_days != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
RELEASE_DAYS: ${{ steps.notes.outputs.release_days }}
run: |
for DAY in $RELEASE_DAYS; do
if gh release view "$DAY" >/dev/null 2>&1; then
echo "Release $DAY already exists, skipping"
continue
fi
cd "$RUNNER_TEMP"
# GitHub fills a release's Contributors only from bare @login mentions
sed -E 's#\[@([A-Za-z0-9-]+)\]\(https://github\.com/\1\)#@\1#g' "section_$DAY.md" > release_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 < release_full.md > release_notes.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' >> release_notes.md
fi
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" "$DAY" >> release_notes.md
fi
cat release_notes.md
if [ "$DRY_RUN" = "true" ]; then
echo "Dry run: not creating the release $DAY"
else
gh release create "$DAY" -t "$DAY" -F release_notes.md
fi
cd - >/dev/null
done
- name: Archive old changelog entries
if: env.RUN_ARCHIVE == 'true'
uses: actions/github-script@v9
with:
script: |
const fs = require('fs').promises;
const path = require('path');
const KEEP_DAYS = 30;
const ARCHIVE_PATH = '.github/changelogs';
const CHANGELOG_PATH = 'CHANGELOG.md';
// Calculate cutoff date
const cutoffDate = new Date();
cutoffDate.setDate(cutoffDate.getDate() - KEEP_DAYS);
cutoffDate.setHours(0, 0, 0, 0);
console.log(`Cutoff date: ${cutoffDate.toISOString().split('T')[0]}`);
// Read changelog and normalize line endings
let content = await fs.readFile(CHANGELOG_PATH, 'utf-8');
content = content.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
const lines = content.split('\n');
// Parse entries
const datePattern = /^## (\d{4})-(\d{2})-(\d{2})$/;
let header = [];
let recentEntries = [];
let archiveData = {};
let currentDate = null;
let currentContent = [];
let inHeader = true;
let inOldHistory = false;
let historyDetailsDepth = 0;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
const match = line.match(datePattern);
// Detect the start of History section: <details> followed by line with 📜 History
if (inHeader && !inOldHistory && line.trim() === '<details>') {
// Look ahead to see if this is the History section
const nextLine = lines[i + 1] || '';
if (nextLine.includes('📜 History')) {
inOldHistory = true;
historyDetailsDepth = 1;
continue;
}
}
// Track nested details tags to find the end of History section
if (inOldHistory) {
if (line.trim() === '<details>') {
historyDetailsDepth++;
}
if (line.trim() === '</details>') {
historyDetailsDepth--;
if (historyDetailsDepth === 0) {
// We've closed the main History details tag
inOldHistory = false;
}
}
continue;
}
if (match) {
inHeader = false;
// Save previous entry
if (currentDate && currentContent.length > 0) {
const entryText = currentContent.join('\n').trim();
const dateObj = new Date(`${currentDate}T00:00:00Z`);
// Always add to archive (by month)
const year = currentDate.substring(0, 4);
const month = currentDate.substring(5, 7);
if (!archiveData[year]) archiveData[year] = {};
if (!archiveData[year][month]) archiveData[year][month] = [];
archiveData[year][month].push(`## ${currentDate}\n\n${entryText}`);
// Also add to recent entries if within cutoff
if (dateObj >= cutoffDate) {
recentEntries.push(`## ${currentDate}\n\n${entryText}`);
}
}
currentDate = `${match[1]}-${match[2]}-${match[3]}`;
currentContent = [];
} else if (inHeader) {
header.push(line);
} else if (currentDate) {
currentContent.push(line);
}
}
// Don't forget the last entry
if (currentDate && currentContent.length > 0) {
const entryText = currentContent.join('\n').trim();
const dateObj = new Date(`${currentDate}T00:00:00Z`);
// Always add to archive (by month)
const year = currentDate.substring(0, 4);
const month = currentDate.substring(5, 7);
if (!archiveData[year]) archiveData[year] = {};
if (!archiveData[year][month]) archiveData[year][month] = [];
archiveData[year][month].push(`## ${currentDate}\n\n${entryText}`);
// Also add to recent entries if within cutoff
if (dateObj >= cutoffDate) {
recentEntries.push(`## ${currentDate}\n\n${entryText}`);
}
}
console.log(`Recent entries: ${recentEntries.length}`);
console.log(`Years to archive: ${Object.keys(archiveData).length}`);
// Month names in English
const monthNames = {
'01': 'January', '02': 'February', '03': 'March', '04': 'April',
'05': 'May', '06': 'June', '07': 'July', '08': 'August',
'09': 'September', '10': 'October', '11': 'November', '12': 'December'
};
// Create/update archive files
for (const year of Object.keys(archiveData).sort().reverse()) {
const yearPath = path.join(ARCHIVE_PATH, year);
try {
await fs.mkdir(yearPath, { recursive: true });
} catch (e) {
// Directory exists
}
for (const month of Object.keys(archiveData[year]).sort().reverse()) {
const monthPath = path.join(yearPath, `${month}.md`);
// Read existing content if exists
let existingContent = '';
try {
existingContent = await fs.readFile(monthPath, 'utf-8');
// Normalize line endings to prevent regex issues
existingContent = existingContent.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
} catch (e) {
// File doesn't exist
}
// Parse existing entries into a Map (date -> content) for deduplication
const allEntries = new Map();
// Helper function to parse entries from content
const parseEntries = (content) => {
const entries = new Map();
const parts = content.split(/(?=^## \d{4}-\d{2}-\d{2}$)/m);
for (const part of parts) {
const trimmed = part.trim();
if (!trimmed) continue;
const dateMatch = trimmed.match(/^## (\d{4}-\d{2}-\d{2})/);
if (dateMatch) {
entries.set(dateMatch[1], trimmed);
}
}
return entries;
};
// Parse existing content
if (existingContent) {
const existingEntries = parseEntries(existingContent);
for (const [date, content] of existingEntries) {
allEntries.set(date, content);
}
}
// Add new entries (existing entries take precedence to avoid overwriting)
let addedCount = 0;
for (const entry of archiveData[year][month]) {
const dateMatch = entry.match(/^## (\d{4}-\d{2}-\d{2})/);
if (dateMatch && !allEntries.has(dateMatch[1])) {
allEntries.set(dateMatch[1], entry.trim());
addedCount++;
}
}
// Sort entries by date (newest first) and write
const sortedDates = [...allEntries.keys()].sort().reverse();
const sortedContent = sortedDates.map(date => allEntries.get(date)).join('\n\n');
if (addedCount > 0 || !existingContent) {
await fs.writeFile(monthPath, sortedContent + '\n', 'utf-8');
console.log(`Updated: ${monthPath} (${allEntries.size} total entries, +${addedCount} new)`);
}
}
}
// Build history section
let historySection = [];
historySection.push('');
historySection.push('<details>');
historySection.push('<summary><h2>📜 History</h2></summary>');
historySection.push('');
// Get all years from archive directory
let allYears = [];
try {
const archiveDir = await fs.readdir(ARCHIVE_PATH);
allYears = archiveDir.filter(f => /^\d{4}$/.test(f)).sort().reverse();
} catch (e) {
allYears = Object.keys(archiveData).sort().reverse();
}
for (const year of allYears) {
historySection.push('');
historySection.push('<details>');
historySection.push(`<summary><h3>${year}</h3></summary>`);
historySection.push('');
// Get months for this year
let months = [];
try {
const yearDir = await fs.readdir(path.join(ARCHIVE_PATH, year));
months = yearDir
.filter(f => f.endsWith('.md'))
.map(f => f.replace('.md', ''))
.sort()
.reverse();
} catch (e) {
months = Object.keys(archiveData[year] || {}).sort().reverse();
}
for (const month of months) {
const monthName = monthNames[month] || month;
const monthPath = path.join(ARCHIVE_PATH, year, `${month}.md`);
// Count entries in month file
let entryCount = 0;
try {
let monthContent = await fs.readFile(monthPath, 'utf-8');
monthContent = monthContent.replace(/\r\n/g, '\n').replace(/\r/g, '\n');
entryCount = (monthContent.match(/^## \d{4}-\d{2}-\d{2}$/gm) || []).length;
} catch (e) {
entryCount = (archiveData[year]?.[month] || []).length;
}
const relativePath = `.github/changelogs/${year}/${month}.md`;
historySection.push('');
historySection.push('<details>');
historySection.push(`<summary><h4>${monthName} (${entryCount} entries)</h4></summary>`);
historySection.push('');
historySection.push(`[View ${monthName} ${year} Changelog](${relativePath})`);
historySection.push('');
historySection.push('</details>');
}
historySection.push('');
historySection.push('</details>');
}
historySection.push('');
historySection.push('</details>');
// Build new CHANGELOG.md (History first, then recent entries)
const newChangelog = [
...header,
'',
historySection.join('\n'),
'',
recentEntries.join('\n\n')
].join('\n');
await fs.writeFile(CHANGELOG_PATH, newChangelog, 'utf-8');
console.log('CHANGELOG.md updated successfully');
- name: Check for changes
run: |
if [ -n "$(git status --porcelain CHANGELOG.md .github/changelogs)" ]; then
if [ "$DRY_RUN" = "true" ]; then
echo "Dry run: not committing. Pending changes:"
git status --short CHANGELOG.md .github/changelogs
git --no-pager diff --stat
git --no-pager diff -- CHANGELOG.md | head -n 200
else
echo "changed=true" >> $GITHUB_ENV
fi
fi
- name: Commit and push changes
if: env.changed == 'true'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md .github/changelogs/
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')
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. It is updated on every merge to main and merged automatically at 00:01 UTC together with the day's release. To fix an entry, rename the pull request it comes from; edits to this branch are overwritten." \
--head $BRANCH_NAME \
--base main \
--label "$AUTOMATED_PR_LABEL"
fi
- name: Approve pull request
if: env.changed == 'true' && env.MODE == 'finalize'
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')
if [ -n "$PR_NUMBER" ]; then
gh pr review "$PR_NUMBER" --approve
fi
- name: Approve pull request and merge
if: env.changed == 'true' && env.MODE == 'finalize'
env:
GH_TOKEN: ${{ steps.generate-token-merge.outputs.token }}
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')
if [ -n "$PR_NUMBER" ]; then
gh pr review "$PR_NUMBER" --approve
gh pr merge "$PR_NUMBER" --squash --admin --match-head-commit "$HEAD_SHA"
fi
@@ -1,6 +1,6 @@
name: Record closed PHP drift PR
name: Record closed drift PR
# The drift check opens one PR per script and treats a closed one as a verdict:
# The drift checks open one PR per script and treat a closed one as a verdict:
# that bump is not proposed again. Record it on the report so the decision is
# visible there.
@@ -13,7 +13,9 @@ jobs:
if: >
github.repository == 'community-scripts/ProxmoxVE' &&
github.event.pull_request.merged == false &&
startsWith(github.event.pull_request.head.ref, 'php-drift/')
(startsWith(github.event.pull_request.head.ref, 'node-drift/') ||
startsWith(github.event.pull_request.head.ref, 'php-drift/') ||
startsWith(github.event.pull_request.head.ref, 'python-drift/'))
runs-on: ubuntu-latest
permissions:
issues: write
@@ -25,10 +27,15 @@ jobs:
const owner = context.repo.owner;
const repo = context.repo.repo;
// php-drift/<slug>-<from>-to-<to>
const m = pr.head.ref.match(/^php-drift\/(.+)-(\d+\.\d+)-to-(\d+\.\d+)$/);
// <kind>-drift/<slug>-<from>-to-<to>
const m = pr.head.ref.match(/^(node|php|python)-drift\/(.+)-(\d+(?:\.\d+)?)-to-(\d+(?:\.\d+)?)$/);
if (!m) return;
const [, slug, from, to] = m;
const [, kind, slug, from, to] = m;
const [report, runtime] = {
node: ['Node.js', 'Node'],
php: ['PHP', 'PHP'],
python: ['Python', 'Python'],
}[kind];
// A close by the stale bot is a lapsed review, not a decision on
// the bump, and the drift check reopens those.
@@ -38,15 +45,15 @@ jobs:
owner, repo, state: 'open', labels: 'automated,dependencies', per_page: 100,
});
const issue = issues.data.find(
(i) => !i.pull_request && i.title === '[Automated] PHP Version Drift Report',
(i) => !i.pull_request && i.title === `[Automated] ${report} Version Drift Report`,
);
if (!issue) return;
const body = stale
? `\`${slug}\` — PR #${pr.number} (PHP ${from} → ${to}) was closed as stale. `
? `\`${slug}\` — PR #${pr.number} (${runtime} ${from} → ${to}) was closed as stale. `
+ `No decision was recorded, so the next drift check opens it again.`
: `\`${slug}\` — PR #${pr.number} (PHP ${from} → ${to}) was closed without merging. `
+ `The script keeps PHP ${from} and this bump will not be proposed again. `
: `\`${slug}\` — PR #${pr.number} (${runtime} ${from} → ${to}) was closed without merging. `
+ `The script keeps ${runtime} ${from} and this bump will not be proposed again. `
+ `If it was closed by mistake, reopen the PR.`;
await github.rest.issues.createComment({
-69
View File
@@ -1,69 +0,0 @@
name: Create Daily Release
on:
schedule:
- cron: '1 0 * * *' # Runs daily at 00:01 UTC
workflow_dispatch:
jobs:
create-daily-release:
if: github.repository == 'community-scripts/ProxmoxVE'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Clean CHANGELOG (remove HTML header)
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"
# 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
echo "=== Extracted Changelog ==="
cat changelog_tmp.md
echo "==========================="
# 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"
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
+2 -2
View File
@@ -70,8 +70,8 @@ jobs:
page++;
// GitHub search API limit: max 10000 results (100 pages * 100) - temporarily increased
if (page > 100) break;
// Search returns at most 1000 results; the rest is locked on the next runs
if (page > 10) break;
}
console.log(`Total locked: ${totalLocked} issues/PRs`);
-55
View File
@@ -1,55 +0,0 @@
name: Record closed Node.js drift PR
# The drift check opens one PR per script and treats a closed one as a verdict:
# that bump is not proposed again. That decision is invisible on the report
# unless it is written there, so record it as a comment naming the script.
on:
pull_request:
types: [closed]
jobs:
record:
if: >
github.repository == 'community-scripts/ProxmoxVE' &&
github.event.pull_request.merged == false &&
startsWith(github.event.pull_request.head.ref, 'node-drift/')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@v9
with:
script: |
const pr = context.payload.pull_request;
const owner = context.repo.owner;
const repo = context.repo.repo;
// node-drift/<slug>-<from>-to-<to>
const m = pr.head.ref.match(/^node-drift\/(.+)-(\d+)-to-(\d+)$/);
if (!m) return;
const [, slug, from, to] = m;
// A close by the stale bot is a lapsed review, not a decision on
// the bump, and the drift check reopens those. Saying "declined"
// here would contradict it.
const stale = pr.labels.some((l) => l.name === 'stale');
const issues = await github.rest.issues.listForRepo({
owner, repo, state: 'open', labels: 'automated,dependencies', per_page: 100,
});
const issue = issues.data.find(
(i) => !i.pull_request && i.title === '[Automated] Node.js Version Drift Report',
);
if (!issue) return;
const body = stale
? `\`${slug}\` — PR #${pr.number} (Node ${from} → ${to}) was closed as stale. `
+ `No decision was recorded, so the next drift check opens it again.`
: `\`${slug}\` — PR #${pr.number} (Node ${from} → ${to}) was closed without merging. `
+ `The script keeps Node ${from} and this bump will not be proposed again. `
+ `If it was closed by mistake, reopen the PR.`;
await github.rest.issues.createComment({
owner, repo, issue_number: issue.number, body,
});
-54
View File
@@ -1,54 +0,0 @@
name: Record closed Python drift PR
# The drift check opens one PR per script and treats a closed one as a verdict:
# that bump is not proposed again. Record it on the report so the decision is
# visible there.
on:
pull_request:
types: [closed]
jobs:
record:
if: >
github.repository == 'community-scripts/ProxmoxVE' &&
github.event.pull_request.merged == false &&
startsWith(github.event.pull_request.head.ref, 'python-drift/')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@v9
with:
script: |
const pr = context.payload.pull_request;
const owner = context.repo.owner;
const repo = context.repo.repo;
// python-drift/<slug>-<from>-to-<to>
const m = pr.head.ref.match(/^python-drift\/(.+)-(\d+\.\d+)-to-(\d+\.\d+)$/);
if (!m) return;
const [, slug, from, to] = m;
// A close by the stale bot is a lapsed review, not a decision on
// the bump, and the drift check reopens those.
const stale = pr.labels.some((l) => l.name === 'stale');
const issues = await github.rest.issues.listForRepo({
owner, repo, state: 'open', labels: 'automated,dependencies', per_page: 100,
});
const issue = issues.data.find(
(i) => !i.pull_request && i.title === '[Automated] Python Version Drift Report',
);
if (!issue) return;
const body = stale
? `\`${slug}\` — PR #${pr.number} (Python ${from} → ${to}) was closed as stale. `
+ `No decision was recorded, so the next drift check opens it again.`
: `\`${slug}\` — PR #${pr.number} (Python ${from} → ${to}) was closed without merging. `
+ `The script keeps Python ${from} and this bump will not be proposed again. `
+ `If it was closed by mistake, reopen the PR.`;
await github.rest.issues.createComment({
owner, repo, issue_number: issue.number, body,
});
+105
View File
@@ -590,6 +590,111 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
</details>
## 2026-12-04
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- Wiki.js: rebuild SQLite in the application directory [@maniac79](https://github.com/maniac79) ([#19299](https://github.com/community-scripts/ProxmoxVE/pull/19299))
- Frigate: stop the service cleanly [@MickLesk](https://github.com/MickLesk) ([#19296](https://github.com/community-scripts/ProxmoxVE/pull/19296))
- Update authentik 2026.8.7 [@thieneret](https://github.com/thieneret) ([#19051](https://github.com/community-scripts/ProxmoxVE/pull/19051))
- #### ✨ New Features
- Authentik: bump to 2026.11 [@MickLesk](https://github.com/MickLesk) ([#19298](https://github.com/community-scripts/ProxmoxVE/pull/19298))
- #### 🔧 Refactor
- Kyoo: install the FFmpeg build its transcoder needs [@MickLesk](https://github.com/MickLesk) ([#19294](https://github.com/community-scripts/ProxmoxVE/pull/19294))
## 2026-12-03
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- BentoPDF: use relative redirects in nginx [@CrazyWolf13](https://github.com/CrazyWolf13) ([#19284](https://github.com/community-scripts/ProxmoxVE/pull/19284))
- TeddyCloud: Include custom images in backup [@Sab44](https://github.com/Sab44) ([#19276](https://github.com/community-scripts/ProxmoxVE/pull/19276))
- #### 🔧 Refactor
- AFFiNE: run one server, update to 0.27.4 [@MickLesk](https://github.com/MickLesk) ([#19283](https://github.com/community-scripts/ProxmoxVE/pull/19283))
- Docker/NPMplus (Alpine): use docker-cli-compose instead of a downloaded binary [@MickLesk](https://github.com/MickLesk) ([#19278](https://github.com/community-scripts/ProxmoxVE/pull/19278))
### 💾 Core
- setup_docker: install docker-compose-plugin only next to docker-ce [@MickLesk](https://github.com/MickLesk) ([core#335](https://github.com/community-scripts/core/pull/335))
- core: Stop the run when a disabled script is started [@MickLesk](https://github.com/MickLesk) ([core#330](https://github.com/community-scripts/core/pull/330))
- docker: remove legacy docker-compose binaries that shadow docker-compose-plugin [@MickLesk](https://github.com/MickLesk) ([core#334](https://github.com/community-scripts/core/pull/334))
- tools: add check_for_gl_tag [@MickLesk](https://github.com/MickLesk) ([core#332](https://github.com/community-scripts/core/pull/332))
- core: say what curl said when a download fails [@MickLesk](https://github.com/MickLesk) ([core#331](https://github.com/community-scripts/core/pull/331))
- feat: ask VMs for tags, delete protection and the DNS search domain [@MickLesk](https://github.com/MickLesk) ([core#329](https://github.com/community-scripts/core/pull/329))
### 📚 Documentation
- ci: fix fork merges and issue locking, merge the drift-closed workflows [@MickLesk](https://github.com/MickLesk) ([#19286](https://github.com/community-scripts/ProxmoxVE/pull/19286))
### 📂 Github
- fix(ci): daily release fixes (drop Frontend, keep days apart) [@CrazyWolf13](https://github.com/CrazyWolf13) ([#19274](https://github.com/community-scripts/ProxmoxVE/pull/19274))
- fix(ci): set GH_REPO in the daily release step [@CrazyWolf13](https://github.com/CrazyWolf13) ([#19272](https://github.com/community-scripts/ProxmoxVE/pull/19272))
## 2026-12-02
### 🆕 New Scripts
- Docling-Serve [@MickLesk](https://github.com/MickLesk) ([#19237](https://github.com/community-scripts/ProxmoxVE/pull/19237))
- Kopia [@MickLesk](https://github.com/MickLesk) ([#19238](https://github.com/community-scripts/ProxmoxVE/pull/19238))
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- n8n: update with an empty npm cache and the service stopped [@MickLesk](https://github.com/MickLesk) ([#19262](https://github.com/community-scripts/ProxmoxVE/pull/19262))
- Pterodactyl Panel: switch PHP with setup_php [@MickLesk](https://github.com/MickLesk) ([#19255](https://github.com/community-scripts/ProxmoxVE/pull/19255))
- Frigate: fetch the Intel key for install_deps with retries [@MickLesk](https://github.com/MickLesk) ([#19253](https://github.com/community-scripts/ProxmoxVE/pull/19253))
- ERPNext: raise the default RAM to 6 GB [@MickLesk](https://github.com/MickLesk) ([#19252](https://github.com/community-scripts/ProxmoxVE/pull/19252))
- Aurral: build without the exact Node minor check [@MickLesk](https://github.com/MickLesk) ([#19251](https://github.com/community-scripts/ProxmoxVE/pull/19251))
- Dreeve: follow FrankenPHP releases for PHP 8.6 [@MickLesk](https://github.com/MickLesk) ([#19250](https://github.com/community-scripts/ProxmoxVE/pull/19250))
- cross-seed: reinstall when a Node.js upgrade broke better-sqlite3 [@MickLesk](https://github.com/MickLesk) ([#19249](https://github.com/community-scripts/ProxmoxVE/pull/19249))
- Dispatcharr: consume the plugins and dvr queues like upstream [@MickLesk](https://github.com/MickLesk) ([#19248](https://github.com/community-scripts/ProxmoxVE/pull/19248))
- #### 🔧 Refactor
- Refactor: ArchiveBox [@MickLesk](https://github.com/MickLesk) ([#17495](https://github.com/community-scripts/ProxmoxVE/pull/17495))
- Martin: Refactor - use the legacycpu build on CPUs below x86-64-v3 [@MickLesk](https://github.com/MickLesk) ([#19264](https://github.com/community-scripts/ProxmoxVE/pull/19264))
- Sure: set SECRET_KEY_BASE whatever the example holds [@MickLesk](https://github.com/MickLesk) ([#19258](https://github.com/community-scripts/ProxmoxVE/pull/19258))
### 🧰 Tools
- #### ✨ New Features
- [tools.update-lxcs] feat: optional CLEAN_CACHE to remove downloaded packages after each update [@mattstein111](https://github.com/mattstein111) ([#19192](https://github.com/community-scripts/ProxmoxVE/pull/19192))
### 📂 Github
- refactor(ci): merge changelog, archive and release workflows into one daily run [@CrazyWolf13](https://github.com/CrazyWolf13) ([#19190](https://github.com/community-scripts/ProxmoxVE/pull/19190))
## 2026-12-01
### 🆕 New Scripts
- XWiki [@freakms](https://github.com/freakms) ([#19239](https://github.com/community-scripts/ProxmoxVE/pull/19239))
- OpenWA [@MickLesk](https://github.com/MickLesk) ([#19236](https://github.com/community-scripts/ProxmoxVE/pull/19236))
- Alexandrie [@MickLesk](https://github.com/MickLesk) ([#19240](https://github.com/community-scripts/ProxmoxVE/pull/19240))
- NetBird Server VM ([#19215](https://github.com/community-scripts/ProxmoxVE/pull/19215))
### 🚀 Updated Scripts
- #### 💥 Breaking Changes
- DroppedNeedle: build and update the Rust v3 [@MickLesk](https://github.com/MickLesk) ([#18735](https://github.com/community-scripts/ProxmoxVE/pull/18735))
### 💾 Core
- VM's: let a Cloud-Init VM be reached by SSH key only [@MickLesk](https://github.com/MickLesk) ([core#328](https://github.com/community-scripts/core/pull/328))
## 2026-11-30
### 🆕 New Scripts
+23 -17
View File
@@ -31,17 +31,26 @@ function update_script() {
exit
fi
RELEASE="v0.27.3"
if [[ -f /etc/systemd/system/affine-worker.service ]]; then
msg_info "Removing affine-worker Service"
systemctl disable -q --now affine-worker
rm -f /etc/systemd/system/affine-worker.service
systemctl daemon-reload
systemctl restart affine-web
msg_ok "Removed affine-worker Service"
fi
RELEASE="v0.27.4"
if check_for_gh_release "affine_app" "toeverything/AFFiNE" "${RELEASE}" "each release is tested individually before the version is updated. Please do not open issues for this"; then
NODE_VERSION="22" setup_nodejs
msg_info "Stopping Services"
systemctl stop affine-web affine-worker
msg_ok "Stopped Services"
msg_info "Stopping Service"
systemctl stop affine-web
msg_ok "Stopped Service"
ensure_dependencies cmake
create_backup /opt/affine/.env /root/.affine/config /root/.affine/storage
create_backup /opt/affine/.env
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "affine_app" "toeverything/AFFiNE" "tarball" "${RELEASE}" "/opt/affine"
@@ -55,14 +64,14 @@ function update_script() {
msg_info "Rebuilding Application (Patience ~25 mins, don't close the console!)"
cd /opt/affine
source /root/.profile
export PATH="/root/.cargo/bin:/root/.rbenv/shims:$PATH"
export PATH="/root/.cargo/bin:$PATH"
set -a && source /opt/affine/.env && set +a
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
export VITE_CORE_COMMIT_SHA=$(cat ~/.affine_app)
# Initialize git repo (required for build process)
# The build needs a git repository
export HUSKY=0
$STD git init -q
$STD git config user.email "build@local"
@@ -70,7 +79,6 @@ function update_script() {
$STD git add -A
$STD git commit -q -m "update" --no-verify --allow-empty
# Force Turbo to run sequentially
mkdir -p /opt/affine/.turbo
cat <<TURBO >/opt/affine/.turbo/config.json
{
@@ -79,10 +87,9 @@ function update_script() {
TURBO
$STD corepack enable
$STD corepack prepare yarn@4.13.0 --activate
$STD yarn config set enableTelemetry 0
export NODE_OPTIONS="--max-old-space-size=2048"
export NODE_OPTIONS="--max-old-space-size=4096"
$STD yarn install
$STD bash ./scripts/set-version.sh "$(cat ~/.affine_app)"
export BUILD_TYPE=stable
@@ -102,8 +109,6 @@ TURBO
$STD yarn affine init
$STD yarn affine build -p @affine/reader
$STD yarn affine build -p @affine/server
export NODE_OPTIONS="--max-old-space-size=4096"
$STD yarn affine build -p @affine/web
$STD yarn affine build -p @affine/admin
@@ -117,15 +122,16 @@ TURBO
mkdir -p /opt/affine/packages/backend/server/static/mobile
echo '{"publicPath":"/","js":[],"css":[],"gitHash":"","description":""}' \
>/opt/affine/packages/backend/server/static/mobile/assets-manifest.json
msg_ok "Rebuilt Application"
# Run migrations
msg_info "Running Migrations"
cd /opt/affine/packages/backend/server
set -a && source /opt/affine/.env && set +a
$STD node ./scripts/self-host-predeploy.js
msg_ok "Ran Migrations"
msg_info "Starting Services"
systemctl start affine-web affine-worker
msg_ok "Started Services"
msg_info "Starting Service"
systemctl start affine-web
msg_ok "Started Service"
msg_ok "Updated Successfully!"
fi
exit
+81
View File
@@ -0,0 +1,81 @@
#!/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/Smaug6739/Alexandrie
APP="Alexandrie"
var_tags="${var_tags:-notes;markdown;knowledge-base}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-6}"
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 [[ ! -d /opt/alexandrie ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "rustfs" "rustfs/rustfs"; then
msg_info "Stopping RustFS"
systemctl stop alexandrie-backend rustfs
msg_ok "Stopped RustFS"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "rustfs" "rustfs/rustfs" "prebuild" "latest" "/opt/rustfs" "rustfs-linux-$(arch_resolve x86_64 aarch64)-gnu-*.zip"
chmod +x /opt/rustfs/rustfs
msg_info "Starting RustFS"
systemctl start rustfs alexandrie-backend
msg_ok "Started RustFS"
fi
if check_for_gh_release "alexandrie" "Smaug6739/Alexandrie"; then
msg_info "Stopping Alexandrie"
systemctl stop alexandrie-frontend alexandrie-backend
msg_ok "Stopped Alexandrie"
setup_go
NODE_VERSION="24" NODE_MODULE="bun" setup_nodejs
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "alexandrie" "Smaug6739/Alexandrie" "tarball"
msg_info "Building Alexandrie"
cd /opt/alexandrie/backend
CGO_ENABLED=0 $STD go build -o alexandrie .
$STD go clean -cache -modcache
cd /opt/alexandrie/frontend
$STD bun install --frozen-lockfile
NODE_ENV=production $STD bun run build
rm -rf node_modules .nuxt ~/.bun/install/cache
msg_ok "Built Alexandrie"
msg_info "Starting Alexandrie"
systemctl start alexandrie-backend alexandrie-frontend
msg_ok "Started Alexandrie"
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}${CL}"
+40 -22
View File
@@ -12,7 +12,7 @@ var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
@@ -30,30 +30,48 @@ function update_script() {
exit
fi
NODE_VERSION="22" NODE_MODULE="@postlight/parser@latest,single-file-cli@latest" setup_nodejs
PYTHON_VERSION="3.13" setup_uv
if check_for_gh_release "archivebox" "ArchiveBox/ArchiveBox"; then
msg_info "Stopping ArchiveBox"
systemctl stop archivebox
msg_ok "Stopped ArchiveBox"
ensure_dependencies chromium
export UV_PYTHON_INSTALL_DIR="/opt/archivebox/python"
PYTHON_VERSION="3.13" setup_uv
ensure_dependencies chromium
msg_info "Stopping Service"
systemctl stop archivebox
msg_ok "Stopped Service"
if [[ ! -x /opt/archivebox/.venv/bin/archivebox ]]; then
msg_info "Migrating ArchiveBox to 0.9"
$STD uv pip uninstall --system --break-system-packages archivebox playwright
rm -rf /home/archivebox/.cache/ms-playwright
remove_old_tool_version "nodejs" "nodesource"
sed -i -e '/^User=archivebox$/d' -e 's|^ExecStart=/usr/local/bin/archivebox |ExecStart=/opt/archivebox/.venv/bin/archivebox |' /etc/systemd/system/archivebox.service
sed -i '/^ExecStart=/i ExecStartPre=-/bin/sh -c "echo 1G 2>/dev/null >/sys/fs/cgroup/memory.reclaim"' /etc/systemd/system/archivebox.service
systemctl daemon-reload
$STD uv venv --python 3.13 /opt/archivebox/.venv
msg_ok "Migrated ArchiveBox to 0.9"
fi
msg_info "Upgrading Playwright"
$STD uv pip install playwright --system --break-system-packages
$STD playwright install-deps chromium
msg_ok "Upgraded Playwright"
msg_info "Updating ArchiveBox"
$STD uv pip install --python /opt/archivebox/.venv/bin/python "archivebox==${CHECK_UPDATE_RELEASE#v}"
ln -sf /opt/archivebox/.venv/bin/archivebox /usr/local/bin/archivebox
cd /opt/archivebox/data
$STD archivebox init
if ! grep -q "^BASE_URL" ArchiveBox.conf; then
$STD archivebox config --set "BASE_URL=http://${LOCAL_IP}:$(grep -oP 'server 0\.0\.0\.0:\K[0-9]+' /etc/systemd/system/archivebox.service)"
fi
echo 1G 2>/dev/null >/sys/fs/cgroup/memory.reclaim || true
$STD archivebox install
$STD archivebox update --migrate-only
cat <<EOF >~/.archivebox
${CHECK_UPDATE_RELEASE#v}
EOF
msg_ok "Updated ArchiveBox"
msg_info "Updating ArchiveBox"
cd /opt/archivebox/data
$STD uv pip install --system --break-system-packages --upgrade --no-reinstall archivebox
sudo -u archivebox archivebox init
msg_ok "Updated ArchiveBox"
msg_info "Starting Service"
systemctl start archivebox
msg_ok "Started Service"
msg_ok "Updated successfully!"
msg_info "Starting ArchiveBox"
systemctl start archivebox
msg_ok "Started ArchiveBox"
msg_ok "Updated successfully!"
fi
exit
}
@@ -64,4 +82,4 @@ 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}:8000/admin/login${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}:8000/admin/${CL}"
+1 -1
View File
@@ -46,7 +46,7 @@ function update_script() {
export VITE_GITHUB_REPO="lklynet/aurral"
export VITE_RELEASE_CHANNEL="stable"
$STD pnpm install --frozen-lockfile --config.engine-strict=false --filter aurral-frontend --filter aurral-backend
$STD pnpm --filter aurral-frontend run build
$STD pnpm --config.engine-strict=false --filter aurral-frontend run build
mkdir -p /opt/aurral_data
cat <<EOF >/opt/aurral/aurral.env
NODE_ENV=production
+219 -130
View File
@@ -31,13 +31,27 @@ function update_script() {
exit
fi
read -r MAJOR MINOR PATCH <<<"$(sed 's/^version\///; s/\./ /g' "$HOME/.authentik")"
# An update that did not finish leaves the version it started from in the .pending marker
VERSION_FILE="$HOME/.authentik"
if [[ -s $VERSION_FILE.pending ]]; then
VERSION_FILE="$VERSION_FILE.pending"
fi
read -r MAJOR MINOR PATCH <<<"$(sed 's/^version\///; s/\./ /g' "$VERSION_FILE")"
if [[ $MAJOR == 2026 && $MINOR -lt 5 ]]; then
msg_error "Updating from version ${MAJOR}.${MINOR}.${PATCH} is not supported. A minimum version of 2026.5.x is required to update. See: https://docs.goauthentik.io/releases/2026.8/"
exit
fi
if [[ $MAJOR == 2026 && $MINOR -lt 11 ]]; then
BASE_URL="$(yq '.web.base_url // ""' /etc/authentik/config.yml 2>/dev/null)$(grep -s '^AUTHENTIK_WEB__BASE_URL=.' /etc/default/authentik-server || true)"
BASE_URL+="$(runuser -u postgres -- psql -d authentik -tA -c "SELECT _config->>'authentik_host' FROM authentik_outposts_outpost WHERE managed = 'goauthentik.io/outposts/embedded'" -c "SELECT base_url FROM authentik_tenants_tenant" -c "SELECT base_url FROM authentik_admin_systemsettings" 2>/dev/null | tr -d '[:space:]' || true)"
if [[ -z $BASE_URL ]]; then
msg_error "authentik 2026.11 does not start without a base URL. Add AUTHENTIK_WEB__BASE_URL=https://<your authentik address> to /etc/default/authentik-server and /etc/default/authentik-worker, then run the update again."
exit
fi
fi
msg_info "Update dependencies"
ensure_dependencies crossbuild-essential-$(arch_resolve) gcc-$(arch_resolve "x86-64" "aarch64")-linux-gnu cmake clang libunwind-18-dev
msg_ok "Update dependencies"
@@ -47,8 +61,12 @@ function update_script() {
RUST_PROFILE="minimal" RUST_TOOLCHAIN="stable" setup_rust
setup_yq
AUTHENTIK_VERSION="version/2026.8.6"
# Source: https://github.com/goauthentik/fips/blob/main/Makefile#L26
AUTHENTIK_VERSIONS=("version/2026.11.0")
# authentik only updates from the previous major release
if [[ $MAJOR == 2026 && $MINOR -lt 8 ]]; then
AUTHENTIK_VERSIONS=("version/2026.8.7" "version/2026.11.0")
fi
# Source: https://github.com/goauthentik/fips/blob/main/Makefile#L28
XMLSEC_VERSION="1.3.13"
if check_for_gh_release "geoipupdate" "maxmind/geoipupdate"; then
@@ -68,143 +86,191 @@ function update_script() {
msg_ok "Updated xmlsec"
fi
if check_for_gh_release "authentik" "goauthentik/authentik" "${AUTHENTIK_VERSION}"; then
msg_info "Stopping Services"
systemctl stop authentik-server authentik-worker
if [[ $(systemctl is-active authentik-ldap) == active ]]; then
systemctl stop authentik-ldap
fi
if [[ $(systemctl is-active authentik-rac) == active ]]; then
systemctl stop authentik-rac
fi
if [[ $(systemctl is-active authentik-radius) == active ]]; then
systemctl stop authentik-radius
fi
msg_ok "Stopped Services"
for AUTHENTIK_VERSION in "${AUTHENTIK_VERSIONS[@]}"; do
if check_for_gh_release "authentik" "goauthentik/authentik" "${AUTHENTIK_VERSION}"; then
msg_info "Stopping Services"
systemctl stop authentik-server authentik-worker
if [[ $(systemctl is-active authentik-ldap) == active ]]; then
systemctl stop authentik-ldap
fi
if [[ $(systemctl is-active authentik-rac) == active ]]; then
systemctl stop authentik-rac
fi
if [[ $(systemctl is-active authentik-radius) == active ]]; then
systemctl stop authentik-radius
fi
msg_ok "Stopped Services"
if [[ ! -d /opt/authentik-data/blueprints ]]; then
msg_info "Moving blueprints to presistent directory"
cp -r /opt/authentik/blueprints /opt/authentik-data/
rm -r /opt/authentik/blueprints
$STD find /opt/authentik-data -path '*/lost+found' -prune -o -exec chown authentik:authentik {} +
yq -i ".blueprints_dir = \"/opt/authentik-data/blueprints\"" /etc/authentik/config.yml
msg_ok "blueprints moved to presistent directory"
msg_warn "The blueprints provided by authentik are always overwritten when updated! Only manually created custom blueprints remain unchanged between updates."
fi
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "authentik" "goauthentik/authentik" "tarball" "${AUTHENTIK_VERSION}" "/opt/authentik"
UV_PYTHON_INSTALL_DIR="/usr/local/bin" PYTHON_VERSION="3.14.10" UV_PROJECT_DIR="/opt/authentik" setup_uv
GO_VERSION="$(grep -m1 '^go ' /opt/authentik/go.mod | awk '{print $2}')" setup_go
msg_info "Configuring rust"
cd /opt/authentik
$STD rustup install
$STD rustup default "$(sed -n 's/channel = "\(.*\)"/\1/p' rust-toolchain.toml)"
msg_ok "Configured rust"
msg_info "Updating web"
export NODE_ENV="production"
cd /opt/authentik
$STD node ./scripts/node/lint-runtime.ts ./web
cd /opt/authentik/web
$STD pnpm install --frozen-lockfile
$STD pnpm run build
$STD pnpm run build:sfe
msg_ok "Updated web"
msg_info "Updating outposts"
cd /opt/authentik
mkdir -p /opt/authentik/bin
export CGO_ENABLED="1"
export CC="$(arch_resolve "x86_64" "aarch64")-linux-gnu-gcc"
$STD go mod download
$STD go build -o /opt/authentik/bin/ldap ./cmd/ldap
$STD go build -o /opt/authentik/bin/rac ./cmd/rac
$STD go build -o /opt/authentik/bin/radius ./cmd/radius
msg_ok "Updated outposts"
msg_info "Building binary. It may take more than 10 minutes, please be patient."
export AWS_LC_FIPS_SYS_CC="clang"
cd /opt/authentik
$STD cargo build --package authentik --no-default-features --features core --locked --release
cp ./target/release/authentik /opt/authentik/bin/
rm -r ./target
msg_ok "Built worker"
msg_info "Updating python server"
export UV_NO_BINARY_PACKAGE="cryptography lxml python-kadmin-rs xmlsec"
export UV_COMPILE_BYTECODE="1"
export UV_LINK_MODE="copy"
export UV_NATIVE_TLS="1"
export RUSTUP_PERMIT_COPY_RENAME="true"
export UV_PYTHON_INSTALL_DIR="/usr/local/bin"
cd /opt/authentik
for attempt in 1 2 3; do
if [[ $attempt -eq 3 ]]; then
$STD uv sync --locked --no-install-project --no-dev
break
fi
$STD uv sync --locked --no-install-project --no-dev && break
msg_warn "uv sync attempt $attempt failed, retrying..."
sleep $((attempt * 15))
done
chown -R authentik:authentik /opt/authentik
msg_ok "Updated python server"
if [[ $AUTHENTIK_VERSION == "${AUTHENTIK_VERSIONS[-1]}" ]]; then
# Installs that never set up MaxMind only have its test databases: give them the DB-IP Lite ones authentik's own image ships
if grep -qs '^AccountID ChangeME' /usr/local/etc/GeoIP.conf && [[ $(yq '.events.context_processors.geoip' /etc/authentik/config.yml) == /opt/authentik-data/geoip/GeoLite2-City.mmdb ]]; then
yq -i '.events.context_processors.geoip = "/opt/authentik-data/geoip/dbip-city-lite.mmdb"' /etc/authentik/config.yml
yq -i '.events.context_processors.asn = "/opt/authentik-data/geoip/dbip-asn-lite.mmdb"' /etc/authentik/config.yml
fi
if [[ $(yq '.events.context_processors.geoip' /etc/authentik/config.yml) == /opt/authentik-data/geoip/dbip-city-lite.mmdb ]]; then
msg_info "Updating GeoIP databases"
mkdir -p /opt/authentik-data/geoip
for EDITION in city asn; do
for MONTH in "$(date -u +%Y-%m)" "$(date -u -d "$(date -u +%Y-%m-15) -1 month" +%Y-%m)"; do
if curl -fsL "https://download.db-ip.com/free/dbip-${EDITION}-lite-${MONTH}.mmdb.gz" | gunzip >"/opt/authentik-data/geoip/dbip-${EDITION}-lite.mmdb.tmp" 2>/dev/null; then
mv "/opt/authentik-data/geoip/dbip-${EDITION}-lite.mmdb.tmp" "/opt/authentik-data/geoip/dbip-${EDITION}-lite.mmdb"
break
fi
done
done
rm -f /opt/authentik-data/geoip/*.tmp
if [[ -s /opt/authentik-data/geoip/dbip-city-lite.mmdb ]]; then
msg_ok "Updated GeoIP databases"
else
msg_warn "The GeoIP databases could not be downloaded from download.db-ip.com. authentik works without them; the next update tries again."
fi
fi
fi
if [[ ! -d /opt/authentik-data/blueprints ]]; then
msg_info "Moving blueprints to presistent directory"
cp -r /opt/authentik/blueprints /opt/authentik-data/
rm -r /opt/authentik/blueprints
$STD find /opt/authentik-data -path '*/lost+found' -prune -o -exec chown authentik:authentik {} +
yq -i ".blueprints_dir = \"/opt/authentik-data/blueprints\"" /etc/authentik/config.yml
msg_ok "blueprints moved to presistent directory"
msg_warn "The blueprints provided by authentik are always overwritten when updated! Only manually created custom blueprints remain unchanged between updates."
fi
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "authentik" "goauthentik/authentik" "tarball" "${AUTHENTIK_VERSION}" "/opt/authentik"
UV_PYTHON_INSTALL_DIR="/usr/local/bin" PYTHON_VERSION="3.14.10" UV_PROJECT_DIR="/opt/authentik" setup_uv
GO_VERSION="$(grep -m1 '^go ' /opt/authentik/go.mod | awk '{print $2}')" setup_go
# Also catch installs whose version marker already reads 2026.8.x but whose units were never migrated
if [[ $MAJOR == 2026 && $MINOR -lt 8 ]] || grep -q "ExecStart=/opt/authentik/authentik-server" /etc/systemd/system/authentik-server.service; then
msg_info "Updating Worker and Server config (from $MAJOR.$MINOR)"
cat <<EOF >>/etc/default/authentik-server
RUST_BACKTRACE=full
EOF
cat <<EOF >>/etc/default/authentik-worker
RUST_BACKTRACE=full
EOF
msg_ok "Updated Worker and Server config (from $MAJOR.$MINOR)"
msg_info "Configuring rust"
cd /opt/authentik
$STD rustup install
$STD rustup default "$(sed -n 's/channel = "\(.*\)"/\1/p' rust-toolchain.toml)"
msg_ok "Configured rust"
msg_info "Updating web"
export NODE_ENV="production"
cd /opt/authentik
$STD node ./scripts/node/lint-runtime.ts ./web
cd /opt/authentik/web
$STD pnpm install --frozen-lockfile
$STD pnpm run build
$STD pnpm run build:sfe
msg_ok "Updated web"
msg_info "Updating outposts"
cd /opt/authentik
mkdir -p /opt/authentik/bin
export CGO_ENABLED="1"
export CC="$(arch_resolve "x86_64" "aarch64")-linux-gnu-gcc"
$STD go mod download
$STD go build -o /opt/authentik/bin/ldap ./cmd/ldap
$STD go build -o /opt/authentik/bin/rac ./cmd/rac
$STD go build -o /opt/authentik/bin/radius ./cmd/radius
msg_ok "Updated outposts"
msg_info "Building binary. It may take more than 10 minutes, please be patient."
export AWS_LC_FIPS_SYS_CC="clang"
cd /opt/authentik
$STD cargo build --package authentik --no-default-features --features core --locked --release
cp ./target/release/authentik /opt/authentik/bin/
rm -r ./target
msg_ok "Built worker"
msg_info "Updating python server"
export UV_NO_BINARY_PACKAGE="cryptography lxml python-kadmin-rs xmlsec"
export UV_COMPILE_BYTECODE="1"
export UV_LINK_MODE="copy"
export UV_NATIVE_TLS="1"
export RUSTUP_PERMIT_COPY_RENAME="true"
export UV_PYTHON_INSTALL_DIR="/usr/local/bin"
cd /opt/authentik
for attempt in 1 2 3; do
if [[ $attempt -eq 3 ]]; then
$STD uv sync --locked --no-install-project --no-dev
break
msg_info "Updating services (from $MAJOR.$MINOR)"
sed -i "s|ExecStart=/opt/authentik/authentik-server|ExecStart=/opt/authentik/bin/authentik server|g" /etc/systemd/system/authentik-server.service
sed -i "s|ExecStart=/opt/authentik/authentik-worker worker|ExecStart=/opt/authentik/bin/authentik worker|g" /etc/systemd/system/authentik-worker.service
sed -i "s|ExecStart=/opt/authentik/ldap|ExecStart=/opt/authentik/bin/ldap|g" /etc/systemd/system/authentik-ldap.service
sed -i "s|ExecStart=/opt/authentik/radius|ExecStart=/opt/authentik/bin/radius|g" /etc/systemd/system/authentik-radius.service
sed -i "s|ExecStart=/opt/authentik/rac|ExecStart=/opt/authentik/bin/rac|g" /etc/systemd/system/authentik-rac.service
systemctl daemon-reload
msg_ok "Updated services (from $MAJOR.$MINOR)"
fi
$STD uv sync --locked --no-install-project --no-dev && break
msg_warn "uv sync attempt $attempt failed, retrying..."
sleep $((attempt * 15))
done
chown -R authentik:authentik /opt/authentik
msg_ok "Updated python server"
cp -r /opt/authentik/blueprints /opt/authentik-data/
rm -r /opt/authentik/blueprints
$STD find /opt/authentik-data -path '*/lost+found' -prune -o -exec chown authentik:authentik {} +
msg_info "Updating Worker and Server config"
sed -i "s|/dev/shm\/\?$|/dev/shm/authentik-server|g" /etc/default/authentik-server
sed -i "s|/dev/shm\/\?$|/dev/shm/authentik-worker|g" /etc/default/authentik-worker
msg_ok "Updated Worker and Server config"
# Also catch installs whose version marker already reads 2026.8.x but whose units were never migrated
if [[ $MAJOR == 2026 && $MINOR -lt 8 ]] || grep -q "ExecStart=/opt/authentik/authentik-server" /etc/systemd/system/authentik-server.service; then
msg_info "Updating Worker and Server config (from $MAJOR.$MINOR)"
cat <<EOF >>/etc/default/authentik-server
RUST_BACKTRACE=full
EOF
cat <<EOF >>/etc/default/authentik-worker
RUST_BACKTRACE=full
EOF
msg_ok "Updated Worker and Server config (from $MAJOR.$MINOR)"
msg_info "Updating services (from $MAJOR.$MINOR)"
sed -i "s|ExecStart=/opt/authentik/authentik-server|ExecStart=/opt/authentik/bin/authentik server|g" /etc/systemd/system/authentik-server.service
sed -i "s|ExecStart=/opt/authentik/authentik-worker worker|ExecStart=/opt/authentik/bin/authentik worker|g" /etc/systemd/system/authentik-worker.service
sed -i "s|ExecStart=/opt/authentik/ldap|ExecStart=/opt/authentik/bin/ldap|g" /etc/systemd/system/authentik-ldap.service
sed -i "s|ExecStart=/opt/authentik/radius|ExecStart=/opt/authentik/bin/radius|g" /etc/systemd/system/authentik-radius.service
sed -i "s|ExecStart=/opt/authentik/rac|ExecStart=/opt/authentik/bin/rac|g" /etc/systemd/system/authentik-rac.service
msg_info "Updating services"
sed -i 's/authentik Go Server (API Gateway)/authentik Server/g' /etc/systemd/system/authentik-server.service
if ! grep -qF -- 'ExecStartPre=/usr/bin/mkdir -p "${TMPDIR}"' /etc/systemd/system/authentik-server.service; then
sed -i '/ExecStart=/i ExecStartPre=/usr/bin/mkdir -p "${TMPDIR}"' /etc/systemd/system/authentik-server.service
fi
if ! grep -qF -- 'ExecStartPre=/usr/bin/mkdir -p "${TMPDIR}"' /etc/systemd/system/authentik-worker.service; then
sed -i '/ExecStart=/i ExecStartPre=/usr/bin/mkdir -p "${TMPDIR}"' /etc/systemd/system/authentik-worker.service
fi
systemctl daemon-reload
msg_ok "Updated services (from $MAJOR.$MINOR)"
fi
msg_ok "Updated services"
msg_info "Updating Worker and Server config"
sed -i "s|/dev/shm\/\?$|/dev/shm/authentik-server|g" /etc/default/authentik-server
sed -i "s|/dev/shm\/\?$|/dev/shm/authentik-worker|g" /etc/default/authentik-worker
msg_ok "Updated Worker and Server config"
msg_info "Migrating database"
$STD runuser -u authentik -- bash -c 'set -a; . /etc/default/authentik-server; set +a; mkdir -p "$TMPDIR" "$PROMETHEUS_MULTIPROC_DIR"; cd /opt/authentik && python -m lifecycle.migrate'
msg_ok "Migrated database"
# This stage is done: the next one, or the next run, starts from here
rm -f "$HOME/.authentik.pending"
read -r MAJOR MINOR PATCH <<<"$(sed 's/^version\///; s/\./ /g' <<<"$AUTHENTIK_VERSION")"
msg_info "Updating services"
sed -i 's/authentik Go Server (API Gateway)/authentik Server/g' /etc/systemd/system/authentik-server.service
if ! grep -qF -- 'ExecStartPre=/usr/bin/mkdir -p "${TMPDIR}"' /etc/systemd/system/authentik-server.service; then
sed -i '/ExecStart=/i ExecStartPre=/usr/bin/mkdir -p "${TMPDIR}"' /etc/systemd/system/authentik-server.service
fi
if ! grep -qF -- 'ExecStartPre=/usr/bin/mkdir -p "${TMPDIR}"' /etc/systemd/system/authentik-worker.service; then
sed -i '/ExecStart=/i ExecStartPre=/usr/bin/mkdir -p "${TMPDIR}"' /etc/systemd/system/authentik-worker.service
fi
systemctl daemon-reload
msg_ok "Updated services"
msg_info "Starting Services"
systemctl start authentik-server authentik-worker
if [[ $(systemctl is-enabled authentik-ldap) == enabled ]]; then
systemctl start authentik-ldap
fi
if [[ $(systemctl is-enabled authentik-rac) == enabled ]]; then
systemctl start authentik-rac
fi
if [[ $(systemctl is-enabled authentik-radius) == enabled ]]; then
systemctl start authentik-radius
fi
msg_ok "Started Services"
msg_info "Starting Services"
systemctl start authentik-server authentik-worker
if [[ $(systemctl is-enabled authentik-ldap) == enabled ]]; then
systemctl start authentik-ldap
fi
if [[ $(systemctl is-enabled authentik-rac) == enabled ]]; then
systemctl start authentik-rac
fi
if [[ $(systemctl is-enabled authentik-radius) == enabled ]]; then
systemctl start authentik-radius
fi
msg_ok "Started Services"
fi
msg_info "Waiting for authentik to become ready (up to 300s)"
CODE=000
for _ in {1..60}; do
CODE=$(curl -ksI -m 3 https://127.0.0.1:9443/ | sed -n 's,^HTTP/[0-9.]* \([0-9]\{3\}\).*,\1,p' || true)
[[ "$CODE" == "200" || "$CODE" == "302" ]] && break
sleep 5
done
if [[ "$CODE" == "200" || "$CODE" == "302" ]]; then
msg_ok "authentik is responding (HTTP ${CODE})"
else
msg_warn "authentik did not start responding (HTTP ${CODE}) within 300s. It may still be booting (migrations after an upgrade can take longer); check: journalctl -eu authentik-server"
fi
fi
done
msg_ok "Updated successfully!"
exit
}
@@ -214,18 +280,41 @@ build_container
msg_info "Attaching data storage volume"
ct_attach_volume 1 /opt/authentik-data
$STD ct_exec bash -c "mkdir -p /opt/authentik-data/{certs,media,geoip,templates}; \
cp /opt/authentik/tests/geoip/GeoLite2-ASN-Test.mmdb /opt/authentik-data/geoip/GeoLite2-ASN.mmdb; \
cp /opt/authentik/tests/geoip/GeoLite2-City-Test.mmdb /opt/authentik-data/geoip/GeoLite2-City.mmdb; \
$STD ct_exec bash -c "mkdir -p /opt/authentik-data/{certs,media,geoip,templates}"
# The DB-IP Lite databases authentik's own image ships; DB-IP publishes one edition a month
for EDITION in city asn; do
for MONTH in "$(date -u +%Y-%m)" "$(date -u -d "$(date -u +%Y-%m-15) -1 month" +%Y-%m)"; do
if ct_exec bash -c "curl -fsL https://download.db-ip.com/free/dbip-${EDITION}-lite-${MONTH}.mmdb.gz | gunzip >/opt/authentik-data/geoip/dbip-${EDITION}-lite.mmdb.tmp && mv /opt/authentik-data/geoip/dbip-${EDITION}-lite.mmdb.tmp /opt/authentik-data/geoip/dbip-${EDITION}-lite.mmdb" 2>/dev/null; then
break
fi
done
done
$STD ct_exec bash -c "rm -f /opt/authentik-data/geoip/*.tmp; \
cp -r /opt/authentik/blueprints /opt/authentik-data/; \
rm -r /opt/authentik/blueprints; \
find /opt/authentik-data -path '*/lost+found' -prune -o -exec chown authentik:authentik {} +"
msg_ok "Attached data storage volume"
if ! ct_exec test -s /opt/authentik-data/geoip/dbip-city-lite.mmdb; then
msg_warn "The GeoIP databases could not be downloaded from download.db-ip.com. authentik works without them; the next update tries again."
fi
msg_info "Starting Services"
ct_exec systemctl enable -q --now authentik-server authentik-worker
msg_ok "Started Services"
msg_info "Waiting for authentik to become ready (up to 300s)"
CODE=000
for _ in {1..60}; do
CODE=$(ct_exec curl -ksI -m 3 https://127.0.0.1:9443/ | sed -n 's,^HTTP/[0-9.]* \([0-9]\{3\}\).*,\1,p' || true)
[[ "$CODE" == "200" || "$CODE" == "302" ]] && break
sleep 5
done
if [[ "$CODE" == "200" || "$CODE" == "302" ]]; then
msg_ok "authentik is responding (HTTP ${CODE})"
else
msg_warn "authentik did not start responding (HTTP ${CODE}) within 300s. It may still be booting (first boot runs migrations); check inside the container with journalctl -eu authentik-server"
fi
description
msg_ok "Completed successfully!\n"
+1
View File
@@ -74,6 +74,7 @@ server {
server {
listen 8443 ssl;
server_name _;
absolute_redirect off;
ssl_certificate /etc/ssl/certs/bentopdf-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/bentopdf-selfsigned.key;
root /opt/bentopdf/dist;
+6 -1
View File
@@ -30,13 +30,18 @@ function update_script() {
ensure_dependencies build-essential
if command -v cross-seed &>/dev/null; then
current_version=$(cross-seed --version)
current_version=$(node -p "require('$(npm root -g)/cross-seed/package.json').version")
latest_version=$(npm show cross-seed version)
if [ "$current_version" != "$latest_version" ]; then
msg_info "Updating cross-seed from version v${current_version} to v${latest_version}"
$STD npm install -g cross-seed@latest
systemctl restart cross-seed
msg_ok "Updated successfully!"
elif ! cross-seed --version &>/dev/null; then
msg_info "Reinstalling cross-seed v${current_version} for Node.js $(node -v)"
$STD npm install -g "cross-seed@${current_version}"
systemctl restart cross-seed
msg_ok "Reinstalled cross-seed"
else
msg_ok "cross-seed is already at v${current_version}"
fi
+45 -1
View File
@@ -117,9 +117,52 @@ EOF
msg_ok "Compiled and Installed Comskip"
fi
if ! grep -qs -- "-Q celery,plugins" /opt/dispatcharr/start-celery.sh; then
msg_info "Migrating Celery Workers"
cat <<'EOF' >/opt/dispatcharr/start-celery.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
set -a
source .env
set +a
exec uv run celery -A dispatcharr worker -l info -Q celery,plugins -n default@%h --autoscale="${CELERY_MAX_WORKERS:-6},${CELERY_MIN_WORKERS:-1}"
EOF
cat <<'EOF' >/opt/dispatcharr/start-celery-dvr.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
set -a
source .env
set +a
exec uv run celery -A dispatcharr worker -l info -Q dvr -n dvr@%h --pool=threads --concurrency=20
EOF
chmod +x /opt/dispatcharr/start-celery.sh /opt/dispatcharr/start-celery-dvr.sh
cat <<EOF >/etc/systemd/system/dispatcharr-celery-dvr.service
[Unit]
Description=Dispatcharr Celery DVR Worker
After=network.target redis-server.service
Requires=dispatcharr.service
[Service]
Type=simple
WorkingDirectory=/opt/dispatcharr
ExecStart=/opt/dispatcharr/start-celery-dvr.sh
Restart=on-failure
RestartSec=10
User=root
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable -q --now dispatcharr-celery-dvr
systemctl restart dispatcharr-celery
msg_ok "Migrated Celery Workers"
fi
if check_for_gh_release "Dispatcharr" "Dispatcharr/Dispatcharr"; then
msg_info "Stopping Services"
systemctl stop dispatcharr-celery
systemctl stop dispatcharr-celery-dvr
systemctl stop dispatcharr-celerybeat
systemctl stop dispatcharr-daphne
systemctl stop dispatcharr
@@ -130,7 +173,7 @@ EOF
if [[ -f /opt/dispatcharr/start-gunicorn.sh ]]; then
rm -f /opt/dispatcharr/start-gunicorn.sh
fi
create_backup /opt/dispatcharr/.env /opt/dispatcharr/start-celery.sh /opt/dispatcharr/start-celerybeat.sh /opt/dispatcharr/start-daphne.sh
create_backup /opt/dispatcharr/.env /opt/dispatcharr/start-celery.sh /opt/dispatcharr/start-celery-dvr.sh /opt/dispatcharr/start-celerybeat.sh /opt/dispatcharr/start-daphne.sh
if [[ -f /opt/dispatcharr/.env ]]; then
set -o allexport
source /opt/dispatcharr/.env
@@ -213,6 +256,7 @@ EOF
msg_info "Starting Services"
systemctl start dispatcharr
systemctl start dispatcharr-celery
systemctl start dispatcharr-celery-dvr
systemctl start dispatcharr-celerybeat
systemctl start dispatcharr-daphne
msg_ok "Started Services"
+9
View File
@@ -60,6 +60,15 @@ update_deb_based() {
update_alpine() {
$STD apk -U upgrade
if [[ -f /root/.docker/cli-plugins/docker-compose ]]; then
msg_info "Migrating Docker Compose to the Alpine package"
if apk info -e docker-cli-compose &>/dev/null || $STD apk add docker-cli-compose; then
rm -f /root/.docker/cli-plugins/docker-compose
msg_ok "Migrated Docker Compose to the Alpine package ($(docker compose version --short))"
else
msg_warn "Could not install docker-cli-compose, keeping the old Compose binary"
fi
fi
msg_ok "Updated successfully!"
}
+70
View File
@@ -0,0 +1,70 @@
#!/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/docling-project/docling-serve
APP="Docling-Serve"
var_tags="${var_tags:-ai;documents;ocr}"
var_cpu="${var_cpu:-4}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-10}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_docling_api_key="${var_docling_api_key:-}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/docling-serve ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "docling-serve" "docling-project/docling-serve"; then
msg_info "Stopping Docling Serve"
systemctl stop docling-serve
msg_ok "Stopped Docling Serve"
PYTHON_VERSION="3.12" setup_uv
msg_info "Updating Docling Serve"
$STD uv pip install --upgrade --python /opt/docling-serve/.venv/bin/python --torch-backend cpu "docling-serve[rapidocr,tesserocr]==${CHECK_UPDATE_RELEASE#v}"
cat <<EOF >~/.docling-serve
${CHECK_UPDATE_RELEASE#v}
EOF
msg_ok "Updated Docling Serve"
msg_info "Updating Docling Models"
$STD /opt/docling-serve/.venv/bin/docling-tools models download -o /opt/docling-serve_data/models layout tableformer picture_classifier rapidocr
msg_ok "Updated Docling Models"
msg_info "Starting Docling Serve"
systemctl start docling-serve
msg_ok "Started Docling Serve"
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}:5001${CL}"
echo -e "${INFO}${YW}The API key is DOCLING_SERVE_API_KEY in /opt/docling-serve_data/.env${CL}"
+12
View File
@@ -31,6 +31,18 @@ function update_script() {
exit
fi
if check_for_gh_release "frankenphp" "php/frankenphp"; then
msg_info "Stopping Service"
systemctl stop dreeve
msg_ok "Stopped Service"
fetch_and_deploy_gh_release "frankenphp" "php/frankenphp" "singlefile" "latest" "/opt/frankenphp" "frankenphp-linux-$(arch_resolve x86_64 aarch64)-gnu"
msg_info "Starting Service"
systemctl start dreeve
msg_ok "Started Service"
fi
if check_for_gh_release "dreeve" "dreeveapp/dreeve"; then
msg_info "Stopping Service"
systemctl stop dreeve
+36 -69
View File
@@ -35,52 +35,46 @@ function update_script() {
[[ -d /opt/musicseerr ]] && MIGRATING=true
if [[ "$MIGRATING" == "true" ]] || check_for_gh_release "droppedneedle" "DroppedNeedle/DroppedNeedle"; then
FROM_V2=false
[[ "$MIGRATING" == "true" || -d /opt/droppedneedle/venv ]] && FROM_V2=true
OLD_VERSION="$(cat ~/.droppedneedle 2>/dev/null || true)"
if [[ "$MIGRATING" == "true" ]]; then
msg_warn "Migrating Musicseerr to DroppedNeedle"
msg_info "Stopping Musicseerr Service"
systemctl disable -q --now musicseerr
msg_ok "Stopped Musicseerr Service"
DATA_DIR="/opt/musicseerr/backend"
else
msg_info "Stopping Service"
systemctl stop droppedneedle
msg_ok "Stopped Service"
DATA_DIR="/opt/droppedneedle/backend"
fi
create_backup "$DATA_DIR/config" "$DATA_DIR/cache"
PYTHON_VERSION="3.13" setup_uv
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "droppedneedle" "DroppedNeedle/DroppedNeedle" "tarball"
NODE_VERSION="25" NODE_MODULE="pnpm@10.33.0" setup_nodejs
msg_info "Building Frontend"
cd /opt/droppedneedle/frontend
export NODE_OPTIONS="--max-old-space-size=3072"
rm -rf node_modules build
$STD pnpm install --frozen-lockfile
$STD pnpm run build
msg_ok "Built Frontend"
msg_info "Updating Application"
mkdir -p /opt/droppedneedle/backend/config /opt/droppedneedle/backend/cache
$STD uv venv --clear /opt/droppedneedle/venv
$STD uv pip install -r /opt/droppedneedle/backend/requirements.txt --python=/opt/droppedneedle/venv/bin/python
rm -rf /opt/droppedneedle/backend/static
cp -r /opt/droppedneedle/frontend/build /opt/droppedneedle/backend/static
msg_ok "Updated Application"
restore_backup
ensure_dependencies ffmpeg python3
CLEAN_INSTALL=1 CLEAN_INSTALL_KEEP="backend/config backend/cache backend/plugins backend/imports frontend" fetch_and_deploy_gh_release "droppedneedle" "DroppedNeedle/DroppedNeedle" "prebuild" "latest" "/opt/droppedneedle" "droppedneedle-v*-$(arch_resolve x86_64 aarch64)-linux.tar.gz" &&
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "droppedneedle-frontend" "DroppedNeedle/DroppedNeedle" "prebuild" "latest" "/opt/droppedneedle/frontend" "droppedneedle-frontend-v*.tar.gz" || {
echo "$OLD_VERSION" >~/.droppedneedle
msg_error "Download failed; the old version stays recorded, run update again"
exit 1
}
rm -f /usr/local/bin/droppedneedle /usr/local/bin/droppedneedle-tool
if [[ "$MIGRATING" == "true" ]]; then
msg_info "Migrating Musicseerr Data"
rm -rf /opt/droppedneedle/backend/config /opt/droppedneedle/backend/cache
mkdir -p /opt/droppedneedle/backend
cp -a /opt/musicseerr/backend/config /opt/droppedneedle/backend/config
cp -a /opt/musicseerr/backend/cache /opt/droppedneedle/backend/cache
rm -f /etc/systemd/system/musicseerr.service
sed -i 's/musicseerr/droppedneedle/g' /bin/update
rm -rf /opt/musicseerr
msg_ok "Migrated Musicseerr Data"
fi
mkdir -p /opt/droppedneedle/backend/{config,cache,plugins,imports}
msg_info "Replacing systemd Service"
cat <<EOF >/etc/systemd/system/droppedneedle.service
msg_info "Writing systemd Service"
SLSKD_LINE="$(grep -s '^Environment=SLSKD_DOWNLOADS_PATH=' /etc/systemd/system/droppedneedle.service || echo '# Environment=SLSKD_DOWNLOADS_PATH=<path-to-slskd-downloads>')"
cat <<EOF >/etc/systemd/system/droppedneedle.service
[Unit]
Description=DroppedNeedle Service
After=network.target
@@ -90,59 +84,32 @@ Type=simple
User=root
WorkingDirectory=/opt/droppedneedle/backend
Environment=ROOT_APP_DIR=/opt/droppedneedle/backend
Environment=DROPPEDNEEDLE_STATIC_DIR=/opt/droppedneedle/frontend/static
Environment=PORT=8688
Environment=COMMIT_TAG=v$(<~/.droppedneedle)
# Environment=SLSKD_DOWNLOADS_PATH=<path-to-slskd-downloads>
ExecStart=/opt/droppedneedle/venv/bin/python -m maintenance.automatic_upgrade --start-target
Environment=TZ=$(cat /etc/timezone 2>/dev/null || echo Etc/UTC)
${SLSKD_LINE}
ExecStart=/opt/droppedneedle/droppedneedle
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
rm -f /etc/systemd/system/musicseerr.service
msg_ok "Replaced systemd Service"
else
if ! grep -q 'SLSKD' /etc/systemd/system/droppedneedle.service; then
sed -i '\|=8688$|a# Environment=SLSKD_DOWNLOADS_PATH=<path-to-slskd-downloads>' /etc/systemd/system/droppedneedle.service
fi
sed -i 's|^ExecStart=.*|ExecStart=/opt/droppedneedle/venv/bin/python -m maintenance.automatic_upgrade --start-target|' /etc/systemd/system/droppedneedle.service
if grep -q '^Environment=COMMIT_TAG=' /etc/systemd/system/droppedneedle.service; then
sed -i "s|^Environment=COMMIT_TAG=.*|Environment=COMMIT_TAG=v$(<~/.droppedneedle)|" /etc/systemd/system/droppedneedle.service
else
sed -i "\|=8688$|a Environment=COMMIT_TAG=v$(<~/.droppedneedle)" /etc/systemd/system/droppedneedle.service
fi
fi
systemctl daemon-reload
if [[ "$MIGRATING" == "true" ]]; then
msg_info "Enabling DroppedNeedle Service"
systemctl enable -q --now droppedneedle
msg_ok "Enabled DroppedNeedle Service"
systemctl enable -q droppedneedle
msg_ok "Wrote systemd Service"
sed -i 's/musicseerr/droppedneedle/g' /bin/update
rm -rf /opt/musicseerr
msg_info "Waiting up to 1min for backend to boot and retrieve Admin Username"
for i in {1..30}; do
username=$(/opt/droppedneedle/venv/bin/python -c 'import sqlite3; conn = sqlite3.connect("/opt/droppedneedle/backend/cache/library.db"); c = conn.cursor(); c.execute("SELECT username FROM auth_users WHERE role=\"admin\""); admin=c.fetchone(); print(admin[0]) if (admin and admin[0]) else None' 2>/dev/null || true)
if [[ -n "$username" ]]; then
break
fi
sleep 2
done
if [[ -n "$username" ]]; then
msg_ok "Admin Username retrieved (Admin Username is: ${username})"
else
msg_warn "Failed to retrieve Admin Username. The backend might still be starting."
fi
msg_ok "Migrated successfully!"
else
msg_info "Starting Service"
systemctl start droppedneedle
msg_ok "Started Service"
msg_ok "Updated successfully!"
rm -rf /opt/droppedneedle/venv
msg_info "Starting Service"
systemctl start droppedneedle
msg_ok "Started Service"
if [[ "$FROM_V2" == "true" ]]; then
msg_warn "DroppedNeedle 3 needs a one-time upgrade of the v2 data: open http://${LOCAL_IP}:8688 and sign in with a v2 admin."
msg_warn "Before pressing Upgrade: single sign-on and Spotify callback URLs move from /api/v1 to /api/v3. See docs/upgrading-from-v2.md upstream."
msg_warn "No v2 admin with a password? The one-time sign-in code is in: journalctl -u droppedneedle | grep 'upgrade sign-in code'"
fi
msg_ok "Updated successfully!"
fi
exit
}
+1 -1
View File
@@ -10,7 +10,7 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_
APP="ERPNext"
var_tags="${var_tags:-erp;business;accounting}"
var_cpu="${var_cpu:-4}"
var_ram="${var_ram:-4096}"
var_ram="${var_ram:-6144}"
var_disk="${var_disk:-20}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
+60
View File
@@ -0,0 +1,60 @@
#!/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/kopia/kopia
APP="Kopia"
var_tags="${var_tags:-backup}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-1024}"
var_disk="${var_disk:-10}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_kopia_password="${var_kopia_password:-}"
export var_kopia_repo_password="${var_kopia_repo_password:-}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /opt/kopia_data/.env ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "kopia" "kopia/kopia"; then
msg_info "Stopping Kopia"
systemctl stop kopia
msg_ok "Stopped Kopia"
fetch_and_deploy_gh_release "kopia" "kopia/kopia" "binary" "latest" "" "kopia_*_linux_$(arch_resolve "amd64" "arm64").deb"
msg_info "Starting Kopia"
systemctl start kopia
msg_ok "Started Kopia"
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}https://${IP}:51515${CL}"
echo -e "${INFO}${YW}Credentials are stored in /opt/kopia_data/.env${CL}"
+6
View File
@@ -32,6 +32,12 @@ function update_script() {
exit
fi
if check_for_gh_release "kyoo-ffmpeg" "zoriya/ffmpeg"; then
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "kyoo-ffmpeg" "zoriya/ffmpeg" "prebuild" "latest" "/opt/kyoo-ffmpeg" "ffmpeg-*-linux-$(arch_resolve).tar.xz"
ln -sf /opt/kyoo-ffmpeg/ffmpeg /opt/kyoo-ffmpeg/ffprobe /usr/local/bin/
systemctl restart kyoo-transcoder
fi
if check_for_gh_release "kyoo" "zoriya/Kyoo"; then
msg_info "Stopping Kyoo"
systemctl stop kyoo-scanner kyoo-api kyoo-transcoder kyoo-auth
+8 -1
View File
@@ -36,7 +36,14 @@ function update_script() {
systemctl stop martin
msg_ok "Stopped Martin"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "martin" "maplibre/martin" "prebuild" "latest" "/opt/martin" "martin-$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl.tar.gz"
if [[ "$(cat ~/.martin 2>/dev/null)" =~ (^|[^0-9])1\.[0-9] ]]; then
msg_warn "Martin 2.0 drops settings 1.x deprecated and needs PostgreSQL 15 and PostGIS 3.5 for database sources: https://maplibre.org/martin/migration-guide/"
fi
MARTIN_ASSET="martin-$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl.tar.gz"
if [[ "$(arch_resolve)" == "amd64" ]] && ! { grep -qw avx2 /proc/cpuinfo && grep -qw bmi2 /proc/cpuinfo && grep -qw fma /proc/cpuinfo && grep -qw movbe /proc/cpuinfo; }; then
MARTIN_ASSET="martin-x86_64-unknown-linux-musl-legacycpu.tar.gz"
fi
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "martin" "maplibre/martin" "prebuild" "latest" "/opt/martin" "$MARTIN_ASSET"
msg_info "Starting Martin"
systemctl start martin
+12 -1
View File
@@ -25,10 +25,21 @@ function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /usr/share/keyrings/mysql.gpg ]]; then
if [[ ! -f /etc/apt/sources.list.d/mysql.sources ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if [[ -f /usr/share/keyrings/mysql.gpg ]]; then
setup_deb822_repo \
"mysql" \
"https://repo.mysql.com/RPM-GPG-KEY-mysql-2025" \
"http://repo.mysql.com/apt/$(get_os_info id)" \
"$(get_os_info codename)" \
"$(sed -n 's/^Components: //p' /etc/apt/sources.list.d/mysql.sources)"
rm -f /usr/share/keyrings/mysql.gpg
fi
msg_info "Updating ${APP} LXC"
apt_update_safe
$STD apt -y upgrade
+4 -1
View File
@@ -49,8 +49,11 @@ EOF
# n8n-nodes-base 2.46.0 pins both @napi-rs/canvas musl binaries as hard
# dependencies, which no os/cpu/libc combination can satisfy. Drop --force
# once upstream makes them optional again.
# prevent excessive ram use by clearing cache
systemctl stop n8n
$STD npm cache clean --force
$STD npm install -g n8n@latest --force
systemctl restart n8n
systemctl start n8n
msg_ok "Updated n8n"
msg_ok "Updated successfully!"
exit
+10
View File
@@ -26,6 +26,16 @@ function update_script() {
$STD apk -U upgrade
msg_ok "System updated"
if [[ -f /root/.docker/cli-plugins/docker-compose ]]; then
msg_info "Migrating Docker Compose to the Alpine package"
if apk info -e docker-cli-compose &>/dev/null || $STD apk add docker-cli-compose; then
rm -f /root/.docker/cli-plugins/docker-compose
msg_ok "Migrated Docker Compose to the Alpine package"
else
msg_warn "Could not install docker-cli-compose, keeping the old Compose binary"
fi
fi
msg_info "Pulling latest NPMplus container image"
cd /opt
$STD docker compose pull
+75
View File
@@ -0,0 +1,75 @@
#!/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/rmyndharis/OpenWA
APP="OpenWA"
var_tags="${var_tags:-whatsapp;messaging;api}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-6}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_api_key="${var_api_key:-}"
header_info "$APP"
variables
color
catch_errors
if [[ -n "$var_api_key" && ${#var_api_key} -lt 32 ]]; then
msg_error "var_api_key must be at least 32 characters long."
exit 1
fi
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/openwa ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "openwa" "rmyndharis/OpenWA"; then
msg_info "Stopping OpenWA"
systemctl stop openwa
msg_ok "Stopped OpenWA"
NODE_VERSION="22" setup_nodejs
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "openwa" "rmyndharis/OpenWA" "tarball"
msg_info "Building OpenWA"
cd /opt/openwa
export PUPPETEER_SKIP_DOWNLOAD=true
$STD npm ci
$STD npm run build
$STD npm run dashboard:build
$STD npm prune --omit=dev
rm -rf dashboard/node_modules ~/.npm
msg_ok "Built OpenWA"
msg_info "Starting OpenWA"
systemctl start openwa
msg_ok "Started OpenWA"
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}:2785${CL}"
echo -e "${INFO}${YW}Admin API key: API_MASTER_KEY in /opt/openwa_data/.env${CL}"
+4 -1
View File
@@ -56,8 +56,11 @@ function update_script() {
msg_warn "The lockfile of this release is out of date, resolving dependencies without it"
$STD pnpm install --no-frozen-lockfile
}
# tsc 7 (Go) ignores NODE_OPTIONS; four checkers no longer fit in 10 GB, one with GOMEMLIMIT peaks at ~8 GB
sed -i 's/"compilerOptions": {/&\n "checkers": 1,/' server/tsconfig.json
export GOMEMLIMIT=6GiB
$STD pnpm build
unset NODE_OPTIONS
unset NODE_OPTIONS GOMEMLIMIT
msg_ok "Rebuilt Paperclip"
msg_info "Updating Agent CLIs"
+1 -23
View File
@@ -30,29 +30,7 @@ function update_script() {
exit
fi
setup_mariadb
CURRENT_PHP=$(php -v 2>/dev/null | awk '/^PHP/{print $2}' | cut -d. -f1,2)
if [[ "$CURRENT_PHP" != "8.4" ]]; then
msg_info "Migrating PHP $CURRENT_PHP to 8.4"
$STD curl -fsSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
$STD dpkg -i /tmp/debsuryorg-archive-keyring.deb
$STD sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
cat <<EOF >/etc/apt/sources.list.d/php.sources
Types: deb
URIs: https://packages.sury.org/php/
Suites: $(lsb_release -sc)
Components: main
Signed-By: /usr/share/keyrings/deb.sury.org-php.gpg
EOF
apt_update_safe
$STD apt remove -y php"${CURRENT_PHP//./}"*
$STD apt install -y \
php8.4 \
php8.4-{gd,mysql,mbstring,bcmath,xml,curl,zip,intl,fpm} \
libapache2-mod-php8.4
msg_ok "Migrated PHP $CURRENT_PHP to 8.4"
fi
PHP_VERSION="8.4" PHP_APACHE="YES" PHP_FPM="YES" PHP_MODULE="mysql" setup_php
if [[ -f /opt/${APP}_version.txt ]]; then
mv /opt/"${APP}_version.txt" ~/.pterodactyl-panel
+2 -1
View File
@@ -41,7 +41,8 @@ function update_script() {
/opt/teddycloud/data/content \
/opt/teddycloud/data/library \
/opt/teddycloud/data/firmware \
/opt/teddycloud/data/cache
/opt/teddycloud/data/cache \
/opt/teddycloud/data/www/custom_img
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "teddycloud" "toniebox-reverse-engineering/teddycloud" "prebuild" "latest" "/opt/teddycloud" "teddycloud.amd64.release*.zip"
+1 -1
View File
@@ -86,7 +86,7 @@ function update_script() {
msg_info "Restoring Data"
cp -R /opt/wikijs-backup/* /opt/wikijs
if [[ "$SQLITE_INSTALL" == "true" ]]; then
$STD npm rebuild sqlite3
$STD npm --prefix /opt/wikijs rebuild sqlite3
fi
rm -rf /opt/wikijs-backup
msg_ok "Restored Data"
+90
View File
@@ -0,0 +1,90 @@
#!/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: freakms
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://www.xwiki.org
APP="XWiki"
var_tags="${var_tags:-wiki}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-4096}"
var_disk="${var_disk:-16}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
var_arm64="${var_arm64:-no}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /etc/xwiki/xwiki.cfg ]]; then
msg_error "No XWiki Installation Found!"
exit
fi
apt_update_safe
if ! apt list --upgradable 2>/dev/null | grep -q '^xwiki-'; then
msg_ok "XWiki is already up to date"
exit 0
fi
echo
msg_warn "The package update may include config file changes."
echo -e "${TAB}${YW}How do you want to handle /etc/xwiki?${CL}"
echo -e "${TAB} 1) Keep your current config"
echo -e "${TAB} 2) Install the new package maintainer's config"
if [[ "${PHS_SILENT:-0}" == "1" ]]; then
CONFIG_CHOICE="1"
else
read -rp " Choose [1/2] (default: 1): " -t 60 CONFIG_CHOICE || CONFIG_CHOICE="1"
fi
[[ -z "$CONFIG_CHOICE" ]] && CONFIG_CHOICE="1"
msg_info "Stopping XWiki"
systemctl stop tomcat10
msg_ok "Stopped XWiki"
if [[ "$CONFIG_CHOICE" == "2" ]]; then
BACKUP_DIR="/opt/xwiki_config_$(date +%Y%m%d%H%M)" create_backup /etc/xwiki
DPKG_CONF_OPT="--force-confnew"
else
create_backup /etc/xwiki
DPKG_CONF_OPT="--force-confold"
fi
msg_info "Updating XWiki"
$STD apt install -y --only-upgrade -o Dpkg::Options::="$DPKG_CONF_OPT" \
xwiki-common xwiki-pgsql-common xwiki-tomcat10-common xwiki-tomcat10-pgsql
msg_ok "Updated XWiki"
if [[ "$CONFIG_CHOICE" == "2" ]]; then
msg_warn "New package config installed. Your previous config is in /opt/xwiki_config_*/files/etc/xwiki"
else
restore_backup
fi
msg_info "Starting XWiki"
systemctl start tomcat10
msg_ok "Started XWiki"
msg_ok "Updated successfully!"
exit 0
}
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}:8080/xwiki${CL}"
+3 -27
View File
@@ -31,7 +31,7 @@ PG_DB_NAME="affine" PG_DB_USER="affine" setup_postgresql_db
NODE_VERSION="22" setup_nodejs
setup_rust
fetch_and_deploy_gh_release "affine_app" "toeverything/AFFiNE" "tarball" "v0.27.3" "/opt/affine"
fetch_and_deploy_gh_release "affine_app" "toeverything/AFFiNE" "tarball" "v0.27.4" "/opt/affine"
msg_info "Setting up Directories"
rm -rf /root/.affine
@@ -59,7 +59,7 @@ source /root/.profile
export PATH="/root/.cargo/bin:$PATH"
export COREPACK_ENABLE_DOWNLOAD_PROMPT=0
export VITE_CORE_COMMIT_SHA=$(cat ~/.affine_app)
# # Initialize git repo (required for build process)
# The build needs a git repository
export HUSKY=0
$STD git init -q
$STD git config user.email "build@local"
@@ -73,10 +73,8 @@ cat <<TURBO >/opt/affine/.turbo/config.json
}
TURBO
$STD corepack enable
$STD corepack prepare yarn@4.13.0 --activate
$STD yarn config set enableTelemetry 0
export NODE_OPTIONS="--max-old-space-size=4096"
export TSC_COMPILE_ON_ERROR=true
$STD yarn install
$STD bash ./scripts/set-version.sh "$(cat ~/.affine_app)"
export BUILD_TYPE=stable
@@ -95,7 +93,6 @@ ln -sf /opt/affine/packages/backend/native/server-native.node \
$STD yarn affine init
$STD yarn affine build -p @affine/reader
$STD yarn affine build -p @affine/server
export NODE_OPTIONS="--max-old-space-size=4096"
$STD yarn affine build -p @affine/web
$STD yarn affine build -p @affine/admin
mkdir -p /opt/affine/packages/backend/server/static
@@ -135,28 +132,7 @@ RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/affine-worker.service
[Unit]
Description=AFFiNE Background Worker
After=network.target postgresql.service redis-server.service
Requires=postgresql.service redis-server.service
[Service]
Type=simple
WorkingDirectory=/opt/affine/packages/backend/server
EnvironmentFile=/opt/affine/.env
Environment=LD_PRELOAD=libjemalloc.so.2
Environment=NODE_OPTIONS=--max-old-space-size=1024
ExecStart=/usr/bin/node ./dist/main.js --worker
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now redis-server affine-web affine-worker
systemctl enable -q --now redis-server affine-web
msg_ok "Created Services"
msg_info "Creating Admin User"
+182
View File
@@ -0,0 +1,182 @@
#!/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/Smaug6739/Alexandrie
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 nginx
msg_ok "Installed Dependencies"
setup_go
NODE_VERSION="24" NODE_MODULE="bun" setup_nodejs
setup_mariadb
MARIADB_DB_NAME="alexandrie" MARIADB_DB_USER="alexandrie" MARIADB_DB_CREDS_FILE="/dev/null" setup_mariadb_db
fetch_and_deploy_gh_release "rustfs" "rustfs/rustfs" "prebuild" "latest" "/opt/rustfs" "rustfs-linux-$(arch_resolve x86_64 aarch64)-gnu-*.zip"
chmod +x /opt/rustfs/rustfs
fetch_and_deploy_gh_release "alexandrie" "Smaug6739/Alexandrie" "tarball"
msg_info "Building Alexandrie Backend"
cd /opt/alexandrie/backend
CGO_ENABLED=0 $STD go build -o alexandrie .
$STD go clean -cache -modcache
msg_ok "Built Alexandrie Backend"
msg_info "Building Alexandrie Frontend"
cd /opt/alexandrie/frontend
$STD bun install --frozen-lockfile
NODE_ENV=production $STD bun run build
rm -rf node_modules .nuxt ~/.bun/install/cache
msg_ok "Built Alexandrie Frontend"
msg_info "Configuring Alexandrie"
mkdir -p /opt/alexandrie_data/storage
S3_ACCESS_KEY=$(random_password 20)
S3_SECRET_KEY=$(random_password 40)
cat <<EOF >/opt/alexandrie_data/.env
BACKEND_PORT=8201
GIN_MODE=release
JWT_SECRET=$(random_password 64)
FRONTEND_URL=http://${LOCAL_IP}
COOKIE_DOMAIN=
ALLOW_UNSECURE=true
CONFIG_DISABLE_SIGNUP=false
CONFIG_DISABLE_NATIVE_LOGIN=false
DATABASE_HOST=127.0.0.1
DATABASE_PORT=3306
DATABASE_NAME=${MARIADB_DB_NAME}
DATABASE_USER=${MARIADB_DB_USER}
DATABASE_PASSWORD=${MARIADB_DB_PASS}
MINIO_ENDPOINT=127.0.0.1:9000
MINIO_PUBLIC_URL=http://${LOCAL_IP}
MINIO_SECURE=false
MINIO_ACCESSKEY=${S3_ACCESS_KEY}
MINIO_SECRETKEY=${S3_SECRET_KEY}
MINIO_BUCKET=alexandrie
SMTP_HOST=
SMTP_MAIL=
SMTP_MAIL_FROM=
SMTP_PASSWORD=
NUXT_PUBLIC_BASE_API=http://${LOCAL_IP}
NUXT_PUBLIC_BASE_CDN=http://${LOCAL_IP}
NUXT_PUBLIC_BASE_URL=http://${LOCAL_IP}
NUXT_PUBLIC_CDN_ENDPOINT=/alexandrie/
NUXT_PUBLIC_CONFIG_DISABLE_SIGNUP_PAGE=false
NUXT_PUBLIC_CONFIG_DISABLE_LANDING_PAGE=false
RUSTFS_ACCESS_KEY=${S3_ACCESS_KEY}
RUSTFS_SECRET_KEY=${S3_SECRET_KEY}
RUSTFS_VOLUMES=/opt/alexandrie_data/storage
RUSTFS_ADDRESS=127.0.0.1:9000
RUSTFS_CONSOLE_ENABLE=false
RUSTFS_OBS_LOGGER_LEVEL=error
EOF
chmod 600 /opt/alexandrie_data/.env
cat <<EOF >/etc/nginx/sites-available/alexandrie
server {
listen 80;
server_name _;
client_max_body_size 1G;
location /api/ {
proxy_pass http://127.0.0.1:8201;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$scheme;
}
location ~ ^/alexandrie(-backups)?/ {
proxy_pass http://127.0.0.1:9000;
proxy_set_header Host \$host;
proxy_buffering off;
}
location / {
proxy_pass http://127.0.0.1:8200;
proxy_http_version 1.1;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto \$scheme;
}
}
EOF
nginx_enable_site "alexandrie"
msg_ok "Configured Alexandrie"
msg_info "Creating Services"
cat <<EOF >/etc/systemd/system/rustfs.service
[Unit]
Description=RustFS Object Storage for Alexandrie
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/alexandrie_data
EnvironmentFile=/opt/alexandrie_data/.env
ExecStart=/opt/rustfs/rustfs
Restart=on-failure
RestartSec=5
LimitNOFILE=65536
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/alexandrie-backend.service
[Unit]
Description=Alexandrie Backend
After=network-online.target mariadb.service rustfs.service
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/alexandrie/backend
EnvironmentFile=/opt/alexandrie_data/.env
ExecStart=/opt/alexandrie/backend/alexandrie
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/alexandrie-frontend.service
[Unit]
Description=Alexandrie Frontend
After=network-online.target alexandrie-backend.service
[Service]
Type=simple
WorkingDirectory=/opt/alexandrie/frontend
EnvironmentFile=/opt/alexandrie_data/.env
Environment=NODE_ENV=production
Environment=HOST=127.0.0.1
Environment=PORT=8200
ExecStart=/usr/bin/node .output/server/index.mjs
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now rustfs alexandrie-backend alexandrie-frontend
msg_ok "Created Services"
motd_ssh
customize
cleanup_lxc
+29 -55
View File
@@ -15,69 +15,43 @@ update_os
msg_info "Installing Dependencies"
$STD apt install -y \
git \
expect \
libssl-dev \
libldap2-dev \
libsasl2-dev \
procps \
dnsutils \
ripgrep \
libatomic1 \
chromium
msg_ok "Installed Dependencies"
msg_info "Installing Python Dependencies"
$STD apt install -y \
python3-ldap \
python3-msgpack \
python3-regex
msg_ok "Installed Python Dependencies"
NODE_VERSION="22" NODE_MODULE="@postlight/parser@latest,single-file-cli@latest" setup_nodejs
export UV_PYTHON_INSTALL_DIR="/opt/archivebox/python"
PYTHON_VERSION="3.13" setup_uv
msg_info "Installing Playwright"
$STD uv pip install playwright --system --break-system-packages
$STD playwright install-deps chromium
msg_ok "Installed Playwright"
msg_info "Installing ArchiveBox"
mkdir -p /opt/archivebox/{data,.npm,.cache,.local}
$STD adduser --system --shell /bin/bash --gecos 'Archive Box User' --group --disabled-password --home /home/archivebox archivebox
chown -R archivebox:archivebox /opt/archivebox/{data,.npm,.cache,.local}
chmod -R 755 /opt/archivebox/data
$STD uv pip install archivebox --system --break-system-packages
cd /opt/archivebox/data
ADMIN_PASS=$(random_password 20)
expect <<EOF
set timeout -1
log_user 0
spawn sudo -u archivebox playwright install chromium
spawn sudo -u archivebox archivebox setup
expect "Username"
send "\r"
expect "Email address"
send "\r"
expect "Password"
send "${ADMIN_PASS}\r"
expect "Password (again)"
send "${ADMIN_PASS}\r"
expect eof
ARCHIVEBOX_VERSION="${var_appversion:-$(get_latest_github_release "ArchiveBox/ArchiveBox")}"
mkdir -p /opt/archivebox/data
$STD uv venv --python 3.13 /opt/archivebox/.venv
$STD uv pip install --python /opt/archivebox/.venv/bin/python "archivebox==${ARCHIVEBOX_VERSION#v}"
ln -sf /opt/archivebox/.venv/bin/archivebox /usr/local/bin/archivebox
cat <<EOF >~/.archivebox
${ARCHIVEBOX_VERSION#v}
EOF
{
echo "ArchiveBox Credentials"
echo "Username: archivebox"
echo "Password: ${ADMIN_PASS}"
} >~/archivebox.creds
msg_ok "Installed ArchiveBox"
msg_info "Initializing ArchiveBox"
cd /opt/archivebox/data
$STD archivebox init
ADMIN_PASS=$(random_password 20)
DJANGO_SUPERUSER_USERNAME=archivebox DJANGO_SUPERUSER_EMAIL=archivebox@archivebox.local DJANGO_SUPERUSER_PASSWORD="$ADMIN_PASS" $STD archivebox manage createsuperuser --noinput
$STD archivebox config --set "BASE_URL=http://${LOCAL_IP}:8000"
cat <<EOF >~/archivebox.creds
ArchiveBox Credentials
Username: archivebox
Password: ${ADMIN_PASS}
EOF
msg_ok "Initialized ArchiveBox"
msg_info "Installing ArchiveBox Extractors"
# 0.9.77 counts page cache as used memory under a cgroup limit and refuses to run (ArchiveBox#1966)
echo 1G 2>/dev/null >/sys/fs/cgroup/memory.reclaim || true
$STD archivebox install
msg_ok "Installed ArchiveBox Extractors"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/archivebox.service
[Unit]
@@ -85,9 +59,9 @@ Description=ArchiveBox Server
After=network.target
[Service]
User=archivebox
WorkingDirectory=/opt/archivebox/data
ExecStart=/usr/local/bin/archivebox server 0.0.0.0:8000
ExecStartPre=-/bin/sh -c "echo 1G 2>/dev/null >/sys/fs/cgroup/memory.reclaim"
ExecStart=/opt/archivebox/.venv/bin/archivebox server 0.0.0.0:8000
Restart=always
[Install]
+1 -1
View File
@@ -34,7 +34,7 @@ export VITE_APP_VERSION="$(cat ~/.aurral)"
export VITE_GITHUB_REPO="lklynet/aurral"
export VITE_RELEASE_CHANNEL="stable"
$STD pnpm install --frozen-lockfile --config.engine-strict=false --filter aurral-frontend --filter aurral-backend
$STD pnpm --filter aurral-frontend run build
$STD pnpm --config.engine-strict=false --filter aurral-frontend run build
msg_ok "Built Aurral"
msg_info "Creating Service"
+3 -4
View File
@@ -57,7 +57,7 @@ PG_VERSION="17" setup_postgresql
PG_DB_NAME="authentik" PG_DB_USER="authentik" PG_DB_GRANT_SUPERUSER="true" setup_postgresql_db
XMLSEC_VERSION="1.3.13"
AUTHENTIK_VERSION="version/2026.8.6"
AUTHENTIK_VERSION="version/2026.11.0"
fetch_and_deploy_gh_release "xmlsec" "lsh123/xmlsec" "tarball" "${XMLSEC_VERSION}" "/opt/xmlsec"
fetch_and_deploy_gh_release "authentik" "goauthentik/authentik" "tarball" "${AUTHENTIK_VERSION}" "/opt/authentik"
GO_VERSION="$(grep -m1 '^go ' /opt/authentik/go.mod | awk '{print $2}')" setup_go
@@ -108,7 +108,6 @@ DatabaseDirectory /opt/authentik-data/geoip
RetryFor 5m
Parallelism 1
EOF
echo "#39 19 * * 6,4 /usr/bin/geoipupdate -f /usr/local/etc/GeoIP.conf" | crontab -
msg_info "Building binary. It may take more than 10 minutes, please be patient."
@@ -143,8 +142,8 @@ mkdir -p /etc/authentik
mv /opt/authentik/authentik/lib/default.yml /etc/authentik/config.yml
yq -i ".secret_key = \"$(random_password 64)\"" /etc/authentik/config.yml
yq -i ".postgresql.password = \"${PG_DB_PASS}\"" /etc/authentik/config.yml
yq -i ".events.context_processors.geoip = \"/opt/authentik-data/geoip/GeoLite2-City.mmdb\"" /etc/authentik/config.yml
yq -i ".events.context_processors.asn = \"/opt/authentik-data/geoip/GeoLite2-ASN.mmdb\"" /etc/authentik/config.yml
yq -i ".events.context_processors.geoip = \"/opt/authentik-data/geoip/dbip-city-lite.mmdb\"" /etc/authentik/config.yml
yq -i ".events.context_processors.asn = \"/opt/authentik-data/geoip/dbip-asn-lite.mmdb\"" /etc/authentik/config.yml
yq -i ".blueprints_dir = \"/opt/authentik-data/blueprints\"" /etc/authentik/config.yml
yq -i ".cert_discovery_dir = \"/opt/authentik-data/certs\"" /etc/authentik/config.yml
yq -i ".email.template_dir = \"/opt/authentik-data/templates\"" /etc/authentik/config.yml
+1
View File
@@ -52,6 +52,7 @@ server {
server {
listen 8443 ssl;
server_name _;
absolute_redirect off;
ssl_certificate /etc/ssl/certs/bentopdf-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/bentopdf-selfsigned.key;
root /opt/bentopdf/dist;
+31 -3
View File
@@ -185,16 +185,26 @@ exec .venv/bin/uwsgi \\
EOF
chmod +x /opt/dispatcharr/start-uwsgi.sh
cat <<EOF >/opt/dispatcharr/start-celery.sh
cat <<'EOF' >/opt/dispatcharr/start-celery.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
set -a
source .env
set +a
exec uv run celery -A dispatcharr worker -l info -c 4 -Q celery,recordings,dvr,default
exec uv run celery -A dispatcharr worker -l info -Q celery,plugins -n default@%h --autoscale="${CELERY_MAX_WORKERS:-6},${CELERY_MIN_WORKERS:-1}"
EOF
chmod +x /opt/dispatcharr/start-celery.sh
cat <<'EOF' >/opt/dispatcharr/start-celery-dvr.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
set -a
source .env
set +a
exec uv run celery -A dispatcharr worker -l info -Q dvr -n dvr@%h --pool=threads --concurrency=20
EOF
chmod +x /opt/dispatcharr/start-celery-dvr.sh
cat <<EOF >/opt/dispatcharr/start-celerybeat.sh
#!/usr/bin/env bash
cd /opt/dispatcharr
@@ -250,6 +260,24 @@ User=root
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/dispatcharr-celery-dvr.service
[Unit]
Description=Dispatcharr Celery DVR Worker
After=network.target redis-server.service
Requires=dispatcharr.service
[Service]
Type=simple
WorkingDirectory=/opt/dispatcharr
ExecStart=/opt/dispatcharr/start-celery-dvr.sh
Restart=on-failure
RestartSec=10
User=root
[Install]
WantedBy=multi-user.target
EOF
cat <<EOF >/etc/systemd/system/dispatcharr-celerybeat.service
[Unit]
Description=Dispatcharr Celery Beat Scheduler
@@ -285,7 +313,7 @@ User=root
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now dispatcharr dispatcharr-celery dispatcharr-celerybeat dispatcharr-daphne
systemctl enable -q --now dispatcharr dispatcharr-celery dispatcharr-celery-dvr dispatcharr-celerybeat dispatcharr-daphne
msg_ok "Created Services"
motd_ssh
+3 -7
View File
@@ -66,16 +66,12 @@ setup_alpine() {
$STD rc-update add docker default
msg_ok "Installed Docker"
DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_github_release "docker/compose" false)
prompt="${var_docker_compose:-}"
[[ -n "$prompt" ]] || read -r -p "${TAB3}Would you like to add Docker Compose? <y/N> " prompt || true
if [[ "${prompt,,}" =~ ^(y|yes|true)$ ]]; then
msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p "$DOCKER_CONFIG"/cli-plugins
curl -fsSL https://github.com/docker/compose/releases/download/"$DOCKER_COMPOSE_LATEST_VERSION"/docker-compose-linux-$(arch_resolve "x86_64" "aarch64") -o ~/.docker/cli-plugins/docker-compose
chmod +x "$DOCKER_CONFIG"/cli-plugins/docker-compose
msg_ok "Installed Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
msg_info "Installing Docker Compose"
$STD apk add docker-cli-compose
msg_ok "Installed Docker Compose $(docker compose version --short)"
fi
prompt="${var_docker_socket:-}"
[[ -n "$prompt" ]] || read -r -p "${TAB3}Would you like to expose the Docker TCP socket? <y/N> " prompt || true
+83
View File
@@ -0,0 +1,83 @@
#!/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/docling-project/docling-serve
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
if [[ "$(arch_resolve)" == "amd64" ]] && ! { grep -qw -m1 'sse4_2' /proc/cpuinfo && grep -qw -m1 'popcnt' /proc/cpuinfo; }; then
msg_error "Docling's NumPy builds require an x86-64-v2 CPU with SSE4.2 and POPCNT (Intel Nehalem, AMD Bulldozer or newer), which this CPU does not have."
exit 236
fi
msg_info "Installing Dependencies"
$STD apt install -y \
libgl1 \
libglib2.0-0t64 \
tesseract-ocr \
tesseract-ocr-deu \
tesseract-ocr-eng \
tesseract-ocr-fra \
tesseract-ocr-osd \
tesseract-ocr-spa
msg_ok "Installed Dependencies"
PYTHON_VERSION="3.12" setup_uv
check_for_gh_release "docling-serve" "docling-project/docling-serve" "${var_appversion:-}"
msg_info "Installing Docling Serve ${CHECK_UPDATE_RELEASE#v}"
$STD uv venv --python 3.12 /opt/docling-serve/.venv
$STD uv pip install --python /opt/docling-serve/.venv/bin/python --torch-backend cpu "docling-serve[rapidocr,tesserocr]==${CHECK_UPDATE_RELEASE#v}"
cat <<EOF >~/.docling-serve
${CHECK_UPDATE_RELEASE#v}
EOF
msg_ok "Installed Docling Serve ${CHECK_UPDATE_RELEASE#v}"
msg_info "Downloading Docling Models"
$STD /opt/docling-serve/.venv/bin/docling-tools models download -o /opt/docling-serve_data/models layout tableformer picture_classifier rapidocr
msg_ok "Downloaded Docling Models"
msg_info "Configuring Docling Serve"
cat <<EOF >/opt/docling-serve_data/.env
UVICORN_HOST=0.0.0.0
UVICORN_PORT=5001
DOCLING_SERVE_ENABLE_UI=true
DOCLING_SERVE_ARTIFACTS_PATH=/opt/docling-serve_data/models
DOCLING_SERVE_API_KEY=${var_docling_api_key:-$(random_password 32)}
TESSDATA_PREFIX=/usr/share/tesseract-ocr/5/tessdata
EOF
chmod 600 /opt/docling-serve_data/.env
msg_ok "Configured Docling Serve"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/docling-serve.service
[Unit]
Description=Docling Serve
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/docling-serve_data
EnvironmentFile=/opt/docling-serve_data/.env
ExecStart=/opt/docling-serve/.venv/bin/docling-serve run
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now docling-serve
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc
+1 -2
View File
@@ -20,8 +20,7 @@ $STD apt install -y \
ca-certificates
msg_ok "Installed Dependencies"
# 1.13.0's php-cli shifts the script into argv[1], which breaks composer and bin/console (php/frankenphp#2690); unpin once 1.13.1 is out
fetch_and_deploy_gh_release "frankenphp" "php/frankenphp" "singlefile" "v1.12.7" "/opt/frankenphp" "frankenphp-linux-$(arch_resolve x86_64 aarch64)-gnu"
fetch_and_deploy_gh_release "frankenphp" "php/frankenphp" "singlefile" "latest" "/opt/frankenphp" "frankenphp-linux-$(arch_resolve x86_64 aarch64)-gnu"
fetch_and_deploy_gh_release "dreeve" "dreeveapp/dreeve" "tarball"
msg_info "Providing php CLI"
+11 -18
View File
@@ -13,24 +13,15 @@ setting_up_container
network_check
update_os
PYTHON_VERSION="3.13" setup_uv
fetch_and_deploy_gh_release "droppedneedle" "DroppedNeedle/DroppedNeedle" "tarball"
NODE_VERSION="25" NODE_MODULE="pnpm@10.33.0" setup_nodejs
msg_info "Installing Dependencies"
$STD apt install -y \
ffmpeg \
python3
msg_ok "Installed Dependencies"
msg_info "Building Frontend"
cd /opt/droppedneedle/frontend
export NODE_OPTIONS="--max-old-space-size=3072"
$STD pnpm install --frozen-lockfile
$STD pnpm run build
msg_ok "Built Frontend"
msg_info "Setting up Application"
mkdir -p /opt/droppedneedle/backend/config /opt/droppedneedle/backend/cache
$STD uv venv /opt/droppedneedle/venv
$STD uv pip install -r /opt/droppedneedle/backend/requirements.txt --python=/opt/droppedneedle/venv/bin/python
rm -rf /opt/droppedneedle/backend/static
cp -r /opt/droppedneedle/frontend/build /opt/droppedneedle/backend/static
msg_ok "Set up Application"
fetch_and_deploy_gh_release "droppedneedle" "DroppedNeedle/DroppedNeedle" "prebuild" "latest" "/opt/droppedneedle" "droppedneedle-v*-$(arch_resolve x86_64 aarch64)-linux.tar.gz"
fetch_and_deploy_gh_release "droppedneedle-frontend" "DroppedNeedle/DroppedNeedle" "prebuild" "latest" "/opt/droppedneedle/frontend" "droppedneedle-frontend-v*.tar.gz"
mkdir -p /opt/droppedneedle/backend/{config,cache,plugins,imports}
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/droppedneedle.service
@@ -43,10 +34,12 @@ Type=simple
User=root
WorkingDirectory=/opt/droppedneedle/backend
Environment=ROOT_APP_DIR=/opt/droppedneedle/backend
Environment=DROPPEDNEEDLE_STATIC_DIR=/opt/droppedneedle/frontend/static
Environment=PORT=8688
Environment=COMMIT_TAG=v$(<~/.droppedneedle)
Environment=TZ=$(cat /etc/timezone 2>/dev/null || echo Etc/UTC)
# Environment=SLSKD_DOWNLOADS_PATH=<path-to-slskd-downloads>
ExecStart=/opt/droppedneedle/venv/bin/python -m maintenance.automatic_upgrade --start-target
ExecStart=/opt/droppedneedle/droppedneedle
Restart=on-failure
RestartSec=5
+6 -1
View File
@@ -224,6 +224,9 @@ sed -i '/^.*unset DEBIAN_FRONTEND.*$/d' /opt/frigate/docker/main/install_deps.sh
echo "libedgetpu1-max libedgetpu/accepted-eula boolean true" | debconf-set-selections
echo "libedgetpu1-max libedgetpu/install-confirm-max boolean true" | debconf-set-selections
echo 'force-overwrite' >/etc/dpkg/dpkg.cfg.d/force-overwrite
if [[ "$(arch_resolve)" == "amd64" ]] && download_gpg_key "https://repositories.intel.com/gpu/intel-graphics.key" "/usr/share/keyrings/intel-graphics.gpg" "dearmor"; then
sed -i '/intel-graphics.key/d' /opt/frigate/docker/main/install_deps.sh
fi
$STD bash /opt/frigate/docker/main/install_deps.sh
rm -f /etc/dpkg/dpkg.cfg.d/force-overwrite
$STD pip3 install -U /wheels/*.whl
@@ -365,7 +368,9 @@ User=root
EnvironmentFile=/etc/frigate.env
ExecStartPre=+/usr/bin/systemctl restart go2rtc.service
ExecStartPre=+rm -f /dev/shm/logs/frigate/current
ExecStart=/bin/bash -c "bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run 2> >(/usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S ' >&2) | /usr/bin/ts '%%Y-%%m-%%d %%H:%%M:%%.S '"
ExecStart=/bin/bash -c 'exec > >(/usr/bin/ts "%%Y-%%m-%%d %%H:%%M:%%.S ") 2>&1; exec bash /opt/frigate/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/run'
KillMode=mixed
TimeoutStopSec=60
StandardOutput=file:/dev/shm/logs/frigate/current
StandardError=file:/dev/shm/logs/frigate/current
+57
View File
@@ -0,0 +1,57 @@
#!/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/kopia/kopia
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
fetch_and_deploy_gh_release "kopia" "kopia/kopia" "binary" "latest" "" "kopia_*_linux_$(arch_resolve "amd64" "arm64").deb"
create_self_signed_cert "kopia"
msg_info "Creating Kopia Repository"
mkdir -p /opt/kopia_data/{config,repository,cache,logs}
cat <<EOT >/opt/kopia_data/.env
KOPIA_CONFIG_PATH=/opt/kopia_data/config/repository.config
KOPIA_CACHE_DIRECTORY=/opt/kopia_data/cache
KOPIA_LOG_DIR=/opt/kopia_data/logs
KOPIA_PASSWORD=${var_kopia_repo_password:-$(random_password)}
KOPIA_SERVER_USERNAME=admin
KOPIA_SERVER_PASSWORD=${var_kopia_password:-$(random_password)}
KOPIA_SERVER_CONTROL_PASSWORD=$(random_password)
EOT
chmod 600 /opt/kopia_data/.env
set -a
source /opt/kopia_data/.env
set +a
$STD kopia repository create filesystem --path /opt/kopia_data/repository
msg_ok "Created Kopia Repository"
msg_info "Creating Service"
cat <<EOT >/etc/systemd/system/kopia.service
[Unit]
Description=Kopia Server
After=network-online.target
Wants=network-online.target
[Service]
EnvironmentFile=/opt/kopia_data/.env
ExecStart=/usr/bin/kopia server start --address=0.0.0.0:51515 --tls-cert-file=/etc/ssl/kopia/kopia.crt --tls-key-file=/etc/ssl/kopia/kopia.key
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOT
systemctl enable -q --now kopia
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc
+2
View File
@@ -25,6 +25,8 @@ $STD apt install -y \
msg_ok "Installed Dependencies"
setup_ffmpeg
fetch_and_deploy_gh_release "kyoo-ffmpeg" "zoriya/ffmpeg" "prebuild" "latest" "/opt/kyoo-ffmpeg" "ffmpeg-*-linux-$(arch_resolve).tar.xz"
ln -sf /opt/kyoo-ffmpeg/ffmpeg /opt/kyoo-ffmpeg/ffprobe /usr/local/bin/
setup_hwaccel
PG_VERSION="18" setup_postgresql
PG_DB_NAME="kyoo" PG_DB_USER="kyoo" setup_postgresql_db
+6 -1
View File
@@ -13,7 +13,12 @@ setting_up_container
network_check
update_os
fetch_and_deploy_gh_release "martin" "maplibre/martin" "prebuild" "latest" "/opt/martin" "martin-$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl.tar.gz"
# Martin 2.x builds for x86_64 need an x86-64-v3 CPU; older ones get the legacycpu build.
MARTIN_ASSET="martin-$(arch_resolve "x86_64" "aarch64")-unknown-linux-musl.tar.gz"
if [[ "$(arch_resolve)" == "amd64" ]] && ! { grep -qw avx2 /proc/cpuinfo && grep -qw bmi2 /proc/cpuinfo && grep -qw fma /proc/cpuinfo && grep -qw movbe /proc/cpuinfo; }; then
MARTIN_ASSET="martin-x86_64-unknown-linux-musl-legacycpu.tar.gz"
fi
fetch_and_deploy_gh_release "martin" "maplibre/martin" "prebuild" "latest" "/opt/martin" "$MARTIN_ASSET"
msg_info "Configuring Martin"
mkdir -p /opt/martin_data/tiles
+7 -24
View File
@@ -14,11 +14,6 @@ setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y \
lsb-release
msg_ok "Installed Dependencies"
RELEASE_REPO="mysql-8.0"
RELEASE_AUTH="mysql_native_password"
prompt="${var_mysql_lts:-}"
@@ -28,26 +23,14 @@ if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
RELEASE_AUTH="caching_sha2_password"
fi
setup_deb822_repo \
"mysql" \
"https://repo.mysql.com/RPM-GPG-KEY-mysql-2025" \
"http://repo.mysql.com/apt/$(get_os_info id)" \
"$(get_os_info codename)" \
"${RELEASE_REPO}"
msg_info "Installing MySQL"
curl -fsSL https://repo.mysql.com/RPM-GPG-KEY-mysql-2023 | gpg --dearmor -o /usr/share/keyrings/mysql.gpg
if [ "$(lsb_release -si)" = "Debian" ]; then
cat <<EOF >/etc/apt/sources.list.d/mysql.sources
Types: deb
URIs: http://repo.mysql.com/apt/debian
Suites: $(lsb_release -sc)
Components: ${RELEASE_REPO}
Signed-By: /usr/share/keyrings/mysql.gpg
EOF
else
cat <<EOF >/etc/apt/sources.list.d/mysql.sources
Types: deb
URIs: http://repo.mysql.com/apt/ubuntu
Suites: $(lsb_release -sc)
Components: ${RELEASE_REPO}
Signed-By: /usr/share/keyrings/mysql.gpg
EOF
fi
apt_update_safe
export DEBIAN_FRONTEND=noninteractive
$STD apt install -y \
mysql-community-client \
+1 -7
View File
@@ -21,15 +21,9 @@ $STD apk add \
msg_ok "Installed Dependencies"
msg_info "Installing Docker & Compose"
$STD apk add docker
$STD apk add docker docker-cli-compose
$STD rc-service docker start
$STD rc-update add docker default
DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_github_release "docker/compose" false)
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -fsSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_LATEST_VERSION/docker-compose-linux-$(arch_resolve "x86_64" "aarch64") -o ~/.docker/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
msg_ok "Installed Docker & Compose"
msg_info "Fetching NPMplus"
+72
View File
@@ -0,0 +1,72 @@
#!/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/rmyndharis/OpenWA
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 \
chromium \
fonts-liberation
msg_ok "Installed Dependencies"
setup_ffmpeg
NODE_VERSION="22" setup_nodejs
fetch_and_deploy_gh_release "openwa" "rmyndharis/OpenWA" "tarball"
msg_info "Building OpenWA"
cd /opt/openwa
export PUPPETEER_SKIP_DOWNLOAD=true
$STD npm ci
$STD npm run build
$STD npm run dashboard:build
$STD npm prune --omit=dev
rm -rf dashboard/node_modules ~/.npm
msg_ok "Built OpenWA"
msg_info "Configuring OpenWA"
mkdir -p /opt/openwa_data/data
cat <<EOF >/opt/openwa_data/.env
NODE_ENV=production
PORT=2785
API_MASTER_KEY=${var_api_key:-$(random_password 40)}
CSP_UPGRADE_INSECURE_REQUESTS=false
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
EOF
chmod 600 /opt/openwa_data/.env
msg_ok "Configured OpenWA"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/openwa.service
[Unit]
Description=OpenWA WhatsApp API Gateway
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
WorkingDirectory=/opt/openwa_data
ExecStart=/usr/bin/node /opt/openwa/dist/main
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now openwa
msg_ok "Created Service"
motd_ssh
customize
cleanup_lxc
+4 -1
View File
@@ -36,8 +36,11 @@ $STD pnpm install --frozen-lockfile || {
msg_warn "The lockfile of this release is out of date, resolving dependencies without it"
$STD pnpm install --no-frozen-lockfile
}
# tsc 7 (Go) ignores NODE_OPTIONS; four checkers no longer fit in 10 GB, one with GOMEMLIMIT peaks at ~8 GB
sed -i 's/"compilerOptions": {/&\n "checkers": 1,/' server/tsconfig.json
export GOMEMLIMIT=6GiB
$STD pnpm build
unset NODE_OPTIONS
unset NODE_OPTIONS GOMEMLIMIT
msg_ok "Built Paperclip"
msg_info "Installing Agent CLIs"
+1 -1
View File
@@ -44,7 +44,7 @@ msg_info "Configuring Sure"
KEY="$(openssl rand -hex 64)"
mkdir -p /etc/sure
mv /opt/sure/.env.example /etc/sure/.env
sed -i -e "/^SECRET_KEY_BASE=/s/secret-value/${KEY}/" \
sed -i -e "s/^SECRET_KEY_BASE=.*/SECRET_KEY_BASE=${KEY}/" \
-e 's/_KEY_BASE=.*$/&\n\nRAILS_FORCE_SSL=false \
\
# Change to true when using a reverse proxy \
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: freakms
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://www.xwiki.org
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
setup_postgresql
setup_deb822_repo \
"xwiki" \
"https://maven.xwiki.org/xwiki-keyring.gpg" \
"https://maven.xwiki.org" \
"stable/"
msg_info "Installing XWiki"
debconf-set-selections <<EOF
dbconfig-common dbconfig-common/dbconfig-install boolean true
dbconfig-common dbconfig-common/remember-admin-pass boolean false
EOF
export DEBIAN_FRONTEND=noninteractive
$STD apt install -y xwiki-tomcat10-pgsql
msg_ok "Installed XWiki"
msg_info "Configuring XWiki"
XWIKI_XMX=$(($(awk '/MemTotal/ {print $2}' /proc/meminfo) * 60 / 100 / 1024))
sed -i 's/^\(JAVA_OPTS=.*\)$/#\1/' /etc/default/tomcat10
cat <<EOF >>/etc/default/tomcat10
JAVA_OPTS="-Djava.awt.headless=true -Xmx${XWIKI_XMX}m -XX:+UseG1GC"
EOF
systemctl restart tomcat10
msg_ok "Configured XWiki"
motd_ssh
customize
cleanup_lxc
+5
View File
@@ -119,6 +119,11 @@ EXCLUDE=
# Healthchecks.io Ping URL (optional)
# PING_URL=
# Remove downloaded packages after each successful update (optional).
# Without it, apt and the other package managers keep every package they
# download, and the cache grows on each run until the container's disk fills.
# CLEAN_CACHE=yes
CONF
ok "Created config ${CONF_FILE}"
fi
+28 -2
View File
@@ -13,6 +13,7 @@ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
CONF_FILE="/etc/update-lxcs.conf"
LOG_FILE="/var/log/update-lxcs-cron.log"
PING_URL=""
CLEAN_CACHE=""
# Collect excluded containers from arguments
excluded_containers=("$@")
@@ -20,6 +21,7 @@ excluded_containers=("$@")
# Merge exclusions and healthchecks URL from config file if it exists
if [[ -f "$CONF_FILE" ]]; then
PING_URL=$(grep -oP '^\s*PING_URL\s*=\s*\K.+' "$CONF_FILE" 2>/dev/null | tr -d '"' | tr -d "'" || true)
CLEAN_CACHE=$(grep -oP '^\s*CLEAN_CACHE\s*=\s*\K.+' "$CONF_FILE" 2>/dev/null | tr -d '"' | tr -d "'" || true)
conf_exclude=$(grep -oP '^\s*EXCLUDE\s*=\s*\K[0-9,]+' "$CONF_FILE" 2>/dev/null || true)
IFS=',' read -ra conf_ids <<<"$conf_exclude"
for id in "${conf_ids[@]}"; do
@@ -39,6 +41,22 @@ fi
echo -e "\n $(date)"
# Remove downloaded package files after a successful update (CLEAN_CACHE=yes).
# The upgrade commands keep every package they download, so without this the
# cache grows on every run until the container's disk is full.
function clean_container() {
local container=$1
local os=$2
echo -e " [Info] Cleaning package cache in $container"
case "$os" in
alpine) pct exec "$container" -- ash -c "apk cache clean 2>/dev/null || true" ;;
archlinux) pct exec "$container" -- bash -c "pacman -Sc --noconfirm" ;;
fedora | rocky | centos | alma) pct exec "$container" -- bash -c "dnf -y clean packages" ;;
ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get clean" ;;
opensuse) pct exec "$container" -- bash -c "zypper --non-interactive clean" ;;
esac
}
function update_container() {
local container=$1
local name
@@ -46,14 +64,22 @@ function update_container() {
local os
os=$(pct config "$container" | awk '/^ostype/ {print $2}')
echo -e "\n [Info] Updating $container : $name (os: $os)"
local rc=0
case "$os" in
alpine) pct exec "$container" -- ash -c "apk -U upgrade" ;;
archlinux) pct exec "$container" -- bash -c "pacman -Syyu --noconfirm" ;;
fedora | rocky | centos | alma) pct exec "$container" -- bash -c "dnf -y update && dnf -y upgrade" ;;
ubuntu | debian | devuan) pct exec "$container" -- bash -c "apt-get update; DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::='--force-confold' dist-upgrade -y; status=\$?; rm -rf /usr/lib/python3.*/EXTERNALLY-MANAGED || true; exit \$status" ;;
opensuse) pct exec "$container" -- bash -c "zypper ref && zypper --non-interactive dup" ;;
*) echo " [Warn] Unknown OS type '$os' for container $container, skipping" ;;
esac
*)
echo " [Warn] Unknown OS type '$os' for container $container, skipping"
return 0
;;
esac || rc=$?
if [[ $rc -eq 0 && "${CLEAN_CACHE,,}" =~ ^(1|yes|true)$ ]]; then
clean_container "$container" "$os" || echo " [Warn] Cache cleanup failed for $container"
fi
return $rc
}
update_status=0
+442
View File
@@ -0,0 +1,442 @@
#!/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://netbird.io
COMMUNITY_SCRIPTS_URL="${COMMUNITY_SCRIPTS_URL:-https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main}"
source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/pve/vm-core.func")
load_functions
APP="NetBird Server"
APP_TYPE="vm"
NSAPP="netbird-server"
var_os="debian"
var_version="13"
GEN_MAC=02:$(openssl rand -hex 5 | awk '{print toupper($0)}' | sed 's/\(..\)/\1:/g; s/.$//')
RANDOM_UUID="$(cat /proc/sys/kernel/random/uuid)"
METHOD=""
USE_CLOUD_INIT="no"
OS_TYPE="debian"
OS_VERSION="13"
OS_CODENAME="trixie"
OS_DISPLAY="Debian 13 (Trixie)"
THIN="discard=on,ssd=1,"
NETBIRD_DOMAIN_INPUT=""
NETBIRD_PROXY_TYPE_INPUT="0"
NETBIRD_EMAIL_INPUT=""
DOCKER_PREINSTALLED="no"
DOCKER_INSTALL_MARKER=""
NETBIRD_SETUP_MARKER=""
header_info
echo -e "\n Loading..."
set -Eeo pipefail
shopt -s inherit_errexit
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
trap cleanup EXIT
trap 'post_update_to_api "failed" "130"' SIGINT
trap 'post_update_to_api "failed" "143"' SIGTERM
trap 'post_update_to_api "failed" "129"; exit 129' SIGHUP
TEMP_DIR=$(mktemp -d)
pushd "$TEMP_DIR" >/dev/null
vm_preflight
vm_require_tools virt-customize jq
function configure_netbird_setup() {
if [[ "${VM_UNATTENDED:-0}" == "1" ]]; then
if [[ -z "${VM_NETBIRD_DOMAIN:-}" ]]; then
msg_error "An unattended NetBird Server install needs VM_NETBIRD_DOMAIN"
msg_error "Set it to the public domain whose DNS A record points at this VM, e.g. VM_NETBIRD_DOMAIN=netbird.my-domain.com"
exit 1
fi
NETBIRD_DOMAIN_INPUT="$VM_NETBIRD_DOMAIN"
NETBIRD_PROXY_TYPE_INPUT="${VM_NETBIRD_PROXY_TYPE:-0}"
NETBIRD_EMAIL_INPUT="${VM_NETBIRD_EMAIL:-admin@${NETBIRD_DOMAIN_INPUT}}"
echo -e "${INFO}${BOLD}${DGN}NetBird Domain: ${BGN}${NETBIRD_DOMAIN_INPUT}${CL}"
echo -e "${INFO}${BOLD}${DGN}Reverse Proxy: ${BGN}${NETBIRD_PROXY_TYPE_INPUT}${CL}"
echo -e "${INFO}${BOLD}${DGN}Let's Encrypt Email: ${BGN}${NETBIRD_EMAIL_INPUT}${CL}"
return
fi
while true; do
if vm_dialog inputbox "NETBIRD DOMAIN" \
"Enter the public domain for your NetBird server.\n(DNS A record must point to this VM's public IP)\n\ne.g. netbird.my-domain.com" \
11 65 "" --cancel-button Exit-Script; then
NETBIRD_DOMAIN_INPUT="$VM_DIALOG_RESULT"
if [[ -z "$NETBIRD_DOMAIN_INPUT" ]] || [[ "$NETBIRD_DOMAIN_INPUT" == "netbird.example.com" ]]; then
vm_dialog msgbox "INVALID DOMAIN" "Please enter a valid domain name." 8 50
continue
fi
echo -e "${INFO}${BOLD}${DGN}NetBird Domain: ${BGN}${NETBIRD_DOMAIN_INPUT}${CL}"
break
else
exit_script
fi
done
if vm_dialog radiolist "REVERSE PROXY" \
"Select the reverse proxy for NetBird" 14 70 4 \
"0" "Traefik (recommended, built-in with auto TLS)" ON \
"2" "Nginx (generates config template)" OFF \
"3" "Nginx Proxy Manager" OFF \
"5" "Other/Manual" OFF; then
NETBIRD_PROXY_TYPE_INPUT="$VM_DIALOG_RESULT"
echo -e "${INFO}${BOLD}${DGN}Reverse Proxy: ${BGN}${NETBIRD_PROXY_TYPE_INPUT}${CL}"
else
exit_script
fi
if [[ "$NETBIRD_PROXY_TYPE_INPUT" == "0" ]]; then
while true; do
if vm_dialog inputbox "LETSENCRYPT EMAIL" \
"Enter your email for Let's Encrypt certificates:" 8 65 "" --cancel-button Exit-Script; then
NETBIRD_EMAIL_INPUT="$VM_DIALOG_RESULT"
if [[ -z "$NETBIRD_EMAIL_INPUT" ]]; then
vm_dialog msgbox "INVALID EMAIL" "Email is required for Let's Encrypt." 8 50
continue
fi
echo -e "${INFO}${BOLD}${DGN}Let's Encrypt Email: ${BGN}${NETBIRD_EMAIL_INPUT}${CL}"
break
else
exit_script
fi
done
fi
}
function select_os() {
if [[ -n "${1:-}" ]]; then
OS_CHOICE="$1"
elif [[ "${VM_UNATTENDED:-0}" == "1" ]]; then
OS_CHOICE="${VM_OS_VERSION:-debian13}"
elif vm_dialog radiolist "SELECT OS" \
"Choose Operating System for NetBird Server VM" 15 68 4 \
"debian13" "Debian 13 (Trixie) - Latest" ON \
"debian12" "Debian 12 (Bookworm) - Stable" OFF \
"ubuntu2604" "Ubuntu 26.04 LTS (Resolute)" OFF \
"ubuntu2404" "Ubuntu 24.04 LTS (Noble)" OFF; then
OS_CHOICE="$VM_DIALOG_RESULT"
else
exit_script
fi
case $OS_CHOICE in
debian13)
OS_TYPE="debian"
OS_VERSION="13"
OS_CODENAME="trixie"
OS_DISPLAY="Debian 13 (Trixie)"
;;
debian12)
OS_TYPE="debian"
OS_VERSION="12"
OS_CODENAME="bookworm"
OS_DISPLAY="Debian 12 (Bookworm)"
;;
ubuntu2604)
OS_TYPE="ubuntu"
OS_VERSION="26.04"
OS_CODENAME="resolute"
OS_DISPLAY="Ubuntu 26.04 LTS"
;;
ubuntu2404)
OS_TYPE="ubuntu"
OS_VERSION="24.04"
OS_CODENAME="noble"
OS_DISPLAY="Ubuntu 24.04 LTS"
;;
*)
msg_error "Unsupported OS '${OS_CHOICE}' (expected debian13, debian12, ubuntu2604 or ubuntu2404)"
exit 1
;;
esac
var_os="$OS_TYPE"
var_version="$OS_VERSION"
echo -e "${OS}${BOLD}${DGN}Operating System: ${BGN}${OS_DISPLAY}${CL}"
}
function select_cloud_init() {
VM_CLOUD_INIT="${VM_CLOUD_INIT:-yes}"
CLOUDINIT_REQUIRED=0
if [[ "$OS_TYPE" == "ubuntu" ]]; then
CLOUDINIT_REQUIRED=1
fi
vm_prompt_cloud_init "$OS_TYPE"
}
function get_image_url() {
local arch
arch=$(vm_arch_resolve amd64 arm64)
case $OS_TYPE in
debian)
if [[ "$USE_CLOUD_INIT" == "yes" ]]; then
echo "https://cloud.debian.org/images/cloud/${OS_CODENAME}/latest/debian-${OS_VERSION}-generic-${arch}.qcow2"
else
echo "https://cloud.debian.org/images/cloud/${OS_CODENAME}/latest/debian-${OS_VERSION}-nocloud-${arch}.qcow2"
fi
;;
ubuntu)
echo "https://cloud-images.ubuntu.com/${OS_CODENAME}/current/${OS_CODENAME}-server-cloudimg-${arch}.img"
;;
esac
}
function default_settings() {
select_os "${VM_OS_VERSION:-}"
vm_apply_machine_type "q35"
VMID=$(get_valid_nextid)
DISK_SIZE="10G"
DISK_CACHE=""
HN="netbird"
CPU_TYPE=" -cpu host"
CORE_COUNT="2"
RAM_SIZE="2048"
BRG="vmbr0"
MAC="$GEN_MAC"
VLAN=""
MTU=""
START_VM="yes"
METHOD="default"
vm_echo_default_settings
}
function advanced_settings() {
METHOD="advanced"
select_os
vm_prompt_vmid "${VMID:-$(get_valid_nextid)}"
vm_prompt_machine_type "q35"
vm_prompt_disk_size "10G"
vm_prompt_disk_cache "none"
vm_prompt_hostname "netbird"
vm_prompt_cpu_model "host"
vm_prompt_cpu_cores "2"
vm_prompt_ram "2048"
vm_prompt_bridge "vmbr0"
vm_prompt_mac "$GEN_MAC"
vm_prompt_vlan
vm_prompt_mtu
vm_prompt_keyboard
vm_prompt_verbose "no"
vm_prompt_start_vm "yes"
if vm_confirm_advanced_settings "Ready to create a NetBird Server VM?"; then
echo -e "${CREATING}${BOLD}${DGN}Creating a NetBird Server VM using the above advanced settings${CL}"
else
header_info
echo -e "${ADVANCED}${BOLD}${RD}Using Advanced Settings${CL}"
advanced_settings
fi
}
vm_start_script "Use Default Settings?\n\nDefaults:\n• 2 CPU Cores\n• 2 GB RAM\n• 10 GB Disk\n• Cloud-Init enabled" 14 58
select_cloud_init
configure_netbird_setup
post_to_api_vm
vm_select_storage "$HN"
vm_define_disk_references 2
msg_info "Retrieving the URL for the ${OS_DISPLAY} Disk Image"
URL=$(get_image_url)
CACHE_FILE="$(vm_image_cache_path "$URL")"
msg_ok "${CL}${BL}${URL}${CL}"
MIN_IMAGE_BYTES=$((100 * 1024 * 1024))
vm_fetch_image "$URL" "$CACHE_FILE" --cache --min-bytes "$MIN_IMAGE_BYTES" || exit 115
WORK_FILE="$TEMP_DIR/netbird.qcow2"
cp "$CACHE_FILE" "$WORK_FILE"
if [[ "${USE_CLOUD_INIT:-no}" != "yes" ]]; then
msg_info "Expanding the root filesystem to ${DISK_SIZE}"
vm_expand_image "$WORK_FILE" "$DISK_SIZE" || true
fi
export LIBGUESTFS_BACKEND_SETTINGS=dns=8.8.8.8,1.1.1.1
msg_info "Installing base packages"
if vm_customize "NetBird base packages" "$WORK_FILE" --install qemu-guest-agent,curl,ca-certificates,jq; then
msg_ok "Installed base packages"
msg_info "Installing Docker"
if vm_customize "Docker" "$WORK_FILE" \
--run-command 'bash -o pipefail -c "curl -fsSL https://get.docker.com | sh"' \
--run-command 'systemctl enable docker'; then
DOCKER_PREINSTALLED="yes"
msg_ok "Installed Docker"
DOCKER_DAEMON_TMP="$TEMP_DIR/docker-daemon.json"
cat >"$DOCKER_DAEMON_TMP" <<'JSON'
{
"storage-driver": "overlay2",
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}
JSON
vm_customize "Docker daemon" "$WORK_FILE" \
--mkdir /etc/docker \
--upload "${DOCKER_DAEMON_TMP}:/etc/docker/daemon.json" || msg_warn "Docker daemon tuning failed; continuing with Docker defaults"
else
msg_warn "Docker pre-install failed; installation is pending on first boot."
fi
else
msg_warn "Package pre-install failed; Docker installation is pending on first boot."
fi
NETBIRD_ENV_TMP="$TEMP_DIR/netbird.env"
cat >"$NETBIRD_ENV_TMP" <<ENVEOF
NETBIRD_NON_INTERACTIVE="true"
NETBIRD_DOMAIN="${NETBIRD_DOMAIN_INPUT}"
NETBIRD_REVERSE_PROXY_TYPE="${NETBIRD_PROXY_TYPE_INPUT}"
NETBIRD_LETSENCRYPT_EMAIL="${NETBIRD_EMAIL_INPUT}"
NETBIRD_ENABLE_PROXY="false"
NETBIRD_ENABLE_CROWDSEC="false"
NETBIRD_BIND_LOCALHOST_ONLY="false"
ENVEOF
vm_customize "NetBird configuration" "$WORK_FILE" \
--upload "${NETBIRD_ENV_TMP}:/root/netbird.env" || exit 1
NETBIRD_SETUP_TMP="$TEMP_DIR/netbird-setup.sh"
cat >"$NETBIRD_SETUP_TMP" <<'SETUPEOF'
#!/usr/bin/env bash
set -Eeuo pipefail
exec > /var/log/netbird-setup.log 2>&1
echo "[$(date)] Starting NetBird automated setup"
for _ in {1..60}; do
docker info >/dev/null 2>&1 && break
sleep 5
done
docker info >/dev/null 2>&1 || {
echo "[$(date)] ERROR: Docker not ready after 5 min"
exit 1
}
set -a
source /root/netbird.env
set +a
curl -fsSL https://github.com/netbirdio/netbird/releases/latest/download/getting-started.sh \
-o /root/getting-started.sh
echo "[$(date)] Running NetBird getting-started.sh"
bash /root/getting-started.sh
echo "[$(date)] NetBird setup completed"
SETUPEOF
vm_prepare_cloud_image "$WORK_FILE" "$HN" || true
if [[ "$DOCKER_PREINSTALLED" == "no" ]]; then
DOCKER_INSTALL_TMP="$TEMP_DIR/install-docker.sh"
cat >"$DOCKER_INSTALL_TMP" <<'DOCKEREOF'
#!/usr/bin/env bash
set -Eeuo pipefail
export DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a
exec > /var/log/install-docker.log 2>&1
echo "[$(date)] Starting Docker installation"
for _ in {1..30}; do
ping -c 1 8.8.8.8 >/dev/null 2>&1 && break
sleep 2
done
apt-get update
apt-get install -y qemu-guest-agent curl ca-certificates jq
bash -o pipefail -c "curl -fsSL https://get.docker.com | sh"
systemctl enable docker
install -d /etc/docker
cat > /etc/docker/daemon.json <<'JSON'
{
"storage-driver": "overlay2",
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}
JSON
systemctl start docker
echo "[$(date)] Docker installation completed"
DOCKEREOF
vm_firstboot_unit "$WORK_FILE" install-docker "$DOCKER_INSTALL_TMP" \
--description "Install Docker on first boot" \
--cloud-init "$USE_CLOUD_INIT" || exit 1
DOCKER_INSTALL_MARKER="$VM_FIRSTBOOT_MARKER"
fi
NETBIRD_AFTER=(--after docker.service)
if [[ "$DOCKER_PREINSTALLED" == "no" ]]; then
NETBIRD_AFTER+=(--after install-docker.service)
fi
vm_firstboot_unit "$WORK_FILE" netbird-setup "$NETBIRD_SETUP_TMP" \
--description "NetBird initial setup" \
"${NETBIRD_AFTER[@]}" \
--cloud-init "$USE_CLOUD_INIT" || exit 1
NETBIRD_SETUP_MARKER="$VM_FIRSTBOOT_MARKER"
vm_claim_vmid
msg_info "Creating NetBird Server VM shell"
qm create "$VMID" -agent 1${MACHINE} -tablet 0 -bios ovmf${CPU_TYPE} -cores "$CORE_COUNT" -memory "$RAM_SIZE" \
-name "$HN" -tags community-script -net0 "virtio,bridge=$BRG,macaddr=$MAC$VLAN$MTU" -onboot 1 -ostype l26 -scsihw virtio-scsi-pci >/dev/null
vm_mark_created
msg_ok "Created VM shell"
vm_alloc_efi_disk "$DISK0"
vm_import_disk "$VMID" "$WORK_FILE" "$STORAGE"
DISK_OPTIONS="${DISK_CACHE}${THIN}"
DISK_OPTIONS="${DISK_OPTIONS%,}"
ROOT_DISK="$VM_IMPORTED_DISK"
[[ -n "$DISK_OPTIONS" ]] && ROOT_DISK="${ROOT_DISK},${DISK_OPTIONS}"
msg_info "Attaching EFI and root disk"
qm set "$VMID" \
--efidisk0 "${DISK0_REF}${FORMAT}" \
--scsi0 "$ROOT_DISK" \
--boot order=scsi0 \
--serial0 socket >/dev/null
msg_ok "Attached EFI and root disk"
vm_resize_disk "scsi0" "$DISK_SIZE"
set_description
vm_provision "$VMID"
if [[ "$USE_CLOUD_INIT" == "yes" && -n "${CLOUDINIT_SSH_KEYS:-}" ]]; then
$STD qm set "$VMID" --sshkeys "$CLOUDINIT_SSH_KEYS"
fi
vm_start_vm "NetBird Server VM"
vm_wait_for_ip 180 || true
if [[ "$USE_CLOUD_INIT" == "yes" ]]; then
display_cloud_init_info "$VMID" "$HN"
else
msg_warn "Debian nocloud console login: root, no password. Set one before exposing the VM."
fi
DOCKER_STATUS="Pre-installed"
if [[ "$DOCKER_PREINSTALLED" == "no" ]]; then
DOCKER_STATUS="First-boot unit install-docker.service${DOCKER_INSTALL_MARKER:+ (${DOCKER_INSTALL_MARKER})}"
fi
vm_print_summary \
"OS=${OS_DISPLAY}" \
"Domain=https://${NETBIRD_DOMAIN_INPUT}" \
"Docker=${DOCKER_STATUS}" \
"NetBird unit=netbird-setup.service" \
"Setup marker=${NETBIRD_SETUP_MARKER}"
vm_next_steps \
"NetBird installation continues in the VM on first boot." \
"Monitor setup with: tail -f /var/log/netbird-setup.log (Docker install: /var/log/install-docker.log)" \
"Keep ports open: 80/tcp, 443/tcp, 3478/udp."
vm_finish "VM created. NetBird installation continues in the VM on first boot."