From a608fad84aab2899f5d95c8c652eca5bfc9c7a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Gastinel?= Date: Thu, 29 Oct 2026 00:02:07 +0100 Subject: [PATCH] Site vercors.me : pages Station, A propos (mentions), 404, SEO, favicon, deploy/ Co-Authored-By: Claude Sonnet 5.5 --- deploy/Caddyfile.vercors.me | 37 ++++++++++++++++++++++++ deploy/dns-vercors.me.md | 19 +++++++++++++ public/404.html | 27 ++++++++++++++++++ public/a-propos.html | 56 +++++++++++++++++++++++++++++++++++++ public/app.js | 25 +++++++++++++++-- public/favicon.svg | 1 + public/index.html | 34 ++++++++++++---------- public/og.svg | 1 + public/robots.txt | 4 +++ public/sitemap.xml | 6 ++++ public/station.html | 37 ++++++++++++++++++++++++ public/style.css | 22 +++++++++++++++ 12 files changed, 253 insertions(+), 16 deletions(-) create mode 100644 deploy/Caddyfile.vercors.me create mode 100644 deploy/dns-vercors.me.md create mode 100644 public/404.html create mode 100644 public/a-propos.html create mode 100644 public/favicon.svg create mode 100644 public/og.svg create mode 100644 public/robots.txt create mode 100644 public/sitemap.xml create mode 100644 public/station.html diff --git a/deploy/Caddyfile.vercors.me b/deploy/Caddyfile.vercors.me new file mode 100644 index 0000000..58279c0 --- /dev/null +++ b/deploy/Caddyfile.vercors.me @@ -0,0 +1,37 @@ +# NON APPLIQUE. Bloc a ajouter au Caddy public APRES validation de Theo (DNS en place, mentions legales completees). +# Le site est statique : copier public/ vers /srv/vercors.me/ (chemin a confirmer sur l'hote retenu [A VERIFIER]). +# Le JSON public/data/meteo.json est ecrit toutes les 5-10 min par collecte/collecter_weatherlink.py (cron, ecriture atomique). + +www.vercors.me { + redir https://vercors.me{uri} permanent +} + +vercors.me { + root * /srv/vercors.me + encode zstd gzip + + header { + Strict-Transport-Security "max-age=31536000" + X-Content-Type-Options "nosniff" + Referrer-Policy "strict-origin-when-cross-origin" + X-Frame-Options "DENY" + Permissions-Policy "geolocation=(), camera=(), microphone=()" + # Leaflet charge les tuiles OSM/OpenTopoMap ; tout le reste vient du site + Content-Security-Policy "default-src 'self'; img-src 'self' data: https://*.tile.openstreetmap.org https://*.tile.opentopomap.org; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline'; connect-src 'self'; frame-ancestors 'none'" + -Server + } + + # pages : /station -> station.html, /a-propos -> a-propos.html + try_files {path} {path}.html {path}/index.html + + @donnees path /data/* + header @donnees Cache-Control "no-cache" + @statique path /fonts/* /vendor/* + header @statique Cache-Control "public, max-age=2592000" + + handle_errors { + rewrite * /404.html + file_server + } + file_server +} diff --git a/deploy/dns-vercors.me.md b/deploy/dns-vercors.me.md new file mode 100644 index 0000000..7b0ff2e --- /dev/null +++ b/deploy/dns-vercors.me.md @@ -0,0 +1,19 @@ +# Enregistrements DNS pour vercors.me : NON APPLIQUES + +Rien n'a ete modifie chez le registrar ni dans une zone DNS. A faire par Theo, apres validation. + +Prealables [A VERIFIER] : vercors.me est bien enregistre au nom de Theo ; quel registrar / quelle zone ; IP publique du serveur qui servira le site (celle du VPS qui porte le Caddy public, a ne pas deviner ici). + +| Nom | Type | Valeur | Remarque | +|---|---|---|---| +| vercors.me | A | IPv4 du serveur public [A COMPLETER] | site | +| vercors.me | AAAA | IPv6 du serveur public, si disponible [A COMPLETER] | optionnel | +| www.vercors.me | CNAME | vercors.me. | redirige vers l'apex (bloc www du Caddyfile) | +| vercors.me | CAA | 0 issue "letsencrypt.org" | optionnel, limite les emetteurs de certificats | + +Courrier : aucun e-mail n'est prevu sur vercors.me (le contact est studio@gastinel.me). Pour eviter l'usurpation, ajouter : +| vercors.me | TXT | v=spf1 -all | domaine qui n'envoie aucun courrier | +| _dmarc.vercors.me | TXT | v=DMARC1; p=reject; | | +| vercors.me | MX | 0 . | MX nul (RFC 7505) | + +Ordre conseille : 1) completer les mentions legales (SIRET, hebergeur) ; 2) copier public/ sur le serveur ; 3) ajouter le bloc Caddy (Let's Encrypt HTTP-01 demande que les enregistrements A/AAAA pointent deja vers le serveur et que les ports 80/443 soient ouverts) ; 4) creer les enregistrements DNS ; 5) verifier https://vercors.me/ , /station , /a-propos , /robots.txt , une URL inconnue (404 « Hors sentier »). diff --git a/public/404.html b/public/404.html new file mode 100644 index 0000000..79be5ea --- /dev/null +++ b/public/404.html @@ -0,0 +1,27 @@ + + + + + + +Hors sentier · Météo Vercors + + + + +
+ +

