fix(update): sudo für apt-get update — Banner blieb sonst auf altem Stand

API läuft als edgeguard-User; ohne /etc/sudoers.d/edgeguard-Whitelist
schreibt apt-get update nicht in /var/lib/apt/lists/ und der candidate
bleibt auf dem Stand des letzten postinst-Runs. Erfordert einmalig
manuelles `sudo apt-get update && apt install edgeguard-api edgeguard-ui
edgeguard` um auf 1.0.48 zu kommen — ab dann läuft der Check automatisch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Debian
2026-05-11 14:28:37 +02:00
parent 62505d547c
commit 05850934fb
8 changed files with 113 additions and 6 deletions

View File

@@ -213,7 +213,10 @@ func (h *SystemHandler) Health(c *gin.Context) {
// fails — we'd still return the cached candidate). Then `apt-cache
// policy` is parsed for each package.
func (h *SystemHandler) PackageVersions(c *gin.Context) {
_ = exec.Command("apt-get", "update", "-qq").Run()
// API läuft als edgeguard-User; ohne sudo schreibt apt-get update
// nicht in /var/lib/apt/lists und der candidate bleibt veraltet.
// Sudoers-Eintrag in postinst whitelisted exakt diese Zeile.
_ = exec.Command("sudo", "-n", "/usr/bin/apt-get", "update", "-qq").Run()
out := map[string]string{}
for _, pkg := range []string{"edgeguard-api", "edgeguard-ui", "edgeguard"} {