[BREAKING] added entrypoint middleware support and config, config schema update

This commit is contained in:
yusing
2024-11-30 08:02:03 +08:00
parent 3af3a88f66
commit 1c1ba1b55e
9 changed files with 274 additions and 74 deletions

View File

@@ -2,19 +2,22 @@ package types
type (
Config struct {
Providers Providers `json:"providers" yaml:",flow"`
AutoCert AutoCertConfig `json:"autocert" yaml:",flow"`
ExplicitOnly bool `json:"explicit_only" yaml:"explicit_only"`
Entrypoint Entrypoint `json:"entrypoint" yaml:",flow"`
Providers Providers `json:"providers" yaml:",flow"`
MatchDomains []string `json:"match_domains" yaml:"match_domains"`
Homepage HomepageConfig `json:"homepage" yaml:"homepage"`
TimeoutShutdown int `json:"timeout_shutdown" yaml:"timeout_shutdown"`
RedirectToHTTPS bool `json:"redirect_to_https" yaml:"redirect_to_https"`
}
Providers struct {
Files []string `json:"include" yaml:"include"`
Docker map[string]string `json:"docker" yaml:"docker"`
Notification []NotificationConfig `json:"notification" yaml:"notification"`
}
Entrypoint struct {
RedirectToHTTPS bool `json:"redirect_to_https" yaml:"redirect_to_https"`
Middlewares []map[string]any
}
NotificationConfig map[string]any
)
@@ -24,6 +27,8 @@ func DefaultConfig() *Config {
Homepage: HomepageConfig{
UseDefaultCategories: true,
},
RedirectToHTTPS: false,
Entrypoint: Entrypoint{
RedirectToHTTPS: false,
},
}
}