Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FleetKey ¶ added in v0.10.0
FleetKey returns the stored fleet bearer token, mirroring MasterKey's keychain-preferred / file-fallback storage. It tries the OS keychain first, then a 0600 <appDir>/.fleet_api_key file (migrating that file's value into the keychain when found). An empty string with a nil error means "not stored yet" so the caller can generate a fresh token or migrate a legacy config.json value and persist it via SetFleetKey.
func SetFleetKey ¶ added in v0.10.0
SetFleetKey persists the fleet bearer token keychain-first, falling back to a 0600 <appDir>/.fleet_api_key file when the keychain is unavailable (headless Linux / CI), exactly like MasterKey's storage tail.
Types ¶
type AppConfig ¶
type AppConfig struct {
FirstRunComplete bool `json:"firstRunComplete"`
DisplayCurrency string `json:"displayCurrency"`
RuntimeProvider string `json:"runtimeProvider"`
AutoUpdate bool `json:"autoUpdate"`
HostnamePrefix string `json:"hostnamePrefix"`
CollectIntervalMinutes int `json:"collectIntervalMinutes"`
RetentionDays int `json:"retentionDays"`
Timezone string `json:"timezone"`
// FleetAPIKey is the legacy plaintext location for the fleet bearer token. It is
// no longer persisted here — the token lives in the OS keychain with a 0600 file
// fallback via FleetKey/SetFleetKey. The field is retained with omitempty only so
// an older config.json still unmarshals and ensureFleetAPIKey can migrate its
// value into the keychain and then blank it from disk.
FleetAPIKey string `json:"fleetApiKey,omitempty"`
FleetBindAddress string `json:"fleetBindAddress"`
FleetPort int `json:"fleetPort"`
// MetricsEnabled turns on the opt-in Prometheus /metrics endpoint on the fleet
// server. It defaults to false (disabled) — the bool zero value, so applyDefaults
// needs no change. Enabling it exposes earnings, health and fleet stats on the
// fleet bind address (loopback by default) with no authentication, matching the
// Prometheus scraping convention.
MetricsEnabled bool `json:"metricsEnabled"`
// WorkerURLPolicy selects how the SSRF worker-URL validator (internal/fleetnet)
// classifies a remote worker endpoint before the desktop makes an authenticated
// request to it. One of "strict" (only WorkerAllowedHosts), "private" (RFC1918 +
// Tailscale CGNAT 100.64.0.0/10 + IPv6 ULA fc00::/7 + the allowlist — the sensible
// homelab default), or "public" (any non-loopback/link-local/metadata/unspecified
// address). Defaults to "private" via applyDefaults.
WorkerURLPolicy string `json:"workerUrlPolicy"`
// WorkerAllowedHosts is an explicit allowlist of worker hosts/IPs. It is the sole
// allow-source in "strict" mode and is always honored in the other modes. Entries
// may be an exact hostname, a "*.suffix" DNS suffix (e.g. Tailscale MagicDNS
// "*.mango-alpha.ts.net"), a CIDR, or a literal IP. Defaults to empty (nil).
WorkerAllowedHosts []string `json:"workerAllowedHosts"`
// WorkerAllowMetadata, when false (the default, the bool zero value), makes the
// cloud instance-metadata endpoints (169.254.169.254, fd00:ec2::254,
// metadata.google.internal) ALWAYS blocked regardless of policy or allowlist.
// Setting it true is the only way to reach a metadata address and should be rare.
WorkerAllowMetadata bool `json:"workerAllowMetadata"`
}
Click to show internal directories.
Click to hide internal directories.