From 4026e591bf585e23722795bb0026ade18c9eab0d Mon Sep 17 00:00:00 2001 From: Matthew Grotke Date: Fri, 22 May 2026 02:11:02 -0400 Subject: [PATCH] Development --- routlin/install.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/routlin/install.py b/routlin/install.py index 0e0061a..093bc69 100644 --- a/routlin/install.py +++ b/routlin/install.py @@ -374,6 +374,13 @@ def install_caddy(pm): die("Caddy required for external access.") +def _external_access_domain(): + """Return the configured domain if a Routlin Caddy block exists, else None.""" + if not CADDYFILE.exists(): + return None + m = re.search(rf'(\S+)\s*\{{[^}}]*127\.0\.0\.1:{FLASK_PORT}', CADDYFILE.read_text(), re.DOTALL) + return m.group(1) if m else None + def setup_caddy(domain, email): block = ( f"\n# Routlin Dashboard\n" @@ -496,6 +503,14 @@ def main(): # -- External access ------------------------------------------- header("External Access (optional)") + ext_domain = _external_access_domain() + if ext_domain: + print(f" External access to the web dashboard is already configured.") + print(f" https://{ext_domain}/") + print() + print("Done.") + return + print(" External access lets you reach the dashboard from outside") print(" your LAN via HTTPS using a domain name and Caddy.") print()