diff --git a/README.md b/README.md index 692ab7c..7ba29b6 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ I am an engineering student in Computer Science & Telecom at INP ENSEEIHT (Toulo | **Passions** | Self-hosting, offensive security training, photography, geopolitics | | **Civic engagement** | Volunteering and awareness actions, with hours tracked and links to the events | | **Contact** | A form that sends messages straight to my inbox | +| **Legal notice** | A separate page, in English and French, with the publisher and hosting details and how personal data from the contact form is handled (GDPR) | ## Design choices @@ -29,14 +30,13 @@ I am an engineering student in Computer Science & Telecom at INP ENSEEIHT (Toulo - **Simple by design**: one page, plain HTML, CSS and JavaScript. No framework, no build step, no tracking, no third-party requests: even the fonts are served from the site itself. - **Accessible and responsive**: readable on a phone, usable with a keyboard and a screen reader (the certification timeline works with the arrow keys), and respectful of reduced-motion settings. - **Ready for strict security headers**: no inline styles or scripts, so the site works under a strict Content-Security-Policy. -- **Privacy-minded contact form**: no email address is published. Messages go through a small PHP script that sends them by SMTP, with the credentials kept outside the web root, plus anti-spam protections (honeypot, per-visitor rate limit, origin check). +- **Privacy-minded contact form**: no email address is published. Messages go through a small PHP script that sends them by SMTP, with the credentials kept outside the web root, plus anti-spam protections (honeypot, per-visitor rate limit, origin check). No cookies are set. ## Repository layout ``` www/ the website itself (the only folder served publicly) portfolio-private/ configuration template and mail library for the contact form -server/ sample web server configuration ``` Secrets, server logs and CVs are deliberately kept out of this repository. diff --git a/www/.htaccess b/www/.htaccess deleted file mode 100644 index e63a71c..0000000 --- a/www/.htaccess +++ /dev/null @@ -1,25 +0,0 @@ -# Apache uniquement (ignoré par Nginx) -ErrorDocument 404 /404.html -Options -Indexes - - - Header always set Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self'; font-src 'self'; img-src 'self' data:; connect-src 'self'; form-action 'self'; frame-ancestors 'none'; base-uri 'self'; object-src 'none'" - Header always set X-Content-Type-Options "nosniff" - Header always set Referrer-Policy "strict-origin-when-cross-origin" - Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()" - Header always set X-Frame-Options "DENY" - - Header set Cache-Control "public, max-age=2592000" - - - Header set Cache-Control "no-cache" - - - -# Seul contact.php peut être exécuté - - Require all denied - - - Require all granted - diff --git a/www/404.html b/www/404.html index a3ff528..5d24097 100644 --- a/www/404.html +++ b/www/404.html @@ -6,9 +6,9 @@ Page not found – Nelson Thomas - - - + + +
diff --git a/www/contact.php b/www/contact.php index 8e44bb6..3b803bc 100644 --- a/www/contact.php +++ b/www/contact.php @@ -82,6 +82,13 @@ if ($name === '' || $subject === '' || $message === '' || !filter_var($email, FI $ip = $_SERVER['REMOTE_ADDR'] ?? 'unknown'; $store = sys_get_temp_dir() . '/portfolio-contact-' . hash('sha256', $ip . ($cfg['rate_salt'] ?? '')); $now = time(); + +// Delete fingerprints older than one hour (as stated in the legal notice). +foreach (glob(sys_get_temp_dir() . '/portfolio-contact-*') ?: [] as $old) { + if (@filemtime($old) < $now - 3600) { + @unlink($old); + } +} $hits = []; if (is_readable($store)) { foreach (explode(',', (string) file_get_contents($store)) as $t) { diff --git a/www/css/fonts.css b/www/css/fonts.css index b738016..f7c4b73 100644 --- a/www/css/fonts.css +++ b/www/css/fonts.css @@ -1,9 +1,17 @@ -/* Self-hosted fonts (SIL Open Font License, see fonts/OFL-*.txt). Latin subset. */ -@font-face{font-family:"Chakra Petch";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/chakra-petch-500.woff2) format("woff2")} -@font-face{font-family:"Chakra Petch";font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/chakra-petch-600.woff2) format("woff2")} -@font-face{font-family:"Chakra Petch";font-style:normal;font-weight:700;font-display:swap;src:url(../fonts/chakra-petch-700.woff2) format("woff2")} -@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/ibm-plex-sans-400.woff2) format("woff2")} -@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/ibm-plex-sans-500.woff2) format("woff2")} -@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:600;font-display:swap;src:url(../fonts/ibm-plex-sans-600.woff2) format("woff2")} -@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:400;font-display:swap;src:url(../fonts/ibm-plex-mono-400.woff2) format("woff2")} -@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:500;font-display:swap;src:url(../fonts/ibm-plex-mono-500.woff2) format("woff2")} +/* Self-hosted fonts (SIL Open Font License 1.1, see fonts/OFL-*.txt), from Fontsource: latin + latin-ext subsets */ +@font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:500;src:url(../fonts/chakra-petch-latin-ext-500-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF} +@font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:500;src:url(../fonts/chakra-petch-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} +@font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:600;src:url(../fonts/chakra-petch-latin-ext-600-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF} +@font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:600;src:url(../fonts/chakra-petch-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} +@font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:700;src:url(../fonts/chakra-petch-latin-ext-700-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF} +@font-face{font-family:'Chakra Petch';font-style:normal;font-display:swap;font-weight:700;src:url(../fonts/chakra-petch-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} +@font-face{font-family:'IBM Plex Sans';font-style:normal;font-display:swap;font-weight:400;src:url(../fonts/ibm-plex-sans-latin-ext-400-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF} +@font-face{font-family:'IBM Plex Sans';font-style:normal;font-display:swap;font-weight:400;src:url(../fonts/ibm-plex-sans-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} +@font-face{font-family:'IBM Plex Sans';font-style:normal;font-display:swap;font-weight:500;src:url(../fonts/ibm-plex-sans-latin-ext-500-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF} +@font-face{font-family:'IBM Plex Sans';font-style:normal;font-display:swap;font-weight:500;src:url(../fonts/ibm-plex-sans-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} +@font-face{font-family:'IBM Plex Sans';font-style:normal;font-display:swap;font-weight:600;src:url(../fonts/ibm-plex-sans-latin-ext-600-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF} +@font-face{font-family:'IBM Plex Sans';font-style:normal;font-display:swap;font-weight:600;src:url(../fonts/ibm-plex-sans-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} +@font-face{font-family:'IBM Plex Mono';font-style:normal;font-display:swap;font-weight:400;src:url(../fonts/ibm-plex-mono-latin-ext-400-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF} +@font-face{font-family:'IBM Plex Mono';font-style:normal;font-display:swap;font-weight:400;src:url(../fonts/ibm-plex-mono-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} +@font-face{font-family:'IBM Plex Mono';font-style:normal;font-display:swap;font-weight:500;src:url(../fonts/ibm-plex-mono-latin-ext-500-normal.woff2) format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF} +@font-face{font-family:'IBM Plex Mono';font-style:normal;font-display:swap;font-weight:500;src:url(../fonts/ibm-plex-mono-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD} diff --git a/www/css/style.css b/www/css/style.css index d0504ff..55dd882 100644 --- a/www/css/style.css +++ b/www/css/style.css @@ -345,6 +345,35 @@ footer p{margin:0} .item.with-media .media{display:block;width:100%;height:100%;min-height:220px;max-height:300px;object-fit:cover;border-radius:8px} @media (max-width:820px){.item.with-media{grid-template-columns:1fr}.item.with-media .media{min-height:0;max-height:none;aspect-ratio:4/3;height:auto}} +/* ===== Legal notice page ===== */ +.foot-legal{color:var(--muted)} +.foot-legal:hover{color:var(--text)} +.legal{max-width:820px;margin:0 auto;padding:2.5rem 1.25rem 4rem} +.legal-top{display:flex;justify-content:space-between;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:2rem} +.back{display:inline-flex;align-items:center;gap:.4rem;font-size:.92rem} +.lang-switch{display:flex;gap:.3rem;padding:3px;border:1px solid var(--line);border-radius:999px;background:var(--surface)} +.lang-switch a{padding:.25rem .75rem;border-radius:999px;font-size:.85rem;color:var(--muted);text-decoration:none} +.lang-switch a[aria-current="true"]{background:var(--proton);color:#fff} +.legal h1{font-size:clamp(2rem,5vw,2.8rem);margin-bottom:.4rem} +.legal .updated{color:var(--muted);font:500 .85rem var(--mono);margin-bottom:2rem} +.legal .toc{display:flex;flex-wrap:wrap;gap:.5rem;list-style:none;padding:0;margin:0 0 2.5rem} +.legal .toc a{display:inline-block;padding:.35rem .75rem;border:1px solid var(--line);border-radius:999px;font-size:.88rem;color:var(--text);text-decoration:none;background:var(--surface)} +.legal .toc a:hover{border-color:var(--proton-soft)} +.legal section{padding:1.6rem;margin-bottom:1.25rem;background:var(--surface);border:1px solid var(--line);border-radius:12px;scroll-margin-top:1rem} +.legal h2{font-size:1.35rem;margin-bottom:.9rem} +.legal p,.legal li{font-size:.97rem} +.legal ul{padding-left:1.2rem;margin:0 0 1rem} +.legal li{margin-bottom:.35rem} +.legal-lang{scroll-margin-top:1rem} +.legal-lang[hidden]{display:none} +dl.facts{display:grid;grid-template-columns:minmax(120px,auto) 1fr;gap:.55rem 1.2rem;margin:0} +dl.facts dt{color:var(--muted);font-size:.9rem} +dl.facts dd{margin:0} +.data-table{width:100%;border-collapse:collapse;font-size:.93rem;margin:.4rem 0 1rem} +.data-table th,.data-table td{text-align:left;vertical-align:top;padding:.6rem .7rem;border-bottom:1px solid var(--line)} +.data-table th{color:var(--muted);font-weight:500;width:34%} +@media (max-width:560px){dl.facts{grid-template-columns:1fr;gap:.15rem}dl.facts dd{margin-bottom:.6rem}.data-table th{width:auto}.legal section{padding:1.2rem}} + /* Career cards: keep the action buttons at the bottom */ #career .item{display:flex;flex-direction:column;align-items:flex-start} #career .item>.btn,#career .cv-links{margin-top:auto} diff --git a/www/fonts/chakra-petch-500.woff2 b/www/fonts/chakra-petch-latin-500-normal.woff2 similarity index 100% rename from www/fonts/chakra-petch-500.woff2 rename to www/fonts/chakra-petch-latin-500-normal.woff2 diff --git a/www/fonts/chakra-petch-600.woff2 b/www/fonts/chakra-petch-latin-600-normal.woff2 similarity index 100% rename from www/fonts/chakra-petch-600.woff2 rename to www/fonts/chakra-petch-latin-600-normal.woff2 diff --git a/www/fonts/chakra-petch-700.woff2 b/www/fonts/chakra-petch-latin-700-normal.woff2 similarity index 100% rename from www/fonts/chakra-petch-700.woff2 rename to www/fonts/chakra-petch-latin-700-normal.woff2 diff --git a/www/fonts/chakra-petch-latin-ext-500-normal.woff2 b/www/fonts/chakra-petch-latin-ext-500-normal.woff2 new file mode 100644 index 0000000..0f85e0e Binary files /dev/null and b/www/fonts/chakra-petch-latin-ext-500-normal.woff2 differ diff --git a/www/fonts/chakra-petch-latin-ext-600-normal.woff2 b/www/fonts/chakra-petch-latin-ext-600-normal.woff2 new file mode 100644 index 0000000..a7e4aa9 Binary files /dev/null and b/www/fonts/chakra-petch-latin-ext-600-normal.woff2 differ diff --git a/www/fonts/chakra-petch-latin-ext-700-normal.woff2 b/www/fonts/chakra-petch-latin-ext-700-normal.woff2 new file mode 100644 index 0000000..fd340cb Binary files /dev/null and b/www/fonts/chakra-petch-latin-ext-700-normal.woff2 differ diff --git a/www/fonts/ibm-plex-mono-400.woff2 b/www/fonts/ibm-plex-mono-latin-400-normal.woff2 similarity index 100% rename from www/fonts/ibm-plex-mono-400.woff2 rename to www/fonts/ibm-plex-mono-latin-400-normal.woff2 diff --git a/www/fonts/ibm-plex-mono-500.woff2 b/www/fonts/ibm-plex-mono-latin-500-normal.woff2 similarity index 100% rename from www/fonts/ibm-plex-mono-500.woff2 rename to www/fonts/ibm-plex-mono-latin-500-normal.woff2 diff --git a/www/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 b/www/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 new file mode 100644 index 0000000..732c64d Binary files /dev/null and b/www/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 differ diff --git a/www/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 b/www/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 new file mode 100644 index 0000000..6f33f8c Binary files /dev/null and b/www/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 differ diff --git a/www/fonts/ibm-plex-sans-400.woff2 b/www/fonts/ibm-plex-sans-latin-400-normal.woff2 similarity index 100% rename from www/fonts/ibm-plex-sans-400.woff2 rename to www/fonts/ibm-plex-sans-latin-400-normal.woff2 diff --git a/www/fonts/ibm-plex-sans-500.woff2 b/www/fonts/ibm-plex-sans-latin-500-normal.woff2 similarity index 100% rename from www/fonts/ibm-plex-sans-500.woff2 rename to www/fonts/ibm-plex-sans-latin-500-normal.woff2 diff --git a/www/fonts/ibm-plex-sans-600.woff2 b/www/fonts/ibm-plex-sans-latin-600-normal.woff2 similarity index 100% rename from www/fonts/ibm-plex-sans-600.woff2 rename to www/fonts/ibm-plex-sans-latin-600-normal.woff2 diff --git a/www/fonts/ibm-plex-sans-latin-ext-400-normal.woff2 b/www/fonts/ibm-plex-sans-latin-ext-400-normal.woff2 new file mode 100644 index 0000000..ef4be2d Binary files /dev/null and b/www/fonts/ibm-plex-sans-latin-ext-400-normal.woff2 differ diff --git a/www/fonts/ibm-plex-sans-latin-ext-500-normal.woff2 b/www/fonts/ibm-plex-sans-latin-ext-500-normal.woff2 new file mode 100644 index 0000000..6b51734 Binary files /dev/null and b/www/fonts/ibm-plex-sans-latin-ext-500-normal.woff2 differ diff --git a/www/fonts/ibm-plex-sans-latin-ext-600-normal.woff2 b/www/fonts/ibm-plex-sans-latin-ext-600-normal.woff2 new file mode 100644 index 0000000..c19b3c6 Binary files /dev/null and b/www/fonts/ibm-plex-sans-latin-ext-600-normal.woff2 differ diff --git a/www/index.html b/www/index.html index 34d3d2f..8adb770 100644 --- a/www/index.html +++ b/www/index.html @@ -16,11 +16,11 @@ Nelson Thomas – ePortfolio - - - - - + + + + +
@@ -476,8 +476,8 @@
- + - + diff --git a/www/js/legal.js b/www/js/legal.js new file mode 100644 index 0000000..b076722 --- /dev/null +++ b/www/js/legal.js @@ -0,0 +1,21 @@ +(function(){ + // Land at the top, even when the page is shown inside a frame (scrollIntoView also scrolls the parent page) + if('scrollRestoration' in history)history.scrollRestoration='manual'; + function toTop(){window.scrollTo(0,0);var m=document.body;if(m&&m.scrollIntoView)m.scrollIntoView({block:'start',behavior:'instant'})} + window.addEventListener('load',function(){if(!/^#(en|fr)-/.test(location.hash))toTop()}); + var arts={en:document.getElementById('en'),fr:document.getElementById('fr')}; + var links=[].slice.call(document.querySelectorAll('.lang-switch a')); + function show(lang,top){ + Object.keys(arts).forEach(function(k){arts[k].hidden=k!==lang}); + links.forEach(function(a){a.setAttribute('aria-current',a.getAttribute('href')==='#'+lang)}); + document.documentElement.lang=lang; + document.title=lang==='fr'?'Mentions légales – Nelson Thomas':'Legal notice – Nelson Thomas'; + if(top)toTop(); + } + links.forEach(function(a){a.addEventListener('click',function(e){ + e.preventDefault(); var l=a.getAttribute('href').slice(1); + history.replaceState(null,'','#'+l); show(l,true); + })}); + var h=location.hash.slice(1,3); + show(h==='fr'||h==='en'?h:(/^fr\b/i.test(navigator.language||'')?'fr':'en'),!/^#(en|fr)-/.test(location.hash)); +})(); diff --git a/www/legal.html b/www/legal.html new file mode 100644 index 0000000..5ad0725 --- /dev/null +++ b/www/legal.html @@ -0,0 +1,108 @@ + + + + + + +Legal notice – Nelson Thomas + +Legal notice – Nelson Thomas + + + + + +
+ + + +
+ + + +