Hors sentier

+

Cette page n'existe pas, ou a changé de place. Retour au balisage.

+Retour à la carte +
+ + diff --git a/public/a-propos.html b/public/a-propos.html new file mode 100644 index 0000000..c85a907 --- /dev/null +++ b/public/a-propos.html @@ -0,0 +1,56 @@ + + + + + + +À propos · Météo Vercors + + + + + + + + + + + + + + + +
+

Météo Vercors

+ +
+ +
+
+

À propos

+

Météo Vercors affiche en direct les mesures de stations météo situées dans le Vercors, et uniquement dans le Vercors. C'est un projet personnel et indépendant, sans publicité ni suivi des visiteurs.

+

Quand une station ne répond plus (aucun relevé depuis 90 minutes), elle est marquée « hors ligne » : son dernier relevé reste visible dans la fiche, daté, mais n'est jamais présenté comme actuel.

+

Tant que la collecte réelle n'est pas branchée, les valeurs affichées sont des données d'exemple, signalées par l'étiquette « exemple » et un bandeau. Ce ne sont pas des mesures.

+ +

Sources et licences

+
    +
  • Stations Davis : relevés de stations WeatherLink appartenant à Théo Gastinel et à ses proches, via l'API WeatherLink v2 de Davis Instruments.
  • +
  • Réseau Infoclimat : à venir, uniquement les stations publiées sous licence CC BY, avec mention de la station et de la licence. Les stations CC BY-NC ne sont pas republiées.
  • +
  • Fond de carte : © contributeurs OpenStreetMap, © OpenTopoMap (CC BY-SA). Les tuiles sont chargées depuis les serveurs de ces tiers, qui voient l'adresse IP du visiteur.
  • +
  • La police Inter (licence SIL OFL) et Leaflet (licence BSD-2) sont hébergées sur ce site.
  • +
  • Les valeurs de chaque station restent séparées : aucune moyenne ni fusion entre sources.
  • +
+

Site indépendant, sans lien avec le Parc naturel régional du Vercors ni avec une commune. Les relevés ne remplacent pas un bulletin officiel (Météo-France) pour la sécurité en montagne.

+ +

Mentions légales

+

Éditeur : Théo Gastinel, micro-entreprise. Directeur de la publication : Théo Gastinel.
+SIRET et adresse : [À COMPLÉTER].
+Contact : studio@gastinel.me

+

