eep only package-changing executions and clean up entry presentation

This commit is contained in:
MacRimi
2026-09-11 08:37:23 +02:00
parent ca7c9ec58e
commit 8e0d4ff337
20 changed files with 80 additions and 81 deletions
+11 -2
View File
@@ -78,6 +78,7 @@ function operationLabelKey(change: { operation: string; capture: string }): stri
function undoKey(change: { revert: string; exactness: string }): string {
if (change.revert === "remove") return "undo.remove"
if (change.revert === "restore" && change.exactness === "exact") return "undo.restore"
if (change.revert === "purge") return "undo.purge"
return `exactness.${change.exactness}`
}
@@ -128,6 +129,10 @@ const FN_LABEL: Record<string, string> = {
// else is a general host script (nvidia/tpu installers, PVE update, vfio…).
const POST_INSTALL_SOURCES = new Set(["auto", "customizable"])
// A few sources deserve a friendly name instead of a raw script identifier;
// everything else shows the script it came from.
const FRIENDLY_SOURCE = new Set(["install_proxmenux"])
// Which of the three sections a change belongs to: installations are their
// own block, post-install optimizations another, general scripts the rest.
function blockOf(c: { class: string; source: string }): "installs" | "postInstall" | "scripts" {
@@ -399,7 +404,11 @@ export function AuditChanges() {
// install sections group by the script that made the change, and show
// that script's name — not a per-function label.
const key = b === "postInstall" ? (c.function || c.source || "—") : (c.source || c.function || "—")
const label = b === "postInstall" ? groupLabel(c.function, c.source) : (c.source || c.function || "—")
const label = b === "postInstall"
? groupLabel(c.function, c.source)
: FRIENDLY_SOURCE.has(c.source)
? t(`audit.changes.scriptLabel.${c.source}`)
: (c.source || c.function || "—")
const g = target.get(key) || { key, label, version: "", last: 0, items: [] }
g.items.push(c)
if (c.recorded_at > g.last) g.last = c.recorded_at
@@ -408,7 +417,7 @@ export function AuditChanges() {
}
const sort = (m: Map<string, Group>) => Array.from(m.values()).sort((a, b) => b.last - a.last)
return { post: sort(post), scripts: sort(scripts), installs: sort(installs) }
}, [changes])
}, [changes, t])
const when = (epoch: number) => new Date(epoch * 1000).toLocaleString(language)
+6 -2
View File
@@ -5877,7 +5877,7 @@
"failed": "Das Änderungsjournal war nicht lesbar",
"intro": "Was ProxMenux auf diesem Host geändert hat und was vor jeder Änderung vorhanden war. Gezeigt wird die Differenz.",
"empty": "Auf diesem Host wurde noch nichts aufgezeichnet.",
"since": "Aufzeichnung seit {date}. Früher Angewandtes erscheint als angewandt, ohne den ersetzten Zustand.",
"since": "Aufzeichnung seit {date}.",
"byFunction": "Nach Funktion",
"count": "{count} Änderungen",
"function": "Funktion",
@@ -5924,12 +5924,16 @@
},
"undo": {
"remove": "Löscht die Datei (vorher war keine vorhanden)",
"restore": "Stellt exakt den vorherigen Zustand wieder her"
"restore": "Stellt exakt den vorherigen Zustand wieder her",
"purge": "Das Paket kann deinstalliert werden"
},
"section": {
"postInstall": "Post-Install-Optimierungen",
"scripts": "ProxMenux-Skripte",
"installs": "Installierte Pakete und Werkzeuge"
},
"scriptLabel": {
"install_proxmenux": "ProxMenux-Installer"
}
},
"comparison": {
+6 -2
View File
@@ -5943,7 +5943,7 @@
"failed": "The change journal could not be read",
"intro": "What ProxMenux changed on this host and what was there before each change. The difference is shown.",
"empty": "Nothing has been recorded on this host yet.",
"since": "Recording since {date}. Anything applied before that appears as applied, without the state it replaced.",
"since": "Recording since {date}.",
"byFunction": "By function",
"count": "{count} changes",
"function": "Function",
@@ -5990,12 +5990,16 @@
},
"undo": {
"remove": "Deletes the file (there was none before)",
"restore": "Restores exactly what was there"
"restore": "Restores exactly what was there",
"purge": "The package can be uninstalled"
},
"section": {
"postInstall": "Post-install optimizations",
"scripts": "ProxMenux scripts",
"installs": "Installed packages and utilities"
},
"scriptLabel": {
"install_proxmenux": "ProxMenux installer"
}
},
"comparison": {
+6 -2
View File
@@ -5877,7 +5877,7 @@
"failed": "No se ha podido leer el registro de cambios",
"intro": "Qué ha cambiado ProxMenux en este host y qué había antes de cada cambio. Se muestra la diferencia.",
"empty": "Todavía no se ha registrado nada en este host.",
"since": "Registrando desde el {date}. Lo aplicado antes figura como aplicado, sin el estado al que sustituyó.",
"since": "Registrando desde el {date}.",
"byFunction": "Por función",
"count": "{count} cambios",
"function": "Función",
@@ -5924,12 +5924,16 @@
},
"undo": {
"remove": "Elimina el fichero (no había ninguno antes)",
"restore": "Restaura exactamente lo que había"
"restore": "Restaura exactamente lo que había",
"purge": "Se puede desinstalar el paquete"
},
"section": {
"postInstall": "Optimizaciones de post-install",
"scripts": "Scripts de ProxMenux",
"installs": "Paquetes y utilidades instalados"
},
"scriptLabel": {
"install_proxmenux": "Instalador de ProxMenux"
}
},
"comparison": {
+6 -2
View File
@@ -5877,7 +5877,7 @@
"failed": "Le journal des modifications n'a pas pu être lu",
"intro": "Ce que ProxMenux a changé sur cet hôte et ce qui existait avant chaque changement. C'est la différence qui est montrée.",
"empty": "Rien n'a encore été enregistré sur cet hôte.",
"since": "Enregistrement depuis le {date}. Ce qui a été appliqué avant figure comme appliqué, sans l'état remplacé.",
"since": "Enregistrement depuis le {date}.",
"byFunction": "Par fonction",
"count": "{count} modifications",
"function": "Fonction",
@@ -5924,12 +5924,16 @@
},
"undo": {
"remove": "Supprime le fichier (il n'y en avait aucun avant)",
"restore": "Restaure exactement ce qui existait"
"restore": "Restaure exactement ce qui existait",
"purge": "Le paquet peut être désinstallé"
},
"section": {
"postInstall": "Optimisations post-installation",
"scripts": "Scripts ProxMenux",
"installs": "Paquets et utilitaires installés"
},
"scriptLabel": {
"install_proxmenux": "Programme d'installation de ProxMenux"
}
},
"comparison": {
+6 -2
View File
@@ -5877,7 +5877,7 @@
"failed": "Non è stato possibile leggere il registro delle modifiche",
"intro": "Cosa ha cambiato ProxMenux su questo host e cosa c'era prima di ogni modifica. Viene mostrata la differenza.",
"empty": "Su questo host non è ancora stato registrato nulla.",
"since": "Registrazione dal {date}. Ciò che è stato applicato prima risulta applicato, senza lo stato sostituito.",
"since": "Registrazione dal {date}.",
"byFunction": "Per funzione",
"count": "{count} modifiche",
"function": "Funzione",
@@ -5924,12 +5924,16 @@
},
"undo": {
"remove": "Elimina il file (prima non ce n'era nessuno)",
"restore": "Ripristina esattamente ciò che c'era"
"restore": "Ripristina esattamente ciò che c'era",
"purge": "Il pacchetto può essere disinstallato"
},
"section": {
"postInstall": "Ottimizzazioni post-installazione",
"scripts": "Script di ProxMenux",
"installs": "Pacchetti e utilità installati"
},
"scriptLabel": {
"install_proxmenux": "Installer di ProxMenux"
}
},
"comparison": {
+6 -2
View File
@@ -5877,7 +5877,7 @@
"failed": "Não foi possível ler o registo de alterações",
"intro": "O que o ProxMenux alterou neste host e o que existia antes de cada alteração. Mostra-se a diferença.",
"empty": "Ainda não foi registado nada neste anfitrião.",
"since": "A registar desde {date}. O que foi aplicado antes figura como aplicado, sem o estado que substituiu.",
"since": "A registar desde {date}.",
"byFunction": "Por função",
"count": "{count} alterações",
"function": "Função",
@@ -5924,12 +5924,16 @@
},
"undo": {
"remove": "Elimina o ficheiro (não existia nenhum antes)",
"restore": "Restaura exatamente o que existia"
"restore": "Restaura exatamente o que existia",
"purge": "O pacote pode ser desinstalado"
},
"section": {
"postInstall": "Otimizações pós-instalação",
"scripts": "Scripts do ProxMenux",
"installs": "Pacotes e utilitários instalados"
},
"scriptLabel": {
"install_proxmenux": "Instalador do ProxMenux"
}
},
"comparison": {
+6 -2
View File
@@ -5943,7 +5943,7 @@
"failed": "Denník zmien sa nepodarilo prečítať",
"intro": "Čo ProxMenux na tomto hostiteľovi zmenil a čo tam bolo pred každou zmenou. Zobrazuje sa rozdiel.",
"empty": "Na tomto hostiteľovi zatiaľ nebolo nič zaznamenané.",
"since": "Zaznamenáva sa od {date}. Čo bolo použité skôr, figuruje ako použité, bez stavu, ktorý nahradilo.",
"since": "Zaznamenáva sa od {date}.",
"byFunction": "Podľa funkcie",
"count": "{count} zmien",
"function": "Funkcia",
@@ -5990,12 +5990,16 @@
},
"undo": {
"remove": "Odstráni súbor (predtým žiadny nebol)",
"restore": "Obnoví presne to, čo tam bolo"
"restore": "Obnoví presne to, čo tam bolo",
"purge": "Balík možno odinštalovať"
},
"section": {
"postInstall": "Optimalizácie po inštalácii",
"scripts": "Skripty ProxMenux",
"installs": "Nainštalované balíky a nástroje"
},
"scriptLabel": {
"install_proxmenux": "Inštalátor ProxMenux"
}
},
"comparison": {
+6 -2
View File
@@ -5878,7 +5878,7 @@
"failed": "Ändringsjournalen kunde inte läsas",
"intro": "Vad ProxMenux ändrat på den här värden och vad som fanns före varje ändring. Skillnaden visas.",
"empty": "Inget har ännu registrerats på den här värden.",
"since": "Registrerar sedan {date}. Det som tillämpades dessförinnan står som tillämpat, utan det tillstånd det ersatte.",
"since": "Registrerar sedan {date}.",
"byFunction": "Per funktion",
"count": "{count} ändringar",
"function": "Funktion",
@@ -5925,12 +5925,16 @@
},
"undo": {
"remove": "Tar bort filen (det fanns ingen tidigare)",
"restore": "Återställer exakt vad som fanns"
"restore": "Återställer exakt vad som fanns",
"purge": "Paketet kan avinstalleras"
},
"section": {
"postInstall": "Optimeringar efter installation",
"scripts": "ProxMenux-skript",
"installs": "Installerade paket och verktyg"
},
"scriptLabel": {
"install_proxmenux": "ProxMenux-installerare"
}
},
"comparison": {
+2 -2
View File
@@ -844,8 +844,8 @@ install_normal_version() {
if [ -f "$BASE_DIR/scripts/global/pmx_journal.sh" ]; then
# shellcheck source=/dev/null
source "$BASE_DIR/scripts/global/pmx_journal.sh"
pmx_journal_context "install_proxmenux" "1.0"
pmx_record_applied "dialog, jq, curl, git" "1.0" "install_dependencies"
pmx_journal_context "install_proxmenux" "1.0" "install_proxmenux"
pmx_record_install "dialog jq curl git" "1.0"
fi
chmod +x "$BASE_DIR/install_proxmenux.sh"
msg_ok "Necessary files created."
+2 -2
View File
@@ -734,8 +734,8 @@ install_beta() {
if [ -f "$BASE_DIR/scripts/global/pmx_journal.sh" ]; then
# shellcheck source=/dev/null
source "$BASE_DIR/scripts/global/pmx_journal.sh"
pmx_journal_context "install_proxmenux" "1.0"
pmx_record_applied "dialog, jq, curl, git" "1.0" "install_dependencies"
pmx_journal_context "install_proxmenux" "1.0" "install_proxmenux"
pmx_record_install "dialog jq curl git" "1.0"
fi
if [ -d "./oci" ]; then
-2
View File
@@ -254,7 +254,6 @@ cleanup_duplicate_repos_pve9() {
if [ $cleaned_count -gt 0 ]; then
msg_ok "$(translate "Cleaned up $cleaned_count duplicate/old repositories")"
pmx_record_execution "Update package lists after repository cleanup" "apt-get update"
apt-get update > /dev/null 2>&1 || true
else
msg_ok "$(translate "No duplicate repositories found")"
@@ -335,7 +334,6 @@ cleanup_duplicate_repos_pve9_() {
if [ $cleaned_count -gt 0 ]; then
msg_ok "$(translate "Cleaned up $cleaned_count duplicate/old repositories")"
pmx_record_execution "Update package lists after repository cleanup" "apt-get update"
apt-get update > /dev/null 2>&1 || true
else
msg_ok "$(translate "No duplicate repositories found")"
@@ -819,7 +819,6 @@ _proxmenux_nvidia_migrate_legacy_blacklist() {
chown --reference="$udev_disabled" "$udev_rules" 2>/dev/null || true
pmx_remove_file "$udev_disabled" || true
fi
pmx_record_execution "Reload udev rules" "udevadm control --reload-rules"
udevadm control --reload-rules >/dev/null 2>&1 || true
changed=true
fi
+14
View File
@@ -405,6 +405,20 @@ pmx_record_execution() {
# changed — the state before it ran is not knowable. Used by the
# registration path so a host carries an honest account of what was
# applied before the journal existed.
# Records packages the installer put on the host before the journal existed
# (its own dependencies). They are a real host change, so they belong in the
# installation class — there is simply no prior state to diff, because the
# host did not have them.
pmx_record_install() {
local packages="$1" version="${2:-1.0}"
local -a fields
mapfile -t fields < <(_pmx_journal_common)
_pmx_journal_record "${fields[@]}" \
"class=installation" "operation=install_package" "target=$packages" \
"installed=$packages" "function_version=$version" "result=ok" \
"capture=created" "revert=purge" "exactness=none"
}
pmx_record_applied() {
local tool="$1" version="$2" state="${3:-applied}"
local -a fields
-4
View File
@@ -120,7 +120,6 @@ EOF
cleanup_duplicate_repos
msg_info "$(translate "Updating package lists...")"
pmx_record_execution "Update package lists" "apt-get update"
if apt-get update > "$log_file" 2>&1; then
msg_ok "$(translate "Package lists updated successfully")"
else
@@ -168,14 +167,12 @@ EOF
msg_info2 "$(translate "Update cancelled by user")"
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
apt-get -y autoremove > /dev/null 2>&1 || true
pmx_record_execution "Clean downloaded package cache" "apt-get -y autoclean"
apt-get -y autoclean > /dev/null 2>&1 || true
return 0
elif [[ $MENU_RESULT -eq 2 ]]; then
msg_ok "$(translate "System is already up to date. No update needed.")"
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
apt-get -y autoremove > /dev/null 2>&1 || true
pmx_record_execution "Clean downloaded package cache" "apt-get -y autoclean"
apt-get -y autoclean > /dev/null 2>&1 || true
return 0
fi
@@ -273,7 +270,6 @@ EOF
msg_info "$(translate "Performing system cleanup...")"
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
apt-get -y autoremove > /dev/null 2>&1 || true
pmx_record_execution "Clean downloaded package cache" "apt-get -y autoclean"
apt-get -y autoclean > /dev/null 2>&1 || true
msg_ok "$(translate "Cleanup finished")"
-8
View File
@@ -164,7 +164,6 @@ EOF
fi
# UPDATE: no progress bar here (dpkg is not involved); capture output to parse errors
pmx_record_execution "Update package lists" "apt-get update"
update_output=$(apt-get update 2>&1)
update_exit_code=$?
@@ -182,25 +181,21 @@ EOF
if command -v gpg >/dev/null 2>&1; then
# Modern approach: receive -> export -> dearmor into /etc/apt/keyrings/<KEY>.gpg
pmx_record_execution "Import missing repository signing key" "gpg --batch --keyserver keyserver.ubuntu.com --recv-keys $key"
if gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" \
&& gpg --batch --export "$key" | gpg --dearmor -o "/etc/apt/keyrings/${key}.gpg"; then
msg_ok "$(translate "Imported missing GPG key: $key")"
else
msg_warn "$(translate "Keyrings method failed; trying apt-key fallback")"
pmx_record_execution "Import missing repository signing key with apt-key" "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key"
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "$key" >/dev/null 2>&1 || true
fi
else
# Fallback for minimal systems without gpg installed
msg_warn "$(translate "gpg not found; trying apt-key fallback")"
pmx_record_execution "Import missing repository signing key with apt-key" "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key"
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "$key" >/dev/null 2>&1 || true
fi
fi
# Retry update after importing the key
pmx_record_execution "Retry package list update" "apt-get update"
if apt-get update > "$log_file" 2>&1; then
msg_ok "$(translate "Package lists updated after GPG fix")" | tee -a "$screen_capture"
else
@@ -282,7 +277,6 @@ EOF
msg_info2 "$(translate "Update cancelled by user")"
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
apt-get -y autoremove > /dev/null 2>&1 || true
pmx_record_execution "Clean downloaded package cache" "apt-get -y autoclean"
apt-get -y autoclean > /dev/null 2>&1 || true
rm -f "$screen_capture"
return 0
@@ -290,7 +284,6 @@ EOF
msg_ok "$(translate "System is already up to date. No update needed.")"
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
apt-get -y autoremove > /dev/null 2>&1 || true
pmx_record_execution "Clean downloaded package cache" "apt-get -y autoclean"
apt-get -y autoclean > /dev/null 2>&1 || true
rm -f "$screen_capture"
return 0
@@ -341,7 +334,6 @@ EOF
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
apt-get -y autoremove > /dev/null 2>&1 || true
pmx_record_execution "Clean downloaded package cache" "apt-get -y autoclean"
apt-get -y autoclean > /dev/null 2>&1 || true
msg_ok "$(translate "Cleanup finished")"
@@ -118,7 +118,6 @@ EOF
if [[ "$need_update" == true ]] || [[ ! -d /var/lib/apt/lists || -z "$(ls -A /var/lib/apt/lists 2>/dev/null)" ]]; then
msg_info "$(translate "Updating APT package lists...")"
pmx_record_execution "Update APT package lists" "apt-get update"
apt-get update >/dev/null 2>&1 || apt-get update
# Spinner pair: msg_info must be closed before returning.
# Without this the next `msg_info` caller spawns a second
-1
View File
@@ -525,7 +525,6 @@ guided_bridge_repair() {
clear
msg_info "$(translate "Restarting network service...")"
pmx_record_execution "Restart networking service" "systemctl restart networking"
if systemctl restart networking; then
msg_ok "$(translate "Network service restarted successfully")"
else
+3 -21
View File
@@ -175,8 +175,7 @@ remove_subscription_banner() {
return 1
fi
kill -TERM "$SPINNER_PID" 2>/dev/null
sleep 1
stop_spinner
if [[ "$pve_version" -ge 9 ]]; then
if ! whiptail --title "Proxmox VE ${pve_version} Subscription Banner Removal" \
@@ -344,11 +343,8 @@ MaxLevelConsole=notice
MaxLevelWall=crit
EOF
pmx_record_execution "Restart systemd-journald" "systemctl restart systemd-journald.service"
systemctl restart systemd-journald.service > /dev/null 2>&1
pmx_record_execution "Vacuum system journal" "journalctl --vacuum-size=64M --vacuum-time=1d"
journalctl --vacuum-size=64M --vacuum-time=1d > /dev/null 2>&1
pmx_record_execution "Rotate system journal" "journalctl --rotate"
journalctl --rotate > /dev/null 2>&1
msg_ok "$(translate "Journald optimized - Max size: 64M")"
@@ -380,7 +376,6 @@ create 0640 root adm
copytruncate
include /etc/logrotate.d
EOF
pmx_record_execution "Restart logrotate" "systemctl restart logrotate"
systemctl restart logrotate > /dev/null 2>&1
msg_ok "$(translate "Logrotate optimization completed")"
@@ -574,7 +569,6 @@ net.ipv4.tcp_wmem = 8192 65536 16777216
net.unix.max_dgram_qlen = 4096
EOF
pmx_record_execution "Apply network sysctl configuration" "sysctl --system"
sysctl --system > /dev/null 2>&1
pmx_write_file /usr/local/sbin/proxmenux-fwbr-tune <<'EOF'
@@ -632,12 +626,9 @@ EOF
chmod 0644 /etc/udev/rules.d/99-proxmenux-fwbr-tune.rules
chown root:root /etc/udev/rules.d/99-proxmenux-fwbr-tune.rules
pmx_record_execution "Reload systemd configuration" "systemctl daemon-reload"
systemctl daemon-reload >/dev/null 2>&1 || true
pmx_record_execution "Reload udev rules" "udevadm control --reload-rules"
udevadm control --reload-rules >/dev/null 2>&1 || true
pmx_enable_service proxmenux-fwbr-tune.service || true
pmx_record_execution "Tune existing Proxmox firewall bridge interfaces" "/usr/local/sbin/proxmenux-fwbr-tune"
/usr/local/sbin/proxmenux-fwbr-tune >/dev/null 2>&1 || true
@@ -1049,9 +1040,8 @@ install_log2ram_auto() {
if [[ "$is_ssd" == true ]]; then
msg_ok "$(translate "System disk is SSD or M.2. Proceeding with Log2RAM setup.")"
else
kill -TERM "$SPINNER_PID" 2>/dev/null
sleep 1
if whiptail --yesno "$(translate "Do you want to install Log2RAM anyway to reduce log write load?")" 10 70 --title "Log2RAM"; then
stop_spinner
if whiptail --yesno "$(translate "Do you want to install Log2RAM to reduce log write load?")" 10 70 --title "Log2RAM"; then
msg_ok "$(translate "Proceeding with Log2RAM setup on non-SSD disk as requested by user.")"
else
msg_info2 "$(translate "Log2RAM installation cancelled by user")"
@@ -1083,18 +1073,14 @@ install_log2ram_auto() {
rm -rf /etc/systemd/system/log2ram.service.d 2>/dev/null || true
rm -rf /var/log.hdd /tmp/log2ram 2>/dev/null || true
pmx_record_execution "Re-execute the systemd manager" "systemctl daemon-reexec"
systemctl daemon-reexec >/dev/null 2>&1 || true
pmx_record_execution "Reload systemd configuration" "systemctl daemon-reload"
systemctl daemon-reload >/dev/null 2>&1 || true
pmx_record_execution "Restart cron" "systemctl restart cron"
systemctl restart cron >/dev/null 2>&1 || true
msg_ok "$(translate "Previous installation cleaned")"
msg_info "$(translate "Installing Log2RAM from source...")"
if ! command -v git >/dev/null 2>&1; then
pmx_record_execution "Update package lists for Log2RAM" "apt-get update -qq"
apt-get update -qq >/dev/null 2>&1
pmx_install_pkg git
fi
@@ -1107,7 +1093,6 @@ install_log2ram_auto() {
cd /tmp/log2ram || { msg_error "$(translate "Failed to access log2ram directory")"; return 1; }
pmx_record_execution "Run the Log2RAM installer" "bash install.sh"
if ! bash install.sh >>/tmp/log2ram_install.log 2>&1; then
msg_error "$(translate "Failed to run log2ram installer. Check /tmp/log2ram_install.log")"
return 1
@@ -1159,7 +1144,6 @@ EOF
msg_ok "$(translate "PBS API log rotation configured (hourly, size-based)")"
fi
pmx_record_execution "Reload systemd configuration" "systemctl daemon-reload"
systemctl daemon-reload >/dev/null 2>&1 || true
if [[ -f /etc/log2ram.conf ]] && command -v log2ram >/dev/null 2>&1; then
@@ -1257,7 +1241,6 @@ EOF
chmod 0644 /etc/cron.d/log2ram-auto-sync
chown root:root /etc/cron.d/log2ram-auto-sync
pmx_record_execution "Restart cron" "systemctl restart cron"
systemctl restart cron >/dev/null 2>&1 || true
msg_ok "$(translate "Auto-sync enabled when /var/log exceeds 80% of") $LOG2RAM_SIZE"
@@ -1324,7 +1307,6 @@ EOF
#msg_ok "$(translate "Backup created:") /etc/systemd/journald.conf.bak.$(date +%Y%m%d-%H%M%S)"
msg_ok "$(translate "Journald configuration adjusted to") ${USE_MB}M (Log2RAM ${LOG2RAM_SIZE})"
pmx_record_execution "Reload systemd configuration" "systemctl daemon-reload"
systemctl daemon-reload >/dev/null 2>&1 || true
if ! pmx_apply_setting "service-enabled:log2ram" "systemctl is-enabled log2ram" \
systemctl enable log2ram; then
@@ -520,7 +520,6 @@ skip_apt_languages() {
echo "$default_locale UTF-8" | pmx_append_file /etc/locale.gen
fi
msg_info "$(translate "Generating missing locale:") $default_locale"
pmx_record_execution "Generate locale" "locale-gen $default_locale"
locale-gen "$default_locale"
msg_ok "$(translate "Locale generated")"
fi
@@ -595,7 +594,6 @@ configure_time_sync() {
msg_ok "$(translate "Time settings configured - Timezone:") $timezone"
register_tool "time_sync" true "$FUNC_VERSION"
pmx_record_execution "Restart Postfix" "systemctl restart postfix"
systemctl restart postfix 2>/dev/null || true
else
msg_warn "$(translate "Failed to enable automatic time synchronization")"
@@ -707,7 +705,6 @@ apply_amd_fixes() {
fi
if command -v proxmox-boot-tool >/dev/null 2>&1; then
pmx_record_execution "Refresh Proxmox boot configuration" "proxmox-boot-tool refresh"
proxmox-boot-tool refresh >/dev/null 2>&1 && \
msg_ok "$(translate "proxmox-boot-tool refreshed")" || \
msg_warn "$(translate "Failed to refresh proxmox-boot-tool")"
@@ -728,7 +725,6 @@ apply_amd_fixes() {
else
msg_ok "$(translate "'$added_param' already present in GRUB_CMDLINE_LINUX_DEFAULT")"
fi
pmx_record_execution "Regenerate GRUB configuration" "update-grub"
update-grub >/dev/null 2>&1 && \
msg_ok "$(translate "GRUB configuration updated")" || \
msg_warn "$(translate "Failed to update GRUB")"
@@ -867,7 +863,6 @@ net.unix.max_dgram_qlen = 4096
EOF
pmx_record_execution "Apply network sysctl configuration" "sysctl --system"
sysctl --system > /dev/null 2>&1
pmx_write_file /usr/local/sbin/proxmenux-fwbr-tune <<'EOF'
@@ -927,12 +922,9 @@ EOF
chmod 0644 /etc/udev/rules.d/99-zz-proxmenux-fwbr-tune.rules
chown root:root /etc/udev/rules.d/99-zz-proxmenux-fwbr-tune.rules
pmx_record_execution "Reload systemd configuration" "systemctl daemon-reload"
systemctl daemon-reload >/dev/null 2>&1 || true
pmx_record_execution "Reload udev rules" "udevadm control --reload-rules"
udevadm control --reload-rules >/dev/null 2>&1 || true
pmx_enable_service proxmenux-fwbr-tune.service || true
pmx_record_execution "Tune existing Proxmox firewall bridge interfaces" "/usr/local/sbin/proxmenux-fwbr-tune"
/usr/local/sbin/proxmenux-fwbr-tune >/dev/null 2>&1 || true
@@ -1039,7 +1031,6 @@ EOF
fi
# Apply changes
pmx_record_execution "Apply sysctl configuration" "sysctl --system"
sysctl --system > /dev/null 2>&1
if [ "$reboot_needed" -eq 1 ]; then
@@ -1135,7 +1126,6 @@ EOF
msg_info "$(translate "Updating package lists...")"
pmx_record_execution "Update package lists for Ceph" "apt-get update"
update_output=$(apt-get update 2>&1)
update_exit_code=$?
@@ -1964,14 +1954,11 @@ enable_vfio_iommu() {
# Update initramfs and bootloader
msg_info "$(translate "Updating initramfs, GRUB, and EFI boot, patience...")"
pmx_record_execution "Regenerate initramfs" "update-initramfs -u -k all"
update-initramfs -u -k all > /dev/null 2>&1
if [[ "$uses_zfs" == true ]]; then
pmx_record_execution "Refresh Proxmox boot configuration" "proxmox-boot-tool refresh"
proxmox-boot-tool refresh > /dev/null 2>&1
else
pmx_record_execution "Regenerate GRUB configuration" "update-grub"
update-grub > /dev/null 2>&1
fi
@@ -2626,7 +2613,6 @@ configure_fastfetch() {
echo '{"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "modules": []}' | pmx_write_file "$fastfetch_config"
fi
pmx_record_execution "Generate Fastfetch configuration" "fastfetch --gen-config-force"
fastfetch --gen-config-force > /dev/null 2>&1
while true; do
@@ -2752,7 +2738,6 @@ configure_fastfetch() {
msg_ok "$(translate "Fastfetch now displays: System optimised by: ProxMenux")"
pmx_record_execution "Generate Fastfetch configuration" "fastfetch --gen-config"
fastfetch --gen-config > /dev/null 2>&1
msg_ok "$(translate "Fastfetch configuration updated")"
@@ -3155,9 +3140,7 @@ configure_log2ram() {
rm -rf /etc/systemd/system/log2ram.service.d 2>/dev/null || true
rm -rf /var/log.hdd /tmp/log2ram 2>/dev/null || true
pmx_record_execution "Reload systemd configuration" "systemctl daemon-reload"
systemctl daemon-reload >/dev/null 2>&1 || true
pmx_record_execution "Restart cron" "systemctl restart cron"
systemctl restart cron >/dev/null 2>&1 || true
msg_ok "$(translate "Previous installation cleaned")"
@@ -3165,7 +3148,6 @@ configure_log2ram() {
msg_info "$(translate "Installing Log2RAM from GitHub...")"
if ! command -v git >/dev/null 2>&1; then
msg_info "$(translate "Installing required package: git")"
pmx_record_execution "Update package lists for Log2RAM" "apt-get update -qq"
apt-get update -qq >/dev/null 2>&1
pmx_install_pkg git
fi
@@ -3178,7 +3160,6 @@ configure_log2ram() {
fi
cd /tmp/log2ram || { msg_error "$(translate "Failed to access log2ram directory")"; return 1; }
pmx_record_execution "Run the Log2RAM installer" "bash install.sh"
if ! bash install.sh >>/tmp/log2ram_install.log 2>&1; then
msg_error "$(translate "Failed to run log2ram installer. Check /tmp/log2ram_install.log")"
return 1
@@ -3230,7 +3211,6 @@ EOF
msg_ok "$(translate "PBS API log rotation configured (hourly, size-based)")"
fi
pmx_record_execution "Reload systemd configuration" "systemctl daemon-reload"
systemctl daemon-reload >/dev/null 2>&1 || true
if [[ -f /etc/log2ram.conf ]] && command -v log2ram >/dev/null 2>&1; then
@@ -3370,7 +3350,6 @@ EOF
chown -R www-data:www-data /var/log.hdd/pveproxy
chmod 0750 /var/log.hdd/pveproxy
pmx_record_execution "Restart cron" "systemctl restart cron"
systemctl restart cron >/dev/null 2>&1 || true
if ! pmx_apply_setting "service-enabled:log2ram" "systemctl is-enabled log2ram" \
systemctl enable log2ram; then