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 Run this on a Linux box that is always on. It creates a hostname, installs the updater, schedules it, and prints your private dashboard link. Use this when you do not want a system-wide install.Linux updater.
{escape(system_install)}
{escape(system_uninstall)}
--delete-config only when you want to remove everything.
User install
{escape(user_install)}
{escape(clean_uninstall)}
{status}
Custom domain
Use this when KarlDNS should update records inside your domain. For a simpler setup, create a KarlDNS hostname and point a CNAME to it.
Hostname ready
Use the Update-URL directly. Username and password are only for routers that require separate fields.
{_one_time_secret_notice()} {_secret_notice()}Available after KarlDNS can see the TXT record.