config

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig added in v1.9.0

func ValidateConfig(configPath string) error

ValidateConfig validates the config file and returns an error if the config is invalid.

Types

type BufferSizes added in v1.8.0

type BufferSizes struct {
	Websocket        int `mapstructure:"websocket"`
	CTLog            int `mapstructure:"ctlog"`
	BroadcastManager int `mapstructure:"broadcastmanager"`
}

type Config

type Config struct {
	Webserver struct {
		ServerConfig       `mapstructure:",squash"`
		FullURL            string `mapstructure:"full_url"`
		LiteURL            string `mapstructure:"lite_url"`
		DomainsOnlyURL     string `mapstructure:"domains_only_url"`
		CompressionEnabled bool   `mapstructure:"compression_enabled"`
	}
	Prometheus struct {
		ServerConfig        `mapstructure:",squash"`
		Enabled             bool   `mapstructure:"enabled"`
		MetricsURL          string `mapstructure:"metrics_url"`
		ExposeSystemMetrics bool   `mapstructure:"expose_system_metrics"`
	}
	General struct {
		// DisableDefaultLogs indicates whether the default logs used in Google Chrome and provided by Google should be disabled.
		DisableDefaultLogs bool `mapstructure:"disable_default_logs"`
		// AdditionalLogs contains additional logs provided by the user that can be used in addition to the default logs.
		AdditionalLogs      []LogConfig `mapstructure:"additional_logs"`
		AdditionalTiledLogs []LogConfig `mapstructure:"additional_tiled_logs"`
		BufferSizes         BufferSizes `mapstructure:"buffer_sizes"`
		DropOldLogs         *bool       `mapstructure:"drop_old_logs"`
		Recovery            struct {
			Enabled     bool   `mapstructure:"enabled"`
			CTIndexFile string `mapstructure:"ct_index_file"`
		} `mapstructure:"recovery"`
	}
}
var (
	AppConfig Config

	Version = "1.9.0"
)

func ReadConfig

func ReadConfig(configPath string) (Config, error)

ReadConfig reads the configuration using Viper and returns a filled Config struct. It also validates and stores the result in AppConfig.

type LogConfig added in v1.8.0

type LogConfig struct {
	Operator    string `mapstructure:"operator"`
	URL         string `mapstructure:"url"`
	Description string `mapstructure:"description"`
}

type ServerConfig added in v1.4.0

type ServerConfig struct {
	ListenAddr  string   `mapstructure:"listen_addr"`
	ListenPort  int      `mapstructure:"listen_port"`
	CertPath    string   `mapstructure:"cert_path"`
	CertKeyPath string   `mapstructure:"cert_key_path"`
	RealIP      bool     `mapstructure:"real_ip"`
	Whitelist   []string `mapstructure:"whitelist"`
}

Jump to

Keyboard shortcuts

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