Development
This commit is contained in:
parent
64173876a2
commit
4026e591bf
1 changed files with 15 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue