remove nginx config of stopped apps

when the cert of a stopped app gets auto-cleaned up, nginx does not
start anymore since the config references the cert.

there are two possible fixes:
* do not cleanup cert of stopped apps
* remove the nginx config of stopped apps

this implements the second approach
This commit is contained in:
Girish Ramakrishnan
2022-01-28 09:52:03 -08:00
parent ee3d1b3697
commit 5382e3d832
3 changed files with 3 additions and 0 deletions

View File

@@ -672,6 +672,7 @@ async function cleanupCerts() {
const fqdn = certFilename.replace(/\.cert$/, '');
debug(`cleanupCerts: deleting certs of ${fqdn}`);
// it is safe to delete the certs of stopped apps because their nginx configs are removed
safe.fs.unlinkSync(certFilePath);
safe.fs.unlinkSync(path.join(paths.NGINX_CERT_DIR, `${fqdn}.key`));
safe.fs.unlinkSync(path.join(paths.NGINX_CERT_DIR, `${fqdn}.csr`));