config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package config loads and validates Litebox runtime configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Environment string
	// AllowUnconfigured permits the first-run wizard to start without provider
	// credentials. It is set only by Load; hand-built production configs remain
	// strict and must include provider credentials.
	AllowUnconfigured bool
	// Domain is the public hostname used to bootstrap the installation. It is
	// intentionally kept as deployment configuration so the first-run link and
	// reverse proxy can agree before SQLite settings exist.
	Domain                     string
	BaseURL                    *url.URL
	ListenAddr                 string
	DataDir                    string
	DBPath                     string
	MasterKeyPath              string
	CookieName                 string
	SessionTTL                 time.Duration
	LogLevel                   string
	PrimaryAddress             string
	DisplayName                string
	AllowedRecipients          map[string]struct{}
	ResendAPIKey               string
	ResendWebhookSecret        string
	ResendDomainID             string
	StorageBackend             string
	StorageRoot                string
	StorageTempRoot            string
	MaxWebhookBodyBytes        int64
	MaxMessageTextBytes        int64
	MaxUploadRequestBytes      int64
	MaxOutboundAttachmentBytes int64
	MaxAttachmentCount         int
	WorkerCount                int
	JobPollInterval            time.Duration
	JobLease                   time.Duration
	TrustedProxyCIDRs          []string
}

Config contains all runtime configuration. Packages outside config do not read environment variables directly, which keeps validation and tests deterministic.

func Load

func Load() (Config, error)

Load reads configuration from environment variables and applies safe local defaults.

func (Config) ApplySettings added in v0.3.1

func (c Config) ApplySettings(value settings.Values) (Config, error)

ApplySettings overlays the persisted installation snapshot on bootstrap configuration. Paths, listener, storage topology, and proxy trust remain bootstrap-controlled; product settings are database-backed.

func (Config) SecureCookies

func (c Config) SecureCookies() bool

SecureCookies reports whether session cookies must carry the Secure attribute.

func (Config) Validate

func (c Config) Validate() error

Validate reports all configuration errors that can be detected before startup.

Jump to

Keyboard shortcuts

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