fix(daily-infra-report): drop the vestigial Zulip key requirement; fail loudly on a failed send #127

Merged
abiba-bot merged 1 commits from fix/daily-health-digest-remove-vestigial-zulip-20260921 into master 2026-09-21 11:36:49 +00:00
+10 -8
View File
@@ -22,14 +22,12 @@ AUTH = "Authorization: PVEAPIToken=«vault: infrastructure/production PVE_API_TO
ZULIP_SITE = "https://chat.sysloggh.net"
ZULIP_EMAIL = "abiba-bot@chat.sysloggh.net"
ZULIP_API_KEY = os.environ.get("ZULIP_API_KEY", "")
if not ZULIP_API_KEY:
ZULIP_AUTH = None
DEGRADED_LEGS = ["credential-missing: ZULIP_API_KEY"]
print(" ⚠️ Degraded leg: credential-missing: ZULIP_API_KEY", file=sys.stderr)
else:
ZULIP_AUTH = f"{ZULIP_EMAIL}:{ZULIP_API_KEY}"
DEGRADED_LEGS = []
# Note: /api/v1/server_settings is a PUBLIC endpoint (verified HTTP 200 with or without credential).
# No Zulip API key is required for this call. If a future leg genuinely needs abiba-bot's key,
# it must prove it with a 200 from /api/v1/users/me as abiba-bot and label itself degraded when it cannot.
# Never fall back to the vault's shared ZULIP_API_KEY.
ZULIP_AUTH = None
DEGRADED_LEGS = []
LITELLM_PUBLIC = "https://litellm.sysloggh.net"
LITELLM_BACKEND = "192.168.68.116"
@@ -725,6 +723,10 @@ if __name__ == "__main__":
else:
print("\n✅ All legs fully credentialed")
# A failed send must exit non-zero; a degraded leg (no credential) must stay exit 0
if not ok:
sys.exit(1)
issues = sum(1 for i in ["red"] if report.get("zulip_ext", {}).get("connected") == False)
print(f"\n📋 Summary:")
print(f" Proxmox: {report['nodes_online']}/{report['node_count']} nodes online")