Documentation
¶
Overview ¶
Package config holds Phase 3 daemon TOML settings (library layer; daemon owns persistence).
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RestartRequiredKeys = []string{
"listen_addr", "quic_listen_addr", "bootstrap", "api_addr", "key_dir",
"disable_upnp", "fallback_host", "min_observed_peers",
"ice_signal_url", "ice_signal_urls", "ice_stun_urls", "ice_turn_urls",
"turn_servers", "ice_publish_turns", "signal_listen_addr",
}
RestartRequiredKeys lists config keys that need daemon restart after change.
Functions ¶
Types ¶
type Config ¶
type Config struct {
ListenAddr string `toml:"listen_addr" json:"listen_addr"`
QUICListenAddr string `toml:"quic_listen_addr" json:"quic_listen_addr"`
Bootstrap []string `toml:"bootstrap" json:"bootstrap"`
DisableUPnP bool `toml:"disable_upnp" json:"disable_upnp"`
FallbackHost string `toml:"fallback_host" json:"fallback_host"`
MinObservedPeers int `toml:"min_observed_peers" json:"min_observed_peers"`
APIAddr string `toml:"api_addr" json:"api_addr"`
APIToken string `toml:"api_token" json:"api_token"`
KeyDir string `toml:"key_dir" json:"key_dir"`
LogFormat string `toml:"log_format" json:"log_format"`
LogLevel string `toml:"log_level" json:"log_level"`
ICESignalURL string `toml:"ice_signal_url" json:"ice_signal_url"`
ICESignalURLs []string `toml:"ice_signal_urls" json:"ice_signal_urls"`
ICESTUNURLs []string `toml:"ice_stun_urls" json:"ice_stun_urls"`
// ICETURNURLs is the legacy TURN URL list with embedded credentials (user:pass@host).
// Use TURNServers for new deployments.
ICETURNURLs []string `toml:"ice_turn_urls" json:"ice_turn_urls"`
// TURNServers lists TURN relay servers with structured credential configuration.
TURNServers []TURNServerConfig `toml:"turn_servers" json:"turn_servers"`
// ICEPublishTurns is deprecated; new nodes do not publish turns[] to the DHT.
ICEPublishTurns []string `toml:"ice_publish_turns" json:"ice_publish_turns"`
// SignalListenAddr is the TCP listen address for the embedded ICE signaling hub.
// Empty or "off" disables the hub (default). Only enable on bootstrap/infrastructure nodes.
// E.g. ":4121" shares the DHT port over TCP.
SignalListenAddr string `toml:"signal_listen_addr" json:"signal_listen_addr"`
// AutoPublish controls whether the daemon publishes the node identity to the DHT
// on startup and on a schedule (default true). When false, the node stays off the DHT
// as a discoverable endpoint while still participating in routing.
AutoPublish bool `toml:"auto_publish" json:"auto_publish"`
// BootstrapAssistMode enables passive routing and supplemental store writes for network resilience.
// Not included in user-facing documentation.
BeaconMode bool `toml:"beacon_mode" json:"beacon_mode,omitempty"`
// BootstrapNodeIDs lists NodeID hex strings that bootstrap peers must match.
// When non-empty, any bootstrap peer whose NodeID is not in this list is rejected.
// Applies to config-supplied and DNS-discovered bootstrap addresses.
BootstrapNodeIDs []string `toml:"bootstrap_node_ids" json:"bootstrap_node_ids,omitempty"`
}
Config is the a2ald configuration (spec Phase 3).
func Default ¶
func Default() Config
Default returns a copy with zero values filled to spec defaults.
func (*Config) KeyDirOrDefault ¶
KeyDirOrDefault returns the directory for node.key; empty KeyDir means <dataDir>/keys.
type TURNServerConfig ¶ added in v0.1.4
type TURNServerConfig struct {
URL string `toml:"url" json:"url"`
CredentialType string `toml:"credential_type" json:"credential_type"`
Username string `toml:"username" json:"username"`
// Credential is the static password (static), HMAC shared secret (hmac),
// or Authorization header value for the REST API call (rest_api).
Credential string `toml:"credential" json:"credential"`
CredentialURL string `toml:"credential_url" json:"credential_url"`
}
TURNServerConfig is the TOML/JSON-serializable form of a TURN relay server. CredentialType selects the credential method: "static" (default), "hmac", or "rest_api".
Click to show internal directories.
Click to hide internal directories.