make certbot authenticator configurable

address: https://github.com/caprover/caprover/issues/1761
This commit is contained in:
ZeekoZhu
2024-02-20 10:37:21 +08:00
parent 10ea8dbf71
commit 1bba84ee90
3 changed files with 17 additions and 9 deletions
+12 -6
View File
@@ -61,12 +61,18 @@ class CertbotManager {
const cmd = [
'certbot',
'certonly',
'--webroot',
'-w',
`${WEBROOT_PATH_IN_CERTBOT}/${domainName}`,
]
if (CaptainConstants.configs.certbotAuthenticator === 'webroot') {
cmd.push('--webroot')
cmd.push('-w')
cmd.push(`${WEBROOT_PATH_IN_CERTBOT}/${domainName}`)
}
cmd.push(
'-d',
domainName,
]
)
if (shouldUseStaging) {
cmd.push('--staging')
@@ -295,7 +301,7 @@ class CertbotManager {
return dockerApi
.createServiceOnNodeId(
CaptainConstants.certbotImageName,
CaptainConstants.configs.certbotImageName,
CaptainConstants.certbotServiceName,
undefined,
nodeId,
@@ -373,7 +379,7 @@ class CertbotManager {
return dockerApi.updateService(
CaptainConstants.certbotServiceName,
CaptainConstants.certbotImageName,
CaptainConstants.configs.certbotImageName,
[
{
hostPath: CaptainConstants.letsEncryptEtcPath,
+4 -2
View File
@@ -54,6 +54,10 @@ const configs = {
proApiDomains: ['https://pro.caprover.com'],
analyticsDomain: 'https://analytics-v1.caprover.com',
certbotImageName: 'caprover/certbot-sleeping:v1.6.0',
certbotAuthenticator: 'webroot'
}
const data = {
@@ -133,8 +137,6 @@ const data = {
// ********************* Local Docker Constants ************************
certbotImageName: 'caprover/certbot-sleeping:v1.6.0',
captainSaltSecretKey: 'captain-salt',
nginxServiceName: 'captain-nginx',
+1 -1
View File
@@ -279,7 +279,7 @@ export function install() {
return DockerApi.get().pullImage(imageName, undefined)
})
.then(function () {
const imageName = CaptainConstants.certbotImageName
const imageName = CaptainConstants.configs.certbotImageName
console.log(`Pulling: ${imageName}`)
return DockerApi.get().pullImage(imageName, undefined)
})