feat(maintenance): Sprachwahl Deutsch/Englisch bei der Installation (gestapelt auf #50) (#51)

* feat(maintenance): German/English display language, chosen at installation

German source text is the catalog key and English comes from catalog_en.py, so a
missing entry falls back to German. The installer asks 'Language / Sprache' in a
terminal or takes --lang de|en and stores the choice in /etc/pman/language;
PMAN_LANG overrides it per run. Persisted source-check statuses stay language
neutral and are translated on display. Tests check catalog completeness,
placeholder parity, the installer flow (including the interactive prompt) and
English golden snapshots. Module version 1.0.5.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(maintenance): parenthesise the 'last checked' fallback in the source report

The stored check time was concatenated before the 'or' fallback, so an empty
state raised TypeError instead of showing 'not checked yet'. Regression test
covers both languages.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(installer): avoid A && B || C in the language handling (SC2015)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(installer): validate the language file directory before install, rollback and removal

A staged uninstall followed an etc/pman symlink and deleted a language file
outside --destdir. The directory chain is now checked with the other
destinations before any operation.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
==TIM.©.B ==andClaude Sonnet 5.5 authored and GitHub committed 2026-11-07 01:07:21 +01:00
1 parent 3c971f8a0a
commit c9168107c8
45 files changed
+2300 -307

No files matched your search

+8
View File
@@ -29,6 +29,14 @@ Versions follow [Semantic Versioning](https://semver.org/).
## [Unreleased]
### Maintenance module 1.0.5
- Add a display language choice: German (default) or English. The installer asks
`Language / Sprache [de/en]` in a terminal or takes `--lang de|en`, stores it in
`/etc/pman/language` and keeps it on upgrades; `PMAN_LANG=de|en` overrides it per
run. All screens, messages, CLI help and diagnostic reports are translated; a
completeness test fails when a text lacks an English entry.
### Maintenance module 1.0.4
- Rework the Community Scripts menu: the source is named as **Proxmox VE
+5
View File
@@ -34,6 +34,11 @@ Terminal standardmäßig nur den Kern. Zur ausdrücklichen Installation des Modu
pman --maintenance
```
Die Oberfläche gibt es auf Deutsch (Standard) und Englisch. Im Terminal fragt der
Installer zuerst (`Language / Sprache [de/en]`); ohne Terminal gibst du
`--lang en` oder `--lang de` an. Die Wahl steht in `/etc/pman/language` und bleibt bei
Updates erhalten; `PMAN_LANG=en pman --maintenance` überschreibt sie für einen Lauf.
Der Installer installiert keine zusätzlichen APT-Pakete. Für die Oberfläche ist
Python 3.9 oder neuer mit `curses` sowie ein UTF-8-Terminal erforderlich.
+5
View File
@@ -226,6 +226,11 @@ packages such as `virt-viewer`, `jq` or development tools.
pman --maintenance
```
The maintenance interface speaks German (default) or English. A terminal
installation asks first (`Language / Sprache [de/en]`); without a terminal pass
`--lang en` or `--lang de`. The choice is stored in `/etc/pman/language` and kept on
upgrades; `PMAN_LANG=en pman --maintenance` overrides it for one run.
Installs an atomic, root-owned copy at `/usr/local/bin/pman` so later edits to
the checkout cannot change the privileged executable.
+8
View File
@@ -14,6 +14,14 @@ From the matching repository checkout or unpacked release bundle:
pman --maintenance
```
The display language is German (default) or English. Interactive installation asks
`Language / Sprache [de/en]` first (once; an existing choice is kept), noninteractive
installation takes `--lang de|en`. The installer writes the choice to
`/etc/pman/language` (root-owned, removed by `--uninstall-maintenance`). The
environment variable `PMAN_LANG=de|en` overrides the file for one run. Without
either, the module uses German. A text without an English translation is shown in
German instead of failing; stored source-check results stay language neutral.
Interactive installation asks about the module, defaulting to **No**. Without a
terminal, installation defaults to the core. `--without-maintenance` installs the
core and leaves an existing module alone. The installer performs no `apt` package
+30 -3
View File
@@ -7,11 +7,13 @@ WITH_MAINTENANCE=auto
TIMER=auto
ACTION=install
DESTDIR=''
UI_LANG=''
usage() {
cat <<'EOF'
Usage: ./install_dependencies.sh [--with-maintenance|--without-maintenance]
[--no-source-timer] [--uninstall-maintenance|--rollback-maintenance]
[--destdir DIRECTORY]
[--lang de|en] [--destdir DIRECTORY]
--lang sets the display language of the maintenance module (default: ask, else de).
No package installation is performed. --destdir stages files only (no services).
EOF
}
@@ -22,6 +24,14 @@ while (($#)); do
--no-source-timer) TIMER=0 ;;
--uninstall-maintenance) ACTION=uninstall ;;
--rollback-maintenance) ACTION=rollback ;;
--lang)
if (($# < 2)) || [[ "$2" != de && "$2" != en ]]; then
usage
exit 2
fi
UI_LANG="$2"
shift
;;
--destdir)
(($# >= 2)) || {
usage
@@ -76,12 +86,14 @@ secure_dir() {
base="$DESTDIR/usr/local/lib/pman/maintenance"
bin="$DESTDIR/usr/local/bin"
lang_file="$DESTDIR/etc/pman/language"
units="$DESTDIR/etc/systemd/system"
# Validate all destination chains before any install, rollback or removal.
secure_dir "$bin"
secure_dir "$units"
secure_dir "$(dirname -- "$base")"
if [[ -e "$base" || -L "$base" ]]; then secure_dir "$base"; fi
if [[ -e "$(dirname -- "$lang_file")" || -L "$(dirname -- "$lang_file")" ]]; then secure_dir "$(dirname -- "$lang_file")"; fi
atomic_file() {
local src="$1" dst="$2" mode="$3" temp
secure_dir "$(dirname -- "$dst")"
@@ -123,7 +135,7 @@ if [[ "$ACTION" == uninstall ]]; then
exit 1
}
rm -rf -- "$base"
rm -f -- "$bin/pman-maintenance" "$units/pman-maintenance-sources.service" "$units/pman-maintenance-sources.timer"
rm -f -- "$bin/pman-maintenance" "$units/pman-maintenance-sources.service" "$units/pman-maintenance-sources.timer" "$lang_file"
[[ -n "$DESTDIR" ]] || systemctl daemon-reload
echo 'Maintenance module removed; pman core, health cron and diagnostic state retained.'
exit 0
@@ -140,7 +152,16 @@ fi
if [[ "$WITH_MAINTENANCE" == auto ]]; then
WITH_MAINTENANCE=no
if [[ -t 0 && -t 1 ]]; then
read -r -p 'Speicher- und Wartungsmodul zusätzlich installieren? [j/N] ' answer
# An existing choice is kept; ask only on the first interactive installation.
if [[ -z "$UI_LANG" && ! -e "$lang_file" ]]; then
read -r -p 'Language / Sprache [de/en] (de): ' answer
if [[ "${answer,,}" == en* ]]; then UI_LANG=en; else UI_LANG=de; fi
fi
if [[ "$UI_LANG" == en ]] || [[ -z "$UI_LANG" && "$(cat -- "$lang_file" 2>/dev/null)" == en ]]; then
read -r -p 'Also install the storage and maintenance module? [y/N] ' answer
else
read -r -p 'Speicher- und Wartungsmodul zusätzlich installieren? [j/N] ' answer
fi
[[ "$answer" =~ ^[jJyY]$ ]] && WITH_MAINTENANCE=yes
fi
fi
@@ -199,6 +220,12 @@ if [[ "$WITH_MAINTENANCE" == yes ]]; then
systemctl disable --now pman-maintenance-sources.timer
fi
fi
if [[ -n "$UI_LANG" ]]; then
lang_temp=$(mktemp)
printf '%s\n' "$UI_LANG" >"$lang_temp"
atomic_file "$lang_temp" "$lang_file" 0644
rm -f -- "$lang_temp"
fi
echo 'Maintenance module installed. Disable daily metadata checks with systemctl disable --now pman-maintenance-sources.timer.'
fi
echo 'Installed pman. Existing health cron and guest settings were not changed.'
+1 -1
View File
@@ -1,3 +1,3 @@
"""Optional, local-only maintenance adapters for pman."""
VERSION = '1.0.4'
VERSION = '1.0.5'
INTERFACE = 1
+73 -72
View File
@@ -7,6 +7,7 @@ from dataclasses import dataclass
from pathlib import PurePosixPath
from .runner import CommandError
from .state import STATE, read_json, write_json
from .i18n import _
@dataclass(frozen=True)
@@ -17,13 +18,13 @@ class Context:
def __post_init__(self):
if self.scope not in ('host', 'ct', 'vm'):
raise ValueError('Ungültiger Zieltyp.')
raise ValueError(_('Ungültiger Zieltyp.'))
if self.scope != 'host' and (type(self.id) is not int or not 100 <= self.id <= 999999999):
raise ValueError('Ungültige VMID.')
raise ValueError(_('Ungültige VMID.'))
if self.scope == 'host' and self.id is not None:
raise ValueError('Host benötigt keine VMID.')
raise ValueError(_('Host benötigt keine VMID.'))
if self.mount not in ('/var', '/home', '/opt', '/srv'):
raise ValueError('Nur /var, /home, /opt oder /srv sind als Scan-Ziel erlaubt.')
raise ValueError(_('Nur /var, /home, /opt oder /srv sind als Scan-Ziel erlaubt.'))
@dataclass(frozen=True)
@@ -57,14 +58,14 @@ def action_for(key, ctx):
for action in registry(ctx):
if action.id == key:
return action
raise CommandError('Aktion für dieses Ziel nicht verfügbar.')
raise CommandError(_('Aktion für dieses Ziel nicht verfügbar.'))
def guest_running(ctx, runner):
tool = 'pct' if ctx.scope == 'ct' else 'qm'
output = runner.run([tool, 'status', str(ctx.id)]).text
if not re.search(r'^status:\s+running\s*$', output, re.M):
raise CommandError('Gast {} läuft nicht; kein automatischer Start.'.format(ctx.id))
raise CommandError(_('Gast {} läuft nicht; kein automatischer Start.').format(ctx.id))
return tool
@@ -72,7 +73,7 @@ def qga(ctx, runner, command):
guest_running(ctx, runner)
help_text = runner.run(['qm', 'help', 'guest', 'cmd']).text
if not re.search(r'\b' + re.escape(command) + r'\b', help_text):
raise CommandError('Guest-Agent-Befehl auf dieser Proxmox-Version nicht verfügbar.')
raise CommandError(_('Guest-Agent-Befehl auf dieser Proxmox-Version nicht verfügbar.'))
runner.run(['qm', 'guest', 'cmd', str(ctx.id), 'ping'])
return ['qm', 'guest', 'cmd', str(ctx.id), command]
@@ -82,29 +83,29 @@ def cache_plan(ctx, runner):
raw = runner.run(['pct', 'exec', str(ctx.id), '--', 'cat', '/etc/os-release']).text
match = re.search(r'^ID=["\']?([a-z0-9_-]+)', raw, re.M)
if not match or match.group(1) not in ('debian', 'ubuntu'):
raise CommandError('Cache-Bereinigung nur für Debian und Ubuntu verfügbar.')
raise CommandError(_('Cache-Bereinigung nur für Debian und Ubuntu verfügbar.'))
size = runner.run(['pct', 'exec', str(ctx.id), '--', 'du', '-sxh', '/var/cache/apt/archives']).text
command = ['pct', 'exec', str(ctx.id), '--', 'apt-get', 'clean']
return command, 'APT-Cache: ' + size + '\nEntfernt heruntergeladene Paketarchive; keine Pakete oder Nutzdaten.'
return command, 'APT-Cache: ' + size + _('\nEntfernt heruntergeladene Paketarchive; keine Pakete oder Nutzdaten.')
def prepare(key, ctx, runner):
action = action_for(key, ctx)
if not action.mutation:
raise CommandError('Aktion benötigt keine Änderungsfreigabe.')
raise CommandError(_('Aktion benötigt keine Änderungsfreigabe.'))
if key == 'cache-clean':
command, impact = cache_plan(ctx, runner)
elif ctx.scope == 'ct':
guest_running(ctx, runner)
command = ['pct', 'fstrim', str(ctx.id)]
impact = 'Meldet freie Blöcke. Gemeldete Menge ist kein garantiert zurückgewonnener Speicherplatz.'
impact = _('Meldet freie Blöcke. Gemeldete Menge ist kein garantiert zurückgewonnener Speicherplatz.')
else:
command = qga(ctx, runner, 'fstrim')
info_command = qga(ctx, runner, 'get-osinfo')
os_info = json.loads(runner.run(info_command).text)
if os_info.get('id') not in ('debian', 'ubuntu', 'fedora', 'centos', 'rhel', 'rocky', 'almalinux', 'arch', 'opensuse-leap'):
raise CommandError('TRIM für dieses Gastbetriebssystem nicht freigegeben; nur lesende Diagnose verfügbar.')
impact = 'TRIM über QEMU Guest Agent; Discard muss im vollständigen Storage-Pfad unterstützt sein.'
raise CommandError(_('TRIM für dieses Gastbetriebssystem nicht freigegeben; nur lesende Diagnose verfügbar.'))
impact = _('TRIM über QEMU Guest Agent; Discard muss im vollständigen Storage-Pfad unterstützt sein.')
return {'target': '{} {}'.format(ctx.scope.upper(), ctx.id), 'command': command,
'impact': impact, 'display': shlex.join(command)}
@@ -113,7 +114,7 @@ def execute(key, ctx, runner, confirmed=False):
action = action_for(key, ctx)
if action.mutation:
if not confirmed:
raise CommandError('Explizite Bestätigung erforderlich.')
raise CommandError(_('Explizite Bestätigung erforderlich.'))
if key == 'trim' and ctx.scope == 'ct':
guest_running(ctx, runner)
command = ['pct', 'fstrim', str(ctx.id)]
@@ -126,15 +127,15 @@ def execute(key, ctx, runner, confirmed=False):
def do_storage(ctx, runner):
sections = [('Proxmox Storage-Pools', ['pvesm', 'status']),
('Host-Dateisysteme (nicht Thin-Pool-Belegung)', ['df', '-hT']),
('Host-Inodes', ['df', '-hi']),
('Blockgeräte', ['lsblk', '-o', 'NAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS'])]
sections = [(_('Proxmox Storage-Pools'), ['pvesm', 'status']),
(_('Host-Dateisysteme (nicht Thin-Pool-Belegung)'), ['df', '-hT']),
(_('Host-Inodes'), ['df', '-hi']),
(_('Blockgeräte'), ['lsblk', '-o', 'NAME,TYPE,SIZE,FSTYPE,MOUNTPOINTS'])]
if shutil.which('lvs'):
sections.append(('LVM: Thin-Pool / Thin-Volume gesondert lesen',
sections.append((_('LVM: Thin-Pool / Thin-Volume gesondert lesen'),
['lvs', '-a', '-o', 'vg_name,lv_name,lv_attr,lv_size,pool_lv,data_percent,metadata_percent']))
if shutil.which('zpool'):
sections.extend([('ZFS-Pools', ['zpool', 'list']), ('ZFS-Zustand', ['zpool', 'status', '-x'])])
sections.extend([(_('ZFS-Pools'), ['zpool', 'list']), (_('ZFS-Zustand'), ['zpool', 'status', '-x'])])
return sections_report(sections, runner)
@@ -146,7 +147,7 @@ def sections_report(sections, runner):
except CommandError as exc:
if hasattr(runner, 'cancel') and runner.cancel.is_set():
raise
text = 'Nicht verfügbar: ' + str(exc)
text = _('Nicht verfügbar: ') + str(exc)
output.extend([title, text, ''])
return '\n'.join(output)
@@ -154,7 +155,7 @@ def sections_report(sections, runner):
def do_volumes(ctx, runner):
tool = 'pct' if ctx.scope == 'ct' else 'qm'
raw = runner.run([tool, 'config', str(ctx.id)]).text
output = ['Konfigurierte Volumes (keine Zuordnung anhand geratener LV-Namen):']
output = [_('Konfigurierte Volumes (keine Zuordnung anhand geratener LV-Namen):')]
for line in raw.splitlines():
key, sep, value = line.partition(':')
if not sep or not re.fullmatch(r'rootfs|mp\d+|(?:ide|sata|scsi|virtio)\d+', key):
@@ -163,13 +164,13 @@ def do_volumes(ctx, runner):
output.append(line)
if re.fullmatch(r'[A-Za-z0-9_-]+:[A-Za-z0-9_./-]+', volume):
try:
output.append(' Aufgelöst: ' + runner.run(['pvesm', 'path', volume]).text.strip())
output.append(_(' Aufgelöst: ') + runner.run(['pvesm', 'path', volume]).text.strip())
except CommandError as exc:
output.append(' Auflösung nicht verfügbar: ' + str(exc))
output.append(_(' Auflösung nicht verfügbar: ') + str(exc))
else:
output.append(' Bind-Mount, Gerät oder leeres Laufwerk; kein geratenes Storage-Volume.')
output.append(_(' Bind-Mount, Gerät oder leeres Laufwerk; kein geratenes Storage-Volume.'))
if ctx.scope == 'vm':
output.append(' Discard: ' + ('aktiv' if re.search(r',discard=on(?:,|$)', value) else 'nicht als on konfiguriert'))
output.append(' Discard: ' + ('aktiv' if re.search(r',discard=on(?:,|$)', value) else _('nicht als on konfiguriert')))
return '\n'.join(output)
@@ -178,21 +179,21 @@ def do_filesystems(ctx, runner):
command = qga(ctx, runner, 'get-fsinfo')
filesystems = json.loads(runner.run(command).text)
if not isinstance(filesystems, list):
raise CommandError('Unerwartete Guest-Agent-Dateisystemausgabe.')
lines = ['Gast-Dateisystem | Typ | Belegt / Gesamt | Anteil',
'Nur Diagnose; Image-Dateisysteme mit 100% sind kein Speicherplatzalarm.']
raise CommandError(_('Unerwartete Guest-Agent-Dateisystemausgabe.'))
lines = [_('Gast-Dateisystem | Typ | Belegt / Gesamt | Anteil'),
_('Nur Diagnose; Image-Dateisysteme mit 100% sind kein Speicherplatzalarm.')]
for entry in filesystems:
total = entry.get('total-bytes')
used = entry.get('used-bytes')
valid = isinstance(total, (int, float)) and total > 0 and isinstance(used, (int, float))
size = '{:.2f} / {:.2f} GiB'.format(used / 2**30, total / 2**30) if valid else 'nicht verfügbar'
size = '{:.2f} / {:.2f} GiB'.format(used / 2**30, total / 2**30) if valid else _('nicht verfügbar')
percent = '{:.1f}%'.format(100 * used / total) if valid else 'n/a'
image = ' (schreibgeschütztes Image)' if entry.get('type') in ('erofs', 'squashfs', 'iso9660') else ''
image = _(' (schreibgeschütztes Image)') if entry.get('type') in ('erofs', 'squashfs', 'iso9660') else ''
lines.append('{} | {}{} | {} | {}'.format(entry.get('mountpoint', '?'), entry.get('type', '?'), image, size, percent))
return '\n'.join(lines)
guest_running(ctx, runner)
return sections_report([('Gast-Dateisysteme', ['pct', 'exec', str(ctx.id), '--', 'df', '-hT']),
('Gast-Inodes', ['pct', 'exec', str(ctx.id), '--', 'df', '-hi'])], runner)
return sections_report([(_('Gast-Dateisysteme'), ['pct', 'exec', str(ctx.id), '--', 'df', '-hT']),
(_('Gast-Inodes'), ['pct', 'exec', str(ctx.id), '--', 'df', '-hi'])], runner)
def do_scan(ctx, runner):
@@ -200,25 +201,25 @@ def do_scan(ctx, runner):
# Resolve the selected directory first; du -x never follows directory symlinks.
resolved = runner.run(['pct', 'exec', str(ctx.id), '--', 'readlink', '-e', ctx.mount]).text.strip()
if resolved != ctx.mount or not PurePosixPath(resolved).is_absolute():
raise CommandError('Scan-Ziel fehlt oder ist ein Symlink; Scan abgelehnt.')
raise CommandError(_('Scan-Ziel fehlt oder ist ein Symlink; Scan abgelehnt.'))
text = runner.run(['pct', 'exec', str(ctx.id), '--', 'timeout', '-k', '2', '55', 'du', '-x', '-h', '--max-depth=1', '--', ctx.mount],
timeout=60).text
return 'Nur gewählter Pfad {}, keine fremden Dateisysteme; maximal 60 s.\n{}'.format(ctx.mount, text)
return _('Nur gewählter Pfad {}, keine fremden Dateisysteme; maximal 60 s.\n{}').format(ctx.mount, text)
def do_smart(ctx, runner):
if not shutil.which('smartctl'):
raise CommandError('smartctl fehlt. Optionales Paket smartmontools durch den Administrator installieren.')
raise CommandError(_('smartctl fehlt. Optionales Paket smartmontools durch den Administrator installieren.'))
disks = json.loads(runner.run(['lsblk', '-J', '-d', '-o', 'NAME,TYPE,MODEL,SIZE']).text)
previous = read_json(STATE / 'smart.json', {})
current = {}
lines = ['SMART ist herstellerspezifisch; PASSED ist keine Ausfallgarantie.']
lines = [_('SMART ist herstellerspezifisch; PASSED ist keine Ausfallgarantie.')]
metric_groups = [
('Reallocation-Attribut (herstellerspezifisch)', ('Reallocated_Sector_Ct', 'Reallocate_NAND_Blk_Cnt', 'Reallocated_Event_Count')),
('Pending-Attribut (herstellerspezifisch)', ('Current_Pending_Sector', 'Current_Pending_ECC_Cnt')),
('Nicht korrigierbare Fehler', ('Offline_Uncorrectable', 'Reported_Uncorrect', 'Uncorrectable_Error_Cnt')),
('CRC-Fehler', ('UDMA_CRC_Error_Count',)),
('Verschleißattribut', ('Wear_Leveling_Count', 'Percent_Lifetime_Remain', 'Percent_Lifetime_Used',
(_('Reallocation-Attribut (herstellerspezifisch)'), ('Reallocated_Sector_Ct', 'Reallocate_NAND_Blk_Cnt', 'Reallocated_Event_Count')),
(_('Pending-Attribut (herstellerspezifisch)'), ('Current_Pending_Sector', 'Current_Pending_ECC_Cnt')),
(_('Nicht korrigierbare Fehler'), ('Offline_Uncorrectable', 'Reported_Uncorrect', 'Uncorrectable_Error_Cnt')),
(_('CRC-Fehler'), ('UDMA_CRC_Error_Count',)),
(_('Verschleißattribut'), ('Wear_Leveling_Count', 'Percent_Lifetime_Remain', 'Percent_Lifetime_Used',
'Media_Wearout_Indicator', 'SSD_Life_Left')),
]
for disk in disks.get('blockdevices', []):
@@ -229,12 +230,12 @@ def do_smart(ctx, runner):
data = json.loads(runner.run(['smartctl', '-a', '-j', dev], allowed=None).text)
except (ValueError, CommandError):
# One unreadable disk must never hide the health of the remaining ones.
lines.extend(['', '{} ({})'.format(dev, disk.get('model') or 'unbekanntes Modell'),
'SMART-Abfrage fehlgeschlagen: Gerät nicht auswertbar, übersprungen.'])
lines.extend(['', '{} ({})'.format(dev, disk.get('model') or _('unbekanntes Modell')),
_('SMART-Abfrage fehlgeschlagen: Gerät nicht auswertbar, übersprungen.')])
continue
if not isinstance(data, dict):
lines.extend(['', '{} ({})'.format(dev, disk.get('model') or 'unbekanntes Modell'),
'SMART-Abfrage fehlgeschlagen: Gerät nicht auswertbar, übersprungen.'])
lines.extend(['', '{} ({})'.format(dev, disk.get('model') or _('unbekanntes Modell')),
_('SMART-Abfrage fehlgeschlagen: Gerät nicht auswertbar, übersprungen.')])
continue
# Identify history by serial internally, never display or transmit it.
identity = data.get('serial_number') or dev
@@ -242,34 +243,34 @@ def do_smart(ctx, runner):
for row in data.get('ata_smart_attributes', {}).get('table', []):
attributes[row.get('name', str(row.get('id')))] = row.get('raw', {})
passed = data.get('smart_status', {}).get('passed')
health = 'PASSED' if passed is True else ('FEHLER' if passed is False else 'nicht verfügbar')
health = 'PASSED' if passed is True else (_('FEHLER') if passed is False else _('nicht verfügbar'))
temperature = data.get('temperature', {}).get('current')
if temperature is None:
raw_temperature = attributes.get('Temperature_Celsius', {}).get('string', '')
match = re.match(r'\s*(-?\d+)', str(raw_temperature))
temperature = match.group(1) if match else None
temp_text = '{} °C'.format(temperature) if temperature is not None else 'nicht verfügbar'
temp_text = '{} °C'.format(temperature) if temperature is not None else _('nicht verfügbar')
hours = data.get('power_on_time', {}).get('hours')
hours_text = '{} h'.format(hours) if hours is not None else 'nicht verfügbar'
lines.extend(['', '{} {} ({})'.format(dev, disk.get('model') or 'unbekanntes Modell', disk.get('size', '?')),
'SMART-Status: {} | Temperatur: {} | Betriebsstunden: {}'.format(health, temp_text, hours_text)])
hours_text = '{} h'.format(hours) if hours is not None else _('nicht verfügbar')
lines.extend(['', '{} {} ({})'.format(dev, disk.get('model') or _('unbekanntes Modell'), disk.get('size', '?')),
_('SMART-Status: {} | Temperatur: {} | Betriebsstunden: {}').format(health, temp_text, hours_text)])
current_values = {}
counters = []
for label, names in metric_groups[:4]:
found = next(((name, attributes[name]) for name in names if name in attributes), None)
if found is None:
counters.append('{}: nicht gemeldet'.format(label))
counters.append(_('{}: nicht gemeldet').format(label))
continue
name, raw = found
value = raw.get('string') or raw.get('value')
current_values[name] = value
display = str(value).split(' (', 1)[0] if value is not None else 'nicht verfügbar'
display = str(value).split(' (', 1)[0] if value is not None else _('nicht verfügbar')
old = previous.get(identity, {}).get(name)
try:
delta = int(display) - int(str(old).split(' (', 1)[0]) if old is not None else 0
except ValueError:
delta = 0
change = ' (+{} seit letzter Messung)'.format(delta) if delta > 0 else ''
change = _(' (+{} seit letzter Messung)').format(delta) if delta > 0 else ''
counters.append('{}: {}{}'.format(label, display, change))
lines.extend(counters)
wear = next(((name, attributes[name]) for name in metric_groups[4][1] if name in attributes), None)
@@ -277,23 +278,23 @@ def do_smart(ctx, runner):
name, raw = wear
value = raw.get('string') or raw.get('value')
current_values[name] = value
display = str(value).split(' (', 1)[0] if value is not None else 'nicht verfügbar'
lines.append('Verschleißattribut {}: {} (herstellerspezifisch)'.format(name, display))
display = str(value).split(' (', 1)[0] if value is not None else _('nicht verfügbar')
lines.append(_('Verschleißattribut {}: {} (herstellerspezifisch)').format(name, display))
else:
lines.append('Verschleißattribut: nicht gemeldet')
lines.append(_('Verschleißattribut: nicht gemeldet'))
for name, raw in attributes.items():
if name not in current_values and name in {item for _, names in metric_groups for item in names}:
current_values[name] = raw.get('string') or raw.get('value')
nvme = data.get('nvme_smart_health_information_log') or {}
if nvme:
lines.append('NVMe-Gesundheit:')
lines.append(_('NVMe-Gesundheit:'))
nvme_fields = (
('critical_warning', 'Kritische Warnung'),
('temperature', 'Temperatur'),
('percentage_used', 'Verschleiß'),
('available_spare', 'Reserve'),
('media_errors', 'Medienfehler'),
('num_err_log_entries', 'Fehlerprotokolleinträge'),
('critical_warning', _('Kritische Warnung')),
('temperature', _('Temperatur')),
('percentage_used', _('Verschleiß')),
('available_spare', _('Reserve')),
('media_errors', _('Medienfehler')),
('num_err_log_entries', _('Fehlerprotokolleinträge')),
)
for key, label in nvme_fields:
value = nvme.get(key)
@@ -303,9 +304,9 @@ def do_smart(ctx, runner):
lines.append('{}: {}{}'.format(label, value, suffix))
warning = nvme.get('critical_warning')
if warning is not None and warning != 0:
lines.append('NVMe meldet kritische Warnungsbits: {}'.format(warning))
lines.append(_('NVMe meldet kritische Warnungsbits: {}').format(warning))
if not any(nvme.get(key) is not None for key, _ in nvme_fields):
lines.append('Keine bekannten NVMe-Gesundheitswerte gemeldet.')
lines.append(_('Keine bekannten NVMe-Gesundheitswerte gemeldet.'))
current[identity] = current_values
write_json(STATE / 'smart.json', current)
return '\n'.join(lines)
@@ -313,11 +314,11 @@ def do_smart(ctx, runner):
def do_maintenance(ctx, runner):
result = sections_report([
('TRIM-Timer', ['systemctl', 'list-timers', '--all', '--no-pager', '*fstrim*']),
('fstrim Service/Timer', ['systemctl', 'cat', 'fstrim.timer', 'fstrim.service']),
('Letzte TRIM-Meldungen', ['journalctl', '-u', 'fstrim.service', '-n', '30', '--no-pager']),
('Kernel-Pakete (nur Anzeige)', ['dpkg-query', '-W', '-f=${Package}\t${Version}\n', 'proxmox-kernel-*', 'pve-kernel-*']),
('Storage-Belegung einschließlich Backup-Storage', ['pvesm', 'status', '--content', 'backup']),
(_('TRIM-Timer'), ['systemctl', 'list-timers', '--all', '--no-pager', '*fstrim*']),
(_('fstrim Service/Timer'), ['systemctl', 'cat', 'fstrim.timer', 'fstrim.service']),
(_('Letzte TRIM-Meldungen'), ['journalctl', '-u', 'fstrim.service', '-n', '30', '--no-pager']),
(_('Kernel-Pakete (nur Anzeige)'), ['dpkg-query', '-W', '-f=${Package}\t${Version}\n', 'proxmox-kernel-*', 'pve-kernel-*']),
(_('Storage-Belegung einschließlich Backup-Storage'), ['pvesm', 'status', '--content', 'backup']),
], runner)
# Show only scheduler lines mentioning trim; do not dump unrelated cron contents.
from pathlib import Path
@@ -332,5 +333,5 @@ def do_maintenance(ctx, runner):
if log.is_file() and not log.is_symlink():
with log.open('rb') as stream:
stream.seek(max(0, log.stat().st_size - 12000))
result += '\nLetzter Ausschnitt fstrim.log:\n' + stream.read(12000).decode('utf-8', 'replace')
result += _('\nLetzter Ausschnitt fstrim.log:\n') + stream.read(12000).decode('utf-8', 'replace')
return result
+302
View File
@@ -0,0 +1,302 @@
"""English texts for the maintenance module; German source text is the key.
Keep placeholders ({}) in the same order as the German text. The test suite
checks that every translatable text used by the module has an entry here.
"""
EN = {
# actions
'Aktion für dieses Ziel nicht verfügbar.': 'Action not available for this target.',
'Konfigurierte Volumes (keine Zuordnung anhand geratener LV-Namen):':
'Configured volumes (no mapping by guessed LV names):',
'SMART ist herstellerspezifisch; PASSED ist keine Ausfallgarantie.':
'SMART is vendor specific; PASSED is no guarantee against failure.',
'Guest-Agent-Befehl auf dieser Proxmox-Version nicht verfügbar.':
'Guest agent command not available on this Proxmox version.',
'Cache-Bereinigung nur für Debian und Ubuntu verfügbar.': 'Cache cleanup is only available for Debian and Ubuntu.',
'\nEntfernt heruntergeladene Paketarchive; keine Pakete oder Nutzdaten.':
'\nRemoves downloaded package archives; no packages or user data.',
'Aktion benötigt keine Änderungsfreigabe.': 'Action needs no change approval.',
'Meldet freie Blöcke. Gemeldete Menge ist kein garantiert zurückgewonnener Speicherplatz.':
'Reports free blocks. The reported amount is not guaranteed to be reclaimed space.',
'TRIM über QEMU Guest Agent; Discard muss im vollständigen Storage-Pfad unterstützt sein.':
'TRIM via QEMU guest agent; discard must be supported along the whole storage path.',
'Proxmox Storage-Pools': 'Proxmox storage pools',
'Host-Dateisysteme (nicht Thin-Pool-Belegung)': 'Host filesystems (not thin pool usage)',
'Host-Inodes': 'Host inodes',
'Blockgeräte': 'Block devices',
'Gast-Dateisystem | Typ | Belegt / Gesamt | Anteil': 'Guest filesystem | Type | Used / Total | Share',
'Nur Diagnose; Image-Dateisysteme mit 100% sind kein Speicherplatzalarm.':
'Diagnosis only; image filesystems at 100% are not a disk space alarm.',
'Scan-Ziel fehlt oder ist ein Symlink; Scan abgelehnt.': 'Scan target is missing or a symlink; scan refused.',
'Nur gewählter Pfad {}, keine fremden Dateisysteme; maximal 60 s.\n{}':
'Selected path {} only, no other filesystems; 60 s at most.\n{}',
'smartctl fehlt. Optionales Paket smartmontools durch den Administrator installieren.':
'smartctl is missing. The administrator can install the optional package smartmontools.',
'Reallocation-Attribut (herstellerspezifisch)': 'Reallocation attribute (vendor specific)',
'Pending-Attribut (herstellerspezifisch)': 'Pending attribute (vendor specific)',
'Nicht korrigierbare Fehler': 'Uncorrectable errors',
'CRC-Fehler': 'CRC errors',
'Verschleißattribut': 'Wear attribute',
'nicht verfügbar': 'not available',
'Ungültiger Zieltyp.': 'Invalid target type.',
'Ungültige VMID.': 'Invalid VMID.',
'Host benötigt keine VMID.': 'The host needs no VMID.',
'Nur /var, /home, /opt oder /srv sind als Scan-Ziel erlaubt.': 'Only /var, /home, /opt or /srv are allowed as scan target.',
'Explizite Bestätigung erforderlich.': 'Explicit confirmation required.',
'LVM: Thin-Pool / Thin-Volume gesondert lesen': 'LVM: read thin pool / thin volume separately',
' Bind-Mount, Gerät oder leeres Laufwerk; kein geratenes Storage-Volume.':
' Bind mount, device or empty drive; no guessed storage volume.',
'Unerwartete Guest-Agent-Dateisystemausgabe.': 'Unexpected guest agent filesystem output.',
' (schreibgeschütztes Image)': ' (read-only image)',
'Gast-Dateisysteme': 'Guest filesystems',
'Gast-Inodes': 'Guest inodes',
'FEHLER': 'FAILED',
'Verschleißattribut: nicht gemeldet': 'Wear attribute: not reported',
'NVMe-Gesundheit:': 'NVMe health:',
'TRIM-Timer': 'TRIM timer',
'fstrim Service/Timer': 'fstrim service/timer',
'Letzte TRIM-Meldungen': 'Recent TRIM messages',
'Kernel-Pakete (nur Anzeige)': 'Kernel packages (display only)',
'Storage-Belegung einschließlich Backup-Storage': 'Storage usage including backup storage',
'\nLetzter Ausschnitt fstrim.log:\n': '\nLatest excerpt of fstrim.log:\n',
'Gast {} läuft nicht; kein automatischer Start.': 'Guest {} is not running; it is never started automatically.',
'TRIM für dieses Gastbetriebssystem nicht freigegeben; nur lesende Diagnose verfügbar.':
'TRIM is not enabled for this guest operating system; read-only diagnosis only.',
'ZFS-Pools': 'ZFS pools',
'ZFS-Zustand': 'ZFS status',
'Nicht verfügbar: ': 'Not available: ',
'SMART-Abfrage fehlgeschlagen: Gerät nicht auswertbar, übersprungen.':
'SMART query failed: device could not be evaluated, skipped.',
'Kritische Warnung': 'Critical warning',
'Temperatur': 'Temperature',
'Verschleiß': 'Wear',
'Reserve': 'Spare',
'Medienfehler': 'Media errors',
'Fehlerprotokolleinträge': 'Error log entries',
'Keine bekannten NVMe-Gesundheitswerte gemeldet.': 'No known NVMe health values reported.',
' Aufgelöst: ': ' Resolved: ',
'nicht als on konfiguriert': 'not configured as on',
'unbekanntes Modell': 'unknown model',
'SMART-Status: {} | Temperatur: {} | Betriebsstunden: {}': 'SMART status: {} | Temperature: {} | Power-on hours: {}',
' (+{} seit letzter Messung)': ' (+{} since last measurement)',
'Verschleißattribut {}: {} (herstellerspezifisch)': 'Wear attribute {}: {} (vendor specific)',
' Auflösung nicht verfügbar: ': ' Resolution not available: ',
'{}: nicht gemeldet': '{}: not reported',
'NVMe meldet kritische Warnungsbits: {}': 'NVMe reports critical warning bits: {}',
# action table (shown in the menu)
'Storage, Dateisysteme, Inodes': 'Storage, filesystems, inodes',
'Eigene Implementierung': 'Own implementation',
'SMART und Fehlerverlauf': 'SMART and error history',
'TRIM-Zeitplanung, Kernel, Backups': 'TRIM schedule, kernel, backups',
'Volumes und Storage-Zuordnung': 'Volumes and storage mapping',
'Dateisystembelegung': 'Filesystem usage',
'Große Verzeichnisse im gewählten Pfad': 'Large directories in the selected path',
'Ungenutzte Blöcke trimmen': 'Trim unused blocks',
'Eigener Adapter; Community Scripts als Referenz': 'Own adapter; Community Scripts as reference',
'APT-Paketcache bereinigen': 'Clean APT package cache',
# cli
'Optionales pman Speicher- und Wartungsmodul': 'Optional pman storage and maintenance module',
'Maschinenlesbare Schnittstellenversion': 'Machine-readable interface version',
'Öffentliche Quellmetadaten prüfen': 'Check public source metadata',
'Herkunft und gespeicherten Status anzeigen': 'Show provenance and stored status',
'Nur lesende Aktion ohne TUI ausführen': 'Run a read-only action without the TUI',
'Diagnose als JSON ausgeben': 'Print the diagnosis as JSON',
'Als root auf dem Proxmox-Host ausführen.': 'Run as root on the Proxmox host.',
'Änderungen sind nur in der TUI mit Bestätigung möglich.': 'Changes are only possible in the TUI, with confirmation.',
'--json benötigt --report oder --sources.': '--json requires --report or --sources.',
'TUI benötigt ein Terminal; --report für lesende CLI-Ausgaben verwenden.':
'The TUI needs a terminal; use --report for read-only CLI output.',
'Fehler: {}': 'Error: {}',
# community (source check, blocked start)
'Upstream-Datei überschreitet die erlaubte Größe.': 'Upstream file exceeds the allowed size.',
'Start blockiert - nichts wurde ausgeführt.': 'Start blocked - nothing was executed.',
'Werkzeug fehlt in der geprüften Quellenliste.': 'Tool is missing from the reviewed source list.',
'Unbekanntes Community-Werkzeug.': 'Unknown community tool.',
'pman startet nur Stände, die geprüft wurden.': 'pman only starts revisions that have been reviewed.',
'Nächster Schritt: neuen pman-Release abwarten oder die Datei selbst prüfen.':
'Next step: wait for a new pman release or review the file yourself.',
'Upstream ist nicht als geprüfter Stand bestätigt ({}). Start abgebrochen.':
'Upstream is not confirmed as the reviewed revision ({}). Start aborted.',
'Datei: {}/{}': 'File: {}/{}',
'Prüfsumme von {} passt nicht zum geprüften Stand.': 'Checksum of {} does not match the reviewed revision.',
'Geprüft {} -> aktuell {}': 'Reviewed {} -> current {}',
'Status: {}': 'Status: {}',
'{} geändert ({} → {})': '{} changed ({} → {})',
'geprüfter Stand': 'reviewed revision',
'Upstream geändert': 'upstream changed',
'Quelle fehlt': 'source missing',
'Prüfung fehlgeschlagen': 'check failed',
'Noch nicht geprüft': 'not checked yet',
# runner, state, sources
'Abgebrochen; bereits ausgeführte Änderungen werden nicht rückgängig gemacht.':
'Cancelled; changes that already ran are not rolled back.',
'{} (Exit {}): {}': '{} (exit {}): {}',
'Zeitlimit erreicht.': 'Time limit reached.',
'Ausgabelimit erreicht.': 'Output limit reached.',
'Eigene Adapter; geprüfte Community-Tools nur auf Auswahl und mit Versionsprüfung.':
'Own adapters; reviewed community tools only on request and with a version check.',
'Referenzen:': 'References:',
'Zuletzt geprüft: ': 'Last checked: ',
'{} Quellen | geprüft: {} | geändert: {} | fehlen: {} | Fehler: {} | offen: {}':
'{} sources | reviewed: {} | changed: {} | missing: {} | errors: {} | open: {}',
'API-Antwort zu groß.': 'API response too large.',
'geprüft: {}': 'reviewed: {}',
' Fehler: ': ' Error: ',
'Ungültige Metadatenliste.': 'Invalid metadata list.',
'Fehlende Git-Blob-Prüfsumme.': 'Missing Git blob checksum.',
'Referenz {} → aktuell {}': 'Reference {} → current {}',
'Zustandsdatei zu groß.': 'State file too large.',
'Unsicheres Zustandsverzeichnis: {}': 'Unsafe state directory: {}',
'Unsichere Zustandsdatei: {}': 'Unsafe state file: {}',
# ui
'Bereit': 'Ready',
'Zeigt Speicher, Dateisysteme und Inodes des Hosts.': 'Shows storage, filesystems and inodes of the host.',
'Liest SMART-Zustand und speichert einen lokalen Vergleichsstand.':
'Reads the SMART state and stores a local baseline for comparison.',
'Zeigt TRIM-Zeitplanung, Kernel und Backup-Speicher.': 'Shows the TRIM schedule, kernels and backup storage.',
'Zeigt die konfigurierten Volumes des ausgewählten Gastes.': 'Shows the configured volumes of the selected guest.',
'Zeigt die Dateisystembelegung des ausgewählten Gastes.': 'Shows the filesystem usage of the selected guest.',
'Untersucht große Verzeichnisse im ausgewählten CT-Pfad.': 'Scans large directories in the selected CT path.',
'Meldet freie Blöcke des ausgewählten Gastes an den Speicher.': 'Reports the free blocks of the selected guest to the storage.',
'Entfernt heruntergeladene APT-Paketarchive im ausgewählten CT.': 'Removes downloaded APT package archives in the selected CT.',
'Enter startet die Diagnose.': 'Enter starts the diagnosis.',
'Prüfung läuft – Esc bricht ab': 'Check running – Esc cancels',
'↑↓ Auswahl | Enter | PgUp/PgDn | Esc | q Ende': '↑↓ Select | Enter | PgUp/PgDn | Esc | q Quit',
'Änderung mit Bestätigung': 'Change with confirmation',
'Diagnose': 'Diagnosis',
'Für die Oberfläche ist eine UTF-8-Locale erforderlich.': 'The interface needs a UTF-8 locale.',
'Esc/q Abbruch | danach q Ende': 'Esc/q Cancel | then q Quit',
'↑↓ PgUp/PgDn blättern | Esc zurück zur Bestätigung': '↑↓ PgUp/PgDn scroll | Esc back to confirmation',
'PgUp/PgDn Blättern | Esc Zurück | q Ende': 'PgUp/PgDn Scroll | Esc Back | q Quit',
'↑↓ Auswahl | Enter prüfen & bestätigen | Esc zurück | q Ende': '↑↓ Select | Enter check & confirm | Esc back | q Quit',
'↑↓ Auswahl | Enter | Tab Pfad | Esc | q Ende': '↑↓ Select | Enter | Tab path | Esc | q Quit',
'Unsichere Wartungssperre.': 'Unsafe maintenance lock.',
'Terminal unterstützt die Oberfläche nicht; TERM und Fenstergröße prüfen.':
'The terminal does not support the interface; check TERM and window size.',
'PgDn: alle Details lesen | Esc/n Abbruch': 'PgDn: read all details | Esc/n Cancel',
'v Quellcode | j Starten | Esc/n Abbruch | PgUp/PgDn': 'v Source | j Start | Esc/n Cancel | PgUp/PgDn',
'j Bestätigen | Esc/n Abbruch | PgUp/PgDn': 'j Confirm | Esc/n Cancel | PgUp/PgDn',
'Community-Skript starten?': 'Start community script?',
'Community-Skripte': 'Community scripts',
'Bitte zuerst alle Details mit Bild ab lesen.': 'Please read all details first (Page Down).',
'Zurück zum Wartungsmenü.': 'Back to the maintenance menu.',
'Scan: ': 'Scan: ',
'Auswahl: ': 'Selection: ',
'Terminal mindestens 45 Spalten und 12 Zeilen.': 'Terminal needs at least 45 columns and 12 rows.',
'Abgebrochen': 'Cancelled',
'Abbruch angefordert.': 'Cancellation requested.',
'Abbruch angefordert; CT-Scan kann bis zum Gast-Zeitlimit (55 s) weiterlaufen.':
'Cancellation requested; the CT scan may continue until the guest time limit (55 s).',
'Quellcode-Vorschau – es wird nichts ausgeführt': 'Source preview – nothing is executed',
'Prüfe Quellstand und starte Helper Script …': 'Checking source revision and starting helper script …',
'Bereit – es wurde noch nichts gestartet': 'Ready – nothing has been started',
'Quelle: ': 'Source: ',
'Herkunft und Aktualitätsstatus': 'Provenance and freshness status',
'Enter öffnet diese Ansicht.': 'Enter opens this view.',
'pman Wartung': 'pman maintenance',
'Esc/q: Abbruch; danach q beendet.': 'Esc/q: cancel; then q quits.',
'Vergrößern oder q zum Beenden.': 'Enlarge the window or press q to quit.',
'Wartet auf Bestätigung': 'Waiting for confirmation',
'Eingabefehler': 'Input error',
'Start abgebrochen; es wurde kein Helper Script ausgeführt.': 'Start cancelled; no helper script was executed.',
'Abbruch angefordert. Die Änderung kann teilweise oder vollständig':
'Cancellation requested. The change may have run partly or completely;',
'ausgeführt worden sein; dies ist kein Rollback. Zustand prüfen.':
'this is not a rollback. Check the state.',
'Abgebrochen; keine bestätigte Änderung wurde gestartet.': 'Cancelled; no confirmed change was started.',
'Bestätigung erforderlich': 'Confirmation required',
'Abgeschlossen': 'Completed',
'Helper Script mit Fehler beendet': 'Helper script ended with an error',
'Start blockiert': 'Start blocked',
'Quelle geändert, nicht verfügbar oder Start fehlgeschlagen': 'Source changed, unavailable or start failed',
'Änderung abgebrochen.': 'Change cancelled.',
'Änderung ausführen? j = bestätigen, Esc = abbrechen': 'Run the change? j = confirm, Esc = cancel',
'Abbruch eines laufenden Befehls ist kein Rollback.': 'Cancelling a running command is not a rollback.',
'Eingabepuffer konnte nicht geleert werden; Bestätigung abgebrochen.':
'The input buffer could not be cleared; confirmation cancelled.',
'Eingabepuffer konnte nicht geleert werden. Ergebnis oben beachten.':
'The input buffer could not be cleared. See the result above.',
'Start abgebrochen:': 'Start aborted:',
'Ziel: ': 'Target: ',
'Befehl: ': 'Command: ',
'Erfolgreich': 'Successful',
'Keine Ausgabe.': 'No output.',
'Fehlgeschlagen': 'Failed',
'Prüfe den aktuellen Upstream-Stand und lade die Datei …': 'Checking the current upstream revision and downloading the file …',
'Das kann bis zu einer Minute dauern; Esc bricht ab.': 'This can take up to a minute; Esc cancels.',
# view
'Quellstand: noch nie geprüft - Start prüft live.': 'Source status: never checked - starting checks live.',
'FREMD': 'FOREIGN',
'Er stammt weder von pman noch von Proxmox.': 'It comes neither from pman nor from Proxmox.',
'Das Skript läuft danach interaktiv weiter; pman kann es nicht zurückrollen.':
'The script then continues interactively; pman cannot roll it back.',
'Quellstand {}: alle {} Quellen entsprechen dem geprüften Stand': 'Source status {}: all {} sources match the reviewed revision',
'Zurück zum Wartungsmenü': 'Back to the maintenance menu',
'Fremder Code – nicht von pman und nicht von Proxmox.': 'Foreign code – not from pman and not from Proxmox.',
'Enter öffnet das Menü; gestartet wird erst nach Bestätigung.': 'Enter opens the menu; nothing starts before you confirm.',
'Stufe': 'Level',
'Folge': 'Impact',
'Läuft': 'Runs',
'als root auf dem Host': 'as root on the host',
'Stand': 'Status',
'Datei': 'File',
'Quelle': 'Source',
'Befehl': 'Command',
'Core': 'Core',
'Community-Skript beendet.': 'Community script finished.',
'Skript': 'Script',
'Quellstand {}: {} von {} weichen ab - betroffene Tools sind blockiert':
'Source status {}: {} of {} differ - affected tools are blocked',
'Fremder Code, nicht von pman': 'Foreign code, not from pman',
'Web: ': 'Web: ',
'{} · {}-Lizenz': '{} · {} licence',
'{} Skripte, nach Absicht gruppiert:': '{} scripts, grouped by purpose:',
'Start': 'Start',
'Details': 'Details',
'Zeilen {}–{} von {}': 'Lines {}–{} of {}',
'geprüft {} ({})': 'reviewed {} ({})',
'blockiert: ': 'blocked: ',
'FREMDER CODE – läuft als root auf diesem Host ({}).': 'FOREIGN CODE – runs as root on this host ({}).',
'bash {} (pman lädt die Datei, prüft SHA-1 {}… und startet genau diese Bytes in einem Temp-Verzeichnis)':
'bash {} (pman downloads the file, checks SHA-1 {}… and starts exactly these bytes from a temporary directory)',
'core/core.func @ {} · Telemetrie (api.func) wird nicht geladen': 'core/core.func @ {} · telemetry (api.func) is not loaded',
'geprüft {} · Upstream live: unverändert': 'reviewed {} · upstream live: unchanged',
'Quellcode {} - genau diese {} Bytes werden gestartet.': 'Source code {} - exactly these {} bytes will be started.',
# community tool catalogue
'SMART-Übersicht; bietet optional einen kurzen SMART-Selbsttest an.': 'SMART overview; optionally offers a short SMART self-test.',
'Nur Diagnose bis auf Nachfrage. Kann smartmontools und nvme-cli per APT installieren.':
'Diagnosis only unless you agree to its prompt. May install smartmontools and nvme-cli via APT.',
'Diagnose; installiert nur auf Nachfrage Pakete': 'diagnosis; installs packages only if you agree',
'Erstellt ein benutzerdefiniertes Backup ausgewählter Host-Dateien und Verzeichnisse.':
'Creates a custom backup of selected host files and directories.',
'Schreibt ein Archiv am gewählten Ort. Ein Backup auf demselben Host schützt nicht gegen Host-Ausfall.':
'Writes an archive to the chosen location. A backup on the same host does not protect against host failure.',
'Aktualisiert Betriebssystempakete in ausgewählten LXC-Gästen.': 'Updates operating system packages in selected LXC guests.',
'Installiert Updates in bestätigten CTs; kann Dienste oder Gäste beeinflussen.':
'Installs updates in confirmed CTs; can affect services or guests.',
'TRIM für LXC-Dateisysteme auf SSD- und Thin-Provisioning-Speichern.': 'TRIM for LXC filesystems on SSD and thin-provisioned storage.',
'Ändert keine Gastdateien; meldet freie Blöcke an Storage. Betrifft ausgewählte CTs gemäß Helper-Menü.':
'Does not change guest files; reports free blocks to the storage. Affects the CTs selected in the helper menu.',
'Konfiguriert den CPU-Frequenz-Governor des Hosts.': 'Configures the CPU frequency governor of the host.',
'Ändert Host-Energie-/Leistungsverhalten und möglicherweise Startkonfiguration.':
'Changes host power/performance behaviour and possibly the boot configuration.',
'Entfernt nicht mehr benötigte Kernelpakete vom Proxmox-Host.': 'Removes kernel packages that are no longer needed from the Proxmox host.',
'Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive Kernel prüfen.':
'Removes packages on the host. Check the installed and active kernels before confirming.',
'Bereinigt Paketcache und auf Wunsch Logs in ausgewählten LXC-Gästen.': 'Cleans the package cache and, on request, logs in selected LXC guests.',
'Löscht gewählte Cache-/Log-Dateien in den bestätigten CTs; Logs sind danach nicht mehr verfügbar.':
'Deletes chosen cache/log files in the confirmed CTs; the logs are gone afterwards.',
'Findet nicht zugeordnete LVM-Volumes und bietet interaktives Entfernen an.': 'Finds unassigned LVM volumes and offers interactive removal.',
'Kann LVM-Volumes dauerhaft löschen. Helper-Auswahl sorgfältig prüfen; kein Papierkorb.':
'Can delete LVM volumes permanently. Check the helper selection carefully; there is no recycle bin.',
'PRÜFEN & SICHERN': 'CHECK & BACK UP',
'AKTUALISIEREN & OPTIMIEREN': 'UPDATE & OPTIMISE',
'AUFRÄUMEN – LÖSCHT DATEN': 'CLEAN UP – DELETES DATA',
'LESEN': 'READ',
'ändert nichts': 'changes nothing',
'ÄNDERT': 'CHANGE',
'verändert Host oder Gäste': 'changes the host or guests',
'LÖSCHT': 'DELETE',
'entfernt Daten oder Pakete, kein Papierkorb': 'removes data or packages, no recycle bin',
}
+12 -11
View File
@@ -7,26 +7,27 @@ from . import INTERFACE, VERSION
from .actions import Context, action_for, execute
from .runner import Runner
from .sources import check_sources, source_report
from .i18n import _
def main(argv=None):
parser = argparse.ArgumentParser(description='Optionales pman Speicher- und Wartungsmodul')
parser.add_argument('--interface', action='store_true', help='Maschinenlesbare Schnittstellenversion')
parser = argparse.ArgumentParser(description=_('Optionales pman Speicher- und Wartungsmodul'))
parser.add_argument('--interface', action='store_true', help=_('Maschinenlesbare Schnittstellenversion'))
parser.add_argument('--version', action='version', version=VERSION)
parser.add_argument('--scope', choices=('host', 'ct', 'vm'), default='host')
parser.add_argument('--id', type=int)
parser.add_argument('--scan-path', choices=('/var', '/home', '/opt', '/srv'), default='/var')
mode = parser.add_mutually_exclusive_group()
mode.add_argument('--check-sources', action='store_true', help='Öffentliche Quellmetadaten prüfen')
mode.add_argument('--sources', action='store_true', help='Herkunft und gespeicherten Status anzeigen')
mode.add_argument('--report', metavar='ACTION', help='Nur lesende Aktion ohne TUI ausführen')
parser.add_argument('--json', action='store_true', help='Diagnose als JSON ausgeben')
mode.add_argument('--check-sources', action='store_true', help=_('Öffentliche Quellmetadaten prüfen'))
mode.add_argument('--sources', action='store_true', help=_('Herkunft und gespeicherten Status anzeigen'))
mode.add_argument('--report', metavar='ACTION', help=_('Nur lesende Aktion ohne TUI ausführen'))
parser.add_argument('--json', action='store_true', help=_('Diagnose als JSON ausgeben'))
args = parser.parse_args(argv)
if args.interface:
print(json.dumps({'interface': INTERFACE, 'version': VERSION}))
return 0
if os.geteuid() != 0:
parser.error('Als root auf dem Proxmox-Host ausführen.')
parser.error(_('Als root auf dem Proxmox-Host ausführen.'))
try:
ctx = Context(args.scope, args.id, args.scan_path)
if args.check_sources:
@@ -37,13 +38,13 @@ def main(argv=None):
text = source_report()
elif args.report:
if action_for(args.report, ctx).mutation:
parser.error('Änderungen sind nur in der TUI mit Bestätigung möglich.')
parser.error(_('Änderungen sind nur in der TUI mit Bestätigung möglich.'))
text = execute(args.report, ctx, Runner())
else:
if args.json:
parser.error('--json benötigt --report oder --sources.')
parser.error(_('--json benötigt --report oder --sources.'))
if not sys.stdin.isatty() or not sys.stdout.isatty():
parser.error('TUI benötigt ein Terminal; --report für lesende CLI-Ausgaben verwenden.')
parser.error(_('TUI benötigt ein Terminal; --report für lesende CLI-Ausgaben verwenden.'))
from .ui import run_tui
run_tui(ctx)
return 0
@@ -55,7 +56,7 @@ def main(argv=None):
return 0
except (OSError, RuntimeError, ValueError) as exc:
from .ui import clean_text
print('Fehler: {}'.format(clean_text(exc)), file=sys.stderr)
print(_('Fehler: {}').format(clean_text(exc)), file=sys.stderr)
return 1
except KeyboardInterrupt:
print('Abgebrochen.', file=sys.stderr)
+14 -13
View File
@@ -11,6 +11,7 @@ from pathlib import Path
from . import sources
from .state import STATE, read_json
from .i18n import _
PROJECT_NAME = 'Proxmox VE Helper-Scripts'
EDITION = '(Community)'
@@ -95,7 +96,7 @@ def _fetch(url, limit=2 * 1024 * 1024):
with opener.open(request, timeout=12) as response:
body = response.read(limit + 1)
if len(body) > limit:
raise RuntimeError('Upstream-Datei überschreitet die erlaubte Größe.')
raise RuntimeError(_('Upstream-Datei überschreitet die erlaubte Größe.'))
return body
@@ -111,23 +112,23 @@ class SourceBlocked(RuntimeError):
def __init__(self, repository, path, reviewed, observed, status):
self.repository, self.path = repository, path
self.reviewed, self.observed, self.status = reviewed, observed, status
super().__init__('Upstream ist nicht als geprüfter Stand bestätigt ({}). Start abgebrochen.'.format(status))
super().__init__(_('Upstream ist nicht als geprüfter Stand bestätigt ({}). Start abgebrochen.').format(_(status)))
def lines(self):
lines = ['Start blockiert - nichts wurde ausgeführt.', '',
'Datei: {}/{}'.format(self.repository, self.path)]
lines = [_('Start blockiert - nichts wurde ausgeführt.'), '',
_('Datei: {}/{}').format(self.repository, self.path)]
if self.status == 'Upstream geändert' and self.observed:
lines.append('Geprüft {} -> aktuell {}'.format(self.reviewed[:7], self.observed[:7]))
lines.append(_('Geprüft {} -> aktuell {}').format(self.reviewed[:7], self.observed[:7]))
else:
lines.append('Status: {}'.format(self.status))
return lines + ['', 'pman startet nur Stände, die geprüft wurden.',
'Nächster Schritt: neuen pman-Release abwarten oder die Datei selbst prüfen.']
lines.append(_('Status: {}').format(_(self.status)))
return lines + ['', _('pman startet nur Stände, die geprüft wurden.'),
_('Nächster Schritt: neuen pman-Release abwarten oder die Datei selbst prüfen.')]
def _check_current(repository, path, expected):
reference = _reference(repository, path)
if not reference or reference['blob_sha'] != expected:
raise RuntimeError('Werkzeug fehlt in der geprüften Quellenliste.')
raise RuntimeError(_('Werkzeug fehlt in der geprüften Quellenliste.'))
result = sources.check_reference(reference)
if result.get('status') != 'geprüfter Stand':
raise SourceBlocked(repository, path, expected, result.get('observed_sha'),
@@ -138,20 +139,20 @@ def _download_pinned(repository, commit, path, expected):
url = 'https://raw.githubusercontent.com/{}/{}/{}'.format(repository, commit, path)
data = _fetch(url)
if git_blob_sha(data) != expected:
raise RuntimeError('Prüfsumme von {} passt nicht zum geprüften Stand.'.format(path))
raise RuntimeError(_('Prüfsumme von {} passt nicht zum geprüften Stand.').format(path))
return data
def level_text(tool):
"""'WORD – meaning' for the hazard level, with the tool's own qualification if it has one."""
word, meaning = LEVELS[tool['level']]
return '{} – {}'.format(word, tool.get('level_note', meaning))
return '{} – {}'.format(_(word), _(tool.get('level_note', meaning)))
def find_tool(tool_id):
tool = next((item for item in TOOLS if item['id'] == tool_id), None)
if not tool:
raise ValueError('Unbekanntes Community-Werkzeug.')
raise ValueError(_('Unbekanntes Community-Werkzeug.'))
return tool
@@ -183,7 +184,7 @@ def stored_status():
if observed:
if observed == expected:
return 'ok', ''
return 'bad', '{} geändert ({} → {})'.format(name, expected[:7], observed[:7])
return 'bad', _('{} geändert ({} → {})').format(name, expected[:7], observed[:7])
return 'bad', '{}: {}'.format(name, row.get('status', 'Prüfung fehlgeschlagen'))
core = finding(CORE_REPOSITORY, 'core/core.func')
+52
View File
@@ -0,0 +1,52 @@
"""Display language of the maintenance module: German (default) or English.
German source text is the catalog key; English comes from catalog_en.EN. A text
without an entry is shown as written, so a missing translation never breaks the UI.
Persisted identifiers (for example source-check statuses) stay German in files
and are translated only where they are displayed.
"""
import os
import stat
from pathlib import Path
from .catalog_en import EN
LANGUAGES = ('de', 'en')
DEFAULT = 'de'
# Written by install_dependencies.sh; only 'de' or 'en' is accepted from it.
CONFIG = Path('/etc/pman/language')
_override = None
def _from_config():
try:
info = CONFIG.lstat()
if not stat.S_ISREG(info.st_mode) or info.st_uid != 0 or info.st_mode & 0o022:
return ''
return CONFIG.read_text()[:16].strip().lower()
except OSError:
return ''
def language(env=None):
"""PMAN_LANG, then the installer's config file, then the German default."""
if _override:
return _override
env = os.environ if env is None else env
for value in (env.get('PMAN_LANG', ''), _from_config()):
value = value.strip().lower()[:2]
if value in LANGUAGES:
return value
return DEFAULT
def set_language(code):
"""Force a language (tests); None restores the normal resolution."""
global _override
if code is not None and code not in LANGUAGES:
raise ValueError('Unsupported language: {}'.format(code))
_override = code
def _(text):
return EN.get(text, text) if language() == 'en' else text
+5 -4
View File
@@ -6,6 +6,7 @@ import tempfile
import threading
import time
from dataclasses import dataclass
from .i18n import _
class CommandError(RuntimeError):
@@ -39,11 +40,11 @@ class Runner:
try:
while process.poll() is None:
if self.cancel.wait(.05):
reason = 'Abgebrochen; bereits ausgeführte Änderungen werden nicht rückgängig gemacht.'
reason = _('Abgebrochen; bereits ausgeführte Änderungen werden nicht rückgängig gemacht.')
elif time.monotonic() > deadline:
reason = 'Zeitlimit erreicht.'
reason = _('Zeitlimit erreicht.')
elif os.fstat(output.fileno()).st_size > 2 * 1024 * 1024:
reason = 'Ausgabelimit erreicht.'
reason = _('Ausgabelimit erreicht.')
if reason:
break
finally:
@@ -59,5 +60,5 @@ class Runner:
if reason:
raise CommandError(reason)
if allowed is not None and process.returncode not in allowed:
raise CommandError('{} (Exit {}): {}'.format(argv[0], process.returncode, text[:4000]))
raise CommandError(_('{} (Exit {}): {}').format(argv[0], process.returncode, text[:4000]))
return Result(argv, process.returncode, text)
+13 -12
View File
@@ -7,6 +7,7 @@ import urllib.parse
import urllib.request
from pathlib import Path
from .state import STATE, read_json, write_json
from .i18n import _
MANIFEST = Path(__file__).resolve().parent.parent / 'sources.json'
@@ -23,7 +24,7 @@ def fetch_metadata(url, etag=''):
with opener.open(request, timeout=8) as response:
body = response.read(1024 * 1024 + 1)
if len(body) > 1024 * 1024:
raise ValueError('API-Antwort zu groß.')
raise ValueError(_('API-Antwort zu groß.'))
return response.status, json.loads(body), response.headers.get('ETag', '')
except urllib.error.HTTPError as exc:
return exc.code, {}, ''
@@ -33,7 +34,7 @@ def check_reference(reference, fetch=fetch_metadata, previous=None):
previous = previous or {}
result = {'repository': reference['repository'], 'path': reference['path'],
'checked_at': datetime.datetime.now(datetime.timezone.utc).isoformat()}
directory, _, filename = reference['path'].rpartition('/')
directory, _sep, filename = reference['path'].rpartition('/')
path = urllib.parse.quote(directory, safe='/')
url = 'https://api.github.com/repos/{}/contents/{}'.format(reference['repository'], path)
try:
@@ -42,14 +43,14 @@ def check_reference(reference, fetch=fetch_metadata, previous=None):
sha = previous['observed_sha']
elif status == 200 and isinstance(data, list):
if any(not isinstance(row, dict) for row in data):
raise ValueError('Ungültige Metadatenliste.')
raise ValueError(_('Ungültige Metadatenliste.'))
entry = next((row for row in data if row.get('name') == filename and row.get('type') == 'file'), None)
if not entry:
result['status'] = 'Quelle fehlt'
return result
sha = entry.get('sha')
if not isinstance(sha, str) or not sha:
raise ValueError('Fehlende Git-Blob-Prüfsumme.')
raise ValueError(_('Fehlende Git-Blob-Prüfsumme.'))
elif status == 404:
result['status'] = 'Quelle fehlt'
return result
@@ -80,24 +81,24 @@ def source_report():
rows = [checked.get((reference['repository'], reference['path']), {})
for reference in manifest['references']]
counts = Counter(row.get('status', 'Noch nicht geprüft') for row in rows)
lines = ['Zuletzt geprüft: ' + status.get('checked_at', 'Noch nicht geprüft'),
'{} Quellen | geprüft: {} | geändert: {} | fehlen: {} | Fehler: {} | offen: {}'.format(
lines = [_('Zuletzt geprüft: ') + (status.get('checked_at') or _('Noch nicht geprüft')),
_('{} Quellen | geprüft: {} | geändert: {} | fehlen: {} | Fehler: {} | offen: {}').format(
len(rows), counts['geprüfter Stand'], counts['Upstream geändert'], counts['Quelle fehlt'],
counts['Prüfung fehlgeschlagen'], counts['Noch nicht geprüft']),
'Eigene Adapter; geprüfte Community-Tools nur auf Auswahl und mit Versionsprüfung.',
'', 'Referenzen:']
_('Eigene Adapter; geprüfte Community-Tools nur auf Auswahl und mit Versionsprüfung.'),
'', _('Referenzen:')]
for reference in manifest['references']:
row = checked.get((reference['repository'], reference['path']), {})
status_text = row.get('status', 'Noch nicht geprüft')
reviewed = reference['reviewed_commit'][:8]
observed = row.get('observed_sha')
if status_text == 'geprüfter Stand':
detail = 'geprüft: {}'.format(reviewed)
detail = _('geprüft: {}').format(reviewed)
elif status_text == 'Upstream geändert' and observed:
detail = 'Referenz {} → aktuell {}'.format(reviewed, observed[:8])
detail = _('Referenz {} → aktuell {}').format(reviewed, observed[:8])
else:
detail = status_text
detail = _(status_text)
lines.append('{} / {} | {}'.format(reference['repository'], reference['path'], detail))
if row.get('error'):
lines.append(' Fehler: ' + row['error'])
lines.append(_(' Fehler: ') + row['error'])
return '\n'.join(lines)
+4 -3
View File
@@ -4,6 +4,7 @@ import os
import stat
import tempfile
from pathlib import Path
from .i18n import _
STATE = Path('/var/lib/pman-maintenance')
@@ -14,7 +15,7 @@ def private_dir(path):
path.mkdir(mode=0o700, parents=False)
info = path.lstat()
if not stat.S_ISDIR(info.st_mode) or info.st_uid != os.geteuid() or info.st_mode & 0o022:
raise RuntimeError('Unsicheres Zustandsverzeichnis: {}'.format(path))
raise RuntimeError(_('Unsicheres Zustandsverzeichnis: {}').format(path))
return path
@@ -25,9 +26,9 @@ def read_json(path, default=None):
private_dir(path.parent)
info = path.lstat()
if not stat.S_ISREG(info.st_mode) or info.st_uid != os.geteuid() or info.st_mode & 0o022:
raise RuntimeError('Unsichere Zustandsdatei: {}'.format(path))
raise RuntimeError(_('Unsichere Zustandsdatei: {}').format(path))
if info.st_size > 2 * 1024 * 1024:
raise RuntimeError('Zustandsdatei zu groß.')
raise RuntimeError(_('Zustandsdatei zu groß.'))
return json.loads(path.read_text())
except (FileNotFoundError, json.JSONDecodeError):
return default
+71 -70
View File
@@ -13,6 +13,7 @@ from .sources import source_report
from .state import STATE, private_dir
from . import community, view
from .view import clean_text, wrap_output # noqa: F401 (re-exported for callers and tests)
from .i18n import _
def navigate(index, direction, count):
@@ -31,16 +32,16 @@ def terminal_usable(height, width):
def action_description(action):
descriptions = {
'storage': 'Zeigt Speicher, Dateisysteme und Inodes des Hosts.',
'smart': 'Liest SMART-Zustand und speichert einen lokalen Vergleichsstand.',
'maintenance': 'Zeigt TRIM-Zeitplanung, Kernel und Backup-Speicher.',
'volumes': 'Zeigt die konfigurierten Volumes des ausgewählten Gastes.',
'filesystems': 'Zeigt die Dateisystembelegung des ausgewählten Gastes.',
'scan': 'Untersucht große Verzeichnisse im ausgewählten CT-Pfad.',
'trim': 'Meldet freie Blöcke des ausgewählten Gastes an den Speicher.',
'cache-clean': 'Entfernt heruntergeladene APT-Paketarchive im ausgewählten CT.',
'storage': _('Zeigt Speicher, Dateisysteme und Inodes des Hosts.'),
'smart': _('Liest SMART-Zustand und speichert einen lokalen Vergleichsstand.'),
'maintenance': _('Zeigt TRIM-Zeitplanung, Kernel und Backup-Speicher.'),
'volumes': _('Zeigt die konfigurierten Volumes des ausgewählten Gastes.'),
'filesystems': _('Zeigt die Dateisystembelegung des ausgewählten Gastes.'),
'scan': _('Untersucht große Verzeichnisse im ausgewählten CT-Pfad.'),
'trim': _('Meldet freie Blöcke des ausgewählten Gastes an den Speicher.'),
'cache-clean': _('Entfernt heruntergeladene APT-Paketarchive im ausgewählten CT.'),
}
return '{}: {}'.format('Änderung mit Bestätigung' if action.mutation else 'Diagnose',
return '{}: {}'.format(_('Änderung mit Bestätigung') if action.mutation else _('Diagnose'),
descriptions.get(action.id, action.title))
@@ -51,7 +52,7 @@ def mutate(key, ctx, runner):
try:
info = os.fstat(fd)
if info.st_uid != os.geteuid() or info.st_mode & 0o022:
raise RuntimeError('Unsichere Wartungssperre.')
raise RuntimeError(_('Unsichere Wartungssperre.'))
fcntl.flock(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
return execute(key, ctx, runner, confirmed=True)
finally:
@@ -65,11 +66,11 @@ def run_tui(ctx):
except locale.Error:
locale.setlocale(locale.LC_ALL, '')
if not locale.getpreferredencoding(False).lower().replace('-', '').startswith('utf8'):
raise RuntimeError('Für die Oberfläche ist eine UTF-8-Locale erforderlich.')
raise RuntimeError(_('Für die Oberfläche ist eine UTF-8-Locale erforderlich.'))
try:
curses.wrapper(_screen, ctx)
except curses.error as exc:
raise RuntimeError('Terminal unterstützt die Oberfläche nicht; TERM und Fenstergröße prüfen.') from exc
raise RuntimeError(_('Terminal unterstützt die Oberfläche nicht; TERM und Fenstergröße prüfen.')) from exc
finally:
# curses restores terminal mode but leaves the cursor at the last status row.
print()
@@ -143,7 +144,7 @@ def _screen(screen, ctx):
host = socket.gethostname()
selected = 0
scroll = 0
output = [action_description(registry(ctx)[0]), '', 'Enter startet die Diagnose.']
output = [action_description(registry(ctx)[0]), '', _('Enter startet die Diagnose.')]
pending = None
pending_community = None
previewing = False
@@ -158,7 +159,7 @@ def _screen(screen, ctx):
cancel = threading.Event()
messages = queue.Queue()
worker = None
status = 'Bereit'
status = _('Bereit')
page = 1
total = 0
@@ -167,7 +168,7 @@ def _screen(screen, ctx):
busy_kind = kind
cancel.clear()
busy = True
status = 'Prüfung läuft – Esc bricht ab'
status = _('Prüfung läuft – Esc bricht ab')
def job():
try:
runner = Runner(cancel)
@@ -193,43 +194,43 @@ def _screen(screen, ctx):
actions = registry(ctx)
if community_mode:
output = (view.community_detail(community.TOOLS[community_selected], stored)
if community_selected < len(community.TOOLS) else ['Zurück zum Wartungsmenü.'])
if community_selected < len(community.TOOLS) else [_('Zurück zum Wartungsmenü.')])
elif selected < len(actions):
output = [action_description(actions[selected]), '', 'Quelle: ' + actions[selected].source]
output = [action_description(actions[selected]), '', _('Quelle: ') + _(actions[selected].source)]
elif ctx.scope == 'host' and selected == len(actions):
output = view.community_intro()
else:
output = ['Herkunft und Aktualitätsstatus', 'Enter öffnet diese Ansicht.']
output = [_('Herkunft und Aktualitätsstatus'), _('Enter öffnet diese Ansicht.')]
def help_text(page, total):
if busy:
return 'Esc/q Abbruch | danach q Ende'
return _('Esc/q Abbruch | danach q Ende')
if previewing:
return '↑↓ PgUp/PgDn blättern | Esc zurück zur Bestätigung'
return _('↑↓ PgUp/PgDn blättern | Esc zurück zur Bestätigung')
if pending_community:
return ('PgDn: alle Details lesen | Esc/n Abbruch' if scroll + page < total
else 'v Quellcode | j Starten | Esc/n Abbruch | PgUp/PgDn')
return (_('PgDn: alle Details lesen | Esc/n Abbruch') if scroll + page < total
else _('v Quellcode | j Starten | Esc/n Abbruch | PgUp/PgDn'))
if pending:
return ('PgDn: alle Details lesen | Esc/n Abbruch' if scroll + page < total
else 'j Bestätigen | Esc/n Abbruch | PgUp/PgDn')
return (_('PgDn: alle Details lesen | Esc/n Abbruch') if scroll + page < total
else _('j Bestätigen | Esc/n Abbruch | PgUp/PgDn'))
if detail_mode:
return 'PgUp/PgDn Blättern | Esc Zurück | q Ende'
return _('PgUp/PgDn Blättern | Esc Zurück | q Ende')
if community_mode:
return '↑↓ Auswahl | Enter prüfen & bestätigen | Esc zurück | q Ende'
return _('↑↓ Auswahl | Enter prüfen & bestätigen | Esc zurück | q Ende')
if ctx.scope == 'ct':
return '↑↓ Auswahl | Enter | Tab Pfad | Esc | q Ende'
return '↑↓ Auswahl | Enter | PgUp/PgDn | Esc | q Ende'
return _('↑↓ Auswahl | Enter | Tab Pfad | Esc | q Ende')
return _('↑↓ Auswahl | Enter | PgUp/PgDn | Esc | q Ende')
def build_model(height):
actions = registry(ctx)
modal = bool(detail_mode or pending or pending_community or busy)
crumb = ''
if community_mode:
crumb = 'Community-Skript starten?' if pending_community else 'Community-Skripte'
crumb = _('Community-Skript starten?') if pending_community else _('Community-Skripte')
elif ctx.scope == 'ct':
crumb = 'Scan: ' + ctx.mount
crumb = _('Scan: ') + ctx.mount
title = ' | '.join(part for part in (
'pman Wartung', '{} {}'.format(ctx.scope.upper(), ctx.id or '').strip(), crumb) if part)
_('pman Wartung'), '{} {}'.format(ctx.scope.upper(), ctx.id or '').strip(), crumb) if part)
if community_mode:
rows = view.community_rows(stored)
active = community_selected
@@ -241,11 +242,11 @@ def _screen(screen, ctx):
else [r for r in rows if r.kind != 'header'][active].label)
return view.Model(
title=title, rows=rows, selected=active, detail=output, modal=modal,
modal_title='Auswahl: ' + selected_title,
modal_title=_('Auswahl: ') + selected_title,
prov=view.provenance(view.status_line(stored)) if community_mode else None,
scroll=scroll, help=help_text, status=status,
small=('Terminal mindestens 45 Spalten und 12 Zeilen.',
'Esc/q: Abbruch; danach q beendet.' if busy else 'Vergrößern oder q zum Beenden.'),
small=(_('Terminal mindestens 45 Spalten und 12 Zeilen.'),
_('Esc/q: Abbruch; danach q beendet.') if busy else _('Vergrößern oder q zum Beenden.')),
details_heading=not community_mode)
try:
@@ -256,31 +257,31 @@ def _screen(screen, ctx):
scroll = 0
flush_confirmation = True
if cancel.is_set():
output = (['Abbruch angefordert. Die Änderung kann teilweise oder vollständig',
'ausgeführt worden sein; dies ist kein Rollback. Zustand prüfen.']
output = ([_('Abbruch angefordert. Die Änderung kann teilweise oder vollständig'),
_('ausgeführt worden sein; dies ist kein Rollback. Zustand prüfen.')]
if busy_kind == 'mutate' else
['Abgebrochen; keine bestätigte Änderung wurde gestartet.'])
[_('Abgebrochen; keine bestätigte Änderung wurde gestartet.')])
detail_mode = True
status = 'Abgebrochen'
status = _('Abgebrochen')
elif kind == 'community-check':
pending_community = value
output = view.confirm_blocks(value, host)
status = 'Wartet auf Bestätigung'
status = _('Wartet auf Bestätigung')
elif kind == 'prepare':
pending = action
output = ['Ziel: ' + value['target'], 'Befehl: ' + value['display'], value['impact'],
'', 'Änderung ausführen? j = bestätigen, Esc = abbrechen',
'Abbruch eines laufenden Befehls ist kein Rollback.']
status = 'Bestätigung erforderlich'
output = [_('Ziel: ') + value['target'], _('Befehl: ') + value['display'], value['impact'],
'', _('Änderung ausführen? j = bestätigen, Esc = abbrechen'),
_('Abbruch eines laufenden Befehls ist kein Rollback.')]
status = _('Bestätigung erforderlich')
elif kind == 'error' and isinstance(value, community.SourceBlocked):
output = value.lines()
detail_mode = True
status = 'Start blockiert'
status = _('Start blockiert')
else:
text = value if kind != 'error' else str(value)
output = clean_text(text).expandtabs(4).splitlines() or ['Keine Ausgabe.']
output = clean_text(text).expandtabs(4).splitlines() or [_('Keine Ausgabe.')]
detail_mode = True
status = ('Abgebrochen' if cancel.is_set() else 'Fehlgeschlagen') if kind == 'error' else 'Erfolgreich'
status = (_('Abgebrochen') if cancel.is_set() else _('Fehlgeschlagen')) if kind == 'error' else _('Erfolgreich')
except queue.Empty:
pass
screen.erase()
@@ -312,10 +313,10 @@ def _screen(screen, ctx):
pending_community = None
detail_mode = True
if confirming:
output = ['Eingabepuffer konnte nicht geleert werden; Bestätigung abgebrochen.']
output = [_('Eingabepuffer konnte nicht geleert werden; Bestätigung abgebrochen.')]
else:
output += ['', 'Eingabepuffer konnte nicht geleert werden. Ergebnis oben beachten.']
status = 'Eingabefehler'
output += ['', _('Eingabepuffer konnte nicht geleert werden. Ergebnis oben beachten.')]
status = _('Eingabefehler')
continue
key = screen.getch()
if key == -1:
@@ -323,14 +324,14 @@ def _screen(screen, ctx):
if not terminal_usable(height, width):
if busy and key in (27, ord('q')):
cancel.set()
status = 'Abbruch angefordert.'
status = _('Abbruch angefordert.')
elif key == ord('q'):
return
continue
if busy:
if key in (27, ord('q')):
cancel.set()
status = 'Abbruch angefordert; CT-Scan kann bis zum Gast-Zeitlimit (55 s) weiterlaufen.'
status = _('Abbruch angefordert; CT-Scan kann bis zum Gast-Zeitlimit (55 s) weiterlaufen.')
continue
if previewing:
if key in (curses.KEY_PPAGE, curses.KEY_NPAGE):
@@ -342,7 +343,7 @@ def _screen(screen, ctx):
elif key in (27, ord('n'), ord('N')):
previewing = False
output, scroll = saved_view
status = 'Wartet auf Bestätigung'
status = _('Wartet auf Bestätigung')
elif key == ord('q'):
return
continue
@@ -350,7 +351,7 @@ def _screen(screen, ctx):
scroll = page_offset(scroll, -1 if key == curses.KEY_PPAGE else 1, page, total)
continue
if (pending or pending_community) and key in (ord('j'), ord('J')) and scroll + page < total:
status = 'Bitte zuerst alle Details mit Bild ab lesen.'
status = _('Bitte zuerst alle Details mit Bild ab lesen.')
continue
if pending_community:
if key in (ord('v'), ord('V')):
@@ -358,12 +359,12 @@ def _screen(screen, ctx):
previewing = True
output = view.preview_blocks(pending_community)
scroll = 0
status = 'Quellcode-Vorschau – es wird nichts ausgeführt'
status = _('Quellcode-Vorschau – es wird nichts ausgeführt')
continue
if key in (ord('j'), ord('J')):
launch = pending_community
pending_community = None
status = 'Prüfe Quellstand und starte Helper Script …'
status = _('Prüfe Quellstand und starte Helper Script …')
screen.addnstr(height - 1, 0, ' ' * (width - 1), width - 1)
screen.addnstr(height - 1, 0, status, width - 1, curses.A_BOLD)
screen.refresh()
@@ -372,15 +373,15 @@ def _screen(screen, ctx):
exit_code = community.run_launch(launch)
detail_mode = True
output = view.result_blocks(launch, exit_code)
status = 'Abgeschlossen' if exit_code == 0 else 'Helper Script mit Fehler beendet'
status = _('Abgeschlossen') if exit_code == 0 else _('Helper Script mit Fehler beendet')
except community.SourceBlocked as exc:
detail_mode = True
output = exc.lines()
status = 'Start blockiert'
status = _('Start blockiert')
except Exception as exc:
detail_mode = True
output = ['Start abgebrochen:', clean_text(exc)]
status = 'Quelle geändert, nicht verfügbar oder Start fehlgeschlagen'
output = [_('Start abgebrochen:'), clean_text(exc)]
status = _('Quelle geändert, nicht verfügbar oder Start fehlgeschlagen')
finally:
last_links = None
try:
@@ -392,8 +393,8 @@ def _screen(screen, ctx):
continue
if key in (27, ord('n'), ord('N'), ord('q')):
pending_community = None
output = ['Start abgebrochen; es wurde kein Helper Script ausgeführt.']
status = 'Abgebrochen'
output = [_('Start abgebrochen; es wurde kein Helper Script ausgeführt.')]
status = _('Abgebrochen')
if key == ord('q'):
return
continue
@@ -404,8 +405,8 @@ def _screen(screen, ctx):
start('mutate', action)
elif key in (27, ord('n'), ord('N'), ord('q')):
pending = None
output = ['Änderung abgebrochen.']
status = 'Abgebrochen'
output = [_('Änderung abgebrochen.')]
status = _('Abgebrochen')
if key == ord('q'):
return
continue
@@ -415,13 +416,13 @@ def _screen(screen, ctx):
if detail_mode:
detail_mode = False
show_selection()
status = 'Bereit'
status = _('Bereit')
continue
if community_mode:
community_mode = False
selected = len(registry(ctx))
show_selection()
status = 'Bereit'
status = _('Bereit')
continue
return
if detail_mode and key not in (curses.KEY_PPAGE, curses.KEY_NPAGE):
@@ -430,7 +431,7 @@ def _screen(screen, ctx):
step = -1 if key == curses.KEY_UP else 1
if community_mode:
community_selected = navigate(community_selected, step, len(community.TOOLS) + 1)
status = 'Bereit – es wurde noch nichts gestartet'
status = _('Bereit – es wurde noch nichts gestartet')
else:
selected = navigate(selected, step, len(registry(ctx)) + (2 if ctx.scope == 'host' else 1))
show_selection()
@@ -446,17 +447,17 @@ def _screen(screen, ctx):
community_mode = False
selected = len(actions)
show_selection()
status = 'Bereit'
status = _('Bereit')
else:
output = ['Prüfe den aktuellen Upstream-Stand und lade die Datei …',
'Das kann bis zu einer Minute dauern; Esc bricht ab.']
output = [_('Prüfe den aktuellen Upstream-Stand und lade die Datei …'),
_('Das kann bis zu einer Minute dauern; Esc bricht ab.')]
start('community-check', community.TOOLS[community_selected])
elif ctx.scope == 'host' and selected == len(actions):
community_mode = True
community_selected = 0
stored = _stored_status()
show_selection()
status = 'Bereit – es wurde noch nichts gestartet'
status = _('Bereit – es wurde noch nichts gestartet')
elif selected == len(actions) + (1 if ctx.scope == 'host' else 0):
start('sources')
else:
+46 -44
View File
@@ -10,6 +10,7 @@ from collections import namedtuple
from dataclasses import dataclass, field
from . import community
from .i18n import _
# One drawn run of text. style: see attr_flags(); link: URL the text spells out.
Seg = namedtuple('Seg', 'y x text style link')
@@ -22,7 +23,7 @@ Field = namedtuple('Field', 'label text link style', defaults=(None, 'plain'))
# Menu row. kind: header | item | tool | back; level: hazard level of a tool.
Row = namedtuple('Row', 'kind label tag flag level', defaults=('', False, ''))
FIELD_INDENT = 7
FIELD_INDENT = 7 # minimum; grows with the longest label of a block (plus two spaces)
MIN_HEIGHT, MIN_WIDTH = 12, 45
# Badge colours as xterm-256 indices (fixed RGB, so contrast does not depend on
@@ -56,11 +57,12 @@ def wrap_output(lines, width):
def wrap_blocks(blocks, width):
"""Turn strings, L and Field blocks into display lines (L) no wider than width."""
out = []
indent = max([FIELD_INDENT] + [len(b.label) + 2 for b in blocks if isinstance(b, Field)])
for block in blocks:
if isinstance(block, Field):
pieces = _wrap(block.text, width - FIELD_INDENT)
pieces = _wrap(block.text, width - indent)
for index, piece in enumerate(pieces):
lead = block.label.ljust(FIELD_INDENT) if index == 0 else ' ' * FIELD_INDENT
lead = block.label.ljust(indent) if index == 0 else ' ' * indent
out.append(L(piece, block.link, block.style, lead))
continue
if not isinstance(block, L):
@@ -76,7 +78,7 @@ def attr_flags(style, color=''):
color is '256' only when the terminal has fixed 256 colours and NO_COLOR is
unset; otherwise no colour is ever set and the text tags carry the meaning.
"""
base, _, mod = style.partition('+')
base, _sep, mod = style.partition('+')
if base.startswith('tag_'):
if color == '256':
return 'B' + BADGE_LETTER[base]
@@ -132,12 +134,12 @@ def provenance(status_line=''):
def status_line(stored):
"""One line about the last stored upstream check (no network involved)."""
if not stored['checked_at']:
return 'Quellstand: noch nie geprüft - Start prüft live.'
return _('Quellstand: noch nie geprüft - Start prüft live.')
day = stored['checked_at'][:10]
if stored['deviating']:
return 'Quellstand {}: {} von {} weichen ab - betroffene Tools sind blockiert'.format(
return _('Quellstand {}: {} von {} weichen ab - betroffene Tools sind blockiert').format(
day, stored['deviating'], stored['total'])
return 'Quellstand {}: alle {} Quellen entsprechen dem geprüften Stand'.format(day, stored['total'])
return _('Quellstand {}: alle {} Quellen entsprechen dem geprüften Stand').format(day, stored['total'])
def _prov_rows(prov, mode, width):
@@ -145,13 +147,13 @@ def _prov_rows(prov, mode, width):
name = '{} · {} · '.format(prov['name'], prov['license'])
if mode == 'short':
return [[(name, 'accent', None), (prov['web'], 'plain', prov['web'])], 'rule']
first = [(name + 'Fremder Code, nicht von pman', 'accent', None)]
first = [(name + _('Fremder Code, nicht von pman'), 'accent', None)]
status = [(prov['status'], 'plain', None)]
if mode == 'compact':
return [first, status, 'rule']
return [first,
[('Web: ', 'plain', None), (prov['web'], 'plain', prov['web'])],
[('Quelle: ', 'plain', None), (prov['repo'], 'plain', prov['repo'])],
[(_('Web: '), 'plain', None), (prov['web'], 'plain', prov['web'])],
[(_('Quelle: '), 'plain', None), (prov['repo'], 'plain', prov['repo'])],
status, 'rule']
@@ -203,7 +205,7 @@ def render(m, height, width, ascii_only=False):
put(line, '│', x=menu_w)
detail_x, detail_width, start_y = menu_w + 2, width - menu_w - 3, list_top
if m.details_heading:
put(1, 'Details', 'accent', x=detail_x)
put(1, _('Details'), 'accent', x=detail_x)
else:
list_top = top if m.prov else 2
list_height = min(len(m.rows), max(2, height // 4))
@@ -222,7 +224,7 @@ def render(m, height, width, ascii_only=False):
put(line, display.text, display.style, x=x, limit=max(1, detail_width - (x - detail_x)),
link=display.link)
if len(wrapped) > page:
put(height - 3, 'Zeilen {}–{} von {}'.format(scroll + 1, min(len(wrapped), scroll + page),
put(height - 3, _('Zeilen {}–{} von {}').format(scroll + 1, min(len(wrapped), scroll + page),
len(wrapped)))
put(height - 2, m.help(page, len(wrapped)) if callable(m.help) else m.help)
put(height - 1, m.status, 'accent')
@@ -237,7 +239,7 @@ def _put_row(put, y, row, selected, limit, flag_x):
mark = '> ' if selected else ' '
if row.kind == 'item' and row.tag:
text = mark + row.label
x = max(len(text) + 1, min(limit - 9, 30)) # badges line up where the label leaves room
x = max(len(text) + 1, min(limit - len(row.tag) - 1, 30)) # badges line up where the label leaves room
put(y, text.ljust(limit) if selected else text, style, limit=limit)
put(y, row.tag, 'tag_{}{}'.format(row.level, '+sel' if selected else ''), x=x, limit=limit)
return
@@ -277,18 +279,18 @@ def snapshot(frame, height, width, color=''):
def tag_text(level):
"""Fixed-width text tag; 'ext' marks code that does not come from pman."""
word = community.LEVELS[level][0] if level in community.LEVELS else 'FREMD'
word = _(community.LEVELS[level][0]) if level in community.LEVELS else _('FREMD')
return '[{}]'.format(word.ljust(6))
def main_rows(actions, scope):
"""Rows of the maintenance menu: changing actions and external code carry a badge."""
rows = [Row('item', a.title, tag_text('change') if a.mutation else '', False,
rows = [Row('item', _(a.title), tag_text('change') if a.mutation else '', False,
'change' if a.mutation else '') for a in actions]
if scope == 'host':
rows.append(Row('item', 'Helper-Scripts ({}) ▸'.format(len(community.TOOLS)), tag_text('ext'),
False, 'ext'))
rows.append(Row('item', 'Herkunft und Aktualitätsstatus'))
rows.append(Row('item', _('Herkunft und Aktualitätsstatus')))
return rows
@@ -298,10 +300,10 @@ def community_rows(stored):
for tool in community.TOOLS:
if tool['group'] != group:
group = tool['group']
rows.append(Row('header', titles[group]))
rows.append(Row('header', _(titles[group])))
rows.append(Row('tool', tool['label'], tag_text(tool['level']),
stored['tools'][tool['id']]['flagged'], tool['level']))
rows.append(Row('back', 'Zurück zum Wartungsmenü'))
rows.append(Row('back', _('Zurück zum Wartungsmenü')))
return rows
@@ -311,25 +313,25 @@ def community_intro():
for tool in community.TOOLS:
counts[tool['group']] = counts.get(tool['group'], 0) + 1
lines = [L(community.PROJECT_NAME, style='accent'),
'{} · {}-Lizenz'.format(community.EDITION, community.LICENSE),
L('Fremder Code – nicht von pman und nicht von Proxmox.', style='accent'),
_('{} · {}-Lizenz').format(community.EDITION, community.LICENSE),
L(_('Fremder Code – nicht von pman und nicht von Proxmox.'), style='accent'),
'', L(community.WEBSITE, community.WEBSITE), '',
'{} Skripte, nach Absicht gruppiert:'.format(len(community.TOOLS))]
lines += [' {} ({})'.format(title, counts[key])
_('{} Skripte, nach Absicht gruppiert:').format(len(community.TOOLS))]
lines += [' {} ({})'.format(_(title), counts[key])
for key, title in groups.items()]
return lines + ['', 'Enter öffnet das Menü; gestartet wird erst nach Bestätigung.']
return lines + ['', _('Enter öffnet das Menü; gestartet wird erst nach Bestätigung.')]
def community_detail(tool, stored):
blocks = [L(tool['title'], style='accent'), tool['summary'], '',
Field('Stufe', community.level_text(tool), style='accent'),
Field('Folge', tool['impact']),
Field('Läuft', 'als root auf dem Host'),
Field('Stand', 'geprüft {} ({})'.format(community.reviewed_at(), community.REVIEWED_COMMIT[:7])),
Field('Datei', tool['path'])]
blocks = [L(tool['title'], style='accent'), _(tool['summary']), '',
Field(_('Stufe'), community.level_text(tool), style='accent'),
Field(_('Folge'), _(tool['impact'])),
Field(_('Läuft'), _('als root auf dem Host')),
Field(_('Stand'), _('geprüft {} ({})').format(community.reviewed_at(), community.REVIEWED_COMMIT[:7])),
Field(_('Datei'), tool['path'])]
info = stored['tools'][tool['id']]
if info['flagged']:
blocks.append(Field('Start', 'blockiert: ' + info['reason'], style='warn'))
blocks.append(Field(_('Start'), _('blockiert: ') + info['reason'], style='warn'))
return blocks
@@ -338,32 +340,32 @@ def confirm_blocks(launch, host):
url = community.source_url(tool)
name = tool['path'].rpartition('/')[2]
return [L(tool['title'], style='accent'),
Field('Stufe', community.level_text(tool), style='accent'),
Field(_('Stufe'), community.level_text(tool), style='accent'),
'',
L('FREMDER CODE – läuft als root auf diesem Host ({}).'.format(host), style='accent'),
'Er stammt weder von pman noch von Proxmox.',
L(_('FREMDER CODE – läuft als root auf diesem Host ({}).').format(host), style='accent'),
_('Er stammt weder von pman noch von Proxmox.'),
'',
Field('Quelle', url, url),
Field('Befehl', 'bash {} (pman lädt die Datei, prüft SHA-1 {}… und startet genau diese '
'Bytes in einem Temp-Verzeichnis)'.format(name, tool['sha'][:7])),
Field('Core', 'core/core.func @ {} · Telemetrie (api.func) wird nicht geladen'.format(
Field(_('Quelle'), url, url),
Field(_('Befehl'), _('bash {} (pman lädt die Datei, prüft SHA-1 {}… und startet genau diese '
'Bytes in einem Temp-Verzeichnis)').format(name, tool['sha'][:7])),
Field(_('Core'), _('core/core.func @ {} · Telemetrie (api.func) wird nicht geladen').format(
community.CORE_COMMIT[:7])),
Field('Stand', 'geprüft {} · Upstream live: unverändert'.format(community.reviewed_at())),
Field('Folge', tool['impact']),
Field(_('Stand'), _('geprüft {} · Upstream live: unverändert').format(community.reviewed_at())),
Field(_('Folge'), _(tool['impact'])),
'',
'Das Skript läuft danach interaktiv weiter; pman kann es nicht zurückrollen.']
_('Das Skript läuft danach interaktiv weiter; pman kann es nicht zurückrollen.')]
def preview_blocks(launch):
tool = launch.tool
text = launch.script.decode('utf-8', 'replace')
return [L('Quellcode {} - genau diese {} Bytes werden gestartet.'.format(
return [L(_('Quellcode {} - genau diese {} Bytes werden gestartet.').format(
tool['path'].rpartition('/')[2], len(launch.script)), style='accent'),
'SHA-1 (Git-Blob): ' + tool['sha'], ''] + text.splitlines()
def result_blocks(launch, exit_code):
url = community.source_url(launch.tool)
return [L('Community-Skript beendet.', style='accent'),
Field('Skript', launch.tool['title']), Field('Exit', str(exit_code)),
Field('Quelle', url, url)]
return [L(_('Community-Skript beendet.'), style='accent'),
Field(_('Skript'), launch.tool['title']), Field('Exit', str(exit_code)),
Field(_('Quelle'), url, url)]
+1 -1
View File
@@ -2,4 +2,4 @@
import BaseLayout from '../layouts/BaseLayout.astro';
---
<BaseLayout title="Wartung"><div class="wrap"><section class="hero"><p class="eyebrow">Optionales Modul</p><h1>Host und Gäste prüfen.</h1><p class="lead">Storage, Inodes und SMART im Terminal untersuchen. Änderungen bleiben bestätigungspflichtig.</p></section><section class="block"><h2>Installation und Bedienung</h2><pre><code>./install_dependencies.sh --with-maintenance
pman --maintenance</code></pre><p>Python 3.9+, curses und ein UTF-8-Terminal sind erforderlich. Im Hauptmenü öffnet <code>m</code> die Host-Wartung, im Gastmenü die Wartung des gewählten Gastes. Pfeiltasten wählen, Enter öffnet, Esc bricht ab, <code>q</code> beendet.</p><p>Diagnosen zeigen Storage, ZFS/LVM, Inodes und SMART am Host sowie Volumes oder Dateisysteme für CT/VM. TRIM und Cache-Bereinigung benötigen eine gesonderte Bestätigung; <code>--force</code> umgeht diese nicht. Ein Abbruch laufender Änderungen ist kein Rollback.</p><h2>Proxmox VE Helper-Scripts (Community)</h2><p>Das Host-Menü bietet acht ausgewählte Skripte der <a href="https://community-scripts.org">Proxmox VE Helper-Scripts</a> (Repository <code>community-scripts/ProxmoxVE</code>, MIT-Lizenz). Es ist fremder Code: weder pman noch Proxmox haben ihn geschrieben, und er läuft als root auf dem Host.</p><p>Die Skripte sind nach Absicht gruppiert, jedes trägt seine Gefahrenstufe als Text: <code>[LESEN]</code> (Diagnose; Disk Health installiert nur auf Nachfrage Pakete), <code>[ÄNDERT]</code> (verändert Host oder Gäste) oder <code>[LÖSCHT]</code> (entfernt Daten oder Pakete, kein Papierkorb). Farbe ist nur ein zusätzlicher Hinweis; <code>NO_COLOR=1</code>, <code>PMAN_ASCII=1</code> und <code>PMAN_HYPERLINKS=1|0</code> steuern die Darstellung.</p><p>Vor der Bestätigung prüft pman den Upstream-Stand live und lädt die festgelegte Revision herunter. Der Bestätigungsschirm zeigt die genaue Quell-URL, den Befehl, den Root-Hinweis sowie Revision und Prüfsumme. Mit <code>v</code> lässt sich das geprüfte Skript ansehen; nach <code>j</code> werden genau diese Bytes gestartet. Geänderte, fehlende oder nicht erreichbare Quellen blockieren den Start und werden mit Datei und Revision benannt. Die Hashprüfung ist keine Sicherheitsgarantie: Skripte können Host und Gäste ändern. Wirkung und Quelle vor jeder Bestätigung prüfen.</p><p><a href="https://github.com/TimInTech/proxmox-manager/blob/main/docs/maintenance.md">Vollständige Wartungsdokumentation auf GitHub ↗</a></p></section></div></BaseLayout>
pman --maintenance</code></pre><p>Python 3.9+, curses und ein UTF-8-Terminal sind erforderlich. Die Oberfläche gibt es auf Deutsch (Standard) und Englisch: Der Installer fragt im Terminal <code>Language / Sprache [de/en]</code> oder nimmt <code>--lang de|en</code>; <code>PMAN_LANG=en</code> überschreibt die Wahl für einen Lauf. Im Hauptmenü öffnet <code>m</code> die Host-Wartung, im Gastmenü die Wartung des gewählten Gastes. Pfeiltasten wählen, Enter öffnet, Esc bricht ab, <code>q</code> beendet.</p><p>Diagnosen zeigen Storage, ZFS/LVM, Inodes und SMART am Host sowie Volumes oder Dateisysteme für CT/VM. TRIM und Cache-Bereinigung benötigen eine gesonderte Bestätigung; <code>--force</code> umgeht diese nicht. Ein Abbruch laufender Änderungen ist kein Rollback.</p><h2>Proxmox VE Helper-Scripts (Community)</h2><p>Das Host-Menü bietet acht ausgewählte Skripte der <a href="https://community-scripts.org">Proxmox VE Helper-Scripts</a> (Repository <code>community-scripts/ProxmoxVE</code>, MIT-Lizenz). Es ist fremder Code: weder pman noch Proxmox haben ihn geschrieben, und er läuft als root auf dem Host.</p><p>Die Skripte sind nach Absicht gruppiert, jedes trägt seine Gefahrenstufe als Text: <code>[LESEN]</code> (Diagnose; Disk Health installiert nur auf Nachfrage Pakete), <code>[ÄNDERT]</code> (verändert Host oder Gäste) oder <code>[LÖSCHT]</code> (entfernt Daten oder Pakete, kein Papierkorb). Farbe ist nur ein zusätzlicher Hinweis; <code>NO_COLOR=1</code>, <code>PMAN_ASCII=1</code> und <code>PMAN_HYPERLINKS=1|0</code> steuern die Darstellung.</p><p>Vor der Bestätigung prüft pman den Upstream-Stand live und lädt die festgelegte Revision herunter. Der Bestätigungsschirm zeigt die genaue Quell-URL, den Befehl, den Root-Hinweis sowie Revision und Prüfsumme. Mit <code>v</code> lässt sich das geprüfte Skript ansehen; nach <code>j</code> werden genau diese Bytes gestartet. Geänderte, fehlende oder nicht erreichbare Quellen blockieren den Start und werden mit Datei und Revision benannt. Die Hashprüfung ist keine Sicherheitsgarantie: Skripte können Host und Gäste ändern. Wirkung und Quelle vor jeder Bestätigung prüfen.</p><p><a href="https://github.com/TimInTech/proxmox-manager/blob/main/docs/maintenance.md">Vollständige Wartungsdokumentation auf GitHub ↗</a></p></section></div></BaseLayout>
@@ -0,0 +1,83 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Start blocked - nothing was executed.
File: community-scripts/core/core/core.func
Reviewed 1111111 -> current 2222222
pman only starts revisions that have been reviewed.
Next step: wait for a new pman release or review the file yourself.
PgUp/PgDn Scroll | Esc Back | q Quit
Start blocked
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,83 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Start blocked - nothing was executed.
File: community-scripts/core/core/core.func
Reviewed 1111111 -> current 2222222
pman only starts revisions that have been reviewed.
Next step: wait for a new pman release or review the file yourself.
PgUp/PgDn Scroll | Esc Back | q Quit
Start blocked
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,51 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────
Start blocked - nothing was executed.
File: community-scripts/core/core/core.func
Reviewed 1111111 -> current 2222222
pman only starts revisions that have been reviewed.
Next step: wait for a new pman release or review the file yourself.
PgUp/PgDn Scroll | Esc Back | q Quit
Start blocked
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,51 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────
Start blocked - nothing was executed.
File: community-scripts/core/core/core.func
Reviewed 1111111 -> current 2222222
pman only starts revisions that have been reviewed.
Next step: wait for a new pman release or review the file yourself.
PgUp/PgDn Scroll | Esc Back | q Quit
Start blocked
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,85 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
PVE Kernel Clean
Level DELETE – removes data or packages, no recycle bin
FOREIGN CODE – runs as root on this host (pve).
It comes neither from pman nor from Proxmox.
Source https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kerne
l-clean.sh
Command bash kernel-clean.sh (pman downloads the file, checks SHA-1 98351a4… and starts exactly these bytes from a
temporary directory)
Core core/core.func @ fedcba9 · telemetry (api.func) is not loaded
Status reviewed 2026-11-04 · upstream live: unchanged
Impact Removes packages on the host. Check the installed and active kernels before confirming.
The script then continues interactively; pman cannot roll it back.
v Source | j Start | Esc/n Cancel | PgUp/PgDn
Waiting for confirmation
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb
.........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
9,9 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kerne
10,9 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh l-clean.sh
@@ -0,0 +1,85 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
PVE Kernel Clean
Level DELETE – removes data or packages, no recycle bin
FOREIGN CODE – runs as root on this host (pve).
It comes neither from pman nor from Proxmox.
Source https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kerne
l-clean.sh
Command bash kernel-clean.sh (pman downloads the file, checks SHA-1 98351a4… and starts exactly these bytes from a
temporary directory)
Core core/core.func @ fedcba9 · telemetry (api.func) is not loaded
Status reviewed 2026-11-04 · upstream live: unchanged
Impact Removes packages on the host. Check the installed and active kernels before confirming.
The script then continues interactively; pman cannot roll it back.
v Source | j Start | Esc/n Cancel | PgUp/PgDn
Waiting for confirmation
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb
.........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
9,9 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kerne
10,9 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh l-clean.sh
@@ -2,18 +2,18 @@ pman Wartung | HOST | Community-Skript starten?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
PVE Kernel Clean
Stufe LÖSCHT – entfernt Daten oder Pakete, kein Papierkorb
Stufe LÖSCHT – entfernt Daten oder Pakete, kein Papierkorb
FREMDER CODE – läuft als root auf diesem Host (pve).
Er stammt weder von pman noch von Proxmox.
Quelle https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-
clean.sh
Befehl bash kernel-clean.sh (pman lädt die Datei, prüft SHA-1 98351a4… und startet genau diese Bytes in einem
Temp-Verzeichnis)
Core core/core.func @ fedcba9 · Telemetrie (api.func) wird nicht geladen
Stand geprüft 2026-11-04 · Upstream live: unverändert
Folge Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive Kernel prüfen.
Quelle https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel
-clean.sh
Befehl bash kernel-clean.sh (pman lädt die Datei, prüft SHA-1 98351a4… und startet genau diese Bytes in einem
Temp-Verzeichnis)
Core core/core.func @ fedcba9 · Telemetrie (api.func) wird nicht geladen
Stand geprüft 2026-11-04 · Upstream live: unverändert
Folge Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive Kernel prüfen.
Das Skript läuft danach interaktiv weiter; pman kann es nicht zurückrollen.
@@ -43,7 +43,7 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb
.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
@@ -81,5 +81,5 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
9,7 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-
10,7 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh clean.sh
9,8 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel
10,8 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh -clean.sh
@@ -2,18 +2,18 @@ pman Wartung | HOST | Community-Skript starten?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
PVE Kernel Clean
Stufe LÖSCHT – entfernt Daten oder Pakete, kein Papierkorb
Stufe LÖSCHT – entfernt Daten oder Pakete, kein Papierkorb
FREMDER CODE – läuft als root auf diesem Host (pve).
Er stammt weder von pman noch von Proxmox.
Quelle https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-
clean.sh
Befehl bash kernel-clean.sh (pman lädt die Datei, prüft SHA-1 98351a4… und startet genau diese Bytes in einem
Temp-Verzeichnis)
Core core/core.func @ fedcba9 · Telemetrie (api.func) wird nicht geladen
Stand geprüft 2026-11-04 · Upstream live: unverändert
Folge Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive Kernel prüfen.
Quelle https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel
-clean.sh
Befehl bash kernel-clean.sh (pman lädt die Datei, prüft SHA-1 98351a4… und startet genau diese Bytes in einem
Temp-Verzeichnis)
Core core/core.func @ fedcba9 · Telemetrie (api.func) wird nicht geladen
Stand geprüft 2026-11-04 · Upstream live: unverändert
Folge Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive Kernel prüfen.
Das Skript läuft danach interaktiv weiter; pman kann es nicht zurückrollen.
@@ -43,7 +43,7 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb
.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
@@ -81,5 +81,5 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
9,7 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-
10,7 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh clean.sh
9,8 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel
10,8 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh -clean.sh
@@ -2,19 +2,19 @@ pman Wartung | HOST | Community-Skript starten?
Proxmox VE Helper-Scripts (Community) | MIT | https://community-scripts.org
-------------------------------------------------------------------------------
PVE Kernel Clean
Stufe LÖSCHT - entfernt Daten oder Pakete, kein Papierkorb
Stufe LÖSCHT - entfernt Daten oder Pakete, kein Papierkorb
FREMDER CODE - läuft als root auf diesem Host (pve).
Er stammt weder von pman noch von Proxmox.
Quelle https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef01
23456789abcdef01234567/tools/pve/kernel-clean.sh
Befehl bash kernel-clean.sh (pman lädt die Datei, prüft SHA-1 98351a4... und
startet genau diese Bytes in einem Temp-Verzeichnis)
Core core/core.func @ fedcba9 | Telemetrie (api.func) wird nicht geladen
Stand geprüft 2026-11-04 | Upstream live: unverändert
Folge Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive
Kernel prüfen.
Quelle https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0
123456789abcdef01234567/tools/pve/kernel-clean.sh
Befehl bash kernel-clean.sh (pman lädt die Datei, prüft SHA-1 98351a4... un
startet genau diese Bytes in einem Temp-Verzeichnis)
Core core/core.func @ fedcba9 | Telemetrie (api.func) wird nicht geladen
Stand geprüft 2026-11-04 | Upstream live: unverändert
Folge Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive
Kernel prüfen.
Das Skript läuft danach interaktiv weiter; pman kann es nicht zurückrollen.
@@ -27,7 +27,7 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb
.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
@@ -49,5 +49,5 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
9,7 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef01
10,7 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh 23456789abcdef01234567/tools/pve/kernel-clean.sh
9,8 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0
10,8 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh 123456789abcdef01234567/tools/pve/kernel-clean.sh
@@ -0,0 +1,53 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────
PVE Kernel Clean
Level DELETE – removes data or packages, no recycle bin
FOREIGN CODE – runs as root on this host (pve).
It comes neither from pman nor from Proxmox.
Source https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef
0123456789abcdef01234567/tools/pve/kernel-clean.sh
Command bash kernel-clean.sh (pman downloads the file, checks SHA-1
98351a4… and starts exactly these bytes from a temporary directory)
Core core/core.func @ fedcba9 · telemetry (api.func) is not loaded
Status reviewed 2026-11-04 · upstream live: unchanged
Impact Removes packages on the host. Check the installed and active kernels
before confirming.
The script then continues interactively; pman cannot roll it back.
v Source | j Start | Esc/n Cancel | PgUp/PgDn
Waiting for confirmation
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb
.........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
9,9 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef
10,9 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh 0123456789abcdef01234567/tools/pve/kernel-clean.sh
@@ -0,0 +1,53 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────
PVE Kernel Clean
Level DELETE – removes data or packages, no recycle bin
FOREIGN CODE – runs as root on this host (pve).
It comes neither from pman nor from Proxmox.
Source https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef
0123456789abcdef01234567/tools/pve/kernel-clean.sh
Command bash kernel-clean.sh (pman downloads the file, checks SHA-1
98351a4… and starts exactly these bytes from a temporary directory)
Core core/core.func @ fedcba9 · telemetry (api.func) is not loaded
Status reviewed 2026-11-04 · upstream live: unchanged
Impact Removes packages on the host. Check the installed and active kernels
before confirming.
The script then continues interactively; pman cannot roll it back.
v Source | j Start | Esc/n Cancel | PgUp/PgDn
Waiting for confirmation
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb
.........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
9,9 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef
10,9 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh 0123456789abcdef01234567/tools/pve/kernel-clean.sh
@@ -2,19 +2,19 @@ pman Wartung | HOST | Community-Skript starten?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────
PVE Kernel Clean
Stufe LÖSCHT – entfernt Daten oder Pakete, kein Papierkorb
Stufe LÖSCHT – entfernt Daten oder Pakete, kein Papierkorb
FREMDER CODE – läuft als root auf diesem Host (pve).
Er stammt weder von pman noch von Proxmox.
Quelle https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef01
23456789abcdef01234567/tools/pve/kernel-clean.sh
Befehl bash kernel-clean.sh (pman lädt die Datei, prüft SHA-1 98351a4… und
startet genau diese Bytes in einem Temp-Verzeichnis)
Core core/core.func @ fedcba9 · Telemetrie (api.func) wird nicht geladen
Stand geprüft 2026-11-04 · Upstream live: unverändert
Folge Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive
Kernel prüfen.
Quelle https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0
123456789abcdef01234567/tools/pve/kernel-clean.sh
Befehl bash kernel-clean.sh (pman lädt die Datei, prüft SHA-1 98351a4… und
startet genau diese Bytes in einem Temp-Verzeichnis)
Core core/core.func @ fedcba9 · Telemetrie (api.func) wird nicht geladen
Stand geprüft 2026-11-04 · Upstream live: unverändert
Folge Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive
Kernel prüfen.
Das Skript läuft danach interaktiv weiter; pman kann es nicht zurückrollen.
@@ -27,7 +27,7 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb
.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
@@ -49,5 +49,5 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
9,7 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef01
10,7 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh 23456789abcdef01234567/tools/pve/kernel-clean.sh
9,8 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0
10,8 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh 123456789abcdef01234567/tools/pve/kernel-clean.sh
@@ -2,19 +2,19 @@ pman Wartung | HOST | Community-Skript starten?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────
PVE Kernel Clean
Stufe LÖSCHT – entfernt Daten oder Pakete, kein Papierkorb
Stufe LÖSCHT – entfernt Daten oder Pakete, kein Papierkorb
FREMDER CODE – läuft als root auf diesem Host (pve).
Er stammt weder von pman noch von Proxmox.
Quelle https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef01
23456789abcdef01234567/tools/pve/kernel-clean.sh
Befehl bash kernel-clean.sh (pman lädt die Datei, prüft SHA-1 98351a4… und
startet genau diese Bytes in einem Temp-Verzeichnis)
Core core/core.func @ fedcba9 · Telemetrie (api.func) wird nicht geladen
Stand geprüft 2026-11-04 · Upstream live: unverändert
Folge Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive
Kernel prüfen.
Quelle https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0
123456789abcdef01234567/tools/pve/kernel-clean.sh
Befehl bash kernel-clean.sh (pman lädt die Datei, prüft SHA-1 98351a4… und
startet genau diese Bytes in einem Temp-Verzeichnis)
Core core/core.func @ fedcba9 · Telemetrie (api.func) wird nicht geladen
Stand geprüft 2026-11-04 · Upstream live: unverändert
Folge Paketentfernung auf dem Host. Vor Bestätigung installierte und aktive
Kernel prüfen.
Das Skript läuft danach interaktiv weiter; pman kann es nicht zurückrollen.
@@ -27,7 +27,7 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb
.......bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
@@ -49,5 +49,5 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
9,7 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef01
10,7 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh 23456789abcdef01234567/tools/pve/kernel-clean.sh
9,8 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0
10,8 https://github.com/community-scripts/ProxmoxVE/blob/0123456789abcdef0123456789abcdef01234567/tools/pve/kernel-clean.sh 123456789abcdef01234567/tools/pve/kernel-clean.sh
@@ -0,0 +1,84 @@
pman maintenance | HOST | Community scripts
Proxmox VE Helper-Scripts (Community) · MIT · Foreign code, not from pman
Web: https://community-scripts.org
Source: https://github.com/community-scripts/ProxmoxVE
Source status 2026-11-03: 5 of 9 differ - affected tools are blocked
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
CHECK & BACK UP │ PVE Kernel Clean
[READ ] Disk Health │ Removes kernel packages that are no longer needed from the Proxmox host.
[CHANGE] Host Backup │
UPDATE & OPTIMISE │ Level DELETE – removes data or packages, no recycle bin
[CHANGE] LXC Updater │ Impact Removes packages on the host. Check the installed and active
[CHANGE] LXC Filesystem Trim │ kernels before confirming.
[CHANGE] CPU Scaling Governor │ Runs as root on the host
CLEAN UP – DELETES DATA │ Status reviewed 2026-11-04 (0123456)
> [DELETE] Kernel Clean ! │ File tools/pve/kernel-clean.sh
[DELETE] LXC Cleaner ! │ Start blocked: core.func geändert (1111111 → 2222222)
[DELETE] Clean Orphaned LVM │
← Back to the maintenance menu │
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
↑↓ Select | Enter check & confirm | Esc back | q Quit
Ready – nothing has been started
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb..............................bbbbbbbbbbbbbbbb
...gggggggg
...yyyyyyyy
bbbbbbbbbbbbbbbbbb....................................bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
...yyyyyyyy
...yyyyyyyy
...yyyyyyyy
bbbbbbbbbbbbbbbbbbbbbbbb
RRRrrrrrrrrRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
...rrrrrrrr...............................b...........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
...rrrrrrrr
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
---links---
2,8 https://community-scripts.org https://community-scripts.org
3,8 https://github.com/community-scripts/ProxmoxVE https://github.com/community-scripts/ProxmoxVE
@@ -0,0 +1,84 @@
pman maintenance | HOST | Community scripts
Proxmox VE Helper-Scripts (Community) · MIT · Foreign code, not from pman
Web: https://community-scripts.org
Source: https://github.com/community-scripts/ProxmoxVE
Source status 2026-11-03: 5 of 9 differ - affected tools are blocked
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
CHECK & BACK UP │ PVE Kernel Clean
[READ ] Disk Health │ Removes kernel packages that are no longer needed from the Proxmox host.
[CHANGE] Host Backup │
UPDATE & OPTIMISE │ Level DELETE – removes data or packages, no recycle bin
[CHANGE] LXC Updater │ Impact Removes packages on the host. Check the installed and active
[CHANGE] LXC Filesystem Trim │ kernels before confirming.
[CHANGE] CPU Scaling Governor │ Runs as root on the host
CLEAN UP – DELETES DATA │ Status reviewed 2026-11-04 (0123456)
> [DELETE] Kernel Clean ! │ File tools/pve/kernel-clean.sh
[DELETE] LXC Cleaner ! │ Start blocked: core.func geändert (1111111 → 2222222)
[DELETE] Clean Orphaned LVM │
← Back to the maintenance menu │
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
↑↓ Select | Enter check & confirm | Esc back | q Quit
Ready – nothing has been started
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb..............................bbbbbbbbbbbbbbbb
...bbbbbbbb
...bbbbbbbb
bbbbbbbbbbbbbbbbbb....................................bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
...bbbbbbbb
...bbbbbbbb
...bbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbb
RRRXXXXXXXXRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
...bbbbbbbb...............................b...........bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
...bbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
---links---
2,8 https://community-scripts.org https://community-scripts.org
3,8 https://github.com/community-scripts/ProxmoxVE https://github.com/community-scripts/ProxmoxVE
@@ -0,0 +1,52 @@
pman maintenance | HOST | Community scripts
Proxmox VE Helper-Scripts (Community) · MIT · Foreign code, not from pman
Web: https://community-scripts.org
Source: https://github.com/community-scripts/ProxmoxVE
Source status 2026-11-03: 5 of 9 differ - affected tools are blocked
───────────────────────────────────────────────────────────────────────────────
CHECK & BACK UP │ PVE Kernel Clean
[READ ] Disk Health │ Removes kernel packages that are no
[CHANGE] Host Backup │ longer needed from the Proxmox host.
UPDATE & OPTIMISE │
[CHANGE] LXC Updater │ Level DELETE – removes data or
[CHANGE] LXC Filesystem Trim │ packages, no recycle bin
[CHANGE] CPU Scaling Governor │ Impact Removes packages on the host.
CLEAN UP – DELETES DATA │ Check the installed and
> [DELETE] Kernel Clean ! │ active kernels before
[DELETE] LXC Cleaner ! │ confirming.
[DELETE] Clean Orphaned LVM │ Runs as root on the host
← Back to the maintenance menu │ Status reviewed 2026-11-04 (0123456)
│ File tools/pve/kernel-clean.sh
│ Start blocked: core.func geändert
│ (1111111 → 2222222)
↑↓ Select | Enter check & confirm | Esc back | q Quit
Ready – nothing has been started
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb..........................bbbbbbbbbbbbbbbb
...gggggggg
...yyyyyyyy
bbbbbbbbbbbbbbbbbb
...yyyyyyyy.......................................bbbbbbbbbbbbbbbbbbbbbbbb
...yyyyyyyy.......................................bbbbbbbbbbbbbbbbbbbbbbbb
...yyyyyyyy
bbbbbbbbbbbbbbbbbbbbbbbb
RRRrrrrrrrrRRRRRRRRRRRRRRRRRRRRRRRRRRRR
...rrrrrrrr...........................b
...rrrrrrrr
..................................................bbbbbbbbbbbbbbbbbbbbbbbbbbb
..................................................bbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
---links---
2,8 https://community-scripts.org https://community-scripts.org
3,8 https://github.com/community-scripts/ProxmoxVE https://github.com/community-scripts/ProxmoxVE
@@ -0,0 +1,52 @@
pman maintenance | HOST | Community scripts
Proxmox VE Helper-Scripts (Community) · MIT · Foreign code, not from pman
Web: https://community-scripts.org
Source: https://github.com/community-scripts/ProxmoxVE
Source status 2026-11-03: 5 of 9 differ - affected tools are blocked
───────────────────────────────────────────────────────────────────────────────
CHECK & BACK UP │ PVE Kernel Clean
[READ ] Disk Health │ Removes kernel packages that are no
[CHANGE] Host Backup │ longer needed from the Proxmox host.
UPDATE & OPTIMISE │
[CHANGE] LXC Updater │ Level DELETE – removes data or
[CHANGE] LXC Filesystem Trim │ packages, no recycle bin
[CHANGE] CPU Scaling Governor │ Impact Removes packages on the host.
CLEAN UP – DELETES DATA │ Check the installed and
> [DELETE] Kernel Clean ! │ active kernels before
[DELETE] LXC Cleaner ! │ confirming.
[DELETE] Clean Orphaned LVM │ Runs as root on the host
← Back to the maintenance menu │ Status reviewed 2026-11-04 (0123456)
│ File tools/pve/kernel-clean.sh
│ Start blocked: core.func geändert
│ (1111111 → 2222222)
↑↓ Select | Enter check & confirm | Esc back | q Quit
Ready – nothing has been started
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbb..........................bbbbbbbbbbbbbbbb
...bbbbbbbb
...bbbbbbbb
bbbbbbbbbbbbbbbbbb
...bbbbbbbb.......................................bbbbbbbbbbbbbbbbbbbbbbbb
...bbbbbbbb.......................................bbbbbbbbbbbbbbbbbbbbbbbb
...bbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbb
RRRXXXXXXXXRRRRRRRRRRRRRRRRRRRRRRRRRRRR
...bbbbbbbb...........................b
...bbbbbbbb
..................................................bbbbbbbbbbbbbbbbbbbbbbbbbbb
..................................................bbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
---links---
2,8 https://community-scripts.org https://community-scripts.org
3,8 https://github.com/community-scripts/ProxmoxVE https://github.com/community-scripts/ProxmoxVE
@@ -0,0 +1,83 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Source code kernel-clean.sh - exactly these 39 bytes will be started.
SHA-1 (Git-Blob): 98351a487f14ed77df99f8945a9f45bf0b1870c0
#!/usr/bin/env bash
echo one
echo two
↑↓ PgUp/PgDn scroll | Esc back to confirmation
Source preview – nothing is executed
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,83 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Source code kernel-clean.sh - exactly these 39 bytes will be started.
SHA-1 (Git-Blob): 98351a487f14ed77df99f8945a9f45bf0b1870c0
#!/usr/bin/env bash
echo one
echo two
↑↓ PgUp/PgDn scroll | Esc back to confirmation
Source preview – nothing is executed
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,51 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────
Source code kernel-clean.sh - exactly these 39 bytes will be started.
SHA-1 (Git-Blob): 98351a487f14ed77df99f8945a9f45bf0b1870c0
#!/usr/bin/env bash
echo one
echo two
↑↓ PgUp/PgDn scroll | Esc back to confirmation
Source preview – nothing is executed
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,51 @@
pman maintenance | HOST | Start community script?
Proxmox VE Helper-Scripts (Community) · MIT · https://community-scripts.org
───────────────────────────────────────────────────────────────────────────────
Source code kernel-clean.sh - exactly these 39 bytes will be started.
SHA-1 (Git-Blob): 98351a487f14ed77df99f8945a9f45bf0b1870c0
#!/usr/bin/env bash
echo one
echo two
↑↓ PgUp/PgDn scroll | Esc back to confirmation
Source preview – nothing is executed
---attrs---
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
---links---
1,46 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,83 @@
pman maintenance | HOST
Details
Storage, filesystems, inodes │ Proxmox VE Helper-Scripts
SMART and error history │ (Community) · MIT licence
TRIM schedule, kernel, backups │ Foreign code – not from pman and not from Proxmox.
> Helper-Scripts (8) ▸ [FOREIGN] │
Provenance and freshness status │ https://community-scripts.org
│
│ 8 scripts, grouped by purpose:
│ CHECK & BACK UP (2)
│ UPDATE & OPTIMISE (3)
│ CLEAN UP – DELETES DATA (3)
│
│ Enter opens the menu; nothing starts before you confirm.
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
↑↓ Select | Enter | PgUp/PgDn | Esc | q Quit
Ready
---attrs---
bbbbbbbbbbbbbbbbbbbbbbb
..............................................bbbbbbb
..............................................bbbbbbbbbbbbbbbbbbbbbbbbb
..............................................bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRReeeeeeeeeRRRR
bbbbb
---links---
6,46 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,83 @@
pman maintenance | HOST
Details
Storage, filesystems, inodes │ Proxmox VE Helper-Scripts
SMART and error history │ (Community) · MIT licence
TRIM schedule, kernel, backups │ Foreign code – not from pman and not from Proxmox.
> Helper-Scripts (8) ▸ [FOREIGN] │
Provenance and freshness status │ https://community-scripts.org
│
│ 8 scripts, grouped by purpose:
│ CHECK & BACK UP (2)
│ UPDATE & OPTIMISE (3)
│ CLEAN UP – DELETES DATA (3)
│
│ Enter opens the menu; nothing starts before you confirm.
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
│
↑↓ Select | Enter | PgUp/PgDn | Esc | q Quit
Ready
---attrs---
bbbbbbbbbbbbbbbbbbbbbbb
..............................................bbbbbbb
..............................................bbbbbbbbbbbbbbbbbbbbbbbbb
..............................................bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRXXXXXXXXXRRRR
bbbbb
---links---
6,46 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,51 @@
pman maintenance | HOST
Details
Storage, filesystems, inodes │ Proxmox VE Helper-Scripts
SMART and error history │ (Community) · MIT licence
TRIM schedule, kernel, backups │ Foreign code – not from pman and not
> Helper-Scripts (8) ▸ [FOREIGN] │ from Proxmox.
Provenance and freshness status │
│ https://community-scripts.org
│
│ 8 scripts, grouped by purpose:
│ CHECK & BACK UP (2)
│ UPDATE & OPTIMISE (3)
│ CLEAN UP – DELETES DATA (3)
│
│ Enter opens the menu; nothing starts
│ before you confirm.
│
│
│
│
│
↑↓ Select | Enter | PgUp/PgDn | Esc | q Quit
Ready
---attrs---
bbbbbbbbbbbbbbbbbbbbbbb
..........................................bbbbbbb
..........................................bbbbbbbbbbbbbbbbbbbbbbbbb
..........................................bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
RRRRRRRRRRRRRRRRRRRRRRRRRRRRReeeeeeeeeR...bbbbbbbbbbbbb
bbbbb
---links---
7,42 https://community-scripts.org https://community-scripts.org
@@ -0,0 +1,51 @@
pman maintenance | HOST
Details
Storage, filesystems, inodes │ Proxmox VE Helper-Scripts
SMART and error history │ (Community) · MIT licence
TRIM schedule, kernel, backups │ Foreign code – not from pman and not
> Helper-Scripts (8) ▸ [FOREIGN] │ from Proxmox.
Provenance and freshness status │
│ https://community-scripts.org
│
│ 8 scripts, grouped by purpose:
│ CHECK & BACK UP (2)
│ UPDATE & OPTIMISE (3)
│ CLEAN UP – DELETES DATA (3)
│
│ Enter opens the menu; nothing starts
│ before you confirm.
│
│
│
│
│
↑↓ Select | Enter | PgUp/PgDn | Esc | q Quit
Ready
---attrs---
bbbbbbbbbbbbbbbbbbbbbbb
..........................................bbbbbbb
..........................................bbbbbbbbbbbbbbbbbbbbbbbbb
..........................................bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
RRRRRRRRRRRRRRRRRRRRRRRRRRRRRXXXXXXXXXR...bbbbbbbbbbbbb
bbbbb
---links---
7,42 https://community-scripts.org https://community-scripts.org
+109
View File
@@ -0,0 +1,109 @@
"""Language selection and catalog completeness of the maintenance module."""
import ast
import os
import sys
import unittest
from pathlib import Path
from unittest.mock import patch
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / 'maintenance'))
from pman_maintenance import actions, community, i18n
from pman_maintenance.catalog_en import EN
PACKAGE = Path(__file__).resolve().parents[2] / 'maintenance' / 'pman_maintenance'
def translated_literals():
"""Every literal passed to _() plus the table texts that are translated on display."""
found = set()
for path in PACKAGE.glob('*.py'):
if path.name == 'catalog_en.py':
continue
for node in ast.walk(ast.parse(path.read_text())):
if (isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == '_'
and node.args and isinstance(node.args[0], ast.Constant)):
found.add(node.args[0].value)
for tool in community.TOOLS:
found.update([tool['summary'], tool['impact']] + ([tool['level_note']] if 'level_note' in tool else []))
found.update(title for _key, title in community.GROUPS)
for word, meaning in community.LEVELS.values():
found.update([word, meaning])
for action in actions.ACTIONS:
found.update([action.title, action.source])
found.update(['geprüfter Stand', 'Upstream geändert', 'Quelle fehlt', 'Prüfung fehlgeschlagen',
'Noch nicht geprüft', 'FREMD'])
return found
class CatalogTest(unittest.TestCase):
def test_every_translatable_text_has_an_english_entry(self):
missing = sorted(text for text in translated_literals() if text not in EN)
self.assertEqual(missing, [])
def test_catalog_has_no_stale_entries(self):
used = translated_literals()
self.assertEqual(sorted(key for key in EN if key not in used), [])
def test_placeholders_match_between_languages(self):
for german, english in EN.items():
self.assertEqual(german.count('{}'), english.count('{}'), german)
def test_english_text_is_not_left_german(self):
german_words = ('nicht ', 'Fehler', 'Gast ', 'wird ', ' und ', 'Änder')
for german, english in EN.items():
if german == english:
continue
self.assertFalse(any(word in english for word in german_words), (german, english))
class ReportTest(unittest.TestCase):
def setUp(self):
self.addCleanup(i18n.set_language, None)
def test_source_report_without_stored_check_in_both_languages(self):
from pman_maintenance import sources
for language, expected in (('de', 'Zuletzt geprüft: Noch nicht geprüft'),
('en', 'Last checked: not checked yet')):
i18n.set_language(language)
with patch.object(sources, 'read_json', return_value={}):
first_line = sources.source_report().splitlines()[0]
self.assertEqual(first_line, expected)
class LanguageSelectionTest(unittest.TestCase):
def setUp(self):
i18n.set_language(None)
self.addCleanup(i18n.set_language, None)
def test_default_is_german_and_env_wins_over_config(self):
with patch.object(i18n, '_from_config', return_value=''):
self.assertEqual(i18n.language({}), 'de')
self.assertEqual(i18n.language({'PMAN_LANG': 'EN'}), 'en')
self.assertEqual(i18n.language({'PMAN_LANG': 'fr'}), 'de')
with patch.object(i18n, '_from_config', return_value='en'):
self.assertEqual(i18n.language({}), 'en')
self.assertEqual(i18n.language({'PMAN_LANG': 'de'}), 'de')
def test_config_file_must_be_root_owned_and_not_writable_by_others(self):
import tempfile
with tempfile.TemporaryDirectory() as directory:
config = Path(directory) / 'language'
config.write_text('en\n')
with patch.object(i18n, 'CONFIG', config):
self.assertEqual(i18n._from_config(), '' if os.geteuid() != 0 else 'en')
config.chmod(0o666)
self.assertEqual(i18n._from_config(), '')
def test_translation_and_fallback(self):
i18n.set_language('en')
self.assertEqual(i18n._('Bereit'), 'Ready')
self.assertEqual(i18n._('nicht im Katalog'), 'nicht im Katalog')
i18n.set_language('de')
self.assertEqual(i18n._('Bereit'), 'Bereit')
with self.assertRaises(ValueError):
i18n.set_language('fr')
if __name__ == '__main__':
unittest.main()
+84
View File
@@ -93,3 +93,87 @@ class PathAliasTest(unittest.TestCase):
result=subprocess.run(['bash',str(ROOT/'install_dependencies.sh'),'--destdir',str(stage),'--with-maintenance'],capture_output=True,text=True)
self.assertEqual(result.returncode,0,result.stderr)
self.assertEqual(os.readlink(timer),'/dev/null')
class LanguageChoiceTest(unittest.TestCase):
def install(self, stage, *flags):
return subprocess.run(['bash', str(ROOT / 'install_dependencies.sh'), '--destdir', str(stage), *flags],
stdin=subprocess.DEVNULL, capture_output=True, text=True)
def test_lang_flag_is_stored_kept_on_upgrade_and_removed_on_uninstall(self):
with tempfile.TemporaryDirectory() as directory:
stage = Path(directory) / 'stage'
language = stage / 'etc/pman/language'
self.assertEqual(self.install(stage, '--with-maintenance', '--lang', 'en').returncode, 0)
self.assertEqual(language.read_text(), 'en\n')
self.assertEqual(language.stat().st_mode & 0o777, 0o644)
self.assertEqual(self.install(stage, '--with-maintenance').returncode, 0)
self.assertEqual(language.read_text(), 'en\n')
self.assertEqual(self.install(stage, '--with-maintenance', '--lang', 'de').returncode, 0)
self.assertEqual(language.read_text(), 'de\n')
self.assertEqual(self.install(stage, '--uninstall-maintenance').returncode, 0)
self.assertFalse(language.exists())
def test_uninstall_refuses_a_symlinked_language_directory(self):
with tempfile.TemporaryDirectory() as directory:
stage = Path(directory) / 'stage'
outside = Path(directory) / 'outside'
outside.mkdir()
(outside / 'language').write_text('en\n')
(stage / 'etc').mkdir(parents=True)
(stage / 'etc/pman').symlink_to(outside)
result = self.install(stage, '--uninstall-maintenance')
self.assertNotEqual(result.returncode, 0)
self.assertTrue((outside / 'language').exists(), 'a staged uninstall must not delete outside --destdir')
def test_invalid_language_is_rejected_before_anything_is_written(self):
with tempfile.TemporaryDirectory() as directory:
stage = Path(directory) / 'stage'
for flags in (('--lang', 'fr'), ('--lang',)):
result = self.install(stage, '--with-maintenance', *flags)
self.assertEqual(result.returncode, 2, flags)
self.assertFalse(stage.exists())
def test_core_only_install_writes_no_language_file(self):
with tempfile.TemporaryDirectory() as directory:
stage = Path(directory) / 'stage'
self.assertEqual(self.install(stage, '--lang', 'en').returncode, 0)
self.assertFalse((stage / 'etc/pman/language').exists())
def test_interactive_prompt_asks_for_the_language_first(self):
import pty
import select
import time
for answers, expected_language, module_prompt in ((b'en\ny\n', 'en', b'Also install the storage'),
(b'\nj\n', 'de', b'Speicher- und Wartungsmodul')):
with tempfile.TemporaryDirectory() as directory:
stage = Path(directory) / 'stage'
master, slave = pty.openpty()
process = subprocess.Popen(['bash', str(ROOT / 'install_dependencies.sh'), '--destdir', str(stage)],
stdin=slave, stdout=slave, stderr=slave)
os.close(slave)
output = bytearray()
def drain(wait):
try:
while select.select([master], [], [], wait)[0]:
chunk = os.read(master, 4096)
if not chunk:
break
output.extend(chunk)
except OSError: # the child closed the terminal
pass
try:
for line in answers.splitlines(keepends=True):
drain(.5)
os.write(master, line)
process.wait(timeout=20)
drain(.2)
finally:
if process.poll() is None:
process.kill()
os.close(master)
self.assertIn(b'Language / Sprache', bytes(output))
self.assertIn(module_prompt, bytes(output))
self.assertEqual((stage / 'etc/pman/language').read_text(), expected_language + '\n')
self.assertTrue((stage / 'usr/local/bin/pman-maintenance').is_file())
+47 -15
View File
@@ -11,7 +11,8 @@ from unittest.mock import patch
sys.path.insert(0, str(Path(__file__).resolve().parents[2] / 'maintenance'))
from pman_maintenance import community, ui, view
from pman_maintenance import community, i18n, ui, view
from pman_maintenance.i18n import _
from pman_maintenance.actions import Context, registry
GOLDEN = Path(__file__).resolve().parent / 'golden'
@@ -33,33 +34,33 @@ def model(name):
actions = registry(Context('host'))
if name == 'host-main':
rows = view.main_rows(actions, 'host')
return view.Model(title='pman Wartung | HOST', rows=rows, selected=len(actions),
return view.Model(title=_('pman Wartung') + ' | HOST', rows=rows, selected=len(actions),
detail=view.community_intro(), details_heading=True,
help='↑↓ Auswahl | Enter | PgUp/PgDn | Esc | q Ende', status='Bereit')
help=_('↑↓ Auswahl | Enter | PgUp/PgDn | Esc | q Ende'), status=_('Bereit'))
prov = view.provenance(view.status_line(STORED))
kernel = tool('kernel-clean')
selected = community.TOOLS.index(kernel)
if name == 'community-menu':
return view.Model(
title='pman Wartung | HOST | Community-Skripte', rows=view.community_rows(STORED),
title=_('pman Wartung') + ' | HOST | ' + _('Community-Skripte'), rows=view.community_rows(STORED),
selected=selected, detail=view.community_detail(kernel, STORED), prov=prov,
help='↑↓ Auswahl | Enter prüfen & bestätigen | Esc zurück | q Ende',
status='Bereit – es wurde noch nichts gestartet')
help=_('↑↓ Auswahl | Enter prüfen & bestätigen | Esc zurück | q Ende'),
status=_('Bereit – es wurde noch nichts gestartet'))
launch = community.Launch(kernel, b'#!/usr/bin/env bash\necho one\n\techo two\n', b'# core\n')
modal = dict(title='pman Wartung | HOST | Community-Skript starten?', modal=True, prov=prov)
modal = dict(title=_('pman Wartung') + ' | HOST | ' + _('Community-Skript starten?'), modal=True, prov=prov)
if name == 'community-confirm':
return view.Model(detail=view.confirm_blocks(launch, 'pve'),
help='v Quellcode | j Starten | Esc/n Abbruch | PgUp/PgDn',
status='Wartet auf Bestätigung', **modal)
help=_('v Quellcode | j Starten | Esc/n Abbruch | PgUp/PgDn'),
status=_('Wartet auf Bestätigung'), **modal)
if name == 'community-blocked':
blocked = community.SourceBlocked(community.CORE_REPOSITORY, 'core/core.func',
'1111111aaaa', '2222222bbbb', 'Upstream geändert')
return view.Model(detail=blocked.lines(), help='PgUp/PgDn Blättern | Esc Zurück | q Ende',
status='Start blockiert', **modal)
return view.Model(detail=blocked.lines(), help=_('PgUp/PgDn Blättern | Esc Zurück | q Ende'),
status=_('Start blockiert'), **modal)
if name == 'community-preview':
return view.Model(detail=view.preview_blocks(launch),
help='↑↓ PgUp/PgDn blättern | Esc zurück zur Bestätigung',
status='Quellcode-Vorschau – es wird nichts ausgeführt', **modal)
help=_('↑↓ PgUp/PgDn blättern | Esc zurück zur Bestätigung'),
status=_('Quellcode-Vorschau – es wird nichts ausgeführt'), **modal)
raise KeyError(name)
@@ -67,9 +68,13 @@ SCREENS = ('host-main', 'community-menu', 'community-confirm', 'community-blocke
VARIANTS = (('', '256', False), ('nocolor', '', False), ('ascii-nocolor', '', True))
def render_text(name, size, color, ascii_only):
def render_text(name, size, color, ascii_only, lang='de'):
height, width = size[1], size[0]
frame = view.render(model(name), height, width, ascii_only)
i18n.set_language(lang)
try:
frame = view.render(model(name), height, width, ascii_only)
finally:
i18n.set_language(None)
text, codes = view.snapshot(frame, height, width, color)
links = ['{},{} {} {}'.format(s.y, s.x, s.link, s.text) for s in frame.segs if s.link]
return '{}\n---attrs---\n{}\n---links---\n{}\n'.format(text, codes, '\n'.join(links)), frame
@@ -92,6 +97,33 @@ class GoldenTest(unittest.TestCase):
self.assertEqual(path.read_text(), actual)
class EnglishGoldenTest(unittest.TestCase):
def test_english_screens_match_golden_files(self):
for name in SCREENS:
for size in SIZES:
for variant, color, ascii_only in VARIANTS[:2]:
label = '-'.join(filter(None, (name, '{}x{}'.format(*size), variant, 'en')))
with self.subTest(label):
actual, _frame = render_text(name, size, color, ascii_only, 'en')
path = GOLDEN / (label + '.txt')
if os.environ.get('UPDATE_GOLDEN'):
path.write_text(actual)
self.assertTrue(path.exists(), 'missing golden file ' + path.name)
self.assertEqual(path.read_text(), actual)
def test_english_screens_fit_and_show_no_german_ui_words(self):
for name in SCREENS:
for size in SIZES:
text, frame = render_text(name, size, '', False, 'en')
screen = text.split('---attrs---')[0]
for line in screen.splitlines():
self.assertLess(len(line), size[0], (name, line))
if name in ('community-menu', 'host-main'):
self.assertLessEqual(frame.total, frame.page)
for word in ('Fremder', 'Quelle:', 'Bestätigung', 'LÖSCHT', 'ÄNDERT', 'Zurück'):
self.assertNotIn(word, screen, (name, word))
class AccessibilityTest(unittest.TestCase):
def test_every_line_fits_the_terminal_width(self):
for name in SCREENS: