config

package
v0.1.16-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateAddress

func ValidateAddress(s string) (netip.AddrPort, error)

ValidateAddress parses and validates a TCP listen address of the form "host:port", "ip:port", "[ipv6]:port" or ":port". It accepts port 0 (ephemeral port). When the host component is empty (e.g. ":8443"), the returned address uses the unspecified IPv6 address ("::").

Types

type AdminConfig

type AdminConfig struct {
	Socket string `yaml:"socket"`
	Listen string `yaml:"listen"`
}

AdminConfig configures the local administrative interface.

type AuthConfig

type AuthConfig struct {
	BearerTokens BearerTokenConfig `yaml:"bearer_tokens"`
}

AuthConfig configures authentication mechanisms.

type BearerTokenConfig

type BearerTokenConfig struct {
	Enabled bool   `yaml:"enabled"`
	Secret  string `yaml:"secret"` // JWT signing secret (or load from env)
}

BearerTokenConfig configures JWT bearer token authentication.

type Config

type Config struct {
	HTTP        HTTPConfig        `yaml:"http"`
	Metrics     MetricsConfig     `yaml:"metrics"`
	Auth        AuthConfig        `yaml:"auth"`
	Admin       AdminConfig       `yaml:"admin"`
	PKI         PKIConfig         `yaml:"pki"`
	Scheduler   SchedulerConfig   `yaml:"scheduler"`
	Logging     LoggingConfig     `yaml:"logging"`
	Postgres    PostgresConfig    `yaml:"postgres"`
	GitLab      GitLabConfig      `yaml:"-"`
	ObjectStore ObjectStoreConfig `yaml:"object_store"`
	FilePath    string            `yaml:"-"`
}

Config represents the ployd daemon configuration.

func Load

func Load(path string) (Config, error)

Load reads the configuration from the provided path.

func LoadFromEnv

func LoadFromEnv() (Config, error)

LoadFromEnv builds server configuration from environment variables.

func (Config) ResolveRelative

func (cfg Config) ResolveRelative(p string) string

ResolveRelative resolves the provided path relative to the configuration location when the path is relative.

type GitLabConfig

type GitLabConfig struct {
	Domain string
	Token  string
}

GitLabConfig holds env-only GitLab access requisites for server-owned Git operations. It is intentionally not YAML-mapped.

type HTTPConfig

type HTTPConfig struct {
	Listen       string        `yaml:"listen"`
	ReadTimeout  time.Duration `yaml:"read_timeout"`
	WriteTimeout time.Duration `yaml:"write_timeout"`
	IdleTimeout  time.Duration `yaml:"idle_timeout"`
}

HTTPConfig configures the HTTP server.

type LoggingConfig

type LoggingConfig struct {
	Level string `yaml:"level"`
}

LoggingConfig configures logging destinations.

type MetricsConfig

type MetricsConfig struct {
	Listen string `yaml:"listen"`
}

MetricsConfig configures the Prometheus metrics endpoint.

type ObjectStoreConfig

type ObjectStoreConfig struct {
	Endpoint  string `yaml:"endpoint"`
	Bucket    string `yaml:"bucket"`
	AccessKey string `yaml:"access_key"`
	SecretKey string `yaml:"secret_key"`
	Secure    bool   `yaml:"secure"`
	Region    string `yaml:"region,omitempty"`
}

ObjectStoreConfig configures S3-compatible object storage (e.g., Garage).

type PKIConfig

type PKIConfig struct {
	BundleDir   string        `yaml:"bundle_dir"`
	Certificate string        `yaml:"certificate"`
	Key         string        `yaml:"key"`
	RenewBefore time.Duration `yaml:"renew_before"`
	CAEndpoint  string        `yaml:"ca_endpoint"`
}

PKIConfig configures PKI renewal.

type PostgresConfig

type PostgresConfig struct {
	DSN string `yaml:"dsn"`
}

PostgresConfig configures PostgreSQL connection.

type SchedulerConfig

type SchedulerConfig struct {
	HousekeepingInterval time.Duration `yaml:"housekeeping_interval"`
	DiskPruneInterval    time.Duration `yaml:"disk_prune_interval"`
	// TTL is the retention period for logs, events, diffs, and artifact bundles.
	// Data older than this will be purged by the TTL worker. Default: 30 days.
	TTL time.Duration `yaml:"ttl"`
	// TTLInterval is how often the TTL worker runs cleanup. Default: 1 hour.
	TTLInterval time.Duration `yaml:"ttl_interval"`
	// DropPartitions enables dropping entire monthly partitions for expired data
	// instead of row-by-row deletion. More efficient for large datasets.
	DropPartitions bool `yaml:"drop_partitions"`
	// WaveSchedulerInterval is how often the wave scheduler checks for queued runs.
	// Set to 0 to disable the wave scheduler. Default: 5 seconds.
	WaveSchedulerInterval time.Duration `yaml:"wave_scheduler_interval"`
	// StaleJobRecoveryInterval is how often stale Running jobs are recovered.
	// Set to 0 to disable stale-job recovery. Default: 30 seconds.
	StaleJobRecoveryInterval time.Duration `yaml:"stale_job_recovery_interval"`
	// NodeStaleAfter is the heartbeat age threshold after which a node is considered stale.
	// Default: 1 minute.
	NodeStaleAfter time.Duration `yaml:"node_stale_after"`
}

SchedulerConfig configures background task scheduling.

Jump to

Keyboard shortcuts

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