You've already forked caddy-opnsense-blocker
Add background IP intel and restore dashboard stats
This commit is contained in:
@@ -56,11 +56,15 @@ type StorageConfig struct {
|
||||
}
|
||||
|
||||
type InvestigationConfig struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
RefreshAfter Duration `yaml:"refresh_after"`
|
||||
Timeout Duration `yaml:"timeout"`
|
||||
UserAgent string `yaml:"user_agent"`
|
||||
SpamhausEnabled bool `yaml:"spamhaus_enabled"`
|
||||
Enabled bool `yaml:"enabled"`
|
||||
RefreshAfter Duration `yaml:"refresh_after"`
|
||||
Timeout Duration `yaml:"timeout"`
|
||||
UserAgent string `yaml:"user_agent"`
|
||||
SpamhausEnabled bool `yaml:"spamhaus_enabled"`
|
||||
BackgroundWorkers int `yaml:"background_workers"`
|
||||
BackgroundPollInterval Duration `yaml:"background_poll_interval"`
|
||||
BackgroundLookback Duration `yaml:"background_lookback"`
|
||||
BackgroundBatchSize int `yaml:"background_batch_size"`
|
||||
}
|
||||
|
||||
type OPNsenseConfig struct {
|
||||
@@ -181,6 +185,18 @@ func (c *Config) applyDefaults() error {
|
||||
if !c.Investigation.SpamhausEnabled {
|
||||
c.Investigation.SpamhausEnabled = true
|
||||
}
|
||||
if c.Investigation.BackgroundWorkers == 0 {
|
||||
c.Investigation.BackgroundWorkers = 2
|
||||
}
|
||||
if c.Investigation.BackgroundPollInterval.Duration == 0 {
|
||||
c.Investigation.BackgroundPollInterval.Duration = 30 * time.Second
|
||||
}
|
||||
if c.Investigation.BackgroundLookback.Duration == 0 {
|
||||
c.Investigation.BackgroundLookback.Duration = 24 * time.Hour
|
||||
}
|
||||
if c.Investigation.BackgroundBatchSize == 0 {
|
||||
c.Investigation.BackgroundBatchSize = 256
|
||||
}
|
||||
|
||||
if c.OPNsense.Timeout.Duration == 0 {
|
||||
c.OPNsense.Timeout.Duration = 8 * time.Second
|
||||
|
||||
Reference in New Issue
Block a user