mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-09-14 18:56:52 +00:00
eep only package-changing executions and clean up entry presentation
This commit is contained in:
@@ -78,6 +78,7 @@ function operationLabelKey(change: { operation: string; capture: string }): stri
|
|||||||
function undoKey(change: { revert: string; exactness: string }): string {
|
function undoKey(change: { revert: string; exactness: string }): string {
|
||||||
if (change.revert === "remove") return "undo.remove"
|
if (change.revert === "remove") return "undo.remove"
|
||||||
if (change.revert === "restore" && change.exactness === "exact") return "undo.restore"
|
if (change.revert === "restore" && change.exactness === "exact") return "undo.restore"
|
||||||
|
if (change.revert === "purge") return "undo.purge"
|
||||||
return `exactness.${change.exactness}`
|
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…).
|
// else is a general host script (nvidia/tpu installers, PVE update, vfio…).
|
||||||
const POST_INSTALL_SOURCES = new Set(["auto", "customizable"])
|
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
|
// Which of the three sections a change belongs to: installations are their
|
||||||
// own block, post-install optimizations another, general scripts the rest.
|
// own block, post-install optimizations another, general scripts the rest.
|
||||||
function blockOf(c: { class: string; source: string }): "installs" | "postInstall" | "scripts" {
|
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
|
// install sections group by the script that made the change, and show
|
||||||
// that script's name — not a per-function label.
|
// that script's name — not a per-function label.
|
||||||
const key = b === "postInstall" ? (c.function || c.source || "—") : (c.source || c.function || "—")
|
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: [] }
|
const g = target.get(key) || { key, label, version: "", last: 0, items: [] }
|
||||||
g.items.push(c)
|
g.items.push(c)
|
||||||
if (c.recorded_at > g.last) g.last = c.recorded_at
|
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)
|
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) }
|
return { post: sort(post), scripts: sort(scripts), installs: sort(installs) }
|
||||||
}, [changes])
|
}, [changes, t])
|
||||||
|
|
||||||
const when = (epoch: number) => new Date(epoch * 1000).toLocaleString(language)
|
const when = (epoch: number) => new Date(epoch * 1000).toLocaleString(language)
|
||||||
|
|
||||||
|
|||||||
@@ -5877,7 +5877,7 @@
|
|||||||
"failed": "Das Änderungsjournal war nicht lesbar",
|
"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.",
|
"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.",
|
"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",
|
"byFunction": "Nach Funktion",
|
||||||
"count": "{count} Änderungen",
|
"count": "{count} Änderungen",
|
||||||
"function": "Funktion",
|
"function": "Funktion",
|
||||||
@@ -5924,12 +5924,16 @@
|
|||||||
},
|
},
|
||||||
"undo": {
|
"undo": {
|
||||||
"remove": "Löscht die Datei (vorher war keine vorhanden)",
|
"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": {
|
"section": {
|
||||||
"postInstall": "Post-Install-Optimierungen",
|
"postInstall": "Post-Install-Optimierungen",
|
||||||
"scripts": "ProxMenux-Skripte",
|
"scripts": "ProxMenux-Skripte",
|
||||||
"installs": "Installierte Pakete und Werkzeuge"
|
"installs": "Installierte Pakete und Werkzeuge"
|
||||||
|
},
|
||||||
|
"scriptLabel": {
|
||||||
|
"install_proxmenux": "ProxMenux-Installer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"comparison": {
|
"comparison": {
|
||||||
|
|||||||
@@ -5943,7 +5943,7 @@
|
|||||||
"failed": "The change journal could not be read",
|
"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.",
|
"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.",
|
"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",
|
"byFunction": "By function",
|
||||||
"count": "{count} changes",
|
"count": "{count} changes",
|
||||||
"function": "Function",
|
"function": "Function",
|
||||||
@@ -5990,12 +5990,16 @@
|
|||||||
},
|
},
|
||||||
"undo": {
|
"undo": {
|
||||||
"remove": "Deletes the file (there was none before)",
|
"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": {
|
"section": {
|
||||||
"postInstall": "Post-install optimizations",
|
"postInstall": "Post-install optimizations",
|
||||||
"scripts": "ProxMenux scripts",
|
"scripts": "ProxMenux scripts",
|
||||||
"installs": "Installed packages and utilities"
|
"installs": "Installed packages and utilities"
|
||||||
|
},
|
||||||
|
"scriptLabel": {
|
||||||
|
"install_proxmenux": "ProxMenux installer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"comparison": {
|
"comparison": {
|
||||||
|
|||||||
@@ -5877,7 +5877,7 @@
|
|||||||
"failed": "No se ha podido leer el registro de cambios",
|
"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.",
|
"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.",
|
"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",
|
"byFunction": "Por función",
|
||||||
"count": "{count} cambios",
|
"count": "{count} cambios",
|
||||||
"function": "Función",
|
"function": "Función",
|
||||||
@@ -5924,12 +5924,16 @@
|
|||||||
},
|
},
|
||||||
"undo": {
|
"undo": {
|
||||||
"remove": "Elimina el fichero (no había ninguno antes)",
|
"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": {
|
"section": {
|
||||||
"postInstall": "Optimizaciones de post-install",
|
"postInstall": "Optimizaciones de post-install",
|
||||||
"scripts": "Scripts de ProxMenux",
|
"scripts": "Scripts de ProxMenux",
|
||||||
"installs": "Paquetes y utilidades instalados"
|
"installs": "Paquetes y utilidades instalados"
|
||||||
|
},
|
||||||
|
"scriptLabel": {
|
||||||
|
"install_proxmenux": "Instalador de ProxMenux"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"comparison": {
|
"comparison": {
|
||||||
|
|||||||
@@ -5877,7 +5877,7 @@
|
|||||||
"failed": "Le journal des modifications n'a pas pu être lu",
|
"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.",
|
"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.",
|
"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",
|
"byFunction": "Par fonction",
|
||||||
"count": "{count} modifications",
|
"count": "{count} modifications",
|
||||||
"function": "Fonction",
|
"function": "Fonction",
|
||||||
@@ -5924,12 +5924,16 @@
|
|||||||
},
|
},
|
||||||
"undo": {
|
"undo": {
|
||||||
"remove": "Supprime le fichier (il n'y en avait aucun avant)",
|
"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": {
|
"section": {
|
||||||
"postInstall": "Optimisations post-installation",
|
"postInstall": "Optimisations post-installation",
|
||||||
"scripts": "Scripts ProxMenux",
|
"scripts": "Scripts ProxMenux",
|
||||||
"installs": "Paquets et utilitaires installés"
|
"installs": "Paquets et utilitaires installés"
|
||||||
|
},
|
||||||
|
"scriptLabel": {
|
||||||
|
"install_proxmenux": "Programme d'installation de ProxMenux"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"comparison": {
|
"comparison": {
|
||||||
|
|||||||
@@ -5877,7 +5877,7 @@
|
|||||||
"failed": "Non è stato possibile leggere il registro delle modifiche",
|
"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.",
|
"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.",
|
"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",
|
"byFunction": "Per funzione",
|
||||||
"count": "{count} modifiche",
|
"count": "{count} modifiche",
|
||||||
"function": "Funzione",
|
"function": "Funzione",
|
||||||
@@ -5924,12 +5924,16 @@
|
|||||||
},
|
},
|
||||||
"undo": {
|
"undo": {
|
||||||
"remove": "Elimina il file (prima non ce n'era nessuno)",
|
"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": {
|
"section": {
|
||||||
"postInstall": "Ottimizzazioni post-installazione",
|
"postInstall": "Ottimizzazioni post-installazione",
|
||||||
"scripts": "Script di ProxMenux",
|
"scripts": "Script di ProxMenux",
|
||||||
"installs": "Pacchetti e utilità installati"
|
"installs": "Pacchetti e utilità installati"
|
||||||
|
},
|
||||||
|
"scriptLabel": {
|
||||||
|
"install_proxmenux": "Installer di ProxMenux"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"comparison": {
|
"comparison": {
|
||||||
|
|||||||
@@ -5877,7 +5877,7 @@
|
|||||||
"failed": "Não foi possível ler o registo de alterações",
|
"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.",
|
"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.",
|
"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",
|
"byFunction": "Por função",
|
||||||
"count": "{count} alterações",
|
"count": "{count} alterações",
|
||||||
"function": "Função",
|
"function": "Função",
|
||||||
@@ -5924,12 +5924,16 @@
|
|||||||
},
|
},
|
||||||
"undo": {
|
"undo": {
|
||||||
"remove": "Elimina o ficheiro (não existia nenhum antes)",
|
"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": {
|
"section": {
|
||||||
"postInstall": "Otimizações pós-instalação",
|
"postInstall": "Otimizações pós-instalação",
|
||||||
"scripts": "Scripts do ProxMenux",
|
"scripts": "Scripts do ProxMenux",
|
||||||
"installs": "Pacotes e utilitários instalados"
|
"installs": "Pacotes e utilitários instalados"
|
||||||
|
},
|
||||||
|
"scriptLabel": {
|
||||||
|
"install_proxmenux": "Instalador do ProxMenux"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"comparison": {
|
"comparison": {
|
||||||
|
|||||||
@@ -5943,7 +5943,7 @@
|
|||||||
"failed": "Denník zmien sa nepodarilo prečítať",
|
"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.",
|
"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é.",
|
"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",
|
"byFunction": "Podľa funkcie",
|
||||||
"count": "{count} zmien",
|
"count": "{count} zmien",
|
||||||
"function": "Funkcia",
|
"function": "Funkcia",
|
||||||
@@ -5990,12 +5990,16 @@
|
|||||||
},
|
},
|
||||||
"undo": {
|
"undo": {
|
||||||
"remove": "Odstráni súbor (predtým žiadny nebol)",
|
"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": {
|
"section": {
|
||||||
"postInstall": "Optimalizácie po inštalácii",
|
"postInstall": "Optimalizácie po inštalácii",
|
||||||
"scripts": "Skripty ProxMenux",
|
"scripts": "Skripty ProxMenux",
|
||||||
"installs": "Nainštalované balíky a nástroje"
|
"installs": "Nainštalované balíky a nástroje"
|
||||||
|
},
|
||||||
|
"scriptLabel": {
|
||||||
|
"install_proxmenux": "Inštalátor ProxMenux"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"comparison": {
|
"comparison": {
|
||||||
|
|||||||
@@ -5878,7 +5878,7 @@
|
|||||||
"failed": "Ändringsjournalen kunde inte läsas",
|
"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.",
|
"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.",
|
"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",
|
"byFunction": "Per funktion",
|
||||||
"count": "{count} ändringar",
|
"count": "{count} ändringar",
|
||||||
"function": "Funktion",
|
"function": "Funktion",
|
||||||
@@ -5925,12 +5925,16 @@
|
|||||||
},
|
},
|
||||||
"undo": {
|
"undo": {
|
||||||
"remove": "Tar bort filen (det fanns ingen tidigare)",
|
"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": {
|
"section": {
|
||||||
"postInstall": "Optimeringar efter installation",
|
"postInstall": "Optimeringar efter installation",
|
||||||
"scripts": "ProxMenux-skript",
|
"scripts": "ProxMenux-skript",
|
||||||
"installs": "Installerade paket och verktyg"
|
"installs": "Installerade paket och verktyg"
|
||||||
|
},
|
||||||
|
"scriptLabel": {
|
||||||
|
"install_proxmenux": "ProxMenux-installerare"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"comparison": {
|
"comparison": {
|
||||||
|
|||||||
@@ -844,8 +844,8 @@ install_normal_version() {
|
|||||||
if [ -f "$BASE_DIR/scripts/global/pmx_journal.sh" ]; then
|
if [ -f "$BASE_DIR/scripts/global/pmx_journal.sh" ]; then
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
source "$BASE_DIR/scripts/global/pmx_journal.sh"
|
source "$BASE_DIR/scripts/global/pmx_journal.sh"
|
||||||
pmx_journal_context "install_proxmenux" "1.0"
|
pmx_journal_context "install_proxmenux" "1.0" "install_proxmenux"
|
||||||
pmx_record_applied "dialog, jq, curl, git" "1.0" "install_dependencies"
|
pmx_record_install "dialog jq curl git" "1.0"
|
||||||
fi
|
fi
|
||||||
chmod +x "$BASE_DIR/install_proxmenux.sh"
|
chmod +x "$BASE_DIR/install_proxmenux.sh"
|
||||||
msg_ok "Necessary files created."
|
msg_ok "Necessary files created."
|
||||||
|
|||||||
@@ -734,8 +734,8 @@ install_beta() {
|
|||||||
if [ -f "$BASE_DIR/scripts/global/pmx_journal.sh" ]; then
|
if [ -f "$BASE_DIR/scripts/global/pmx_journal.sh" ]; then
|
||||||
# shellcheck source=/dev/null
|
# shellcheck source=/dev/null
|
||||||
source "$BASE_DIR/scripts/global/pmx_journal.sh"
|
source "$BASE_DIR/scripts/global/pmx_journal.sh"
|
||||||
pmx_journal_context "install_proxmenux" "1.0"
|
pmx_journal_context "install_proxmenux" "1.0" "install_proxmenux"
|
||||||
pmx_record_applied "dialog, jq, curl, git" "1.0" "install_dependencies"
|
pmx_record_install "dialog jq curl git" "1.0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d "./oci" ]; then
|
if [ -d "./oci" ]; then
|
||||||
|
|||||||
@@ -254,7 +254,6 @@ cleanup_duplicate_repos_pve9() {
|
|||||||
|
|
||||||
if [ $cleaned_count -gt 0 ]; then
|
if [ $cleaned_count -gt 0 ]; then
|
||||||
msg_ok "$(translate "Cleaned up $cleaned_count duplicate/old repositories")"
|
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
|
apt-get update > /dev/null 2>&1 || true
|
||||||
else
|
else
|
||||||
msg_ok "$(translate "No duplicate repositories found")"
|
msg_ok "$(translate "No duplicate repositories found")"
|
||||||
@@ -335,7 +334,6 @@ cleanup_duplicate_repos_pve9_() {
|
|||||||
|
|
||||||
if [ $cleaned_count -gt 0 ]; then
|
if [ $cleaned_count -gt 0 ]; then
|
||||||
msg_ok "$(translate "Cleaned up $cleaned_count duplicate/old repositories")"
|
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
|
apt-get update > /dev/null 2>&1 || true
|
||||||
else
|
else
|
||||||
msg_ok "$(translate "No duplicate repositories found")"
|
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
|
chown --reference="$udev_disabled" "$udev_rules" 2>/dev/null || true
|
||||||
pmx_remove_file "$udev_disabled" || true
|
pmx_remove_file "$udev_disabled" || true
|
||||||
fi
|
fi
|
||||||
pmx_record_execution "Reload udev rules" "udevadm control --reload-rules"
|
|
||||||
udevadm control --reload-rules >/dev/null 2>&1 || true
|
udevadm control --reload-rules >/dev/null 2>&1 || true
|
||||||
changed=true
|
changed=true
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -405,6 +405,20 @@ pmx_record_execution() {
|
|||||||
# changed — the state before it ran is not knowable. Used by the
|
# changed — the state before it ran is not knowable. Used by the
|
||||||
# registration path so a host carries an honest account of what was
|
# registration path so a host carries an honest account of what was
|
||||||
# applied before the journal existed.
|
# 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() {
|
pmx_record_applied() {
|
||||||
local tool="$1" version="$2" state="${3:-applied}"
|
local tool="$1" version="$2" state="${3:-applied}"
|
||||||
local -a fields
|
local -a fields
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ EOF
|
|||||||
cleanup_duplicate_repos
|
cleanup_duplicate_repos
|
||||||
|
|
||||||
msg_info "$(translate "Updating package lists...")"
|
msg_info "$(translate "Updating package lists...")"
|
||||||
pmx_record_execution "Update package lists" "apt-get update"
|
|
||||||
if apt-get update > "$log_file" 2>&1; then
|
if apt-get update > "$log_file" 2>&1; then
|
||||||
msg_ok "$(translate "Package lists updated successfully")"
|
msg_ok "$(translate "Package lists updated successfully")"
|
||||||
else
|
else
|
||||||
@@ -168,14 +167,12 @@ EOF
|
|||||||
msg_info2 "$(translate "Update cancelled by user")"
|
msg_info2 "$(translate "Update cancelled by user")"
|
||||||
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
||||||
apt-get -y autoremove > /dev/null 2>&1 || true
|
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
|
apt-get -y autoclean > /dev/null 2>&1 || true
|
||||||
return 0
|
return 0
|
||||||
elif [[ $MENU_RESULT -eq 2 ]]; then
|
elif [[ $MENU_RESULT -eq 2 ]]; then
|
||||||
msg_ok "$(translate "System is already up to date. No update needed.")"
|
msg_ok "$(translate "System is already up to date. No update needed.")"
|
||||||
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
||||||
apt-get -y autoremove > /dev/null 2>&1 || true
|
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
|
apt-get -y autoclean > /dev/null 2>&1 || true
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -273,7 +270,6 @@ EOF
|
|||||||
msg_info "$(translate "Performing system cleanup...")"
|
msg_info "$(translate "Performing system cleanup...")"
|
||||||
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
||||||
apt-get -y autoremove > /dev/null 2>&1 || true
|
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
|
apt-get -y autoclean > /dev/null 2>&1 || true
|
||||||
msg_ok "$(translate "Cleanup finished")"
|
msg_ok "$(translate "Cleanup finished")"
|
||||||
|
|
||||||
|
|||||||
@@ -164,7 +164,6 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# UPDATE: no progress bar here (dpkg is not involved); capture output to parse errors
|
# 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_output=$(apt-get update 2>&1)
|
||||||
update_exit_code=$?
|
update_exit_code=$?
|
||||||
|
|
||||||
@@ -182,25 +181,21 @@ EOF
|
|||||||
|
|
||||||
if command -v gpg >/dev/null 2>&1; then
|
if command -v gpg >/dev/null 2>&1; then
|
||||||
# Modern approach: receive -> export -> dearmor into /etc/apt/keyrings/<KEY>.gpg
|
# 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" \
|
if gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" \
|
||||||
&& gpg --batch --export "$key" | gpg --dearmor -o "/etc/apt/keyrings/${key}.gpg"; then
|
&& gpg --batch --export "$key" | gpg --dearmor -o "/etc/apt/keyrings/${key}.gpg"; then
|
||||||
msg_ok "$(translate "Imported missing GPG key: $key")"
|
msg_ok "$(translate "Imported missing GPG key: $key")"
|
||||||
else
|
else
|
||||||
msg_warn "$(translate "Keyrings method failed; trying apt-key fallback")"
|
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
|
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "$key" >/dev/null 2>&1 || true
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Fallback for minimal systems without gpg installed
|
# Fallback for minimal systems without gpg installed
|
||||||
msg_warn "$(translate "gpg not found; trying apt-key fallback")"
|
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
|
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys "$key" >/dev/null 2>&1 || true
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Retry update after importing the key
|
# 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
|
if apt-get update > "$log_file" 2>&1; then
|
||||||
msg_ok "$(translate "Package lists updated after GPG fix")" | tee -a "$screen_capture"
|
msg_ok "$(translate "Package lists updated after GPG fix")" | tee -a "$screen_capture"
|
||||||
else
|
else
|
||||||
@@ -282,7 +277,6 @@ EOF
|
|||||||
msg_info2 "$(translate "Update cancelled by user")"
|
msg_info2 "$(translate "Update cancelled by user")"
|
||||||
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
||||||
apt-get -y autoremove > /dev/null 2>&1 || true
|
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
|
apt-get -y autoclean > /dev/null 2>&1 || true
|
||||||
rm -f "$screen_capture"
|
rm -f "$screen_capture"
|
||||||
return 0
|
return 0
|
||||||
@@ -290,7 +284,6 @@ EOF
|
|||||||
msg_ok "$(translate "System is already up to date. No update needed.")"
|
msg_ok "$(translate "System is already up to date. No update needed.")"
|
||||||
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
||||||
apt-get -y autoremove > /dev/null 2>&1 || true
|
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
|
apt-get -y autoclean > /dev/null 2>&1 || true
|
||||||
rm -f "$screen_capture"
|
rm -f "$screen_capture"
|
||||||
return 0
|
return 0
|
||||||
@@ -341,7 +334,6 @@ EOF
|
|||||||
|
|
||||||
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
pmx_record_execution "Remove unused packages" "apt-get -y autoremove"
|
||||||
apt-get -y autoremove > /dev/null 2>&1 || true
|
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
|
apt-get -y autoclean > /dev/null 2>&1 || true
|
||||||
msg_ok "$(translate "Cleanup finished")"
|
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
|
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...")"
|
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
|
apt-get update >/dev/null 2>&1 || apt-get update
|
||||||
# Spinner pair: msg_info must be closed before returning.
|
# Spinner pair: msg_info must be closed before returning.
|
||||||
# Without this the next `msg_info` caller spawns a second
|
# Without this the next `msg_info` caller spawns a second
|
||||||
|
|||||||
@@ -525,7 +525,6 @@ guided_bridge_repair() {
|
|||||||
clear
|
clear
|
||||||
msg_info "$(translate "Restarting network service...")"
|
msg_info "$(translate "Restarting network service...")"
|
||||||
|
|
||||||
pmx_record_execution "Restart networking service" "systemctl restart networking"
|
|
||||||
if systemctl restart networking; then
|
if systemctl restart networking; then
|
||||||
msg_ok "$(translate "Network service restarted successfully")"
|
msg_ok "$(translate "Network service restarted successfully")"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -175,8 +175,7 @@ remove_subscription_banner() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
kill -TERM "$SPINNER_PID" 2>/dev/null
|
stop_spinner
|
||||||
sleep 1
|
|
||||||
|
|
||||||
if [[ "$pve_version" -ge 9 ]]; then
|
if [[ "$pve_version" -ge 9 ]]; then
|
||||||
if ! whiptail --title "Proxmox VE ${pve_version} Subscription Banner Removal" \
|
if ! whiptail --title "Proxmox VE ${pve_version} Subscription Banner Removal" \
|
||||||
@@ -344,11 +343,8 @@ MaxLevelConsole=notice
|
|||||||
MaxLevelWall=crit
|
MaxLevelWall=crit
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
pmx_record_execution "Restart systemd-journald" "systemctl restart systemd-journald.service"
|
|
||||||
systemctl restart systemd-journald.service > /dev/null 2>&1
|
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
|
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
|
journalctl --rotate > /dev/null 2>&1
|
||||||
|
|
||||||
msg_ok "$(translate "Journald optimized - Max size: 64M")"
|
msg_ok "$(translate "Journald optimized - Max size: 64M")"
|
||||||
@@ -380,7 +376,6 @@ create 0640 root adm
|
|||||||
copytruncate
|
copytruncate
|
||||||
include /etc/logrotate.d
|
include /etc/logrotate.d
|
||||||
EOF
|
EOF
|
||||||
pmx_record_execution "Restart logrotate" "systemctl restart logrotate"
|
|
||||||
systemctl restart logrotate > /dev/null 2>&1
|
systemctl restart logrotate > /dev/null 2>&1
|
||||||
|
|
||||||
msg_ok "$(translate "Logrotate optimization completed")"
|
msg_ok "$(translate "Logrotate optimization completed")"
|
||||||
@@ -574,7 +569,6 @@ net.ipv4.tcp_wmem = 8192 65536 16777216
|
|||||||
net.unix.max_dgram_qlen = 4096
|
net.unix.max_dgram_qlen = 4096
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
pmx_record_execution "Apply network sysctl configuration" "sysctl --system"
|
|
||||||
sysctl --system > /dev/null 2>&1
|
sysctl --system > /dev/null 2>&1
|
||||||
|
|
||||||
pmx_write_file /usr/local/sbin/proxmenux-fwbr-tune <<'EOF'
|
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
|
chmod 0644 /etc/udev/rules.d/99-proxmenux-fwbr-tune.rules
|
||||||
chown root:root /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
|
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
|
udevadm control --reload-rules >/dev/null 2>&1 || true
|
||||||
pmx_enable_service proxmenux-fwbr-tune.service || 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
|
/usr/local/sbin/proxmenux-fwbr-tune >/dev/null 2>&1 || true
|
||||||
|
|
||||||
|
|
||||||
@@ -1049,9 +1040,8 @@ install_log2ram_auto() {
|
|||||||
if [[ "$is_ssd" == true ]]; then
|
if [[ "$is_ssd" == true ]]; then
|
||||||
msg_ok "$(translate "System disk is SSD or M.2. Proceeding with Log2RAM setup.")"
|
msg_ok "$(translate "System disk is SSD or M.2. Proceeding with Log2RAM setup.")"
|
||||||
else
|
else
|
||||||
kill -TERM "$SPINNER_PID" 2>/dev/null
|
stop_spinner
|
||||||
sleep 1
|
if whiptail --yesno "$(translate "Do you want to install Log2RAM to reduce log write load?")" 10 70 --title "Log2RAM"; then
|
||||||
if whiptail --yesno "$(translate "Do you want to install Log2RAM anyway 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.")"
|
msg_ok "$(translate "Proceeding with Log2RAM setup on non-SSD disk as requested by user.")"
|
||||||
else
|
else
|
||||||
msg_info2 "$(translate "Log2RAM installation cancelled by user")"
|
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 /etc/systemd/system/log2ram.service.d 2>/dev/null || true
|
||||||
rm -rf /var/log.hdd /tmp/log2ram 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
|
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
|
systemctl daemon-reload >/dev/null 2>&1 || true
|
||||||
pmx_record_execution "Restart cron" "systemctl restart cron"
|
|
||||||
systemctl restart cron >/dev/null 2>&1 || true
|
systemctl restart cron >/dev/null 2>&1 || true
|
||||||
|
|
||||||
msg_ok "$(translate "Previous installation cleaned")"
|
msg_ok "$(translate "Previous installation cleaned")"
|
||||||
msg_info "$(translate "Installing Log2RAM from source...")"
|
msg_info "$(translate "Installing Log2RAM from source...")"
|
||||||
|
|
||||||
if ! command -v git >/dev/null 2>&1; then
|
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
|
apt-get update -qq >/dev/null 2>&1
|
||||||
pmx_install_pkg git
|
pmx_install_pkg git
|
||||||
fi
|
fi
|
||||||
@@ -1107,7 +1093,6 @@ install_log2ram_auto() {
|
|||||||
|
|
||||||
cd /tmp/log2ram || { msg_error "$(translate "Failed to access log2ram directory")"; return 1; }
|
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
|
if ! bash install.sh >>/tmp/log2ram_install.log 2>&1; then
|
||||||
msg_error "$(translate "Failed to run log2ram installer. Check /tmp/log2ram_install.log")"
|
msg_error "$(translate "Failed to run log2ram installer. Check /tmp/log2ram_install.log")"
|
||||||
return 1
|
return 1
|
||||||
@@ -1159,7 +1144,6 @@ EOF
|
|||||||
msg_ok "$(translate "PBS API log rotation configured (hourly, size-based)")"
|
msg_ok "$(translate "PBS API log rotation configured (hourly, size-based)")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pmx_record_execution "Reload systemd configuration" "systemctl daemon-reload"
|
|
||||||
systemctl daemon-reload >/dev/null 2>&1 || true
|
systemctl daemon-reload >/dev/null 2>&1 || true
|
||||||
|
|
||||||
if [[ -f /etc/log2ram.conf ]] && command -v log2ram >/dev/null 2>&1; then
|
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
|
chmod 0644 /etc/cron.d/log2ram-auto-sync
|
||||||
chown root:root /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
|
systemctl restart cron >/dev/null 2>&1 || true
|
||||||
msg_ok "$(translate "Auto-sync enabled when /var/log exceeds 80% of") $LOG2RAM_SIZE"
|
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 "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})"
|
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
|
systemctl daemon-reload >/dev/null 2>&1 || true
|
||||||
if ! pmx_apply_setting "service-enabled:log2ram" "systemctl is-enabled log2ram" \
|
if ! pmx_apply_setting "service-enabled:log2ram" "systemctl is-enabled log2ram" \
|
||||||
systemctl enable log2ram; then
|
systemctl enable log2ram; then
|
||||||
|
|||||||
@@ -520,7 +520,6 @@ skip_apt_languages() {
|
|||||||
echo "$default_locale UTF-8" | pmx_append_file /etc/locale.gen
|
echo "$default_locale UTF-8" | pmx_append_file /etc/locale.gen
|
||||||
fi
|
fi
|
||||||
msg_info "$(translate "Generating missing locale:") $default_locale"
|
msg_info "$(translate "Generating missing locale:") $default_locale"
|
||||||
pmx_record_execution "Generate locale" "locale-gen $default_locale"
|
|
||||||
locale-gen "$default_locale"
|
locale-gen "$default_locale"
|
||||||
msg_ok "$(translate "Locale generated")"
|
msg_ok "$(translate "Locale generated")"
|
||||||
fi
|
fi
|
||||||
@@ -595,7 +594,6 @@ configure_time_sync() {
|
|||||||
msg_ok "$(translate "Time settings configured - Timezone:") $timezone"
|
msg_ok "$(translate "Time settings configured - Timezone:") $timezone"
|
||||||
register_tool "time_sync" true "$FUNC_VERSION"
|
register_tool "time_sync" true "$FUNC_VERSION"
|
||||||
|
|
||||||
pmx_record_execution "Restart Postfix" "systemctl restart postfix"
|
|
||||||
systemctl restart postfix 2>/dev/null || true
|
systemctl restart postfix 2>/dev/null || true
|
||||||
else
|
else
|
||||||
msg_warn "$(translate "Failed to enable automatic time synchronization")"
|
msg_warn "$(translate "Failed to enable automatic time synchronization")"
|
||||||
@@ -707,7 +705,6 @@ apply_amd_fixes() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v proxmox-boot-tool >/dev/null 2>&1; then
|
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 && \
|
proxmox-boot-tool refresh >/dev/null 2>&1 && \
|
||||||
msg_ok "$(translate "proxmox-boot-tool refreshed")" || \
|
msg_ok "$(translate "proxmox-boot-tool refreshed")" || \
|
||||||
msg_warn "$(translate "Failed to refresh proxmox-boot-tool")"
|
msg_warn "$(translate "Failed to refresh proxmox-boot-tool")"
|
||||||
@@ -728,7 +725,6 @@ apply_amd_fixes() {
|
|||||||
else
|
else
|
||||||
msg_ok "$(translate "'$added_param' already present in GRUB_CMDLINE_LINUX_DEFAULT")"
|
msg_ok "$(translate "'$added_param' already present in GRUB_CMDLINE_LINUX_DEFAULT")"
|
||||||
fi
|
fi
|
||||||
pmx_record_execution "Regenerate GRUB configuration" "update-grub"
|
|
||||||
update-grub >/dev/null 2>&1 && \
|
update-grub >/dev/null 2>&1 && \
|
||||||
msg_ok "$(translate "GRUB configuration updated")" || \
|
msg_ok "$(translate "GRUB configuration updated")" || \
|
||||||
msg_warn "$(translate "Failed to update GRUB")"
|
msg_warn "$(translate "Failed to update GRUB")"
|
||||||
@@ -867,7 +863,6 @@ net.unix.max_dgram_qlen = 4096
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
pmx_record_execution "Apply network sysctl configuration" "sysctl --system"
|
|
||||||
sysctl --system > /dev/null 2>&1
|
sysctl --system > /dev/null 2>&1
|
||||||
|
|
||||||
pmx_write_file /usr/local/sbin/proxmenux-fwbr-tune <<'EOF'
|
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
|
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
|
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
|
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
|
udevadm control --reload-rules >/dev/null 2>&1 || true
|
||||||
pmx_enable_service proxmenux-fwbr-tune.service || 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
|
/usr/local/sbin/proxmenux-fwbr-tune >/dev/null 2>&1 || true
|
||||||
|
|
||||||
|
|
||||||
@@ -1039,7 +1031,6 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Apply changes
|
# Apply changes
|
||||||
pmx_record_execution "Apply sysctl configuration" "sysctl --system"
|
|
||||||
sysctl --system > /dev/null 2>&1
|
sysctl --system > /dev/null 2>&1
|
||||||
|
|
||||||
if [ "$reboot_needed" -eq 1 ]; then
|
if [ "$reboot_needed" -eq 1 ]; then
|
||||||
@@ -1135,7 +1126,6 @@ EOF
|
|||||||
|
|
||||||
msg_info "$(translate "Updating package lists...")"
|
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_output=$(apt-get update 2>&1)
|
||||||
update_exit_code=$?
|
update_exit_code=$?
|
||||||
|
|
||||||
@@ -1964,14 +1954,11 @@ enable_vfio_iommu() {
|
|||||||
|
|
||||||
# Update initramfs and bootloader
|
# Update initramfs and bootloader
|
||||||
msg_info "$(translate "Updating initramfs, GRUB, and EFI boot, patience...")"
|
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
|
update-initramfs -u -k all > /dev/null 2>&1
|
||||||
|
|
||||||
if [[ "$uses_zfs" == true ]]; then
|
if [[ "$uses_zfs" == true ]]; then
|
||||||
pmx_record_execution "Refresh Proxmox boot configuration" "proxmox-boot-tool refresh"
|
|
||||||
proxmox-boot-tool refresh > /dev/null 2>&1
|
proxmox-boot-tool refresh > /dev/null 2>&1
|
||||||
else
|
else
|
||||||
pmx_record_execution "Regenerate GRUB configuration" "update-grub"
|
|
||||||
update-grub > /dev/null 2>&1
|
update-grub > /dev/null 2>&1
|
||||||
fi
|
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"
|
echo '{"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", "modules": []}' | pmx_write_file "$fastfetch_config"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pmx_record_execution "Generate Fastfetch configuration" "fastfetch --gen-config-force"
|
|
||||||
fastfetch --gen-config-force > /dev/null 2>&1
|
fastfetch --gen-config-force > /dev/null 2>&1
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
@@ -2752,7 +2738,6 @@ configure_fastfetch() {
|
|||||||
|
|
||||||
msg_ok "$(translate "Fastfetch now displays: System optimised by: ProxMenux")"
|
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
|
fastfetch --gen-config > /dev/null 2>&1
|
||||||
msg_ok "$(translate "Fastfetch configuration updated")"
|
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 /etc/systemd/system/log2ram.service.d 2>/dev/null || true
|
||||||
rm -rf /var/log.hdd /tmp/log2ram 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
|
systemctl daemon-reload >/dev/null 2>&1 || true
|
||||||
pmx_record_execution "Restart cron" "systemctl restart cron"
|
|
||||||
systemctl restart cron >/dev/null 2>&1 || true
|
systemctl restart cron >/dev/null 2>&1 || true
|
||||||
msg_ok "$(translate "Previous installation cleaned")"
|
msg_ok "$(translate "Previous installation cleaned")"
|
||||||
|
|
||||||
@@ -3165,7 +3148,6 @@ configure_log2ram() {
|
|||||||
msg_info "$(translate "Installing Log2RAM from GitHub...")"
|
msg_info "$(translate "Installing Log2RAM from GitHub...")"
|
||||||
if ! command -v git >/dev/null 2>&1; then
|
if ! command -v git >/dev/null 2>&1; then
|
||||||
msg_info "$(translate "Installing required package: git")"
|
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
|
apt-get update -qq >/dev/null 2>&1
|
||||||
pmx_install_pkg git
|
pmx_install_pkg git
|
||||||
fi
|
fi
|
||||||
@@ -3178,7 +3160,6 @@ configure_log2ram() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cd /tmp/log2ram || { msg_error "$(translate "Failed to access log2ram directory")"; return 1; }
|
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
|
if ! bash install.sh >>/tmp/log2ram_install.log 2>&1; then
|
||||||
msg_error "$(translate "Failed to run log2ram installer. Check /tmp/log2ram_install.log")"
|
msg_error "$(translate "Failed to run log2ram installer. Check /tmp/log2ram_install.log")"
|
||||||
return 1
|
return 1
|
||||||
@@ -3230,7 +3211,6 @@ EOF
|
|||||||
msg_ok "$(translate "PBS API log rotation configured (hourly, size-based)")"
|
msg_ok "$(translate "PBS API log rotation configured (hourly, size-based)")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pmx_record_execution "Reload systemd configuration" "systemctl daemon-reload"
|
|
||||||
systemctl daemon-reload >/dev/null 2>&1 || true
|
systemctl daemon-reload >/dev/null 2>&1 || true
|
||||||
|
|
||||||
if [[ -f /etc/log2ram.conf ]] && command -v log2ram >/dev/null 2>&1; then
|
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
|
chown -R www-data:www-data /var/log.hdd/pveproxy
|
||||||
chmod 0750 /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
|
systemctl restart cron >/dev/null 2>&1 || true
|
||||||
if ! pmx_apply_setting "service-enabled:log2ram" "systemctl is-enabled log2ram" \
|
if ! pmx_apply_setting "service-enabled:log2ram" "systemctl is-enabled log2ram" \
|
||||||
systemctl enable log2ram; then
|
systemctl enable log2ram; then
|
||||||
|
|||||||
Reference in New Issue
Block a user