from __future__ import annotations
from ..ddns_service import DdnsService
from .html_utils import SafeHtml, attr, escape, trusted
from .templates import (
_copy_button,
_copy_row,
_fritzbox_fields,
_manual_update_commands,
_manual_update_panel,
_one_time_secret_notice,
_secret_notice,
)
def _linux_installer_section() -> SafeHtml:
system_install = "curl -fsSL https://karldns.de/install.sh | sudo sh"
system_uninstall = "curl -fsSL https://karldns.de/uninstall.sh | sudo sh"
user_install = "curl -fsSL https://karldns.de/install.sh | sh -s -- --mode user"
clean_uninstall = "curl -fsSL https://karldns.de/uninstall.sh | sh -s -- --mode user --delete-config"
all_commands = "\n".join([system_install, system_uninstall, user_install, clean_uninstall])
return trusted(
f"""
Linux cron updater For a Linux server, Proxmox host, NAS, or home-lab box that is always on, the installer creates a hostname if needed, installs the updater, schedules cron, runs the first update, and prints the private dashboard URL. User mode writes to Install and uninstall should be boring.
{escape(system_install)}
{escape(system_uninstall)}
--delete-config for a clean wipe.
Without sudo
~/.local/bin, ~/.config/karldns, and your user crontab.{escape(user_install)}
{escape(clean_uninstall)}
{status}
Direct custom-domain publishing
Use this only when KarlDNS should publish A/AAAA records directly inside your domain. If you just want your own subdomain, generate a hostname above and create a CNAME to it.
Hostname generated
Use the Update-URL directly. The separate Benutzername and Kennwort values are optional compatibility fields for routers that require them.
{_one_time_secret_notice()} {_secret_notice()}This unlocks after the TXT record is visible in public DNS.