fix typo
Some checks failed
Build Dev / prepare (push) Has been cancelled
Build Dev / build (amd64, darwin) (push) Has been cancelled
Build Dev / build (amd64, freebsd) (push) Has been cancelled
Build Dev / build (amd64, linux) (push) Has been cancelled
Build Dev / build (arm64, darwin) (push) Has been cancelled
Build Dev / build (arm64, freebsd) (push) Has been cancelled
Build Dev / build (arm64, linux) (push) Has been cancelled
Build Dev / docker (push) Has been cancelled

This commit is contained in:
wjqserver 2025-07-22 17:29:38 +08:00
parent cc4b04ede2
commit 33bb588c36
2 changed files with 6 additions and 4 deletions

View file

@ -130,10 +130,10 @@ type WhitelistConfig struct {
}
type IPFilterConfig struct {
Enabled bool `toml:"enabled"`
EnableAllowList bool `toml:"enableAllowList"`
EnableBlockList bool `toml:"enableBlockList"`
IPFilterFile string
Enabled bool `toml:"enabled"`
EnableAllowList bool `toml:"enableAllowList"`
EnableBlockList bool `toml:"enableBlockList"`
IPFilterFile string `toml:"ipFilterFile"`
}
/*

View file

@ -373,6 +373,7 @@ func main() {
ipAllowList, ipBlockList, err := auth.ReadIPFilterList(cfg)
if err != nil {
fmt.Printf("Failed to read IP filter list: %v\n", err)
logger.Errorf("Failed to read IP filter list: %v", err)
os.Exit(1)
}
ipBlockFilter, err := ipfilter.NewIPFilter(ipfilter.IPFilterConfig{
@ -383,6 +384,7 @@ func main() {
})
if err != nil {
fmt.Printf("Failed to initialize IP filter: %v\n", err)
logger.Errorf("Failed to initialize IP filter: %v", err)
os.Exit(1)
} else {
r.Use(ipBlockFilter)