diff --git a/index.html b/index.html index c46f2b6..b22456d 100644 --- a/index.html +++ b/index.html @@ -68,7 +68,7 @@ var STATUS_REFRESH_MS = 30000, APPS_REFRESH_MS = 300000, APP_IMAGE_OVERRIDES = { 'santelis-gestion': 'images/santelis-gestion.jpg' }, hasRenderedApps = false; function normalizeHostname(value) { return String(value || '').toLowerCase().replace(/\.$/, ''); } function getPortalHubUrl(portal) { return 'https://' + portal.host + (PORTAL.env === 'recette' ? '.recette' : '') + '.santinova-soft.org/'; } - function resolvePortalConfig(hostname) { var config = PORTAL_CONFIGS[normalizeHostname(hostname)]; if (!config) return null; var origin = config.env === 'recette' ? 'https://dashboard.recette.santinova-soft.org' : 'https://dashboard.santinova-soft.org'; return Object.assign({}, config, { dashboardAppsUrl: origin + '/api/public/apps', dashboardStatusUrl: origin + '/api/public/status', envLabel: config.env === 'recette' ? 'Recette' : 'Production' }); } + function resolvePortalConfig(hostname) { var config = PORTAL_CONFIGS[normalizeHostname(hostname)]; if (!config) return null; var origin = config.env === 'recette' ? 'https://dashboard-santinova.recette.santinova-soft.org' : 'https://dashboard-santinova.santinova-soft.org'; return Object.assign({}, config, { dashboardAppsUrl: origin + '/api/public/apps', dashboardStatusUrl: origin + '/api/public/status', envLabel: config.env === 'recette' ? 'Recette' : 'Production' }); } function isHttpsUrl(value) { try { return new URL(value).protocol === 'https:'; } catch (error) { return false; } } function isOffline(app) { return app.status === 'offline' || app.status === 'error' || app.containerRunning === false; } function getPortalOnlyApps() { if (!PORTAL || PORTAL.env !== 'prod' || PORTAL.group !== 'SANTELIS') return []; return PORTAL_ONLY_APPS.filter(function(app) { return isHttpsUrl(app.urls && app.urls[PORTAL.env]); }); } diff --git a/test/portal-contract.test.js b/test/portal-contract.test.js index 25bea23..aaad2d5 100644 --- a/test/portal-contract.test.js +++ b/test/portal-contract.test.js @@ -77,7 +77,7 @@ const hosts = { santinova: 'portail-santinova.santinova-soft.org', santelis: 'portail-santelis.santinova-soft.org' }; -const apiApps = 'https://dashboard.santinova-soft.org/api/public/apps'; +const apiApps = 'https://dashboard-santinova.santinova-soft.org/api/public/apps'; for (const [group, host] of Object.entries(hosts)) { const { sandbox } = loadPortal(host); @@ -113,9 +113,9 @@ assert.equal(compose.includes(historicalProductionHost), false, 'l’ancienne UR assert.equal((compose.match(/tls\.certresolver=letsencrypt/g) || []).length, 4, 'seuls les quatre portails par entité doivent demander un certificat TLS'); const deployedApps = [ - { id: 'itinova-contacts', category: 'ITINOVA', urls: { prod: 'https://contacts.santinova-soft.org' } }, - { id: 'itinova-budget-si', category: 'SANTINOVA', urls: { prod: 'https://budget-si.santinova-soft.org' } }, - { id: 'manus-dashboard', category: 'INFRA', urls: { prod: 'https://dashboard.santinova-soft.org' } }, + { id: 'itinova-contacts', category: 'ITINOVA', urls: { prod: 'https://contacts-itinova.santinova-soft.org' } }, + { id: 'itinova-budget-si', category: 'SANTINOVA', urls: { prod: 'https://budget-si-santinova.santinova-soft.org' } }, + { id: 'manus-dashboard', category: 'INFRA', urls: { prod: 'https://dashboard-santinova.santinova-soft.org' } }, { id: 'portail-santinova', category: 'INFRA', urls: { prod: 'https://portail-santinova.santinova-soft.org' } }, { id: 'santelis-gestion', category: 'SANTINOVA', urls: { prod: 'https://gestion-santelis.santinova-soft.org' } } ];