config

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config loads controller settings from flags and SYNCLOUD_* environment variables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// DataDir holds the SQLite database and all controller state.
	DataDir string
	// Listen is the address the API and dashboard listen on.
	Listen string
	// AgentListen is where the agent gateway (gRPC, mTLS) listens.
	AgentListen string
	// AgentProxyListen is the gateway's loopback port for connections
	// Traefik passes on from agent.<domain>:443 (PROXY protocol; "" = off).
	AgentProxyListen string
	// AgentAdvertise is the gateway address given to joining nodes. In production
	// this is the controller's WireGuard IP (10.90.0.1:7443, §8).
	AgentAdvertise string
	// PublicHTTP and PublicHTTPS are Traefik's public entrypoints
	// (":80"/":443"; dev serves HTTP on 127.0.0.1:8080, HTTPS still on :443).
	PublicHTTP  string
	PublicHTTPS string
	// PublicValkey is Traefik's entrypoint for public Valkey databases
	// (TLS, routed by SNI; Phase 12e).
	PublicValkey string
	// PublicPostgres is Traefik's entrypoint for public PostgreSQL databases
	// (STARTTLS, routed by SNI; Phase 13).
	PublicPostgres string
	// PublicPorts is the range public TCP/UDP service ports are assigned
	// from ("20000-20999"; Phase 15c).
	PublicPorts string
	// PublicDBPorts is the range dedicated public database ports are
	// assigned from (LOW-HIGH), apart from PublicPorts.
	PublicDBPorts string
	// PostgresImage overrides PostgreSQL images per major version
	// ("18=img,17=img").
	PostgresImage string
	// TraefikAdmin serves Traefik's ping and metrics on loopback.
	TraefikAdmin string
	// SystemTasks runs the platform components on ctl-0 (D20). Off in tests.
	SystemTasks bool
	// BaseDomain is set on first start when no base domain is stored (§5.0.2).
	// Without it the controller uses <public-ip>.sslip.io, or in dev mode
	// <its address>.sslip.io (the agent advertise IP or the default-route address).
	BaseDomain string
	// PublicIP overrides public IP detection.
	PublicIP string
	// ACME issues real certificates (default on outside dev mode).
	ACME          bool
	ACMEDirectory string
	ACMEEmail     string
	// ACMECAFile is an extra CA bundle trusted for the ACME server (e.g. Pebble in tests).
	ACMECAFile string
	// ControllerSchedulable lets the controller node run services (D3).
	ControllerSchedulable bool
	// RegistryPullHost overrides the registry host nodes pull "@registry/…"
	// images from (default: registry.<base-domain>).
	RegistryPullHost string
	// RegistryInsecure makes builds push over plain HTTP (default: dev only).
	RegistryInsecure bool
	// BuildNode pins Git builds to one node by name (default: any node).
	BuildNode string
	// VictoriaLogsURL is where container logs are stored (the system task).
	VictoriaLogsURL string
	// VictoriaMetricsURL stores metrics such as uptime checks (the system task).
	VictoriaMetricsURL string
	// Firewall manages each node's host firewall (§8.3).
	Firewall bool
	// SecurityGroups isolates containers with security groups (§8.3).
	SecurityGroups bool
	// CentralProbes checks every task from the controller (§5.6).
	CentralProbes bool
	// DownloadsDir holds agent and CLI binaries served to joining nodes.
	DownloadsDir string
	// ShellImage and ShellSynctl configure Cloud Shell (§7.1).
	ShellImage  string
	ShellSynctl string
	// ReleaseURL and ReleaseChannel are where upgrades come from (§5.0.1);
	// UpgradeSettle is how long a new controller must stay healthy.
	ReleaseURL     string
	ReleaseChannel string
	UpgradeSettle  time.Duration
	// Dev enables development behavior (verbose logs, relaxed origin checks for the Vite dev server).
	Dev bool
}

func LoadController

func LoadController(args []string) (Controller, error)

LoadController parses args (without the program name). Environment variables provide defaults; flags override them.

func (Controller) DBPath

func (c Controller) DBPath() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL