This commit is contained in:
wjqserver 2025-04-27 16:39:47 +08:00
parent f540b2edcd
commit d94f6c0f5d
7 changed files with 63 additions and 3 deletions

View file

@ -18,6 +18,7 @@ type Config struct {
Whitelist WhitelistConfig
RateLimit RateLimitConfig
Outbound OutboundConfig
Docker DockerConfig
}
/*
@ -143,6 +144,16 @@ type OutboundConfig struct {
Url string `toml:"url"`
}
/*
[docker]
enabled = false
target = "ghcr" # ghcr/dockerhub
*/
type DockerConfig struct {
Enabled bool `toml:"enabled"`
Target string `toml:"target"`
}
// LoadConfig 从 TOML 配置文件加载配置
func LoadConfig(filePath string) (*Config, error) {
if !FileExists(filePath) {
@ -244,5 +255,9 @@ func DefaultConfig() *Config {
Enabled: false,
Url: "socks5://127.0.0.1:1080",
},
Docker: DockerConfig{
Enabled: false,
Target: "ghcr",
},
}
}