Help us shape the future of Go! Take the 2026 Go Developer Survey

config

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DataDir        string `yaml:"data_dir"`
	AppsDir        string `yaml:"apps_dir"`
	ListenAddr     string `yaml:"listen_addr"`
	HTTPListenAddr string `yaml:"http_listen_addr"`
	// ExtraListenAddrs are additional addresses for the HTTPS proxy server
	// (e.g. [":50051"]). They serve the same routes, TLS policies and certs
	// as ListenAddr. Empty by default.
	ExtraListenAddrs []string `yaml:"extra_listen_addrs"`
	ManagementPort   int      `yaml:"management_port"`
	// ManagementAddr is the bind address for the dashboard listener.
	// Defaults to "127.0.0.1" so the plain-HTTP dashboard is not exposed
	// to the network without an explicit operator decision (front it with
	// Caddy, or set ManagementAddr: "" to bind all interfaces).
	ManagementAddr string          `yaml:"management_addr"`
	Domain         string          `yaml:"domain"`
	TLS            TLSConfig       `yaml:"tls"`
	MasterSecret   string          `yaml:"master_secret"`
	Metrics        MetricsConfig   `yaml:"metrics"`
	RateLimit      RateLimitConfig `yaml:"ratelimit"`
	LoginRateLimit RateLimitConfig `yaml:"login_ratelimit"`
	Registries     []string        `yaml:"registries"`
	TrustedProxies []string        `yaml:"trusted_proxies"`
	// AllowedBindPaths are host folders apps may bind-mount even though they
	// sit under a protected system folder (e.g. /home/media). SimpleDeploy's
	// data folder and other apps' folders stay protected.
	AllowedBindPaths []string      `yaml:"allowed_bind_paths"`
	LogBufferSize    int           `yaml:"log_buffer_size"`
	PublicHost       string        `yaml:"public_host"`
	RecipesIndexURL  string        `yaml:"recipes_index_url"`
	GitSync          GitSyncConfig `yaml:"git_sync"`
}

func DefaultConfig

func DefaultConfig() *Config

func Load

func Load(path string) (*Config, error)

func (*Config) Marshal

func (c *Config) Marshal() ([]byte, error)

func (*Config) PlaceholderMasterSecret added in v1.4.3

func (c *Config) PlaceholderMasterSecret() bool

PlaceholderMasterSecret reports whether master_secret is a known example value from the docs (public, so it must not sign sessions).

func (*Config) SaveAtomic

func (c *Config) SaveAtomic(path string) (err error)

SaveAtomic writes the config to path atomically (temp file + rename). The temp file is removed when any step fails.

func (*Config) Validate

func (c *Config) Validate() error

type GitSyncConfig

type GitSyncConfig struct {
	Enabled       bool          `yaml:"enabled"`
	Remote        string        `yaml:"remote"`
	Branch        string        `yaml:"branch"`
	AuthorName    string        `yaml:"author_name"`
	AuthorEmail   string        `yaml:"author_email"`
	SSHKeyPath    string        `yaml:"ssh_key_path"`
	HTTPSUsername string        `yaml:"https_username"`
	HTTPSToken    string        `yaml:"https_token"`
	PollInterval  time.Duration `yaml:"poll_interval"`
	WebhookSecret string        `yaml:"webhook_secret"`
}

GitSyncConfig controls optional git-backed config sync.

type MetricsConfig

type MetricsConfig struct {
	Tiers []MetricsTier `yaml:"tiers"`
}

type MetricsTier

type MetricsTier struct {
	Name      string `yaml:"name"`
	Interval  string `yaml:"interval,omitempty"`
	Retention string `yaml:"retention"`
}

type RateLimitConfig

type RateLimitConfig struct {
	Requests int    `yaml:"requests"`
	Window   string `yaml:"window"`
	Burst    int    `yaml:"burst"`
	By       string `yaml:"by"`
}

type TLSConfig

type TLSConfig struct {
	Mode  string `yaml:"mode"`
	Email string `yaml:"email"`
}

Jump to

Keyboard shortcuts

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