From e520d9361c7b7de3e599c2261e55682f62a8d0cb Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Wed, 4 Feb 2026 20:24:21 +0000 Subject: [PATCH] Auth mode indication on startupbox --- cista/__main__.py | 11 +++++++++-- cista/api.py | 10 ++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/cista/__main__.py b/cista/__main__.py index 65a00fe..6277e3f 100644 --- a/cista/__main__.py +++ b/cista/__main__.py @@ -25,14 +25,20 @@ def create_banner(): """ -def create_startup_box(*, folder, url, unix=None, dev=False, paskia_url=None): +def create_startup_box(*, folder, url, unix=None, dev=False, paskia_url=None, public=False): """Create a framed startup box with server information.""" title = f"Cista {cista.__version__}" listen = unix if unix else url location = f"{folder} @ {listen}" lines = [title, location] + # Auth line: Paskia or Password, with optional Public suffix if paskia_url: - lines.append(f"Paskia: {paskia_url}") + auth_line = f"Auth: Paskia {paskia_url}" + else: + auth_line = "Auth: Password" + if public: + auth_line += ", Public" + lines.append(auth_line) if dev: lines.append("dev mode") @@ -157,6 +163,7 @@ def _main(): unix=opts.get("unix"), dev=dev, paskia_url=PASKIA_BACKEND_URL or None, + public=config.config.public, ) sys.stderr.write(startup_box) # Run the server diff --git a/cista/api.py b/cista/api.py index deb8681..93aaa37 100644 --- a/cista/api.py +++ b/cista/api.py @@ -166,10 +166,12 @@ def subscribe(uuid, ws): @bp.get("config") async def get_config(request): await auth.verify(request, privileged=True) - return json({ - "name": config.config.name, - "public": config.config.public, - }) + return json( + { + "name": config.config.name, + "public": config.config.public, + } + ) @bp.put("config/public")