Commit Graph
20 Commits
Author SHA1 Message Date
TimInTech 34045b8784 fix: prepare v2.14.1 with SPICE, inventory and terminal fixes 2026-11-08 19:15:49 +01:00
==TIM.©.B ==andClaude Sonnet 5.5 c9168107c8 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>
2026-11-07 01:07:21 +01:00
==TIM.©.B ==andClaude Sonnet 5.5 3c971f8a0a feat(maintenance): Helper-Scripts-Menü mit Herkunft, Gefahrenstufen und Bestätigungsschirm (#50)
* fix(maintenance): re-pin Helper-Scripts to reviewed 2026-11-04 state

Upstream changed core.func and four tools; all eight launchers were blocked.
Reviewed the diffs (clear fallback, probe cache, non-fatal logging); no new
network access or code paths. Pins and blob SHAs updated.

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

* refactor(maintenance): add Helper-Scripts identity, groups, hazard levels and verified-launch API

Group and label the eight launchers, add SourceBlocked with file and revision
details, stored_status() for a network-free menu header, and prepare_launch /
run_launch so the verified bytes can be previewed and then executed unchanged.

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

* feat(maintenance): clearer Helper-Scripts menu with provenance, hazard tags and confirmation

Pure render layer (view.py) feeds curses and the golden snapshot tests.
Menu names the source, licence and website, groups tools by intent, shows
text hazard tags and the stored source check. Confirmation shows URL, command
and root-on-host notice; v previews the verified script. NO_COLOR, ASCII
glyphs and optional OSC 8 links; badge colours are fixed pairs >= 4.5:1.
Module version 1.0.4.

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

* test(maintenance): derive the bumped version in the installer rollback test

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

* fix(maintenance): judge the stored source check against the current manifest

A re-pin after the last daily check must not leave the old verdict standing:
compare the observed blob with the reviewed pin instead of the stored status text.

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

* docs: describe the Helper-Scripts menu, hazard levels, confirmation and display options

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

* docs(demo): record the new Helper-Scripts flow and close an anonymizer gap

The demo now shows the grouped menu, the confirmation screen and the source
preview for Kernel Clean, then cancels without starting anything.

The stream anonymizer now holds back a partial 'Node:' header line until it is
complete; a read ending between the colour codes leaked the real node name into
the recording. The privacy scan strips control sequences before matching (it
missed the leak before) and also checks the confirmation screen.

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

* fix(ci): commit demo markers for verification and de-flake the cancel PTY test

verify_demo reads the confirmation time recorded by the driver, so the file
belongs with the other demo artifacts. The PTY cancel test sent its 'q' in the
same instant the UI flushes queued input and could lose it on a busy runner;
it now repeats the key like a user would.

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

* fix(maintenance): qualify the Disk Health hazard level

Disk Health can install smartmontools/nvme-cli on request, so its level text no
longer promises that nothing changes: 'LESEN – Diagnose; installiert nur auf
Nachfrage Pakete'. Docs and golden snapshots follow.

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

* feat(maintenance): badges in the maintenance menu and a calmer Helper-Scripts overview

Changing actions get [ÄNDERT] and the Helper-Scripts entry gets a blue [FREMD]
badge (white on xterm-256 25, 6.45:1), aligned in a column; the overview lists
name, licence, URL and groups once instead of repeating them.

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

* docs(demo): re-record with the badged maintenance menu

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

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 00:08:17 +01:00
==TIM.©.B == b39859d66a fix: harden SMART scan, site links and CI gates (#48)
- maintenance: a disk whose smartctl output is not JSON no longer aborts
  the whole report; the device is named as unreadable and the remaining
  disks plus their state file keep working (regression test added).
- site: repository-relative file links (CHANGELOG.md and friends) point
  at the GitHub blob, headings get GitHub-style anchors so the upstream
  #-installation, #health-monitoring--alerts and
  #relaying-through-an-external-smtp-provider links resolve again.
- pages workflow: rebuild on README/README.de.md changes because the
  guide reads them at build time; pin all actions to commit SHAs.
- ci: new documentation-site job builds Astro, verifies the five routes,
  key commands and anchors, and runs npm audit on pull requests.
- readme: keep HEALTH_MAIL_TO commented out in the alert quick start so
  --test-notify proves ntfy instead of failing on a missing MTA.
2026-11-03 01:25:40 +01:00
==TIM.©.B ==andTim Baumann c04e5752e7 feat: optional storage and maintenance TUI (#44)
* feat: add optional storage and maintenance module

* fix: make maintenance TUI reports usable

* feat: launch verified community PVE tools

* feat: polish optional maintenance TUI

---------

Co-authored-by: Tim Baumann <tim@timintech.com>
2026-10-28 05:04:14 +01:00
==TIM.©.B ==andClaude bbbdbd3493 fix(actions): stop shuts guests down gracefully instead of pulling the plug (#42)
The stop action called `qm stop` / `pct stop`, which kills the guest
immediately; the `--overrule-shutdown 1` retry after the Bash timeout only
aborts running shutdown tasks and forced nothing. Stop now runs
`qm|pct shutdown --timeout STOP_TIMEOUT --forceStop 1`, so Proxmox shuts the
guest down cleanly and hard-stops it only after the timeout.

The qm/pct mocks now log their argv and can fail on demand; new tests cover
stop (VM and CT), the timeout value, the failure path, a declined
confirmation and restart.


Claude-Session: https://claude.ai/code/session_01S8LmYGQA8hFstiLCCyzUYZ

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-21 21:50:48 +02:00
Tim BaumannandClaude Opus 5 24d5812a2d fix(health): harden notification and state handling
- http:// NTFY_URL together with NTFY_TOKEN_FILE is a config error
  (--check exits 3, --test-notify exits 1).
- Token file: directory must be owned by root/current user and not
  group/world-writable; the token is read through one opened descriptor
  that is verified via /proc/self/fd (regular file, owner, mode 0600).
- Lock file opened for append (never truncated); the parent of
  HEALTH_STATE_DIR must not be group/world-writable.
- qm/pct config fallback runs with timeout 10.
- curl: -q first, --proto =https when a token is used, no --retry.
- json_escape escapes remaining control characters as \u00XX.
- --test-notify removes its temp body file on exit and on INT/TERM.
- _truncate keeps UTF-8 characters intact.
- Tests for each item where practical.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 19:07:05 +02:00
Tim BaumannandClaude Opus 5 479820a579 fix(health): address review findings
- Metric alerts resolve when a guest stops (CPU counter restarts); an
  n/a metric on a running guest keeps its state without being reported.
- Unexpected-stop detection uses the most recent lifecycle task per
  guest (no time window, OK or WARNINGS; suspend, reboot in progress and
  stop-mode backups included); a stop task clears an existing latch.
  onboot=1 guests stopped by a task are WARN instead of CRIT.
- Tasks are read with --source all so running tasks are visible.
- --force warning goes to stderr for --json/--health --json/--check.
- --check: INT/TERM and usage errors exit 3 from the very start.
- Total delivery failure saves the state but keeps the unsent changes
  (and the task watermark) pending, so they fire once on the next run.
- Lock on fd 9, closed for pvesh/python3/qm/pct/curl/sendmail.
- onboot read from /etc/pve/{qemu-server,lxc}/ID.conf (current section)
  with qm/pct fallback; node name from `uname -n` up to the first dot.
- Findings shorten the guest name, never the text; narrow terminals drop
  UPTIME/DISK%/TYPE; ignored guests are not counted; an empty node is
  not an error for --health.
- Regression tests for each item.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 19:01:30 +02:00
Tim BaumannandClaude Opus 5 005a8e91a9 feat(health): send alerts via ntfy and e-mail
- _notify_ntfy: curl with URL, Title/Priority/Tags and the optional
  Bearer token passed only via the stdin config; body from a private
  temp file; no redirects; only the host is logged. A token is never
  sent over plain http (channel fails instead).
- _notify_mail: local sendmail (fallback /usr/sbin/sendmail) with
  validated single-line headers, UTF-8 body and Auto-Submitted.
- _notify_all tries every configured channel and fails only when all
  of them fail, so --check keeps its state and retries next run.
- --test-notify sends a real test message.
- A running or successful vzdump task explains a stopped guest
  (backup stop mode).
- Tests: curl/sendmail mocks, delivery, dedup, recovery, partial and
  total failure, token handling, header injection, vzdump.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 18:51:28 +02:00
Tim BaumannandClaude Opus 5 8a52fff680 feat(health): add --check engine with state, lock and exit codes
- --check evaluates all local guests plus recent node tasks and alerts
  only on changes: new/escalated, improved, RESOLVED with duration.
- CPU needs HEALTH_CPU_RUNS consecutive runs; mem/disk alert at once; a
  metric that is n/a keeps its previous state; a running guest that
  stops without a successful stop/shutdown/destroy/migrate task is WARN
  (latched), onboot=1 and stopped is CRIT.
- Failed tasks since the last run are one-shot events (WARNINGS -> WARN,
  otherwise CRIT); the first run is a baseline; watermark by endtime+UPID.
- Versioned TSV state (0600 in a 0700 dir), regex-validated on load,
  never sourced, written atomically; flock against parallel runs; INT/TERM
  and unexpected aborts exit 3.
- Nagios-style summary; exit 0/1/2/3. --dry-run prints the composed
  message and writes neither state nor lock nor notifications.
- _notify_all is a stub until the ntfy/sendmail senders land; with a
  channel configured it reports failure so state is kept for a retry.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 18:45:31 +02:00
Tim BaumannandClaude Opus 5 3b5c2eee48 feat(health): add health view with pvesh data layer
- Read local guests from `pvesh get /cluster/resources` (30 s timeout),
  parse JSON on stdin with python3 into TSV; templates and guests on
  other nodes are skipped, names sanitized.
- _health_checks is the single source for cpu/mem/disk/down levels;
  stopped guests with onboot=1 are CRIT.
- --health (boxed), --health --list (plain) with findings and totals,
  --health --json with null for n/a metrics; --filter/--name apply.
- Main menu key "h" opens the health overview; the status action adds a
  "Health:" line and stays silent without pvesh/python3.
- Tests: pvesh mock with fixtures, onboot support in qm/pct mocks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 18:40:27 +02:00
Tim BaumannandClaude Opus 5 54ab44e75f feat(health): add health config keys and CLI modes
- New allowlisted config keys: HEALTH_{CPU,MEM,DISK}_{WARN,CRIT},
  HEALTH_CPU_RUNS, HEALTH_IGNORE_IDS, HEALTH_STATE_DIR, NTFY_URL,
  NTFY_TOKEN_FILE, HEALTH_MAIL_TO, HEALTH_MAIL_FROM; inline NTFY_TOKEN
  is ignored and rejected in notification modes.
- _validate_health_config runs only in health/check/test-notify modes.
- New flags --health, --check, --dry-run, --test-notify with mode
  resolution and invalid-combination checks; fatal setup errors exit 3
  in --check mode.
- Extract _fmt_duration and _owner_mode_ok helpers.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-19 18:37:19 +02:00
==TIM.©.B == abad90f368 harden configuration and CI security (#31) 2026-09-01 01:15:54 +02:00
Timintech 1ba97601df fix: harden snapshot validation and spice handling 2026-06-27 16:57:29 +02:00
Timintech 0cfa55a3c1 fix: handle bare VM agent IP payloads 2026-06-21 09:02:14 +02:00
Timintech 27f1300166 feat: add IP info menu for VM and CT 2026-06-21 08:48:33 +02:00
rootandClaude Haiku 4.5 7d3d6e16b8 fix(ui): disable box drawing in --list/--json output
- Box drawing is TUI-only; --list output is meant for parsing
- Set LANG=C, TERM=dumb in test environment to ensure ASCII
- All 29 tests now pass with plain-text table format

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-05-03 14:05:13 +02:00
gummiflipandClaude Sonnet 4.6 abe631b47c feat(v2.9.0): --filter/--force/--timeout flags, pct/qm reboot, type cache, 29 tests, GitHub infra
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-09 16:22:14 +02:00
gummiflipandClaude Sonnet 4.6 7efb76ecc8 refactor(all): v2.8.0 — modular rewrite, UX improvements, safety guards
proxmox-manager.sh:
- Bump to v2.8.0; add --version flag
- Add log() with optional LOG_FILE env for structured timestamped logging
- Add validate_vmid() (numeric, 1–999999) used in main_menu()
- Add confirm() helper for destructive actions (stop, restart, rollback, delete)
- Add _status_color() to centralise status→colour mapping
- Show snapshot list before rollback/delete in snapshots_menu()
- Show node hostname + pveversion in header() when available
- Add keyboard legend to main_menu()
- Fix arithmetic with VMID in spice_enable/spice_info (explicit 10# base cast)
- Normalise all output to English (remove German/English mix)
- Colour-coded action_menu() entries (green/red/yellow/cyan)
- Add YELLOW colour variable
- Clear section comments throughout

tests/run.sh:
- Replace rg with portable grep -q
- Add structured pass/fail counters with summary
- Add tests for --help, --version, --once (interactive loop exit)
- Fix arithmetic bug: PASS++ → PASS=$((PASS + 1)) under set -e

install_dependencies.sh:
- Add root check with helpful sudo hint
- Add apt-get availability check for non-Debian systems
- Add timestamped _log()/_ok()/_err() helpers
- Log per-package install status (already installed vs. will install)
- Improved apt-get error handling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-06 03:24:33 +01:00
TimInTech 63066488fd test: add mock list/json tests 2026-01-10 23:55:53 +01:00