4.2.0-rc.0

This commit is contained in:
wjqserver 2025-07-22 16:37:59 +08:00
parent 95dd34a456
commit d2d9ad1db7
12 changed files with 139 additions and 15 deletions

View file

@ -7,18 +7,19 @@ import (
)
type Config struct {
Server ServerConfig
Httpc HttpcConfig
GitClone GitCloneConfig
Shell ShellConfig
Pages PagesConfig
Log LogConfig
Auth AuthConfig
Blacklist BlacklistConfig
Whitelist WhitelistConfig
RateLimit RateLimitConfig
Outbound OutboundConfig
Docker DockerConfig
Server ServerConfig `toml:"server"`
Httpc HttpcConfig `toml:"httpc"`
GitClone GitCloneConfig `toml:"gitclone"`
Shell ShellConfig `toml:"shell"`
Pages PagesConfig `toml:"pages"`
Log LogConfig `toml:"log"`
Auth AuthConfig `toml:"auth"`
Blacklist BlacklistConfig `toml:"blacklist"`
Whitelist WhitelistConfig `toml:"whitelist"`
IPFilter IPFilterConfig `toml:"ipFilter"`
RateLimit RateLimitConfig `toml:"rateLimit"`
Outbound OutboundConfig `toml:"outbound"`
Docker DockerConfig `toml:"docker"`
}
/*
@ -128,6 +129,13 @@ type WhitelistConfig struct {
WhitelistFile string `toml:"whitelistFile"`
}
type IPFilterConfig struct {
Enabled bool `toml:"enabled"`
EnableAllowList bool `toml:"enableAllowList"`
EnableBlockList bool `toml:"enableBlockList"`
IPFilterFile string
}
/*
[rateLimit]
enabled = false
@ -273,6 +281,12 @@ func DefaultConfig() *Config {
Enabled: false,
WhitelistFile: "/data/ghproxy/config/whitelist.json",
},
IPFilter: IPFilterConfig{
Enabled: false,
IPFilterFile: "/data/ghproxy/config/ipfilter.json",
EnableAllowList: false,
EnableBlockList: false,
},
RateLimit: RateLimitConfig{
Enabled: false,
RatePerMinute: 100,