Documentation
¶
Overview ¶
Package config loads and validates the zatterad server configuration. Sources, in increasing precedence: built-in defaults → TOML file (/etc/zattera/config.toml or --config) → command-line flags (wired by the server command). The CLI has its own tiny config (internal/cli).
Index ¶
Constants ¶
const ( RoleControl = "control" RoleWorker = "worker" )
Role names a node can assume.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ACMEConfig ¶
type Config ¶
type Config struct {
// NodeName defaults to the hostname.
NodeName string `toml:"node_name"`
// DataDir holds raft state, registry blobs, logs, TSDB, certs.
DataDir string `toml:"data_dir"`
// Roles: control, worker, or both.
Roles []string `toml:"roles"`
// Domain is the cluster app domain (apps get <app>-<env>.<domain>).
Domain string `toml:"domain"`
// Dev enables single-node developer mode: self-signed TLS, ACME off,
// mesh off, bootstrap admin token printed at first start.
Dev bool `toml:"dev"`
// SealedAtRest keeps the cluster data key off local disk. The node then
// cannot auto-unseal itself after a restart: it comes up sealed (alerting,
// env-var writes and backups disabled) until an operator runs
// `zattera unseal` or it recovers the key from a control peer. Default
// false, which favours a node coming back working after a reboot; see
// ADR-0006.
SealedAtRest bool `toml:"sealed_at_rest"`
API APIConfig `toml:"api"`
Ingress IngressConfig `toml:"ingress"`
Registry RegistryConfig `toml:"registry"`
Mesh MeshConfig `toml:"mesh"`
ACME ACMEConfig `toml:"acme"`
Join JoinConfig `toml:"join"`
Raft RaftConfig `toml:"raft"`
Logs LogsConfig `toml:"logs"`
Upgrade UpgradeConfig `toml:"upgrade"`
}
Config is the full zatterad configuration.
type IngressConfig ¶
type JoinConfig ¶
type LogsConfig ¶
type MeshConfig ¶
type MeshConfig struct {
// Disabled forces no mesh (implied in single-node dev mode).
Disabled bool `toml:"disabled"`
// ListenPort for WireGuard UDP.
ListenPort uint16 `toml:"listen_port"`
// Interface name (Linux). Darwin picks utunN automatically.
Interface string `toml:"interface"`
// PublicEndpoints this node is reachable at ("ip:port"); autodetected
// when empty and the node has a public address.
PublicEndpoints []string `toml:"public_endpoints"`
// Mode selects the WireGuard datapath (ADR-0003):
// "" / "auto" — kernel WG when available, else userspace; phases A/B
// (hub + direct peering) only.
// "meshsock" — userspace WG with the meshsock bind: UDP hole punching
// (phase C) + TCP relay fallback (phase D). Use on NAT'd
// nodes that need worker↔worker connectivity without a
// routable endpoint.
Mode string `toml:"mode"`
}
func (MeshConfig) MeshsockEnabled ¶
func (m MeshConfig) MeshsockEnabled() bool
MeshsockEnabled reports whether this node should use the meshsock datapath.
type RaftConfig ¶
type RaftConfig struct {
// Listen for raft transport (control nodes; bound to mesh IP or
// 127.0.0.1 in single-node).
Listen string `toml:"listen"`
}
type RegistryConfig ¶
type UpgradeConfig ¶
type UpgradeConfig struct {
BaseURL string `toml:"base_url"`
}
UpgradeConfig bounds self-upgrade (T-95). The control plane chooses the asset URL, but a node only downloads from BaseURL — so a control plane that is compromised or misconfigured still cannot point nodes at arbitrary code.
Empty means the official release host (upgrade.DefaultBaseURL), NOT "unrestricted": a default that silently accepts any URL is the wrong way round for a feature that ends in exec. Set base_url = "*" to opt out, e.g. for an air-gapped mirror.