This commit is contained in:
WJQSERVER 2024-10-08 05:28:56 +08:00
parent f5d7d0994e
commit dc8f4a28e9
9 changed files with 112 additions and 13 deletions

View file

@ -31,6 +31,11 @@ type Config struct {
Enabled bool `yaml:"enabled"`
BlacklistFile string `yaml:"blacklistfile"`
} `yaml:"blacklist"`
Whitelist struct {
Enabled bool `yaml:"enabled"`
WhitelistFile string `yaml:"whitelistfile"`
} `yaml:"whitelist"`
}
// LoadConfig 从 YAML 配置文件加载配置

View file

@ -20,5 +20,10 @@ auth:
# Blacklist Configuration
blacklist:
enabled: true
enabled: false
blacklistfile: "/data/ghproxy/config/blacklist.json"
# Whitelist Configuration
whitelist:
enabled: false
whitelistfile: "/data/ghproxy/config/whitelist.json"

8
config/whitelist.json Normal file
View file

@ -0,0 +1,8 @@
{
"whitelist": [
"test/test1",
"example/repo2",
"another/repo3"
]
}