Documentation
¶
Overview ¶
Package config reads the bootstrap settings of C-02.FR-1 and FR-2 from the environment (ADR-0010): only MUSTER_* variables, read with caarlos0/env and checked with go-playground/validator. A secret can also come from its *_FILE variable. An invalid or missing value is an error that names the variable; nothing falls back silently, and an error never carries a secret.
Index ¶
Constants ¶
const ( DefaultDatabasePort = "5432" DefaultDatabaseSSLMode = "prefer" DefaultListenApp = ":8080" DefaultListenIngest = ":8081" DefaultListenInternal = ":8082" DefaultLogLevel = "info" DefaultRunbookBaseURL = "https://muster-io.github.io/muster" )
The defaults of defaults.md: a variable that is not set takes its default; one that is set, even empty, does not.
Variables ¶
This section is empty.
Functions ¶
func SecureContext ¶
SecureContext reports whether browsers treat the pages of u as a secure context, where they keep the Secure session cookie: https, or http on a loopback host — localhost, a name under .localhost, either with a trailing dot, 127.0.0.0/8 or ::1.
Types ¶
type Config ¶
type Config struct {
// Database is the main connection, for every query; Session the session-capable connection, for advisory locks
// and LISTEN.
Database Database
Session Database
// SecretKeys is the value of MUSTER_SECRET_KEYS or the content of MUSTER_SECRET_KEYS_FILE, and SecretKeysSource
// the variable that was set, empty when neither was; internal/keyring reads and checks them.
SecretKeys logging.Secret
SecretKeysSource string
PublicURL *url.URL
IngestURL *url.URL
ListenApp string
ListenIngest string
ListenInternal string
LogLevel logging.Level
MigrateOnStart bool
TrustedProxies []netip.Prefix
RunbookBaseURL *url.URL
BootstrapAdminEmail string
BootstrapAdminPassword logging.Secret
// Conflicts are the settings given twice, where one form wins; the caller logs them once the logger exists.
Conflicts []Conflict
}
Config is the validated bootstrap configuration.
type Conflict ¶
Conflict is a setting given both as a URL and as fields: Used wins and Ignored are not read.
type Database ¶
type Database struct {
// URL is a postgres:// URL with the password; it is never logged.
URL logging.Secret
// SSLMode is the sslmode in effect, prefer when the URL names none.
SSLMode string
}
Database is one database connection.
type Variable ¶
type Variable struct {
Name string
// Default is the value of a variable that is not set; empty when it has none.
Default string
Description string
// File is the *_FILE variable that may hold the value instead; empty when there is none.
File string
// Secret is set for a value that is never repeated in an error or a log line.
Secret bool
}
Variable is a bootstrap setting as the reference page lists it.