Support multiple canonical-domain-files

This commit is contained in:
Max Stanley 2024-08-25 22:13:08 +01:00
parent 2410137438
commit b2d40c5154
13 changed files with 238 additions and 128 deletions

View file

@ -32,7 +32,7 @@ func TLSConfig(mainDomainSuffix string,
giteaClient *gitea.Client,
acmeClient *AcmeClient,
firstDefaultBranch string,
canonicalDomainConfig string,
canonicalDomainConfigs []string,
challengeCache, canonicalDomainCache cache.ICache,
certDB database.CertDB,
noDNS01 bool,
@ -101,10 +101,10 @@ func TLSConfig(mainDomainSuffix string,
TargetRepo: targetRepo,
TargetBranch: targetBranch,
}
_, valid := targetOpt.CheckCanonicalDomain(giteaClient, domain, mainDomainSuffix, canonicalDomainConfig, canonicalDomainCache)
_, valid := targetOpt.CheckCanonicalDomain(giteaClient, domain, mainDomainSuffix, canonicalDomainConfigs, canonicalDomainCache)
if !valid {
// We shouldn't obtain a certificate when we cannot check if the
// repository has specified this domain in the `.domains` file.
// repository has specified this domain in the specified canonical domain file such as the `.domains` file.
mayObtainCert = false
}
}