Set-OPS-Public/promo/formation/dev-04/slides/relais.html
Daniel Allaire f08a0efa6d formation : le parcours developpeur, cinq modules et trois atlas (288)
Pour qui ecrit une application qu'un ecosysteme Set-OPS heberge, sans acces aux
serveurs : D1 Heberger chez Set-OPS, D2 Le contrat, D3 Le site web statique,
D4 L'application Python, D5 Publier une version (58 diapositives), et trois
atlas interactifs conformes a la CSP du site web de l'Alliance.

Faits tires du guide du developpeur et recoupes dans le code. Une reconstruction
du dorsal repose « derniere », la version notee n'etant qu'un plancher : apres un
retour arriere, la version fautive revient si elle reste la plus haute. D5 et
l'atlas le disent.

Publie par la premiere vraie bascule de make contenu (site_alliance v1.4.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 18:38:28 -05:00

31 lines
4.9 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<section id="relais" data-transition="fade" style="background:#131B36;color:#EEF2F8;font-family:'IBM Plex Sans', Arial, sans-serif;padding:128px 128px 160px;display:flex;flex-direction:column;gap:36px">
<div style="display:flex;flex-direction:column;gap:16px">
<p style="font-size:24px;letter-spacing:3px;text-transform:uppercase;color:#4FE3C1;font-weight:600">6 · Derrière deux relais</p>
<h2 style="font-family:'Source Serif 4', Georgia, serif;font-size:68px;font-weight:400;line-height:1.1;color:#EEF2F8">Vous recevez du HTTP, et les en-têtes du client.</h2>
</div>
<div style="display:flex;gap:32px;align-items:stretch">
<div style="display:grid;grid-template-columns:480px 1fr;column-gap:36px;align-items:start">
<p style="font-size:22px;letter-spacing:2px;text-transform:uppercase;color:#8592AD;font-weight:600;padding:0 0 10px">En-tête</p>
<p style="font-size:22px;letter-spacing:2px;text-transform:uppercase;color:#8592AD;font-weight:600;padding:0 0 10px">Ce qu’il porte</p>
<p style="font-size:25px;line-height:1.35;color:#4FE3C1;font-weight:600;padding:14px 0;border-top:1px solid #2A3556"><span style="font-family:'JetBrains Mono', 'Courier New', monospace;font-size:0.88em;color:#4FE3C1">X-Forwarded-Proto</span></p>
<p style="font-size:25px;line-height:1.35;color:#BCC7DA;font-weight:400;padding:14px 0;border-top:1px solid #2A3556">le schéma du client : <span style="font-family:'JetBrains Mono', 'Courier New', monospace;font-size:0.88em;color:#4FE3C1">https</span></p>
<p style="font-size:25px;line-height:1.35;color:#4FE3C1;font-weight:600;padding:14px 0;border-top:1px solid #2A3556"><span style="font-family:'JetBrains Mono', 'Courier New', monospace;font-size:0.88em;color:#4FE3C1">X-Real-IP</span> · <span style="font-family:'JetBrains Mono', 'Courier New', monospace;font-size:0.88em;color:#4FE3C1">X-Forwarded-For</span></p>
<p style="font-size:25px;line-height:1.35;color:#BCC7DA;font-weight:400;padding:14px 0;border-top:1px solid #2A3556">l’adresse du client</p>
<p style="font-size:25px;line-height:1.35;color:#4FE3C1;font-weight:600;padding:14px 0;border-top:1px solid #2A3556"><span style="font-family:'JetBrains Mono', 'Courier New', monospace;font-size:0.88em;color:#4FE3C1">Host</span></p>
<p style="font-size:25px;line-height:1.35;color:#BCC7DA;font-weight:400;padding:14px 0;border-top:1px solid #2A3556">le nom demandé</p>
</div>
<div style="display:grid;grid-template-columns:repeat(1, 1fr);gap:28px;align-items:stretch">
<div style="display:flex;flex-direction:column;gap:12px;background:#0B1022;padding:30px 32px;border-radius:18px;border-top:6px solid #A98BFF">
<p style="font-size:24px;letter-spacing:2px;text-transform:uppercase;color:#A98BFF;font-weight:600">À votre charge</p>
<p style="font-size:25px;line-height:1.4;color:#BCC7DA">· lire ces en-têtes : Uvicorn le fait d’office ; Gunicorn, Flask : <span style="font-family:'JetBrains Mono', 'Courier New', monospace;font-size:0.88em;color:#4FE3C1">ProxyFix</span></p>
<p style="font-size:25px;line-height:1.4;color:#BCC7DA">· votre CSP, <span style="font-family:'JetBrains Mono', 'Courier New', monospace;font-size:0.88em;color:#4FE3C1">nosniff</span>, <span style="font-family:'JetBrains Mono', 'Courier New', monospace;font-size:0.88em;color:#4FE3C1">X-Frame-Options</span></p>
<p style="font-size:25px;line-height:1.4;color:#BCC7DA">· des cookies <span style="font-family:'JetBrains Mono', 'Courier New', monospace;font-size:0.88em;color:#4FE3C1">Secure</span> et <span style="font-family:'JetBrains Mono', 'Courier New', monospace;font-size:0.88em;color:#4FE3C1">HttpOnly</span></p>
<p style="font-size:25px;line-height:1.4;color:#BCC7DA">· un envoi ≤ 16 Mo</p>
</div>
</div>
</div>
<p style="font-size:27px;line-height:1.45;color:#BCC7DA;width:1550px">Pour un nom public, le pare-feu applicatif répond 403 à ce qui ressemble à une attaque : testez vos formulaires par le vrai nom.</p>
<p style="position:absolute;left:128px;bottom:64px;width:1400px;font-size:24px;color:#8592AD">Set-OPS · Formation · Module D4 — L’application Python</p>
<p style="position:absolute;right:128px;bottom:64px;width:120px;text-align:right;font-size:24px;color:#8592AD">10</p>
<aside>Votre application est derrière deux relais : le frontal, qui termine le HTTPS, puis le nginx local. Elle reçoit donc du HTTP, avec les en-têtes standard : le schéma du client, son adresse, et le nom demandé. Uvicorn les lit d’office pour une connexion venant de 127.0.0.1 ; avec Gunicorn ou Flask, activez la lecture des en-têtes de relais, sans quoi vos redirections partiraient en http. Contrairement au statique, nginx n’ajoute pas de CSP à une application Python : posez la vôtre, au plus strict que votre application supporte, avec nosniff et X-Frame-Options, et marquez vos cookies Secure et HttpOnly. Un envoi est limité à 16 mégaoctets. Pour un nom public, enfin, le pare-feu applicatif bloque ce qui ressemble à une attaque, avec un 403 qui n’atteint jamais votre code : testez vos formulaires par le vrai nom public.</aside>
</section>