homelab: Ausfuehrer erkennt die App auch am neuen /usr/bin/update (SCRIPT_SLUG), das Community-Scripts nach jedem Update schreibt

Nach dem ersten echten Update (Gitea 1.27.2 -> 1.27.3) stand Gitea nur noch als "gitea" ohne App-Baustein da.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-09-24 19:29:55 +02:00
co-authored by Claude Opus 5.5
parent 528198de60
commit 4a2b1723f4
2 changed files with 22 additions and 4 deletions
+11 -4
View File
@@ -112,13 +112,20 @@ def snapshot_moeglich(konfig: dict, arten: dict[str, str]) -> tuple[bool, str |
return True, None
def _app_kennung(vmid: int) -> str | None:
"""Welches Community-Script steckt im Gast? /usr/bin/update lädt ct/<kennung>.sh."""
code, text = _im_gast(vmid, "cat /usr/bin/update 2>/dev/null", 10)
m = re.search(r"/ct/([a-z0-9-]+)\.sh", text) if code == 0 else None
def app_kennung_aus(update_skript: str) -> str | None:
"""Kennung des Community-Scripts aus /usr/bin/update. Zwei Formate: das alte lädt ct/<kennung>.sh direkt,
das neue (schreibt jedes erfolgreiche Update seit 09/2026) setzt `export SCRIPT_SLUG="<kennung>"`."""
m = (re.search(r'^export (?:SCRIPT_SLUG|UPDATE_SCRIPT_NAME)="([a-z0-9-]+)"', update_skript, re.MULTILINE)
or re.search(r"/ct/([a-z0-9-]+)\.sh", update_skript))
return m.group(1) if m else None
def _app_kennung(vmid: int) -> str | None:
"""Welches Community-Script steckt im Gast?"""
code, text = _im_gast(vmid, "cat /usr/bin/update 2>/dev/null", 10)
return app_kennung_aus(text) if code == 0 else None
def _app_version(vmid: int, kennung: str) -> str | None:
befehl = VERSION_PROBEN.get(kennung)
if befehl is None: