From 03ab55b51afeb99d99f312c866ab3effeb7e180c Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Thu, 27 Feb 2020 21:04:06 -0700 Subject: httpcaddyfile: Allow "admin off" option --- caddyconfig/httpcaddyfile/httptype.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 { -- cgit v1.2.3