diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2020-02-27 21:04:06 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2020-02-27 21:04:28 -0700 |
commit | 03ab55b51afeb99d99f312c866ab3effeb7e180c (patch) | |
tree | b34265ffdd1a60c69c4d8e9a4019ba94e1d09a6e /caddyconfig | |
parent | cef6e098bb278d50cb2f45f57ed40b3af47d6a74 (diff) |
httpcaddyfile: Allow "admin off" option
Diffstat (limited to 'caddyconfig')
-rw-r--r-- | caddyconfig/httpcaddyfile/httptype.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go index cfb3121..8c10a53 100644 --- a/caddyconfig/httpcaddyfile/httptype.go +++ b/caddyconfig/httpcaddyfile/httptype.go @@ -327,7 +327,11 @@ func (st ServerType) Setup(originalServerBlocks []caddyfile.ServerBlock, &warnings) } if adminConfig, ok := options["admin"].(string); ok && adminConfig != "" { - cfg.Admin = &caddy.AdminConfig{Listen: adminConfig} + if adminConfig == "off" { + cfg.Admin = &caddy.AdminConfig{Disabled: true} + } else { + cfg.Admin = &caddy.AdminConfig{Listen: adminConfig} + } } if len(customLogs) > 0 { if cfg.Logging == nil { |