Hébergement : [À COMPLÉTER : nom, adresse et contact de l'hébergeur] [À VÉRIFIER].

+

Données personnelles : le site ne dépose aucun cookie et n'a pas de compte. Seul le choix du thème clair ou sombre est gardé dans votre navigateur. Les journaux techniques du serveur (adresse IP, page demandée) servent à la sécurité ; durée de conservation [À VÉRIFIER]. Les tuiles de carte viennent de serveurs tiers (voir ci-dessus). Pour toute demande : studio@gastinel.me.

+

Propriété : le code et la mise en page sont de Théo Gastinel. Les mesures appartiennent à leurs exploitants (voir sources).

+
+ + + + diff --git a/public/app.js b/public/app.js index ab39087..ea74fb9 100644 --- a/public/app.js +++ b/public/app.js @@ -11,6 +11,7 @@ const cardinal = (d) => POINTS[Math.round(d / 22.5) % 16]; const couleurT = () => 'var(--texte)'; +const PAGE = document.body.dataset.page || 'accueil'; const SEUIL_HORS_MIN = 90; let donnees = null, tri = 'altitude', couche = 'temperature', choisie = null, carte = null, marqueurs = {}, cadrage = false; @@ -244,6 +245,7 @@ function remplirFiche(s) { } t.append(tbody); tb.append(t); f.append(tb); } + if (PAGE === 'accueil') { const l = el('p', 'pied'); const a = el('a', null, 'Page de la station'); a.href = 'station.html?id=' + encodeURIComponent(s.id); l.append(a); f.append(l); } f.append(el('p', 'pied', 'Source : ' + (s.source || 'inconnue') + (s.meta.licence ? ' · licence ' + s.meta.licence : '') + (s.exemple ? ' · exemple' : ''))); } @@ -262,13 +264,32 @@ function fermer() { $('#fiche').classList.remove('ouverte'); $('#voile').classList.remove('ouvert'); rendre(false); } -$('#voile').addEventListener('click', fermer); +if ($('#voile')) $('#voile').addEventListener('click', fermer); document.addEventListener('keydown', (e) => { if (e.key === 'Escape') fermer(); }); +function rendreStation() { + const liste = stations(); + const id = new URLSearchParams(location.search).get('id'); + const s = liste.find((x) => x.id === id); + const f = $('#fiche'); + if (!s) { + document.title = 'Station introuvable · Météo Vercors'; + f.replaceChildren(el('h2', null, id ? 'Station introuvable' : 'Choisir une station')); + const ul = el('ul', 'choix'); + for (const x of liste.sort((a, b) => (b.meta.altitude ?? -1) - (a.meta.altitude ?? -1))) { const li = el('li'); const a = el('a', null, x.nom); a.href = 'station.html?id=' + encodeURIComponent(x.id); li.append(a); ul.append(li); } + f.append(ul); return; + } + document.title = s.nom + ' · Météo Vercors'; + const st = window.scrollY; remplirFiche(s); window.scrollTo(0, st); +} function rendre(refiche = true) { + if (PAGE === 'station') { if (donnees) rendreStation(); majEtat(); return; } const liste = stations(); majCarte(liste); majResume(liste); majListe(liste); if (refiche && choisie) { const s = liste.find((x) => x.id === choisie); if (s) { const st = $('#fiche').scrollTop; remplirFiche(s); $('#fiche').scrollTop = st; } } + majEtat(); +} +function majEtat() { if (donnees) { const maj = new Date(donnees.mis_a_jour_utc), min = Math.round((Date.now() - maj) / 60000); $('#etat').textContent = min <= 1 ? 'En direct · ' + heure(maj) : 'Mis à jour il y a ' + age(min); @@ -305,7 +326,7 @@ for (const [attr, set] of [['tri', (v) => { tri = v; }], ['couche', (v) => { cou appliquer(t); b.addEventListener('click', () => { t = t === 'sombre' ? 'clair' : 'sombre'; appliquer(t); try { localStorage.setItem('theme', t); } catch (e) {} }); })(); -initCarte(); +if (PAGE === 'accueil') initCarte(); charger(); setInterval(charger, 60000); setInterval(() => rendre(false), 30000); diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..b720837 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1 @@ + diff --git a/public/index.html b/public/index.html index 4f470b6..2782295 100644 --- a/public/index.html +++ b/public/index.html @@ -4,19 +4,32 @@ - -Météo Vercors +Météo Vercors : stations et mesures en direct + + + + + + + + + + + - +
-

Météo Vercors

+

Météo Vercors

+
Chargement…
+

Les stations météo du Vercors, uniquement : température, vent, pluie et pression, actualisés chaque minute. Une station qui ne répond plus est marquée « hors ligne », jamais présentée comme actuelle.

+
@@ -34,19 +47,12 @@
- -
-

Sources et licences

-

Stations Davis : relevés des stations WeatherLink de Théo Gastinel et de ses proches (Les Bruyères, Méaudre, Gêve, Les Allières, Lans-en-Vercors), via l'API WeatherLink v2 de Davis Instruments.

-

Réseau Infoclimat : à venir, uniquement les stations sous licence CC BY, avec mention de la station et de la licence. Les stations CC BY-NC ne sont pas republiées.

-

Fond de carte : © contributeurs OpenStreetMap, © OpenTopoMap (CC BY-SA). Les valeurs de chaque station restent séparées : aucune moyenne entre sources.

-

Site indépendant, sans lien avec le Parc naturel régional du Vercors ni avec une commune. Actualisation automatique toutes les minutes.

-
- +

Fond de carte © contributeurs OpenStreetMap, © OpenTopoMap (CC BY-SA). Aucune moyenne entre sources. Sources et licences

+
- + diff --git a/public/og.svg b/public/og.svg new file mode 100644 index 0000000..93ef847 --- /dev/null +++ b/public/og.svg @@ -0,0 +1 @@ +Météo VercorsStations du Vercors, en direct diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..e51838e --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / + +Sitemap: https://vercors.me/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..5d5edf8 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,6 @@ + + + https://vercors.me/ + https://vercors.me/station.html + https://vercors.me/a-propos.html + diff --git a/public/station.html b/public/station.html new file mode 100644 index 0000000..6405aa6 --- /dev/null +++ b/public/station.html @@ -0,0 +1,37 @@ + + + + + + +Station · Météo Vercors + + + + + + + + + + + + + + + +
+

Météo Vercors

+ +
Chargement…
+ +
+
+
+
+

Retour à la carte

+ + + + + diff --git a/public/style.css b/public/style.css index 8e7edc9..2964f07 100644 --- a/public/style.css +++ b/public/style.css @@ -77,3 +77,25 @@ ul.liste{list-style:none;margin:0 auto;padding:8px 16px 32px;display:grid;grid-t .sources{padding:24px 16px 56px;color:var(--doux);font-size:13px;border-top:1px solid var(--ligne)} .sources h2{color:var(--texte);font-size:14px;font-weight:600;margin:0 0 8px} .sources p{margin:0 0 8px;max-width:70ch} +/* site public */ +.haut h1 a{color:inherit;text-decoration:none} +.menu{display:flex;gap:4px;margin-left:8px} +.menu a{color:var(--doux);text-decoration:none;font-size:13px;padding:4px 10px;border:1px solid transparent;border-radius:14px} +.menu a[aria-current=page]{color:var(--texte);border-color:var(--ligne)} +.intro,.note{max-width:1100px;margin:0 auto;padding:0 16px 12px;color:var(--doux);font-size:13px} +.intro b{color:var(--texte)} +.note{padding-top:16px} +.note a,.pied a,.texte a,.pied-site a{color:var(--texte)} +.pied-site{max-width:1100px;margin:24px auto 0;padding:20px 16px calc(32px + env(safe-area-inset-bottom));border-top:1px solid var(--ligne);display:flex;flex-wrap:wrap;gap:8px 20px;font-size:12px;color:var(--doux)} +.texte{max-width:728px;margin:0 auto;padding:8px 16px} +.texte h2{font-size:18px;font-weight:600;margin:32px 0 8px;scroll-margin-top:16px} +.texte h2:first-child{margin-top:8px} +.texte p,.texte li{font-size:14px} +.texte li{margin-bottom:6px} +.fiche.enpage{position:static;transform:none;max-width:720px;margin:0 auto;border-radius:0;max-height:none;box-shadow:none;overflow:visible;transition:none;padding-bottom:0} +.fiche.enpage .poignee,.fiche.enpage .fermer{display:none} +.fiche.enpage .fiche-tete{position:static} +.fiche.enpage>h2{padding:0 20px;font-size:19px} +.choix{list-style:none;margin:0;padding:8px 20px} +.choix li{padding:12px 0;border-bottom:1px solid var(--ligne)} +.choix a{color:var(--texte)}