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

This commit is contained in:
Santinova Deployment
2026-10-24 17:06:49 +00:00
parent 31dcb681ca
commit 50136ee22f
2 changed files with 5 additions and 5 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

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