diff options
author | pistasjis <57069715+pistasjis@users.noreply.github.com> | 2023-08-09 19:40:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-09 17:40:37 +0000 |
commit | d8135505d38ca872d507418d2017f4dbf352f06a (patch) | |
tree | db986eab0220bdd5690677e7cae3816a19657ac3 /cmd/main.go | |
parent | 11166889c5231213c9df7d202a811d1748036129 (diff) |
cmd: Require config for caddy validate (fix #5612) (#5614)
* Require config for caddy validate - fixes #5612
Signed-off-by: Pistasj <hi@pistasjis.net>
* Try making adjacent Caddyfile check its own function
Signed-off-by: Pistasj <hi@pistasjis.net>
* add Francis' suggestion
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
* Refactor
* Fix borked commit, sigh
---------
Signed-off-by: Pistasj <hi@pistasjis.net>
Co-authored-by: Francis Lavoie <lavofr@gmail.com>
Co-authored-by: Matthew Holt <mholt@users.noreply.github.com>
Diffstat (limited to 'cmd/main.go')
-rw-r--r-- | cmd/main.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/main.go b/cmd/main.go index bfbd0bb..53b8d67 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -117,9 +117,8 @@ func loadConfigWithLogger(logger *zap.Logger, configFile, adapterName string) ([ zap.String("config_adapter", adapterName)) } } else if adapterName == "" { - // as a special case when no config file or adapter - // is specified, see if the Caddyfile adapter is - // plugged in, and if so, try using a default Caddyfile + // if the Caddyfile adapter is plugged in, we can try using an + // adjacent Caddyfile by default cfgAdapter = caddyconfig.GetAdapter("caddyfile") if cfgAdapter != nil { config, err = os.ReadFile("Caddyfile") |