Documentation
¶
Index ¶
Constants ¶
const (
// MaxSnapshots is the number of snapshots to keep
MaxSnapshots = 10
)
Variables ¶
This section is empty.
Functions ¶
func Sync ¶
func Sync(opts *SyncOptions) error
Sync performs atomic firewall reload
Algorithm (single phase) - v0.7.3 unified architecture: 1. Read static config (whitelist, blacklist, ports) 2. Build feed sets (Go pkg/feeds) - loaded into unified blacklist 3. Build geoban sets (Go pkg/geoban) - loaded into unified blacklist 4. Dump runtime sets (temp_whitelist_ipv4/ipv6, blacklist with timeout) 5. Generate rules.new.nft 6. Validate: nft -c -f rules.new.nft 7. Snapshot: nft list ruleset > backup.nft 8. Apply: nft -f rules.new.nft 9. Restore runtime elements (temp_whitelist, blacklist items with timeout)
Types ¶
type RuntimeSets ¶
RuntimeSets holds current Fail2Ban state
type SyncOptions ¶
type SyncOptions struct {
StagingDir string
SnapshotDir string
WhitelistFile string
BlacklistFile string
FeedsDir string
GeobanDir string
TemplateFile string
TCPPorts []int
UDPPorts []int
DryRun bool // If true, validate only (don't apply)
}
SyncOptions configures the atomic reload
func DefaultSyncOptions ¶
func DefaultSyncOptions() *SyncOptions
DefaultSyncOptions returns default sync options