reverseproxy: add option to force renewal for e2e
This commit is contained in:
+1
-1
@@ -318,7 +318,7 @@ async function setupDnsAndCert(subdomain, domain, auditSource, progressCallback)
|
||||
if (ipv6) await dns.waitForDnsRecord(subdomain, domain, 'AAAA', ipv6, { interval: 30000, times: 50000 });
|
||||
progressCallback({ percent: 60, message: `Getting certificate of ${dashboardFqdn}` });
|
||||
const location = { subdomain, domain, fqdn: dashboardFqdn, type: apps.LOCATION_TYPE_DASHBOARD, certificate: null };
|
||||
await reverseProxy.ensureCertificate(location, auditSource);
|
||||
await reverseProxy.ensureCertificate(location, {}, auditSource);
|
||||
}
|
||||
|
||||
async function syncDnsRecords(options) {
|
||||
|
||||
+5
-4
@@ -378,8 +378,9 @@ async function writeCertificate(location) {
|
||||
return { certFilePath, keyFilePath };
|
||||
}
|
||||
|
||||
async function ensureCertificate(location, auditSource) {
|
||||
async function ensureCertificate(location, options, auditSource) {
|
||||
assert.strictEqual(typeof location, 'object');
|
||||
assert.strictEqual(typeof options, 'object');
|
||||
assert.strictEqual(typeof auditSource, 'object');
|
||||
|
||||
const domainObject = await domains.get(location.domain);
|
||||
@@ -402,7 +403,7 @@ async function ensureCertificate(location, auditSource) {
|
||||
const cert = await blobs.getString(`${blobs.CERT_PREFIX}-${certName}.cert`);
|
||||
|
||||
if (key && cert) {
|
||||
if (providerMatchesSync(domainObject, cert) && !needsRenewalSync(cert)) {
|
||||
if (!options.forceRenewal && providerMatchesSync(domainObject, cert) && !needsRenewalSync(cert)) { // force is for e2e
|
||||
debug(`ensureCertificate: ${fqdn} acme cert exists and is up to date`);
|
||||
return;
|
||||
}
|
||||
@@ -547,7 +548,7 @@ async function configureApp(app, auditSource) {
|
||||
const locations = getAppLocationsSync(app);
|
||||
|
||||
for (const location of locations) {
|
||||
await ensureCertificate(location, auditSource);
|
||||
await ensureCertificate(location, {}, auditSource);
|
||||
}
|
||||
|
||||
await writeAppConfigs(app);
|
||||
@@ -625,7 +626,7 @@ async function checkCerts(options, auditSource, progressCallback) {
|
||||
for (const location of locations) {
|
||||
percent += Math.round(100/locations.length);
|
||||
progressCallback({ percent, message: `Ensuring certs of ${location.fqdn}` });
|
||||
await ensureCertificate(location, auditSource);
|
||||
await ensureCertificate(location, options, auditSource);
|
||||
}
|
||||
|
||||
if (options.rebuild || fs.existsSync(paths.REVERSE_PROXY_REBUILD_FILE)) {
|
||||
|
||||
Reference in New Issue
Block a user