diff --git a/src/apps.js b/src/apps.js index 2820b78ce..0f8a48276 100644 --- a/src/apps.js +++ b/src/apps.js @@ -2713,10 +2713,10 @@ async function restoreInstalledApps(options, auditSource) { } } -async function configureInstalledApps(auditSource) { +async function configureInstalledApps(apps, auditSource) { + assert(Array.isArray(apps)); assert.strictEqual(typeof auditSource, 'object'); - let apps = await list(); apps = apps.filter(app => app.installationState !== exports.ISTATE_ERROR); // remove errored apps. let them be 'repaired' by hand apps = apps.filter(app => app.installationState !== exports.ISTATE_PENDING_CONFIGURE); // safeguard against tasks being created non-stop if we crash on startup diff --git a/src/cloudron.js b/src/cloudron.js index 278bfbbde..6f4c58be6 100644 --- a/src/cloudron.js +++ b/src/cloudron.js @@ -283,7 +283,11 @@ async function updateDashboardDomain(domain, auditSource) { await setDashboardDomain(domain, auditSource); - safe(services.rebuildService('turn', auditSource), { debug }); // to update the realm variable + // mark apps using oidc addon to be reconfigured + const [, installedApps] = await safe(apps.list()); + await safe(apps.configureInstalledApps(installedApps.filter((a) => !!a.manifest.addons.oidc), auditSource)); + + await safe(services.rebuildService('turn', auditSource), { debug }); // to update the realm variable await oidc.stop(); await oidc.start(); diff --git a/src/platform.js b/src/platform.js index be8ff5721..107c57884 100644 --- a/src/platform.js +++ b/src/platform.js @@ -149,7 +149,7 @@ async function markApps(existingInfra, options) { } else if (existingInfra.version !== infra.version) { debug('markApps: reconfiguring installed apps'); reverseProxy.removeAppConfigs(); // should we change the cert location, nginx will not start - await apps.configureInstalledApps(AuditSource.PLATFORM); + await apps.configureInstalledApps(await apps.list(), AuditSource.PLATFORM); } else { let changedAddons = []; if (infra.images.mysql.tag !== existingInfra.images.mysql.tag) changedAddons.push('mysql');