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.
This commit is contained in:
Mechiel Lukkien 2023-08-14 15:01:17 +02:00
parent 48eb530b1f
commit f96310fdd5
No known key found for this signature in database
2 changed files with 5 additions and 3 deletions

View file

@ -512,7 +512,9 @@ are printed.
c.Usage() 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 { if len(errs) > 1 {
log.Printf("multiple errors:") log.Printf("multiple errors:")
for _, err := range errs { for _, err := range errs {

View file

@ -645,8 +645,8 @@ too many authentication failures).
xwritefile("config/domains.conf", []byte(dconfstr), 0660) xwritefile("config/domains.conf", []byte(dconfstr), 0660)
// Verify config. // Verify config.
skipCheckTLSKeyCerts := existingWebserver loadTLSKeyCerts := !existingWebserver
mc, errs := mox.ParseConfig(context.Background(), "config/mox.conf", true, skipCheckTLSKeyCerts, false) mc, errs := mox.ParseConfig(context.Background(), "config/mox.conf", true, loadTLSKeyCerts, false)
if len(errs) > 0 { if len(errs) > 0 {
if len(errs) > 1 { if len(errs) > 1 {
log.Printf("checking generated config, multiple errors:") log.Printf("checking generated config, multiple errors:")