feat: normaliser les URL recette par entité
All checks were successful
Validation applicative / Tests de contrat (push) Successful in 15s

This commit is contained in:
Santinova Deployment
2026-10-24 17:06:48 +00:00
parent 167767eaa2
commit 7faf57cbb8
2 changed files with 13 additions and 13 deletions

View File

@@ -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]); }); }

View File

@@ -81,14 +81,14 @@ const hosts = {
};
const expected = [
[hosts.itinovaRecette, 'recette', 'ITINOVA', 'https://dashboard.recette.santinova-soft.org/api/public/apps'],
[hosts.soinsRecette, 'recette', 'SOINS_ET_SANTE', 'https://dashboard.recette.santinova-soft.org/api/public/apps'],
[hosts.santinovaRecette, 'recette', 'SANTINOVA', 'https://dashboard.recette.santinova-soft.org/api/public/apps'],
[hosts.santelisRecette, 'recette', 'SANTELIS', 'https://dashboard.recette.santinova-soft.org/api/public/apps'],
[hosts.itinovaProd, 'prod', 'ITINOVA', 'https://dashboard.santinova-soft.org/api/public/apps'],
[hosts.soinsProd, 'prod', 'SOINS_ET_SANTE', 'https://dashboard.santinova-soft.org/api/public/apps'],
[hosts.santinovaProd, 'prod', 'SANTINOVA', 'https://dashboard.santinova-soft.org/api/public/apps'],
[hosts.santelisProd, 'prod', 'SANTELIS', 'https://dashboard.santinova-soft.org/api/public/apps']
[hosts.itinovaRecette, 'recette', 'ITINOVA', 'https://dashboard-santinova.recette.santinova-soft.org/api/public/apps'],
[hosts.soinsRecette, 'recette', 'SOINS_ET_SANTE', 'https://dashboard-santinova.recette.santinova-soft.org/api/public/apps'],
[hosts.santinovaRecette, 'recette', 'SANTINOVA', 'https://dashboard-santinova.recette.santinova-soft.org/api/public/apps'],
[hosts.santelisRecette, 'recette', 'SANTELIS', 'https://dashboard-santinova.recette.santinova-soft.org/api/public/apps'],
[hosts.itinovaProd, 'prod', 'ITINOVA', 'https://dashboard-santinova.santinova-soft.org/api/public/apps'],
[hosts.soinsProd, 'prod', 'SOINS_ET_SANTE', 'https://dashboard-santinova.santinova-soft.org/api/public/apps'],
[hosts.santinovaProd, 'prod', 'SANTINOVA', 'https://dashboard-santinova.santinova-soft.org/api/public/apps'],
[hosts.santelisProd, 'prod', 'SANTELIS', 'https://dashboard-santinova.santinova-soft.org/api/public/apps']
];
for (const [host, env, group, appsUrl] of expected) {
@@ -129,10 +129,10 @@ 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 recetteApps = [
{ id: 'itinova-contacts', category: 'ITINOVA', urls: { recette: 'https://contacts.recette.santinova-soft.org' } },
{ id: 'gestion-astreintes-had', category: 'SOINS_ET_SANTE', urls: { recette: 'https://astreintes-had.recette.santinova-soft.org' } },
{ id: 'demat-facturation-dsi', category: 'SANTINOVA', urls: { recette: 'https://demat-facturation.recette.santinova-soft.org' } },
{ id: 'referentiel-ia', category: 'INFRA', urls: { recette: 'https://referentiel-ia.recette.santinova-soft.org' } },
{ id: 'itinova-contacts', category: 'ITINOVA', urls: { recette: 'https://contacts-itinova.recette.santinova-soft.org' } },
{ id: 'gestion-astreintes-had', category: 'SOINS_ET_SANTE', urls: { recette: 'https://astreintes-had-soins-et-sante.recette.santinova-soft.org' } },
{ id: 'demat-facturation-dsi', category: 'SANTINOVA', urls: { recette: 'https://demat-facturation-santinova.recette.santinova-soft.org' } },
{ id: 'referentiel-ia', category: 'INFRA', urls: { recette: 'https://referentiel-ia-santinova.recette.santinova-soft.org' } },
{ id: 'portail-santinova', category: 'INFRA', urls: { recette: 'https://portail-santinova.recette.santinova-soft.org' } },
{ id: 'santelis-gestion', category: 'SANTINOVA', urls: { recette: 'https://gestion-santelis.recette.santinova-soft.org' } }
];