Skip to content

Configuration: every variable ​

Every setting is an environment variable. For the host service they live in /etc/netknownsthat/nkt.env, for the hub — in /etc/netknownsthat/hub.env, in Docker — in the compose file's environment or a .env next to it. Commented templates — deploy/nkt.env.example and deploy/hub.env.example.

  • Durations — 30s, 5m, 6h, 720h; a bare number means seconds.
  • Lists — comma-separated.
  • Booleans — true / false.
  • An empty value is the same as an unset variable — the default applies.

A host under a hub

The hub rewrites a managed host's nkt.env on every install and update. Such a host's settings (API port, terminal, fallback channel) are changed in the host form on the hub, not by editing the file.

Mode and data ​

VariableDefaultMeaning
NKT_MODElocal on Linux, otherwise fixtureslocal — read the real host, fixtures — a snapshot, hub — hub mode
NKT_DATA_DIR/var/lib/netknownsthat; for the hub /var/lib/netknownsthat-hub; in fixtures — ./dataDatabase, config history, TLS, caches
NKT_FIXTURES_ROOT./fixtures/hostSnapshot directory for fixtures
NKT_DEMO_BACKFILLtrueIn fixtures, seed 14 days of synthetic history

Web and access ​

VariableDefaultMeaning
NKT_ADDR127.0.0.1:8077UI and API address
NKT_COOKIE_SECUREtrueSession cookie over HTTPS only; false — for an SSH tunnel over HTTP
NKT_SESSION_TTL12hSession lifetime
NKT_CORS_ORIGINShttp://localhost:5173Extra allowed origins (for state-changing requests and CORS)
NKT_TLS_ENABLEDfalseServe HTTPS itself
NKT_TLS_HOSTS127.0.0.1,::1,<hostname>Names and addresses in the self-signed certificate
NKT_TLS_CERT, NKT_TLS_KEYemptyYour own certificate and key (both) instead of a self-signed one
NKT_FORWARD_ADDRthe host part of NKT_ADDR, port 8446A separate address for Kubernetes port forwards in the browser; off — disable (forwards by path, sandboxed)
NKT_FORWARD_PUBLIC_URLemptyHow the browser sees the forward address behind a proxy: https://fwd.example.com

Accounts ​

VariableDefaultMeaning
NKT_BOOTSTRAP_ADMIN_USERadminThe first administrator's login
NKT_BOOTSTRAP_ADMIN_PASSWORDempty — generateThe first administrator's password (only on first start)
NKT_SYSTEM_LOGINtrue in local, otherwise falseLogin with a host system account (needs unix_chkpwd, group sudo/wheel/admin or root). Not available on the hub

Control ​

VariableDefaultMeaning
NKT_ALLOW_MUTATIONStruefalse — the whole application is read-only
NKT_COMMAND_TIMEOUT30sLimit for host commands (systemctl, nginx -t…)
NKT_TERMINAL_ENABLEDfalse; true on the hubThe web terminal (a root shell in the browser). On the hub — for the "localhost" row, i.e. the hub's own machine
NKT_TERMINAL_IDLE_TIMEOUT30mClose a terminal with no input or output
NKT_TERMINAL_USERempty — the service's userWho the host terminal opens as; the hub sets its SSH user here

What to read on the host ​

VariableDefaultMeaning
NKT_NGINX_ROOT, NKT_NGINX_MAIN_CONFIG/etc/nginx, /etc/nginx/nginx.confnginx configuration
NKT_HAPROXY_ROOT, NKT_HAPROXY_MAIN_CONFIG/etc/haproxy, /etc/haproxy/haproxy.cfghaproxy configuration
NKT_CADDY_ROOT, NKT_CADDY_MAIN_CONFIG/etc/caddy, /etc/caddy/CaddyfileCaddy configuration
NKT_FAIL2BAN_ROOT/etc/fail2banfail2ban configuration
NKT_SYSTEMD_UNIT_ROOT/etc/systemd/systemUnits in "Configs"
NKT_NETPLAN_ROOT/etc/netplanNetplan
NKT_SSH_ROOT/etc/sshsshd
NKT_SYSCTL_ROOT/etc/sysctl.dsysctl
NKT_CRON_ROOT/etc/cron.dcron
NKT_COMPOSE_FILES/srv/docker/docker-compose.yml,/opt/stacks/docker-compose.ymlCompose files to show and edit
NKT_FILES_ROOTS/home,/srv,/opt,/var/wwwRoots of the "Disks → Files" browser (only existing ones are shown; /tmp — always)
NKT_NGINX_ACCESS_LOGS/var/log/nginx/access.lognginx access logs for usage
NKT_HAPROXY_ACCESS_LOGS/var/log/haproxy.loghaproxy access logs
NKT_DOCKER_SOCKET/var/run/docker.sockDocker socket
NKT_PODMAN_SOCKET/run/podman/podman.sockPodman socket
NKT_LIBVIRT_URIqemu:///systemlibvirt connection

