From 1f76e43dd1679c0a10285e9bfc61d2aebfcfb44c Mon Sep 17 00:00:00 2001 From: "Bernd (Hermes)" Date: Tue, 25 Aug 2026 17:06:20 +0200 Subject: [PATCH] =?UTF-8?q?fix(install):=20P-160=20Guard=20=E2=80=94=20dep?= =?UTF-8?q?loy=5Fplugin()=20pr=C3=BCft=20def=20register=20in=20=5F=5Finit?= =?UTF-8?q?=5F=5F.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/install.sh b/install.sh index f01ccab..e0b8d6a 100755 --- a/install.sh +++ b/install.sh @@ -533,6 +533,24 @@ deploy_plugin() { count=$(find "$dst" -type f ! -path '*/__pycache__/*' | wc -l) ok "$count Plugin-Dateien deployed" + # P-160 Guard: Root-__init__.py MUSS register() enthalten. + # Symptom: Gateway meldet "No messaging platforms enabled" + + # "'rocketchat' is not a valid Platform", obwohl `hermes plugins list` + # das Plugin als "enabled" zeigt. Ursache: Root-__init__.py wurde + # versehentlich mit dem Inhalt von archivar/__init__.py überschrieben + # (beide 1279 Bytes, identische MD5). Ohne register() → kein + # ctx.register_platform() → Platform nie registriert. + if [ -f "$dst/__init__.py" ]; then + if grep -q 'def register' "$dst/__init__.py"; then + ok "Root-__init__.py enthält register() (P-160 Guard)" + else + err "FAIL: Root-__init__.py enthält KEIN register() — Datei ist falsch (vermutlich archivar/__init__.py-Inhalt). Gateway wird 'No messaging platforms enabled' melden." + die "Root-__init__.py ohne register() — Abbruch (P-160)" + fi + else + warn "__init__.py nicht gefunden in $dst" + fi + # Pitfall 4: plugin.yaml name-Feld MUSS 'rocketchat' sein if [ -f "$dst/plugin.yaml" ]; then if grep '^name:' "$dst/plugin.yaml" | grep -q 'rocketchat$'; then