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: base_url = settings.public_base_url.rstrip("/") suffix = escape(settings.hostname_suffix or "your DynDNS domain") demo_update_url = escape(f"{base_url}/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) description = "KarlDNS is a free self-hosted Dynamic DNS service for FRITZ!Box routers, custom domains, Linux cron jobs, and home networks." return _page( "KarlDNS", trusted(f"""
{_top_nav()}

Dynamic DNS for home routers.

{demo_update_url}

KarlDNS gives you a private DynDNS update URL under {suffix}. Add it to your router, or use it from a script.

{message_html} {created_html}

Hostname

No account needed.

Use a KarlDNS hostname now, or verify your own domain when you need it.

KarlDNS domain

Create a hostname

You get a hostname, a private update URL, and router fields if your router needs them.

Use your own domain

Verify your domain

Add one TXT record first. KarlDNS only updates domains it can verify.

Update from a router or script.

Works with FRITZ!Box, curl, cron, Home Assistant, OpenWrt, pfSense, OPNsense, UniFi, MikroTik, and custom tools.

# 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}
"""), description=description, preload_logo=True, canonical_url=f"{base_url}/", image_url=f"{base_url}/social-preview.png", image_alt="KarlDNS landing page with private Dynamic DNS update URL", structured_data={ "@context": "https://schema.org", "@type": "SoftwareApplication", "name": "KarlDNS", "applicationCategory": "NetworkingApplication", "operatingSystem": "Linux", "url": f"{base_url}/", "description": description, "image": f"{base_url}/social-preview.png", "offers": {"@type": "Offer", "price": "0", "priceCurrency": "EUR"}, "featureList": [ "Dynamic DNS for FRITZ!Box routers", "Accountless private update URLs", "Custom domain TXT verification", "Linux cron updater", ], }, ) def _render_privacy_page(settings: DdnsSettings) -> str: base_url = settings.public_base_url.rstrip("/") description = "Privacy and legal information for KarlDNS, including stored hostnames, update links, DNS verification records, IP history, and cleanup behavior." return _page( "Legal and Privacy", trusted(f"""
{_top_nav()}

Legal and privacy

Privacy basics.

KarlDNS stores only the data needed to keep your hostname updated.

Data processed

KarlDNS stores hostnames, update links, protected dashboard tokens, protected router passwords, TXT verification records, recent IP history, timestamps, and service events.

Secrets

Dashboard links, update URLs, router passwords, full update URLs, and claim links are secrets. Anyone with them may update or manage the hostname. Passwords and dashboard lookup values are not stored as readable text.

Logs and retention

KarlDNS keeps recent update events for troubleshooting. Cleanup removes abandoned setup records and unused hostnames. Server logs may also include IP addresses and request details.

Contact

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

"""), description=description, canonical_url=f"{base_url}/privacy", image_url=f"{base_url}/social-preview.png", image_alt="KarlDNS legal and privacy information", structured_data={ "@context": "https://schema.org", "@type": "WebPage", "name": "KarlDNS Legal and Privacy", "url": f"{base_url}/privacy", "description": description, "isPartOf": { "@type": "WebSite", "name": "KarlDNS", "url": f"{base_url}/", }, }, )