mirror of
https://codeberg.org/Codeberg/pages-server.git
synced 2025-04-24 22:06:57 +00:00
rename client name more apropriate
This commit is contained in:
parent
48198266fe
commit
258020749d
2 changed files with 6 additions and 6 deletions
|
@ -13,8 +13,8 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type AcmeClient struct {
|
type AcmeClient struct {
|
||||||
legoClient *lego.Client
|
legoClient *lego.Client
|
||||||
mainDomainLegoClient *lego.Client
|
dnsChallengerLegoClient *lego.Client
|
||||||
|
|
||||||
obtainLocks sync.Map
|
obtainLocks sync.Map
|
||||||
|
|
||||||
|
@ -72,8 +72,8 @@ func NewAcmeClient(acmeAccountConf, acmeAPI, acmeMail, acmeEabHmac, acmeEabKID,
|
||||||
}
|
}
|
||||||
|
|
||||||
return &AcmeClient{
|
return &AcmeClient{
|
||||||
legoClient: acmeClient,
|
legoClient: acmeClient,
|
||||||
mainDomainLegoClient: mainDomainAcmeClient,
|
dnsChallengerLegoClient: mainDomainAcmeClient,
|
||||||
|
|
||||||
acmeUseRateLimits: acmeUseRateLimits,
|
acmeUseRateLimits: acmeUseRateLimits,
|
||||||
|
|
||||||
|
|
|
@ -300,7 +300,7 @@ func SetupMainDomainCertificates(mainDomainSuffix string, acmeClient *AcmeClient
|
||||||
}
|
}
|
||||||
|
|
||||||
if mainCertBytes == nil {
|
if mainCertBytes == nil {
|
||||||
_, err = acmeClient.obtainCert(acmeClient.mainDomainLegoClient, []string{"*" + mainDomainSuffix, mainDomainSuffix[1:]}, nil, "", true, mainDomainSuffix, certDB)
|
_, err = acmeClient.obtainCert(acmeClient.dnsChallengerLegoClient, []string{"*" + mainDomainSuffix, mainDomainSuffix[1:]}, nil, "", true, mainDomainSuffix, certDB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("Couldn't renew main domain certificate, continuing with mock certs only")
|
log.Error().Err(err).Msg("Couldn't renew main domain certificate, continuing with mock certs only")
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,7 @@ func MaintainCertDB(ctx context.Context, interval time.Duration, acmeClient *Acm
|
||||||
} else if tlsCertificates[0].NotAfter.Before(time.Now().Add(30 * 24 * time.Hour)) {
|
} else if tlsCertificates[0].NotAfter.Before(time.Now().Add(30 * 24 * time.Hour)) {
|
||||||
// renew main certificate 30 days before it expires
|
// renew main certificate 30 days before it expires
|
||||||
go (func() {
|
go (func() {
|
||||||
_, err = acmeClient.obtainCert(acmeClient.mainDomainLegoClient, []string{"*" + mainDomainSuffix, mainDomainSuffix[1:]}, res, "", true, mainDomainSuffix, certDB)
|
_, err = acmeClient.obtainCert(acmeClient.dnsChallengerLegoClient, []string{"*" + mainDomainSuffix, mainDomainSuffix[1:]}, res, "", true, mainDomainSuffix, certDB)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("Couldn't renew certificate for main domain")
|
log.Error().Err(err).Msg("Couldn't renew certificate for main domain")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue