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

config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package config loads and validates the Ripen policy file. Validation is fail-closed: unknown fields, ambiguous rules, and unsafe values are config-load errors, never warnings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComposeSettings

type ComposeSettings struct {
	Docker EngineSettings
	Podman EngineSettings
}

ComposeSettings holds the two compose engine configurations.

type EngineSettings

type EngineSettings struct {
	Binary string
	Socket string
}

EngineSettings configures one compose engine.

type GitHubPolicy

type GitHubPolicy struct {
	Repository string
	BaseBranch string
	TokenFile  string
}

GitHubPolicy configures Git-native update Proposals.

type HealthPolicy

type HealthPolicy struct {
	Type           string
	Target         string
	AcceptedStatus []int
	TimeoutSeconds float64
}

HealthPolicy is one HTTP functional health check.

type NotifierSettings

type NotifierSettings struct {
	Webhook *WebhookSettings
	// HeartbeatIntervalSeconds, when set, makes the Notifier deliver
	// even a suppressed run.finished if nothing has been delivered for
	// that long, so silence stays distinguishable from failure.
	HeartbeatIntervalSeconds int
}

NotifierSettings holds the one outbound Notifier and its heartbeat.

type Policy

type Policy struct {
	Mode                       domain.Mode
	MaxUpdatesPerRun           int
	VerificationTimeoutSeconds int
	CandidateMinAgeSeconds     int
	LeaseTTLSeconds            int
	CheckIntervalSeconds       int
	ObservationConcurrency     int
	StateFile                  string
	Portainer                  *PortainerSettings
	Compose                    ComposeSettings
	Stacks                     []StackPolicy
	ExcludedStacks             []string
	GitHub                     *GitHubPolicy
	Notifier                   *NotifierSettings
	UI                         *UISettings
}

Policy is the loaded, validated configuration.

func Load

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

Load reads and validates a policy file.

type PortainerSettings

type PortainerSettings struct {
	BaseURL              string
	APIKeyFile           string
	ExpectedUsername     string
	TLSCAFile            string
	TLSFingerprintSHA256 string
}

PortainerSettings configures the Portainer backend connection.

type ServicePolicy

type ServicePolicy struct {
	Name      string
	AutoApply bool
	Health    HealthPolicy
	Enabled   bool
}

ServicePolicy is a per-service rule inside a multi-service stack.

type StackPolicy

type StackPolicy struct {
	Name             string
	Backend          domain.Backend
	Enabled          bool
	AutoApply        bool
	ExpectedServices []string
	Health           *HealthPolicy
	Services         []ServicePolicy
	GitPath          string
	// File and Project apply to compose backends only. File is the
	// symlink-resolved compose file path; Project defaults to Name.
	File    string
	Project string
}

StackPolicy is the policy for one stack.

type UISettings

type UISettings struct {
	Enabled bool
	Address string
	// TokenFile holds the bearer token for a non-loopback bind. Ripen
	// keeps every secret in a file, never in the policy document, and
	// RIPEN_UI_TOKEN is the other way to supply it.
	TokenFile string
}

UISettings configures the optional read-only Web UI. It is off unless enabled is true — there is no way to switch it on by accident.

type WebhookSettings

type WebhookSettings struct {
	URLFile        string
	TokenFile      string
	Events         []event.Name
	TimeoutSeconds int
}

WebhookSettings configures the outbound webhook Notifier. Absent means silent-but-logging: the Event stream still records everything.

Jump to

Keyboard shortcuts

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