diff --git a/AppImage/components/audit-changes.tsx b/AppImage/components/audit-changes.tsx index 148cd304..3da60c19 100644 --- a/AppImage/components/audit-changes.tsx +++ b/AppImage/components/audit-changes.tsx @@ -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 = { // 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) => 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) diff --git a/AppImage/messages/de/common.json b/AppImage/messages/de/common.json index d91109a7..a10e90d9 100644 --- a/AppImage/messages/de/common.json +++ b/AppImage/messages/de/common.json @@ -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": { diff --git a/AppImage/messages/en/common.json b/AppImage/messages/en/common.json index 8f42b9b4..9b77ca41 100644 --- a/AppImage/messages/en/common.json +++ b/AppImage/messages/en/common.json @@ -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": { diff --git a/AppImage/messages/es/common.json b/AppImage/messages/es/common.json index 2e0ec1d8..87fd6745 100644 --- a/AppImage/messages/es/common.json +++ b/AppImage/messages/es/common.json @@ -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": { diff --git a/AppImage/messages/fr/common.json b/AppImage/messages/fr/common.json index cab8ceb7..d59342d0 100644 --- a/AppImage/messages/fr/common.json +++ b/AppImage/messages/fr/common.json @@ -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": { diff --git a/AppImage/messages/it/common.json b/AppImage/messages/it/common.json index 674abffb..6e2fb22d 100644 --- a/AppImage/messages/it/common.json +++ b/AppImage/messages/it/common.json @@ -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": { diff --git a/AppImage/messages/pt/common.json b/AppImage/messages/pt/common.json index 59576ea6..3d27baa0 100644 --- a/AppImage/messages/pt/common.json +++ b/AppImage/messages/pt/common.json @@ -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": { diff --git a/AppImage/messages/sk/common.json b/AppImage/messages/sk/common.json index 5bb94b5f..8ea8883e 100644 --- a/AppImage/messages/sk/common.json +++ b/AppImage/messages/sk/common.json @@ -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": { diff --git a/AppImage/messages/sv/common.json b/AppImage/messages/sv/common.json index 459f7448..5724e69b 100644 --- a/AppImage/messages/sv/common.json +++ b/AppImage/messages/sv/common.json @@ -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": { diff --git a/install_proxmenux.sh b/install_proxmenux.sh index 1342af03..87051211 100755 --- a/install_proxmenux.sh +++ b/install_proxmenux.sh @@ -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." diff --git a/install_proxmenux_beta.sh b/install_proxmenux_beta.sh index 1872e2d4..1c23c5ac 100644 --- a/install_proxmenux_beta.sh +++ b/install_proxmenux_beta.sh @@ -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 diff --git a/scripts/global/common-functions.sh b/scripts/global/common-functions.sh index 6f334b13..ecccc046 100644 --- a/scripts/global/common-functions.sh +++ b/scripts/global/common-functions.sh @@ -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")" diff --git a/scripts/global/pci_passthrough_helpers.sh b/scripts/global/pci_passthrough_helpers.sh index 3ef69779..60b45630 100644 --- a/scripts/global/pci_passthrough_helpers.sh +++ b/scripts/global/pci_passthrough_helpers.sh @@ -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 diff --git a/scripts/global/pmx_journal.sh b/scripts/global/pmx_journal.sh index 9eb1af03..c48994d2 100644 --- a/scripts/global/pmx_journal.sh +++ b/scripts/global/pmx_journal.sh @@ -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 diff --git a/scripts/global/update-pve8.sh b/scripts/global/update-pve8.sh index d108c80f..1089ba0d 100644 --- a/scripts/global/update-pve8.sh +++ b/scripts/global/update-pve8.sh @@ -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")" diff --git a/scripts/global/update-pve9_2.sh b/scripts/global/update-pve9_2.sh index cf04de12..05e13e0c 100644 --- a/scripts/global/update-pve9_2.sh +++ b/scripts/global/update-pve9_2.sh @@ -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/.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")" diff --git a/scripts/global/utils-install-functions.sh b/scripts/global/utils-install-functions.sh index 5bffd85b..7e9839a4 100644 --- a/scripts/global/utils-install-functions.sh +++ b/scripts/global/utils-install-functions.sh @@ -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 diff --git a/scripts/menus/network_menu.sh b/scripts/menus/network_menu.sh index 50e84ee9..8b4bfa79 100644 --- a/scripts/menus/network_menu.sh +++ b/scripts/menus/network_menu.sh @@ -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 diff --git a/scripts/post_install/auto_post_install.sh b/scripts/post_install/auto_post_install.sh index 97a6ddef..5fc3bfd8 100644 --- a/scripts/post_install/auto_post_install.sh +++ b/scripts/post_install/auto_post_install.sh @@ -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 diff --git a/scripts/post_install/customizable_post_install.sh b/scripts/post_install/customizable_post_install.sh index 230f04ae..7aaf2ecc 100644 --- a/scripts/post_install/customizable_post_install.sh +++ b/scripts/post_install/customizable_post_install.sh @@ -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