Development

This commit is contained in:
Matthew Grotke 2026-05-22 02:11:02 -04:00
parent 64173876a2
commit 4026e591bf

View file

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