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()