Configuration
The agent keeps a small JSON config file; the edge is flags and environment variables only, with no config-file dependency.
Agent (ngstone)#
ngstone auth, ngstone config set, and ngstone logout read and write:
$XDG_CONFIG_HOME/ngstone/config.json# falls back to ~/.config/ngstone/config.json if XDG_CONFIG_HOME is unsetngstone auth <token> after it verifies against the edge. Cleared by ngstone logout.ngstone auth or ngstone config set server <addr>. Falls back to ngstone.site:4443 if never set.The file is written mode 0600 inside a 0700directory, via a temp-file-plus-rename so a crash mid-write can't corrupt it. See ngstone config for the commands that read and write it.
Edge (ngstoned)#
-insecure.expvar, /healthz, pprof). Empty disables it.BindOK.URL — http or https.$NGSTONE_TOKEN_SHA256. See Generating a token.staging or production. A config mistake against production can rate-limit the domain for a week.-insecure.certmagic.FileStorage path; must match the systemd StateDirectory.Zone:DNS:Edit on the one zone. Required unless -insecure. Defaults to $NGSTONE_CF_API_TOKEN.Every value in the timeouts and limits table — request timeouts, body caps, rate limits, concurrency caps — is also flag-overridable on the edge (-read-header-timeout, -idle-timeout, -max-header-bytes, -max-body-bytes, -response-header-timeout, -per-ip-rate, -per-ip-burst, -per-ip-lru, -global-inflight, -per-session-inflight, -handshake-concurrency, -unauth-sessions). See Limits & timeouts for the full set and their defaults.
Environment variables#
ngstone port, below a--token flag and above the saved config file.ngstoned instead of -token-sha256.ngstoned instead of -cf-api-token.Never pass secrets as flags
/proc/<pid>/cmdline is world-readable on stock Linux, so anything passed as an ExecStart flag is readable by any local user via ps auxww. Load secrets from EnvironmentFile= instead.Precedence#
On the edge, an explicit flag always wins over its environment fallback; anything left unset falls back to its documented default.
On the agent, resolving the token or server address for ngstone port follows this chain:
--token / --server.NGSTONE_TOKEN. There is no environment override for the server address.ngstone auth or ngstone config set last saved.