This commit is contained in:
wjqserver 2025-03-10 18:53:12 +08:00
parent d26f6d1e1b
commit a18660121a
18 changed files with 638 additions and 118 deletions

View file

@ -7,9 +7,9 @@ import (
type Config struct {
Server ServerConfig
Httpc HttpcConfig
GitClone GitCloneConfig
Pages PagesConfig
Log LogConfig
CORS CORSConfig
Auth AuthConfig
Blacklist BlacklistConfig
Whitelist WhitelistConfig
@ -31,6 +31,7 @@ type ServerConfig struct {
Host string `toml:"host"`
SizeLimit int `toml:"sizeLimit"`
H2C bool `toml:"H2C"`
Cors string `toml:"cors"`
EnableH2C string `toml:"enableH2C"`
Debug bool `toml:"debug"`
}
@ -49,6 +50,16 @@ type HttpcConfig struct {
MaxConnsPerHost int `toml:"maxConnsPerHost"`
}
/*
[gitclone]
mode = "bypass" # bypass / cache
dir = "./repos"
*/
type GitCloneConfig struct {
Mode string `toml:"mode"`
Dir string `toml:"dir"`
}
/*
[pages]
mode = "internal" # "internal" or "external"
@ -69,10 +80,6 @@ type LogConfig struct {
Level string `toml:"level"`
}
type CORSConfig struct {
Enabled bool `toml:"enabled"`
}
type AuthConfig struct {
Enabled bool `toml:"enabled"`
AuthMethod string `toml:"authMethod"`