from __future__ import annotations from ..ddns_models import DdnsSettings from ..ddns_service import DdnsService from .html_utils import escape, trusted from .templates import _message_band, _page, _top_nav from .templates_public_sections import _credentials_panel, _custom_domain_flow, _linux_installer_section def _render_public_home( service: DdnsService, settings: DdnsSettings, created_account: dict[str, str] | None, message: str | None, challenge: dict[str, str | None] | None = None, ) -> str: suffix = escape(settings.hostname_suffix or "your DynDNS domain") demo_update_url = escape(f"{settings.public_base_url.rstrip('/')}/u/?myip=") created_html = _credentials_panel(service, created_account) message_html = _message_band(message) if message and not challenge else "" challenge_html = _custom_domain_flow(service, challenge, message) return _page( "KarlDNS", trusted(f"""
{_top_nav()}

KarlDNS for home routers.

{demo_update_url}

Generate one secret update URL under {suffix}. Paste it into your router, script it with curl, or point your own subdomain at it with a CNAME.

{message_html} {created_html}

Choose your hostname

No account. No login.

Use a generated KarlDNS hostname immediately, or verify your own domain with a DNS TXT record.

Use our domain

Generate a KarlDNS hostname

KarlDNS generates the hostname, secret update URL, and optional router compatibility credentials automatically.

Use your own domain

Verify DNS ownership

Add one TXT record so KarlDNS can confirm you control the domain before it publishes A/AAAA records there.

Update from anything that can send GET.

Use FRITZ!Box placeholders, curl, cron, Home Assistant, OpenWrt, pfSense, OPNsense, UniFi, MikroTik, or your own automation.

# explicit IPv4 curl -sS 'https://karldns.de/u/<secret>?myip=203.0.113.10' # source IP fallback curl -sS 'https://karldns.de/u/<secret>'
{_linux_installer_section()} {challenge_html}
"""), ) def _render_privacy_page() -> str: return _page( "Legal and Privacy", trusted(f"""
{_top_nav()}

Legal and privacy

KarlDNS keeps accountless DynDNS simple.

This page explains the basic data handled by this self-hosted service. Configure your own imprint, controller details, and jurisdiction-specific terms before offering it publicly.

Data processed

KarlDNS stores generated hostnames, public DNS target names, update slugs, hashed management tokens, hashed router passwords, DNS TXT verification challenges, IP update history, timestamps, and operational events needed to run Dynamic DNS.

Secrets

Private management links, update URLs, router passwords, and one-box update URLs are bearer secrets. Anyone with them can update or manage the related hostname. Passwords and management lookup values are not stored in recoverable plaintext.

Logs and retention

The service keeps recent update events for troubleshooting and runs cleanup jobs for abandoned setup flows and unused hostnames. Server and reverse-proxy logs may also contain IP addresses and request metadata depending on your deployment.

Contact

For the public KarlDNS instance, contact Karl through karl.fail or karlcom.de.

"""), )