Archived
Polish KarlDNS production UI and docs
This commit is contained in:
1 parent
ca92dc211a
commit
5beee0e5c6
61 files changed
+1566
-523
No files matched your search
@@ -9,18 +9,18 @@ def main() -> None:
|
||||
parser = argparse.ArgumentParser(prog="karldns")
|
||||
subparsers = parser.add_subparsers(dest="command", required=True)
|
||||
|
||||
render_url = subparsers.add_parser("render-fritz-url", help="Render a FRITZ!Box custom DynDNS update URL.")
|
||||
render_url.add_argument("--base-url", required=True, help="Public base URL of this DDNS service.")
|
||||
render_url = subparsers.add_parser("render-fritz-url", help="Print a FRITZ!Box DynDNS update URL.")
|
||||
render_url.add_argument("--base-url", required=True, help="Public KarlDNS URL.")
|
||||
render_url.add_argument("--host", required=True, help="DNS hostname configured in FRITZ!Box.")
|
||||
render_url.add_argument("--include-ipv6", action="store_true")
|
||||
|
||||
serve = subparsers.add_parser("serve", help="Run the DDNS HTTP service.")
|
||||
serve = subparsers.add_parser("serve", help="Run the KarlDNS web service.")
|
||||
serve.add_argument("--host", default="0.0.0.0")
|
||||
serve.add_argument("--port", type=int, default=8080)
|
||||
serve.add_argument(
|
||||
"--access-log",
|
||||
action="store_true",
|
||||
help="Enable Uvicorn access logs. Disabled by default because update URLs are bearer secrets.",
|
||||
help="Enable redacted request logs. Raw web-server access logs stay off because private URLs are secrets.",
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
@@ -31,8 +31,10 @@ def main() -> None:
|
||||
|
||||
settings = DdnsSettings.from_env()
|
||||
if not settings.admin_password:
|
||||
raise SystemExit("DDNS_ADMIN_PASSWORD must be set.")
|
||||
uvicorn.run(make_app(settings), host=args.host, port=args.port, access_log=args.access_log)
|
||||
raise SystemExit("Set DDNS_ADMIN_PASSWORD before starting KarlDNS.")
|
||||
if args.access_log:
|
||||
settings = settings.model_copy(update={"redacted_access_log": True})
|
||||
uvicorn.run(make_app(settings), host=args.host, port=args.port, access_log=False)
|
||||
|
||||
|
||||
def _render_fritz_url(base_url: str, host: str, include_ipv6: bool) -> str:
|
||||
|
||||
Reference in new issue
Block a user