Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SaveConfig ¶
SaveConfig saves configuration to a TOML file
Types ¶
type BackendConfig ¶
type BackendConfig struct {
Type string `toml:"type"`
}
BackendConfig contains backend storage configuration
type Config ¶
type Config struct {
Server ServerConfig `toml:"server"`
Plugins PluginsConfig `toml:"plugins"`
RateLimit RateLimitConfig `toml:"rateLimit"`
Logging LoggingConfig `toml:"logging"`
}
Config represents the main application configuration
func LoadConfig ¶
LoadConfig loads configuration from a TOML file
type HeadersConfig ¶
type HeadersConfig struct {
Enabled bool `toml:"enabled"`
TorHeader string `toml:"torHeader"`
BanHeader string `toml:"banHeader"`
}
HeadersConfig contains HTTP headers configuration
type LoggingConfig ¶
LoggingConfig contains logging configuration
type PluginsConfig ¶
type PluginsConfig struct {
Enabled bool `toml:"enabled"`
Directory string `toml:"directory"`
Config map[string]map[string]any `toml:"config"`
}
PluginsConfig contains plugin system configuration
type RateLimitConfig ¶
type RateLimitConfig struct {
Enabled bool `toml:"enabled"`
MaxConcurrentConnections int `toml:"maxConcurrentConnections"`
ConnectionRate int `toml:"connectionRate"`
HTTPRequestRate int `toml:"httpRequestRate"`
HTTPErrorRate int `toml:"httpErrorRate"`
CrawlerBlockDuration time.Duration `toml:"crawlerBlockDuration"`
Backend BackendConfig `toml:"backend"`
Tor TorConfig `toml:"tor"`
Headers HeadersConfig `toml:"headers"`
Whitelist WhitelistConfig `toml:"whitelist"`
}
RateLimitConfig contains rate limiting configuration
type ServerConfig ¶
ServerConfig contains server-specific configuration
type TorConfig ¶
type TorConfig struct {
Enabled bool `toml:"enabled"`
MaxRequestsPerConnection int `toml:"maxRequestsPerConnection"`
MaxConcurrentConnections int `toml:"maxConcurrentConnections"`
ConnectionRate int `toml:"connectionRate"`
ConnectionRateWindow time.Duration `toml:"connectionRateWindow"`
BanDuration time.Duration `toml:"banDuration"`
RepeatOffenderBanDuration time.Duration `toml:"repeatOffenderBanDuration"`
ExitNodeListURL string `toml:"exitNodeListURL"`
UpdateInterval time.Duration `toml:"updateInterval"`
CacheFilePath string `toml:"cacheFilePath"`
GlobalRateLimit bool `toml:"globalRateLimit"`
GlobalRequestRate int `toml:"globalRequestRate"`
GlobalRateWindow time.Duration `toml:"globalRateWindow"`
GlobalBanDuration time.Duration `toml:"globalBanDuration"`
}
TorConfig contains Tor-specific rate limiting configuration
type WhitelistConfig ¶
type WhitelistConfig struct {
IPs []string `toml:"ips"`
}
WhitelistConfig contains IP whitelist configuration
Click to show internal directories.
Click to hide internal directories.