diff --git a/setup/start.sh b/setup/start.sh index fa342ab01..1b24d0a13 100755 --- a/setup/start.sh +++ b/setup/start.sh @@ -160,7 +160,7 @@ log "Configuring nginx" # link nginx config to system config unlink /etc/nginx 2>/dev/null || rm -rf /etc/nginx ln -s "${PLATFORM_DATA_DIR}/nginx" /etc/nginx -mkdir -p "${PLATFORM_DATA_DIR}/nginx/applications" +mkdir -p "${PLATFORM_DATA_DIR}/nginx/applications/dashboard" mkdir -p "${PLATFORM_DATA_DIR}/nginx/cert" cp "${script_dir}/start/nginx/nginx.conf" "${PLATFORM_DATA_DIR}/nginx/nginx.conf" cp "${script_dir}/start/nginx/mime.types" "${PLATFORM_DATA_DIR}/nginx/mime.types" diff --git a/src/infra_version.js b/src/infra_version.js index aff8728b1..d7424d630 100644 --- a/src/infra_version.js +++ b/src/infra_version.js @@ -6,7 +6,7 @@ exports = module.exports = { // a version change recreates all containers with latest docker config - 'version': '49.3.0', + 'version': '49.4.0', 'baseImages': [ { repo: 'cloudron/base', tag: 'cloudron/base:3.2.0@sha256:ba1d566164a67c266782545ea9809dc611c4152e27686fd14060332dd88263ea' } diff --git a/src/reverseproxy.js b/src/reverseproxy.js index 4281ed319..fc65d7b57 100644 --- a/src/reverseproxy.js +++ b/src/reverseproxy.js @@ -423,7 +423,7 @@ async function writeDashboardNginxConfig(vhost, certificatePath) { ocsp: await isOcspEnabled(certificatePath.certFilePath) }; const nginxConf = ejs.render(NGINX_APPCONFIG_EJS, data); - const nginxConfigFilename = path.join(paths.NGINX_APPCONFIG_DIR, `${vhost}.conf`); + const nginxConfigFilename = path.join(paths.NGINX_APPCONFIG_DIR, `dashboard/${vhost}.conf`); if (!safe.fs.writeFileSync(nginxConfigFilename, nginxConf)) throw new BoxError(BoxError.FS_ERROR, safe.error); } @@ -705,16 +705,17 @@ async function checkCerts(auditSource, progressCallback) { } function removeAppConfigs() { - const dashboardConfigFilename = `${settings.dashboardFqdn()}.conf`; - debug('removeAppConfigs: removing app nginx configs'); // remove all configs which are not the default or current dashboard for (const entry of fs.readdirSync(paths.NGINX_APPCONFIG_DIR, { withFileTypes: true })) { + if (entry.isDirectory() && entry.name === 'dashboard') continue; + if (entry.isFile() && entry.name === constants.NGINX_DEFAULT_CONFIG_FILE_NAME) continue; + const fullPath = path.join(paths.NGINX_APPCONFIG_DIR, entry.name); if (entry.isDirectory()) { fs.rmSync(fullPath, { recursive: true, force: true }); - } else if (entry.isFile() && entry.name !== constants.NGINX_DEFAULT_CONFIG_FILE_NAME && entry.name !== dashboardConfigFilename) { + } else if (entry.isFile()) { fs.unlinkSync(fullPath); } }