Do not remove default.conf and admin.conf when re-configuring apps

This commit is contained in:
Girish Ramakrishnan
2018-11-10 22:02:42 -08:00
parent 78ac1d2a12
commit a3cc17705d
2 changed files with 6 additions and 3 deletions

View File

@@ -558,8 +558,10 @@ function renewAll(auditSource, callback) {
}
function removeAppConfigs() {
for (var appConfigFile of fs.readdirSync(paths.NGINX_APPCONFIG_DIR)) {
fs.unlinkSync(path.join(paths.NGINX_APPCONFIG_DIR, appConfigFile));
for (let appConfigFile of fs.readdirSync(paths.NGINX_APPCONFIG_DIR)) {
if (appConfigFile !== constants.NGINX_DEFAULT_CONFIG_FILE_NAME && appConfigFile !== constants.NGINX_ADMIN_CONFIG_FILE_NAME) {
fs.unlinkSync(path.join(paths.NGINX_APPCONFIG_DIR, appConfigFile));
}
}
}
@@ -577,7 +579,7 @@ function configureDefaultServer(callback) {
safe.child_process.execSync(certCommand);
}
writeAdminConfig({ certFilePath, keyFilePath }, 'default.conf', '', function (error) {
writeAdminConfig({ certFilePath, keyFilePath }, constants.NGINX_DEFAULT_CONFIG_FILE_NAME, '', function (error) {
if (error) return callback(error);
debug('configureDefaultServer: done');