Documentation ¶
Index ¶
- Constants
- type AdminAPIConfig
- type Config
- func (s *Config) CleanAdminPassword()
- func (s *Config) ConfigDir() string
- func (s *Config) Flush() error
- func (s *Config) GetNetworkAccessPolicy() NetworkAccessPolicy
- func (s *Config) GetPublicAPIConfig() *PublicAPIConfig
- func (s *Config) GetSentEventInterval() human.Interval
- func (s *Config) GetUpdateStatisticsInterval() human.Interval
- func (s *Config) InitialSetupRequired() bool
- func (s *Config) PublicURL() string
- func (s *Config) SetAdminPassword(plain string) error
- func (s *Config) SetPublicIP(newIP xnet.IP) error
- func (s *Config) VerifyAdminPassword(given string) error
- type HttpConfig
- type NetworkAccessPolicy
- type PeerStatisticConfig
- type PublicAPIConfig
Constants ¶
View Source
const ( DefaultUpdateStatisticsInterval = "1m" DefaultTrafficChangeSendEventInterval = "5m" DefaultMaxUpstreamTrafficChange = "50Mb" DefaultMaxDownstreamTrafficChange = "50Mb" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdminAPIConfig ¶
type Config ¶
type Config struct { InstanceID string `yaml:"instance_id"` LogLevel string `yaml:"log_level"` SQLitePath string `yaml:"sqlite_path" valid:"path,required"` Rapidoc bool `yaml:"rapidoc"` Wireguard wireguard.Config `yaml:"wireguard"` HTTP HttpConfig `yaml:"http"` // optional configuration Proxy *proxy.Config `yaml:"proxy,omitempty"` ExternalStats *extstat.Config `yaml:"external_stats,omitempty"` NetworkPolicy *NetworkAccessPolicy `yaml:"network,omitempty"` SSL *xhttp.SSLConfig `yaml:"ssl,omitempty"` Domain *xhttp.DomainConfig `yaml:"domain,omitempty"` AdminAPI *AdminAPIConfig `yaml:"admin_api,omitempty"` PublicAPI *PublicAPIConfig `yaml:"public_api,omitempty"` GRPC *grpc.Config `yaml:"grpc,omitempty"` Sentry *sentry.Config `yaml:"sentry,omitempty"` EventLog *eventlog.StorageConfig `yaml:"event_log,omitempty"` ManagementKeystore string `yaml:"management_keystore,omitempty" valid:"path"` DNSFilter *xdns.Config `yaml:"dns_filter"` PortRestrictions *ipam.PortRestrictionConfig `yaml:"ports,omitempty"` PeerStatistics *PeerStatisticConfig `yaml:"peer_statistics,omitempty"` GeoDBPath string `yaml:"geo_db_path,omitempty"` IPRose iprose.Config `yaml:"iprose,omitempty"` // contains filtered or unexported fields }
func LoadStatic ¶
func (*Config) CleanAdminPassword ¶
func (s *Config) CleanAdminPassword()
func (*Config) GetNetworkAccessPolicy ¶ added in v0.2.5
func (s *Config) GetNetworkAccessPolicy() NetworkAccessPolicy
func (*Config) GetPublicAPIConfig ¶
func (s *Config) GetPublicAPIConfig() *PublicAPIConfig
func (*Config) GetSentEventInterval ¶ added in v0.3.5
func (*Config) GetUpdateStatisticsInterval ¶ added in v0.3.5
func (*Config) InitialSetupRequired ¶
func (*Config) PublicURL ¶
PublicURL returns a URL of this node. Use SSL configuration if given, otherwise it returns http://wireguard_ip:http_listen_port
func (*Config) SetAdminPassword ¶
func (*Config) VerifyAdminPassword ¶
type HttpConfig ¶
type HttpConfig struct { // ListenAddr for HTTP server, default: ":80" ListenAddr string `yaml:"listen_addr" valid:"listen_addr,required"` // CORS enables corresponding middleware for the local development CORS bool `yaml:"cors"` // Enable prometheus metrics on "/metrics" path Prometheus bool `yaml:"prometheus"` }
type NetworkAccessPolicy ¶ added in v0.2.5
type NetworkAccessPolicy struct { Access ipam.NetworkAccess `yaml:"access"` RateLimit *ipam.RateLimiterConfig `yaml:"rate_limit,omitempty"` }
type PeerStatisticConfig ¶ added in v0.3.5
type PeerStatisticConfig struct { // Interval to update tunnel (all peers) statistics // Min valid value = 1m UpdateStatisticsInterval human.Interval `yaml:"update_statistics_interval" valid:"interval"` // Min interval to sent updated peers with new traffic counters // Interval must be defined in duration format. // Valid time units: "ns", "us", "ms", "s", "m", "h". // https://pkg.go.dev/time#ParseDuration // or // be defined as integer in seconds // Note: it must be >= UpdateStatisticsInterval // = UpdateStatisticsInterval if < UpdateStatisticsInterval TrafficChangeSendEventInterval human.Interval `yaml:"traffic_change_send_event_interval" valid:"interval"` // Min pace to sent updated peers with new traffic counters // Interval must be defined in duration format. // Valid size units in human readable format "b", "kb", "mb", "gb" // https://pkg.go.dev/time#ParseDuration // or // be defined as integer in bytes // "" or 0 means it's disabled MaxUpstreamTrafficChange human.Size `yaml:"max_upstream_traffic_change" valid:"size"` MaxDownstreamTrafficChange human.Size `yaml:"max_downstream_traffic_change" valid:"size"` }
type PublicAPIConfig ¶
Click to show internal directories.
Click to hide internal directories.