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

config

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConfigPath added in v0.1.5

func FindConfigPath(providedPath string) string

func Save added in v0.1.5

func Save(cfg *Config, path string) error

Types

type APIConfig

type APIConfig struct {
	Host           string   `yaml:"host"`
	Port           int      `yaml:"port"`
	EnableCORS     bool     `yaml:"enable_cors"`
	AllowedOrigins []string `yaml:"allowed_origins"`
}

type AuditConfig added in v0.1.5

type AuditConfig struct {
	Enabled            bool          `yaml:"enabled" json:"enabled"`
	RetentionDays      int           `yaml:"retention_days" json:"retention_days"`
	CaptureRequestBody bool          `yaml:"capture_request_body" json:"capture_request_body"`
	ExcludedPaths      []string      `yaml:"excluded_paths" json:"excluded_paths"`
	SensitiveFields    []string      `yaml:"sensitive_fields" json:"sensitive_fields"`
	CleanupInterval    time.Duration `yaml:"cleanup_interval" json:"cleanup_interval"`
}

type AuthConfig

type AuthConfig struct {
	Enabled   bool     `yaml:"enabled"`
	APIKeys   []string `yaml:"api_keys"`
	JWTSecret string   `yaml:"jwt_secret"`
}

type CertbotConfig

type CertbotConfig struct {
	Enabled              bool   `yaml:"enabled" json:"enabled"`
	Image                string `yaml:"image" json:"image"`
	Email                string `yaml:"email" json:"email"`
	Staging              bool   `yaml:"staging" json:"staging"`
	CertsPath            string `yaml:"certs_path" json:"certs_path"`
	WebrootPath          string `yaml:"webroot_path" json:"webroot_path"`
	ContainerWebrootPath string `yaml:"container_webroot_path" json:"container_webroot_path"`
	DNSProvider          string `yaml:"dns_provider" json:"dns_provider"`
}

type ClusterConfig added in v0.1.5

type ClusterConfig struct {
	Enabled        bool   `yaml:"enabled"`
	ServerName     string `yaml:"server_name"`
	AdvertiseURL   string `yaml:"advertise_url"`
	HealthInterval string `yaml:"health_interval"`
	RequestTimeout string `yaml:"request_timeout"`
}

type Config

type Config struct {
	DeploymentsPath string               `yaml:"deployments_path"`
	DockerSocket    string               `yaml:"docker_socket"`
	API             APIConfig            `yaml:"api"`
	Auth            AuthConfig           `yaml:"auth"`
	Domain          DomainConfig         `yaml:"domain"`
	Nginx           NginxConfig          `yaml:"nginx"`
	Certbot         CertbotConfig        `yaml:"certbot"`
	Logging         LoggingConfig        `yaml:"logging"`
	Health          HealthConfig         `yaml:"health"`
	Infrastructure  InfrastructureConfig `yaml:"infrastructure"`
	Security        SecurityConfig       `yaml:"security"`
	Audit           AuditConfig          `yaml:"audit"`
	Cluster         ClusterConfig        `yaml:"cluster"`
}

func Load

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

type DomainConfig

type DomainConfig struct {
	DefaultDomain  string `yaml:"default_domain"`
	AutoSubdomain  bool   `yaml:"auto_subdomain"`
	AutoSSL        bool   `yaml:"auto_ssl"`
	SubdomainStyle string `yaml:"subdomain_style"`
}

type HealthConfig

type HealthConfig struct {
	CheckInterval    time.Duration `yaml:"check_interval"`
	MetricsRetention time.Duration `yaml:"metrics_retention"`
}

type InfrastructureConfig added in v0.1.3

type InfrastructureConfig struct {
	DefaultProxyNetwork    string               `yaml:"default_proxy_network" json:"default_proxy_network"`
	DefaultDatabaseNetwork string               `yaml:"default_database_network" json:"default_database_network"`
	Database               SharedDatabaseConfig `yaml:"database" json:"database"`
	Redis                  SharedRedisConfig    `yaml:"redis" json:"redis"`
	PowerDNS               PowerDNSConfig       `yaml:"powerdns" json:"powerdns"`
}

type LoggingConfig

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

type NginxConfig

