From f96310fdd557654f0f40162db145d45289cb0020 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Mon, 14 Aug 2023 15:01:17 +0200 Subject: [PATCH] fix checking for tls certificates, and the quickstart with the -existing-webserver flag some time ago, the flag to ParseConfig() to do or skip checking the tls keys/certs was inverted, but it looks like i didn't change the call sites... so during "mox config test", and after a regular "mox quickstart" there was no check for the tls keys/certs, and during "mox quickstart -existing-webserver" there was a check where there shouldn't be. this made using -existing-webserver impossible. this became clear with the question by morki in issue #5. --- main.go | 4 +++- quickstart.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 55f1b6c..9cf7acf 100644 --- a/main.go +++ b/main.go @@ -512,7 +512,9 @@ are printed. c.Usage() } - _, errs := mox.ParseConfig(context.Background(), mox.ConfigStaticPath, true, false, false) + mox.FilesImmediate = true + + _, errs := mox.ParseConfig(context.Background(), mox.ConfigStaticPath, true, true, false) if len(errs) > 1 { log.Printf("multiple errors:") for _, err := range errs { diff --git a/quickstart.go b/quickstart.go index 49f2e6a..fa9f2f8 100644 --- a/quickstart.go +++ b/quickstart.go @@ -645,8 +645,8 @@ too many authentication failures). xwritefile("config/domains.conf", []byte(dconfstr), 0660) // Verify config. - skipCheckTLSKeyCerts := existingWebserver - mc, errs := mox.ParseConfig(context.Background(), "config/mox.conf", true, skipCheckTLSKeyCerts, false) + loadTLSKeyCerts := !existingWebserver + mc, errs := mox.ParseConfig(context.Background(), "config/mox.conf", true, loadTLSKeyCerts, false) if len(errs) > 0 { if len(errs) > 1 { log.Printf("checking generated config, multiple errors:")