fix: supprimer les portails historiques et leur tuile
All checks were successful
Validation applicative / Tests de contrat (push) Successful in 9s

This commit is contained in:
Manus
2026-10-24 13:44:44 +00:00
parent 0d5229472e
commit 59524da7bd
4 changed files with 19 additions and 22 deletions

View File

@@ -12,6 +12,8 @@ const root = path.join(__dirname, '..');
const html = fs.readFileSync(path.join(root, 'index.html'), 'utf8');
const compose = fs.readFileSync(path.join(root, 'docker-compose.yml'), 'utf8');
const script = html.match(/<script>([\s\S]*?)<\/script>/)?.[1];
const historicalRecetteHost = ['portail', 'recette', 'santinova-soft', 'org'].join('.');
const historicalProductionHost = ['portail', 'santinova-soft', 'org'].join('.');
assert.ok(script, 'le script de configuration des portails doit être présent');
assert.equal(/^(<<<<<<<|=======|>>>>>>>)/m.test(html), false, 'aucun marqueur de conflit Git ne doit être livré');
@@ -19,6 +21,8 @@ assert.match(html, /PORTAL_CONFIGS/, 'les domaines des portails doivent être co
assert.doesNotMatch(html, /class="entity-nav"/, 'un portail ne doit proposer aucun accès aux autres portails');
assert.doesNotMatch(html, /PORTAL_DEFINITIONS/, 'la liste de navigation croisée ne doit pas être livrée');
assert.doesNotMatch(html, /function renderNavigation\(/, 'aucune fonction ne doit construire des liens vers les autres portails');
assert.equal(html.includes(historicalRecetteHost), false, 'le portail historique recette ne doit plus être livré');
assert.equal(html.includes(historicalProductionHost), false, 'le portail historique production ne doit plus être livré');
assert.match(html, /STATUS_REFRESH_MS = 30000/, 'le délai de grisage doit être explicite');
assert.match(html, /setInterval\(fetchAndApplyStatuses, STATUS_REFRESH_MS\)/, 'les statuts doivent être réactualisés périodiquement');
@@ -87,17 +91,16 @@ for (const [group, host] of Object.entries(hosts)) {
`${host} doit avoir un routeur Traefik dédié`
);
}
assert.match(
compose,
/traefik\.http\.routers\.portail-legacy-production\.rule=Host\(`portail\.santinova-soft\.org`\)/,
'l’ancienne URL production doit garder un routeur de redirection'
);
assert.equal((compose.match(/tls\.certresolver=letsencrypt/g) || []).length, 5, 'chaque routeur production doit demander un certificat TLS');
assert.equal(compose.includes(['portail', 'legacy'].join('-')), false, 'aucune route historique ne doit rester exposée');
assert.equal(compose.includes(historicalRecetteHost), false, 'l’ancienne URL recette ne doit plus être routée');
assert.equal(compose.includes(historicalProductionHost), false, 'l’ancienne URL production ne doit plus être routée');
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: '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' } }
];
const expectedVisible = {
@@ -130,10 +133,10 @@ for (const imageName of ['budget-si.jpg', 'dashboard.png', 'portail.png', 'sante
assert.ok(fs.statSync(imagePath).size > 2048, `l’asset ${imageName} ne doit pas être vide`);
}
assert.deepEqual(
loadPortal('portail.santinova-soft.org').redirects,
['https://portail-santinova.santinova-soft.org/'],
'l’ancienne URL production doit rediriger vers le portail Santinova'
);
for (const historicalHost of [historicalRecetteHost, historicalProductionHost]) {
const historicalPortal = loadPortal(historicalHost);
assert.equal(historicalPortal.sandbox.PORTAL, null, `${historicalHost} ne doit plus être reconnu comme portail`);
assert.deepEqual(historicalPortal.redirects, [], `${historicalHost} ne doit plus rediriger vers un portail`);
}
console.log('OK portal-contract');