config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server struct {
		Host string `yaml:"host"`
		Port int    `yaml:"port"`
		// TrustedProxies lists IPs/CIDRs whose X-Forwarded-For / X-Forwarded-Proto headers are honored.
		TrustedProxies []string `yaml:"trusted-proxies"`
	} `yaml:"server"`
	DataDir string `yaml:"data-dir"`
	Auth    struct {
		LoginRateLimit struct {
			Attempts int           `yaml:"attempts"`
			Window   time.Duration `yaml:"window"`
		} `yaml:"login-rate-limit"`
	} `yaml:"auth"`
	// ProxyURL routes all upstream provider traffic through an HTTP(S) or SOCKS5 proxy.
	ProxyURL string `yaml:"proxy-url"`
	// contains filtered or unexported fields
}

Config holds bootstrap settings only. Users, keys, provider accounts and runtime settings live in the database and are managed from the dashboard.

func Default

func Default() *Config

func ForTesting

func ForTesting(trusted []string) (*Config, error)

ForTesting returns defaults with the given trusted proxies parsed.

func Load

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

Load reads path if it exists; a missing file yields defaults.

func (*Config) Addr

func (c *Config) Addr() string

func (*Config) IsTrustedProxy

func (c *Config) IsTrustedProxy(addr netip.Addr) bool

Jump to

Keyboard shortcuts

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