Monitoring ​

VariableDefaultMeaning
NKT_SCHEDULER_ENABLEDtrueBackground probes, metrics, scans; no history without it
NKT_PROBE_INTERVAL1mHow often to check availability
NKT_PROBE_TIMEOUT5sLimit for one probe
NKT_METRICS_INTERVAL1mUsage collection (counters, containers, machines)
NKT_LOG_SCAN_INTERVAL5mAccess log parsing
NKT_INVENTORY_INTERVAL5mA full host scan
NKT_DRIFT_INTERVAL1hChecking the host against profiles; 0 — don't
NKT_RETENTION720h (30 days)How long to keep probe and metric history

Certificates ​

VariableDefaultMeaning
NKT_AUTO_RENEW_CERTSfalseRenew certbot certificates on a schedule (the site stops for the renewal)
NKT_AUTO_RENEW_INTERVAL6hHow often to check
NKT_AUTO_RENEW_WITHIN720h (30 days)How long before expiry to renew
NKT_CERTBOT_TIMEOUT3mLimit for certbot (a network call to Let's Encrypt)
NKT_CERTBOT_EMAILemptyE-mail for Let's Encrypt when issuing

Hub ​

VariableDefaultMeaning
NKT_HUB_MASTER_KEYempty — generate into NKT_DATA_DIR/hub.keySecret encryption key (AES-256, base64: openssl rand -base64 32)
NKT_HUB_SOURCE_ROOTworking directoryA source clone for cross-compiling nkt for hosts; no source — the hub downloads the release
NKT_HUB_GO_BINgoWhich Go to build with; if it doesn't work, the hub installs its own into NKT_DATA_DIR/go-toolchain
NKT_HUB_RELEASE_REPOpiqab/nktWhere to download releases from (for forks)
NKT_HUB_GITHUB_APIhttps://api.github.comThe GitHub API (for GitHub Enterprise or a test stand)
NKT_HUB_HOST_API_PORT8077The nkt API port on hosts (loopback)
NKT_HUB_TUNNEL_PORT8078The fallback channel port on hosts
NKT_HUB_FINDINGS_POLL_INTERVAL60sHost polling: availability and finding counts
NKT_HUB_UPDATE_CHECK_INTERVAL6hChecking for new releases (badge only)
NKT_HUB_VULNDB_REFRESH_INTERVAL12hChecking the shared trivy database freshness
NKT_HUB_CLAMDB_REFRESH_INTERVAL24hRefreshing the ClamAV database copy; 0 — never
NKT_HUB_APTCACHE_MAX_GB20Package cache limit; 0 — no limit (the value set in the UI wins)
NKT_HUB_APTCACHE_PORT3142The cache port on hosts (loopback)
NKT_HUB_EXPORT_PASSWORDemptyFile password for nkt hub delete -export and nkt hub import without a terminal

The hub also reads the common variables above (NKT_ADDR, TLS, accounts, the terminal for "localhost", forwards).

Internal ​

Set by nkt or the hub itself — not set by hand:

VariableSet by
NKT_HUB_TUNNEL_LISTEN_ADDR, NKT_HUB_TUNNEL_TOKENthe hub, in nkt.env of a host with the fallback channel
NKT_GIT_SECRET, NKT_CONSOLE_USERnkt, for child processes (git, container consoles)
NKT_FAKE_BIN, NKT_FAKE_VM_BIN, NKT_TEST_*tests and stands, see Development

nkt-edge ​

The EDGE_* variables — on the nkt-edge page.