type NginxConfig struct {
	Enabled              bool   `yaml:"enabled" json:"enabled"`
	Image                string `yaml:"image" json:"image"`
	ContainerName        string `yaml:"container_name" json:"container_name"`
	ConfigPath           string `yaml:"config_path" json:"config_path"`
	ReloadCommand        string `yaml:"reload_command" json:"reload_command"`
	External             bool   `yaml:"external" json:"external"`
	ContainerWebrootPath string `yaml:"container_webroot_path" json:"container_webroot_path"`
	RejectUnknownDomains bool   `yaml:"reject_unknown_domains" json:"reject_unknown_domains"`
}

type PowerDNSConfig added in v0.1.5

type PowerDNSConfig struct {
	Enabled     bool   `yaml:"enabled" json:"enabled"`
	Container   string `yaml:"container" json:"container"`
	Image       string `yaml:"image" json:"image"`
	APIPort     int    `yaml:"api_port" json:"api_port"`
	DNSPort     int    `yaml:"dns_port" json:"dns_port"`
	APIKey      string `yaml:"api_key" json:"api_key"`
	DataPath    string `yaml:"data_path" json:"data_path"`
	DefaultSOA  string `yaml:"default_soa" json:"default_soa"`
	Nameservers string `yaml:"nameservers" json:"nameservers"`
}

type SecurityConfig added in v0.1.5

type SecurityConfig struct {
	Enabled            bool          `yaml:"enabled" json:"enabled"`
	RealtimeCapture    bool          `yaml:"realtime_capture" json:"realtime_capture"`
	ScanInterval       time.Duration `yaml:"scan_interval" json:"scan_interval"`
	RetentionDays      int           `yaml:"retention_days" json:"retention_days"`
	RateThreshold      int           `yaml:"rate_threshold" json:"rate_threshold"`
	AutoBlockEnabled   bool          `yaml:"auto_block_enabled" json:"auto_block_enabled"`
	AutoBlockThreshold int           `yaml:"auto_block_threshold" json:"auto_block_threshold"`
	AutoBlockDuration  time.Duration `yaml:"auto_block_duration" json:"auto_block_duration"`

	// Detection thresholds for autoblock
	DetectionWindow       time.Duration `yaml:"detection_window" json:"detection_window"`
	NotFoundThreshold     int           `yaml:"not_found_threshold" json:"not_found_threshold"`
	AuthFailureThreshold  int           `yaml:"auth_failure_threshold" json:"auth_failure_threshold"`
	UniquePathsThreshold  int           `yaml:"unique_paths_threshold" json:"unique_paths_threshold"`
	RepeatedHitsThreshold int           `yaml:"repeated_hits_threshold" json:"repeated_hits_threshold"`

	// Internal API token for nginx-to-agent communication (auto-generated if empty)
	InternalAPIToken string `yaml:"internal_api_token" json:"-"`
}

type ServiceExecConfig added in v0.1.5

type ServiceExecConfig struct {
	Image        string   `yaml:"image" json:"image"`
	Container    string   `yaml:"container" json:"container"`
	KeepAlive    bool     `yaml:"keep_alive" json:"keep_alive"`
	RunOnRequest bool     `yaml:"run_on_request" json:"run_on_request"`
	Volumes      []string `yaml:"volumes" json:"volumes"`
	Networks     []string `yaml:"networks" json:"networks"`
}

func (*ServiceExecConfig) ShouldUseDockerRun added in v0.1.5

func (c *ServiceExecConfig) ShouldUseDockerRun() bool

type SharedDatabaseConfig added in v0.1.3

type SharedDatabaseConfig struct {
	Enabled      bool   `yaml:"enabled" json:"enabled"`
	Type         string `yaml:"type" json:"type"`
	Container    string `yaml:"container" json:"container"`
	Host         string `yaml:"host" json:"host"`
	Port         int    `yaml:"port" json:"port"`
	RootUser     string `yaml:"root_user" json:"root_user"`
	RootPassword string `yaml:"root_password" json:"root_password"`
}

type SharedRedisConfig added in v0.1.3

type SharedRedisConfig struct {
	Enabled   bool   `yaml:"enabled" json:"enabled"`
	Container string `yaml:"container" json:"container"`
	Host      string `yaml:"host" json:"host"`
	Port      int    `yaml:"port" json:"port"`
	Password  string `yaml:"password" json:"password"`
}

Jump to

Keyboard shortcuts

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