fail hard + info

This commit is contained in:
6543 2023-02-11 01:30:54 +01:00
parent 258020749d
commit 603446111a
No known key found for this signature in database
GPG key ID: B8BE6D610E61C862

View file

@ -5,6 +5,7 @@ import (
"crypto/elliptic" "crypto/elliptic"
"crypto/rand" "crypto/rand"
"encoding/json" "encoding/json"
"fmt"
"os" "os"
"github.com/go-acme/lego/v4/certcrypto" "github.com/go-acme/lego/v4/certcrypto"
@ -33,8 +34,8 @@ func setupAcmeConfig(configFile, acmeAPI, acmeMail, acmeEabHmac, acmeEabKID stri
// Validate Config // Validate Config
_, err := lego.NewClient(myAcmeConfig) _, err := lego.NewClient(myAcmeConfig)
if err != nil { if err != nil {
// TODO: should we fail hard instead? log.Info().Err(err).Msg("config validation failed, you might just delete the config file and let it recreate")
log.Error().Err(err).Msg("Can't create ACME client, continuing with mock certs only") return nil, fmt.Errorf("acme config validation failed: %w", err)
} }
return myAcmeConfig, nil return myAcmeConfig, nil
} else if !os.IsNotExist(err) { } else if !os.IsNotExist(err) {