Refactor fallback_to_debian12() into fallback_to_previous_os_version()
which dynamically determines the previous major version for any OS type
(debian, ubuntu, alpine, fedora, rocky, centos) by scanning available
local and online templates. The 3-option menu in the LXC stack upgrade
prompt now shows for all OS types, not just Debian 13.
- Add fallback_to_debian12() helper that searches for a Debian 12
template (local then online), downloads if needed, and retries
pct create with the older template
- Extend offer_lxc_stack_upgrade_and_maybe_retry() with a 3-option
menu when using Debian 13: [1] Upgrade LXC stack (recommended),
[2] Use Debian 12 instead (with warning), [3] Cancel
- In both 'unsupported version' error handlers: if LXC stack upgrade
is declined (rc=2) or fails (rc=3), automatically attempt Debian 12
fallback as last resort before giving up
- Add pct sanity check after LXC stack upgrade to detect partial PVE
upgrade breakage (Perl module incompatibility) with clear remediation
steps (apt dist-upgrade + reboot)
- Detect Perl compilation errors in pct create log output early, abort
with actionable message instead of useless retries (exit 232)
- Check /etc/pve/storage.cfg existence before grep, with pmxcfs mount
diagnostics
- Add pvesm status fallback when grep fails to find storage type
- Show available storages and config entries on storage validation failure
- Add link to Proxmox storage documentation on failure
- Make storage grep pattern more robust (flexible whitespace matching)
The previous migration fix attempted to INSERT INTO 'userOrgRoles' before
that table existed (it is new in 1.17.1). The error was silently ignored,
so no role data was migrated. When drizzle-kit then dropped roleId from
userOrgs, all user-role associations were permanently lost.
- CREATE TABLE IF NOT EXISTS for userOrgRoles before migrating data
- Same treatment for userInviteRoles (also new in 1.17.1)
Fixescommunity-scripts/ProxmoxVE#13857
* fix(node): align Node.js versions with upstream for 5 scripts
Update scripts where upstream requires a newer Node.js version:
- iobroker: 22 → 24 (upstream .nvmrc)
- kima-hub: 20 → 22 (upstream Dockerfile)
- myip: 22 → 24 (upstream Dockerfile)
- outline: 22 → 24 (upstream Dockerfile)
- shelfmark: 22 → 24 (upstream Dockerfile)
Skipped 15 scripts where our version is already newer than upstream.
Ref: community-scripts/ProxmoxVE#13870
* fix(node): add setup_nodejs to update scripts for iobroker, kima-hub, myip
These three scripts had NODE_VERSION in install but not in update,
so running an update would not upgrade Node.js to the correct version.
- iobroker: add NODE_VERSION=24
- kima-hub: add NODE_VERSION=22
- myip: add NODE_VERSION=24
* PMG Post Install: Detect gateway via /etc/os-release when /etc/issue is generic
* PMG Post Install: detect gateway via dpkg or PMG service units
* PMG: migrate post-install to deb822 format, fix APT source conflicts
- Simplify PMG detection to dpkg-based check only
- Extend repo_state() to scan .sources files (deb822 format)
- Add toggle_repo() helper for enable/disable on both formats
- Migrate Debian sources correction to deb822 (debian.sources)
- Migrate pmg-enterprise, pmg-no-subscription, pmgtest repo
creation to deb822 .sources files
- Install script: clean up duplicate APT sources created by
proxmox-mailgateway-container package (enterprise.list,
pmg-install-repo.list, legacy sources.list)
* fix: use official Signed-By path & revert install script cleanup
- Change Signed-By from /etc/apt/keyrings/pmg.gpg to
/usr/share/keyrings/proxmox-archive-keyring.gpg in all three
PMG repo creation blocks (enterprise, no-subscription, test),
matching official PMG docs and PVE post-install convention
- Remove APT source cleanup from install script (handled by
post-pmg-install instead)
* remove empty line
notes_json was sent as JSON.stringify(arr) inside JSON.stringify(),
causing PocketBase to receive a string instead of a JSON array.
patchMethods already does it correctly — align patchNotes.
* fix(build.func): pct create audit — 5 fixes
1. Disable globbing (set -f) around pct create calls to prevent
passwords containing * or ? from expanding to filenames.
2. Fix TAGS: use semicolons (pct format), prevent duplicate
community-script prefix, remove trailing separator.
3. Skip keyctl dialog for unprivileged containers — pct always
forces keyctl=1 for CT_TYPE=1, so the dialog was misleading.
4. Remove dead IPV6_STATIC variable (IPv6 is handled via
IPV6_ADDR/IPV6_GATE which are properly wired into NET_STRING).
5. Remove dead UDHCPC_FIX variable — set and exported but never
consumed by any install script.
* Update api.func
User input like 'nfs, cifs' or 'nfs,' would produce invalid pct
features strings like 'mount=nfs; cifs' (space breaks pct argument
parsing) or 'mount=nfs;' (trailing semicolon). Fixes:
- Whiptail dialog (Step 27): normalize input immediately after entry
- load_vars_file validation: normalize before regex check, use
stricter regex that rejects trailing/leading commas
- FEATURES construction: defensive sanitize before building the
mount= value (strip spaces, trailing commas/semicolons)
All three layers ensure 'nfs, cifs' -> 'nfs,cifs' -> 'mount=nfs;cifs'