Fix creating wrong cert type when trying dns

This commit is contained in:
Jamie Curnow
2025-10-27 18:04:29 +10:00
parent 2893ffb1e4
commit e4d9f48870
2 changed files with 23 additions and 14 deletions

View File

@@ -20,6 +20,8 @@ import internalNginx from "./nginx.js";
const letsencryptConfig = "/etc/letsencrypt.ini";
const certbotCommand = "certbot";
const certbotLogsDir = "/data/logs";
const certbotWorkDir = "/tmp/letsencrypt-lib";
const omissions = () => {
return ["is_deleted", "owner.is_deleted"];
@@ -830,18 +832,18 @@ const internalCertificate = {
"--config",
letsencryptConfig,
"--work-dir",
"/tmp/letsencrypt-lib",
certbotWorkDir,
"--logs-dir",
"/tmp/letsencrypt-log",
certbotLogsDir,
"--cert-name",
`npm-${certificate.id}`,
"--agree-tos",
"--authenticator",
"webroot",
"--email",
"-m",
email,
"--preferred-challenges",
"dns,http",
"http",
"--domains",
certificate.domain_names.join(","),
];
@@ -884,14 +886,16 @@ const internalCertificate = {
"--config",
letsencryptConfig,
"--work-dir",
"/tmp/letsencrypt-lib",
certbotWorkDir,
"--logs-dir",
"/tmp/letsencrypt-log",
certbotLogsDir,
"--cert-name",
`npm-${certificate.id}`,
"--agree-tos",
"--email",
"-m",
email,
"--preferred-challenges",
"dns",
"--domains",
certificate.domain_names.join(","),
"--authenticator",
@@ -987,13 +991,13 @@ const internalCertificate = {
"--config",
letsencryptConfig,
"--work-dir",
"/tmp/letsencrypt-lib",
certbotWorkDir,
"--logs-dir",
"/tmp/letsencrypt-log",
certbotLogsDir,
"--cert-name",
`npm-${certificate.id}`,
"--preferred-challenges",
"dns,http",
"http",
"--no-random-sleep-on-renew",
"--disable-hook-validation",
];
@@ -1031,11 +1035,13 @@ const internalCertificate = {
"--config",
letsencryptConfig,
"--work-dir",
"/tmp/letsencrypt-lib",
certbotWorkDir,
"--logs-dir",
"/tmp/letsencrypt-log",
certbotLogsDir,
"--cert-name",
`npm-${certificate.id}`,
"--preferred-challenges",
"dns",
"--disable-hook-validation",
"--no-random-sleep-on-renew",
];
@@ -1068,9 +1074,9 @@ const internalCertificate = {
"--config",
letsencryptConfig,
"--work-dir",
"/tmp/letsencrypt-lib",
certbotWorkDir,
"--logs-dir",
"/tmp/letsencrypt-log",
certbotLogsDir,
"--cert-path",
`${internalCertificate.getLiveCertPath(certificate.id)}/fullchain.pem`,
"--delete-after-revoke",