mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-25 09:40:13 +08:00
httpcaddyfile: Allow "admin off" option
This commit is contained in:
parent
cef6e098bb
commit
03ab55b51a
|
@ -327,8 +327,12 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock,
|
||||||
&warnings)
|
&warnings)
|
||||||
}
|
}
|
||||||
if adminConfig, ok := options["admin"].(string); ok && adminConfig != "" {
|
if adminConfig, ok := options["admin"].(string); ok && adminConfig != "" {
|
||||||
|
if adminConfig == "off" {
|
||||||
|
cfg.Admin = &caddy.AdminConfig{Disabled: true}
|
||||||
|
} else {
|
||||||
cfg.Admin = &caddy.AdminConfig{Listen: adminConfig}
|
cfg.Admin = &caddy.AdminConfig{Listen: adminConfig}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if len(customLogs) > 0 {
|
if len(customLogs) > 0 {
|
||||||
if cfg.Logging == nil {
|
if cfg.Logging == nil {
|
||||||
cfg.Logging = &caddy.Logging{
|
cfg.Logging = &caddy.Logging{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user