mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2024-11-18 10:29:43 +00:00
fix argument check and some nits
This commit is contained in:
parent
196482da07
commit
aa0638903a
2 changed files with 6 additions and 3 deletions
|
@ -49,7 +49,7 @@ func Serve(ctx *cli.Context) error {
|
||||||
acmeEabKID := ctx.String("acme-eab-kid")
|
acmeEabKID := ctx.String("acme-eab-kid")
|
||||||
acmeEabHmac := ctx.String("acme-eab-hmac")
|
acmeEabHmac := ctx.String("acme-eab-hmac")
|
||||||
dnsProvider := ctx.String("dns-provider")
|
dnsProvider := ctx.String("dns-provider")
|
||||||
if acmeAcceptTerms || (dnsProvider == "" && acmeAPI != "https://acme.mock.directory") {
|
if (!acmeAcceptTerms || dnsProvider == "") && acmeAPI != "https://acme.mock.directory" {
|
||||||
return errors.New("you must set $ACME_ACCEPT_TERMS and $DNS_PROVIDER, unless $ACME_API is set to https://acme.mock.directory")
|
return errors.New("you must set $ACME_ACCEPT_TERMS and $DNS_PROVIDER, unless $ACME_API is set to https://acme.mock.directory")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +109,9 @@ func Serve(ctx *cli.Context) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
certificates.SetupCertificates(mainDomainSuffix, dnsProvider, acmeConfig, acmeUseRateLimits, enableHTTPServer, challengeCache, certDB)
|
if err := certificates.SetupCertificates(mainDomainSuffix, dnsProvider, acmeConfig, acmeUseRateLimits, enableHTTPServer, challengeCache, certDB); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
interval := 12 * time.Hour
|
interval := 12 * time.Hour
|
||||||
certMaintainCtx, cancelCertMaintain := context.WithCancel(context.Background())
|
certMaintainCtx, cancelCertMaintain := context.WithCancel(context.Background())
|
||||||
|
|
|
@ -2,8 +2,9 @@ package html
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"github.com/valyala/fasthttp"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
|
"github.com/valyala/fasthttp"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ReturnErrorPage sets the response status code and writes NotFoundPage to the response body, with "%status" replaced
|
// ReturnErrorPage sets the response status code and writes NotFoundPage to the response body, with "%status" replaced
|
||||||
|
|
Loading…
Reference in a new issue