Archived
Stage 1 base config/hardening toolset, applied and verified on pve1
Splits the repo into Stage 1 (base host config/hardening, applies to any node) and Stage 2 (future HA/Ceph cluster, deferred - pve1's mini-PC hardware can't support the assumed split-disk/multi-NIC layout). Adds the Stage 1 toolset: firewall deploy, named admin user creation, unattended security upgrades, subscription-nag removal (with an apt hook so the patch survives package updates), and a read-only audit script. Fixes switch-to-no-subscription-repo.sh, which only handled the legacy .list format and silently no-op'd against PVE 9's deb822 .sources files; it now removes enterprise sources outright rather than commenting them out. Shared logic (root check, idempotent file writes, backups) factored into scripts/lib/common.sh. Ran the full sequence against pve1 via scripts/bootstrap.sh + create-admin-user.sh; scripts/audit.sh confirms all checks pass.
This commit is contained in:
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# Neutralizes the Proxmox "No valid subscription" nag (login popup and the
|
||||
# dashboard subscription indicator) by patching proxmox-widget-toolkit's
|
||||
# proxmoxlib.js. Cosmetic only - doesn't create or spoof a subscription
|
||||
# anywhere except this UI check.
|
||||
#
|
||||
# This file is not run from the repo directly - disable-subscription-nag.sh
|
||||
# installs a copy of it to /usr/local/sbin and wires it into an apt
|
||||
# Post-Invoke hook, because a proxmox-widget-toolkit package upgrade
|
||||
# overwrites proxmoxlib.js and reverts the patch. Idempotent: exits quietly
|
||||
# if already patched or if the file isn't present.
|
||||
set -euo pipefail
|
||||
|
||||
JS_FILE="/usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js"
|
||||
[ -f "$JS_FILE" ] || exit 0
|
||||
|
||||
PATTERN="data.status.toLowerCase() !== 'active'"
|
||||
grep -qF "$PATTERN" "$JS_FILE" || exit 0
|
||||
|
||||
cp "$JS_FILE" "${JS_FILE}.bak.$(date +%s)"
|
||||
sed -i "s/${PATTERN}/false/g" "$JS_FILE"
|
||||
echo "Patched subscription nag in $JS_FILE"
|
||||
Reference in New Issue
Block a user