From 155d6eaaf915b1f180820cf8cfb2b77643b94df3 Mon Sep 17 00:00:00 2001 From: m17hr1l Date: Sun, 7 Jun 2026 01:58:27 +0200 Subject: [PATCH] stage-topo-d topology-export: CLI fed-topology + SW v10 --- src/psyc/_federation_cli.py | 14 +++++++++++++- src/psyc/cockpit/static/sw.js | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/psyc/_federation_cli.py b/src/psyc/_federation_cli.py index b51223c..0c4dcbb 100644 --- a/src/psyc/_federation_cli.py +++ b/src/psyc/_federation_cli.py @@ -13,7 +13,7 @@ import httpx import typer from psyc import db, log -from psyc.lines import discovery, federation, network_view, pulse, translog +from psyc.lines import discovery, federation, network_view, pulse, topology_export, translog from psyc.result import Err, Ok @@ -326,6 +326,18 @@ def register(typer_app: typer.Typer) -> None: for k, v in view.stats.items(): typer.echo(f" {k:<32} {v}") + @typer_app.command("fed-topology") + def fed_topology() -> None: + """Print the sanitized docker topology JSON published at /federation/topology. + + Useful for auditing what gets exposed to peers — pipe through `jq` to + confirm no env vars / volume mounts / IPs leak. On a dev box where + the docker-socket-proxy isn't running the export will be empty. + """ + db.init_db() + export = topology_export.build_export() + typer.echo(json.dumps(export.model_dump(mode="json"), indent=2)) + @typer_app.command("fed-log-verify") def fed_log_verify() -> None: """Re-walk the chain locally and report verification status.""" diff --git a/src/psyc/cockpit/static/sw.js b/src/psyc/cockpit/static/sw.js index f203085..5e0dd8b 100644 --- a/src/psyc/cockpit/static/sw.js +++ b/src/psyc/cockpit/static/sw.js @@ -5,7 +5,7 @@ // This makes the cockpit installable as a PWA and survives flaky connections, // without serving stale operational data behind the operator's back. -const CACHE_VERSION = "psyc-v9"; +const CACHE_VERSION = "psyc-v10"; const STATIC_ASSETS = [ "/static/cockpit.css", "/static/psyc-tokens.css",