mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
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
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:
parent
cc4b04ede2
commit
33bb588c36
2 changed files with 6 additions and 4 deletions
|
|
@ -130,10 +130,10 @@ type WhitelistConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type IPFilterConfig struct {
|
type IPFilterConfig struct {
|
||||||
Enabled bool `toml:"enabled"`
|
Enabled bool `toml:"enabled"`
|
||||||
EnableAllowList bool `toml:"enableAllowList"`
|
EnableAllowList bool `toml:"enableAllowList"`
|
||||||
EnableBlockList bool `toml:"enableBlockList"`
|
EnableBlockList bool `toml:"enableBlockList"`
|
||||||
IPFilterFile string
|
IPFilterFile string `toml:"ipFilterFile"`
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
2
main.go
2
main.go
|
|
@ -373,6 +373,7 @@ func main() {
|
||||||
ipAllowList, ipBlockList, err := auth.ReadIPFilterList(cfg)
|
ipAllowList, ipBlockList, err := auth.ReadIPFilterList(cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Failed to read IP filter list: %v\n", err)
|
fmt.Printf("Failed to read IP filter list: %v\n", err)
|
||||||
|
logger.Errorf("Failed to read IP filter list: %v", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
ipBlockFilter, err := ipfilter.NewIPFilter(ipfilter.IPFilterConfig{
|
ipBlockFilter, err := ipfilter.NewIPFilter(ipfilter.IPFilterConfig{
|
||||||
|
|
@ -383,6 +384,7 @@ func main() {
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Failed to initialize IP filter: %v\n", err)
|
fmt.Printf("Failed to initialize IP filter: %v\n", err)
|
||||||
|
logger.Errorf("Failed to initialize IP filter: %v", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
} else {
|
} else {
|
||||||
r.Use(ipBlockFilter)
|
r.Use(ipBlockFilter)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue