Carefully (re)start oidc server depending on dashboardFqdn

This commit is contained in:
Johannes Zellner
2023-03-21 14:59:28 +01:00
parent 22f9ffd119
commit 2315cf330f
2 changed files with 10 additions and 1 deletions
+7
View File
@@ -44,6 +44,7 @@ const apps = require('./apps.js'),
LogStream = require('./log-stream.js'),
mail = require('./mail.js'),
notifications = require('./notifications.js'),
oidc = require('./oidc.js'),
path = require('path'),
paths = require('./paths.js'),
platform = require('./platform.js'),
@@ -273,6 +274,9 @@ async function setDashboardDomain(domain, auditSource) {
await safe(appstore.updateCloudron({ domain }), { debug });
// this requires dashboardFqdn to be set
await oidc.start();
await eventlog.add(eventlog.ACTION_DASHBOARD_DOMAIN_UPDATE, auditSource, { domain, fqdn });
}
@@ -288,6 +292,9 @@ async function updateDashboardDomain(domain, auditSource) {
await setDashboardDomain(domain, auditSource);
safe(services.rebuildService('turn', auditSource), { debug }); // to update the realm variable
await oidc.stop();
await oidc.start();
}
async function renewCerts(options, auditSource) {