config

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package config provides injectable configuration with environment variable overrides.

Index

Constants

View Source
const (
	DefaultKanbanPortStart = 7100
	DefaultKanbanPortEnd   = 9100
)

Default kanban port range constants.

View Source
const (
	DefaultSnapshotMaxPerService = 10
	DefaultSnapshotMaxAge        = 30 * 24 * time.Hour // 30 days
)

Snapshot retention defaults.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DataDir               string // root data directory (default: /var/lib/ah)
	DBPath                string // state database path (default: {DataDir}/ah.db)
	MeterDBPath           string // metering database path (default: {DataDir}/meter.db)
	MasterKeyPath         string // master encryption key (default: {DataDir}/master.key)
	BuildDir              string // nixpacks build work directory (default: {DataDir}/builds)
	NixpacksPath          string // path to nixpacks binary (default: /usr/local/bin/nixpacks)
	DockerDataDir         string // Docker data root for disk checks (default: /var/lib/docker)
	BaseDomain            string // base domain for public service URLs (default: "" = localhost fallback)
	ExternalTLSTerminated bool   // public TLS terminates before the local proxy (default: false)
	TraefikConfigDir      string // Traefik file provider dynamic config directory (default: /etc/traefik/dynamic)
	KanbanPortStart       int    // inclusive start of kanban port range (default: 7100)
	KanbanPortEnd         int    // inclusive end of kanban port range (default: 9100)

	AdminToken string // AH_ADMIN_TOKEN: operator token for recover/reactivate/quota (comma-separated for rotation; empty = fall back to bootstrap tokens)

	// Snapshot retention
	SnapshotMaxPerService int           // max snapshots kept per service (default: 10, 0 = unlimited)
	SnapshotMaxAge        time.Duration // max age before a snapshot is eligible for cleanup (default: 30d, 0 = unlimited)
}

Config holds all configurable paths and addresses for the ah server.

func Default

func Default() Config

Default returns a Config with all default values.

func FromEnv

func FromEnv() Config

FromEnv returns a Config populated from environment variables, falling back to defaults. Setting AH_DATA_DIR changes all derived paths unless individually overridden.

func (Config) DiskCheckPaths

func (c Config) DiskCheckPaths() []string

DiskCheckPaths returns the paths that should be checked for disk space.

Jump to

Keyboard shortcuts

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