forked from FWS/FWS-TEMPLATE-Website-OnePage
Merge pull request 'Fix/404 tux pattes' (#3) from FWS/FWS-Website:fix/404-tux-pattes into main
Reviewed-on: FWS/FWS-TEMPLATE-Website-OnePage#3
This commit is contained in:
commit
458adb2abd
65 files changed
+9339
-984
No files matched your search
+29
@@ -0,0 +1,29 @@
|
||||
# Dossiers locaux / outils (jamais commités)
|
||||
.freebuff/
|
||||
gestionnaire/
|
||||
FWS-Website/
|
||||
|
||||
# ── Secrets locaux ─────────────────────────────────────────────────────────
|
||||
# Webhook Discord / config locale de l'API bugs (jamais commiter)
|
||||
api/bugs/config.local.php
|
||||
|
||||
# ── Base de données SQLite des signalements ────────────────────────────────
|
||||
# La DB vit sur le serveur, jamais dans git (données utilisateurs + privées)
|
||||
api/bugs/data/*.sqlite
|
||||
api/bugs/data/*.sqlite-wal
|
||||
api/bugs/data/*.sqlite-shm
|
||||
api/bugs/data/*.db
|
||||
api/bugs/data/*.db-wal
|
||||
api/bugs/data/*.db-shm
|
||||
*.sqlite
|
||||
*.sqlite-wal
|
||||
*.sqlite-shm
|
||||
|
||||
# Images des paquets envoyées via l'admin (données hébergées, pas du code)
|
||||
p/assets/img/packages/
|
||||
|
||||
# Cache HTTP local du site (releases Gitea/GitHub, généré par inc/site.php)
|
||||
cache/
|
||||
|
||||
# Journal des erreurs PHP (filet de sécurité inc/errors.php)
|
||||
api/bugs/data/php-errors.log
|
||||
@@ -0,0 +1,73 @@
|
||||
# ── FWS Linux — .htaccess (performance + sécurité) ──────────────────────────
|
||||
|
||||
# Le site est rendu côté serveur : page.php est le point d'entrée unique.
|
||||
# (Les sous-dossiers avec leur propre index.php — admin/bugs, api — restent
|
||||
# prioritaires via l'ordre de DirectoryIndex.)
|
||||
DirectoryIndex index.php page.php
|
||||
|
||||
# Pas de listing de répertoires (ex : /p/, /api/, /admin/)
|
||||
Options -Indexes
|
||||
|
||||
# ── Erreurs Apache « douces » ────────────────────────────────────────────────
|
||||
# 403 (répertoire protégé, listing désactivé…) et 404 : jamais les pages
|
||||
# Apache brutes. page.php sert la page 404 du site ; le statut HTTP reste
|
||||
# correct (403/404) pour les navigateurs comme pour les clients d'API.
|
||||
ErrorDocument 403 /page.php?__e=403
|
||||
ErrorDocument 404 /page.php?__e=404
|
||||
|
||||
# ── Fichiers internes : traités comme introuvables ─────────────────────────
|
||||
# Tout fichier PHP qui n'est pas un point d'entrée légitime (bibliothèques,
|
||||
# corps de pages, config, logs…) répond 404 — on ne révèle même pas son
|
||||
# existence avec un 403. Les accès directs aux corps restent sinon gérés par
|
||||
# leurs shims de délégation vers page.php.
|
||||
RedirectMatch 404 ^/?(inc|cache)/
|
||||
RedirectMatch 404 ^/?api/bugs/(db|discord|config\.local)\.php$
|
||||
RedirectMatch 404 ^/?admin/bugs/init\.php$
|
||||
# Corps de pages et scripts internes sous p/ (hors assets). Les index.php
|
||||
# sont exclus : ils sont résolus en interne par DirectoryIndex (ex /p/dl/).
|
||||
RedirectMatch 404 ^/?p/(?!assets/)(?!.*index\.php$).*\.php$
|
||||
|
||||
# Types MIME manquants (selon la config Apache du conteneur)
|
||||
<IfModule mod_mime.c>
|
||||
AddType image/webp .webp
|
||||
AddType image/avif .avif
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_headers.c>
|
||||
# Sécurité minimale
|
||||
Header set X-Content-Type-Options "nosniff"
|
||||
Header set Referrer-Policy "strict-origin-when-cross-origin"
|
||||
Header set X-Frame-Options "SAMEORIGIN"
|
||||
</IfModule>
|
||||
|
||||
# ── Compression (gzip) ───────────────────────────────────────────────────────
|
||||
<IfModule mod_deflate.c>
|
||||
AddOutputFilterByType DEFLATE text/html text/plain text/css application/javascript application/json application/xml text/xml image/svg+xml
|
||||
# Ne pas compresser ce qui est déjà compressé
|
||||
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|webp|avif|zip|gz|7z|xz)$ no-gzip dont-vary
|
||||
</IfModule>
|
||||
|
||||
# ── Cache navigateur ─────────────────────────────────────────────────────────
|
||||
# Le HTML est chargé en AJAX par le routeur (/?p/…) : on le revalide toujours,
|
||||
# mais les fichiers statiques (css/js/img) peuvent être gardés longtemps.
|
||||
<IfModule mod_headers.c>
|
||||
# Pages html chargées dynamiquement → revalidation (304 rapide si inchangé)
|
||||
<FilesMatch "\.(html?)$">
|
||||
Header set Cache-Control "no-cache"
|
||||
</FilesMatch>
|
||||
|
||||
# CSS / JS : 7 jours + revalidation
|
||||
<FilesMatch "\.(css|js|mjs|json)$">
|
||||
Header set Cache-Control "public, max-age=604800, must-revalidate"
|
||||
</FilesMatch>
|
||||
|
||||
# Images : 30 jours (noms de fichiers stables)
|
||||
<FilesMatch "\.(png|jpe?g|gif|webp|avif|svg|ico|woff2?|ttf|otf)$">
|
||||
Header set Cache-Control "public, max-age=2592000"
|
||||
</FilesMatch>
|
||||
|
||||
# API + PHP : jamais de cache
|
||||
<FilesMatch "\.(php)$">
|
||||
Header set Cache-Control "no-store"
|
||||
</FilesMatch>
|
||||
</IfModule>
|
||||
@@ -0,0 +1,59 @@
|
||||
# AGENTS.md — Instructions pour les agents IA
|
||||
|
||||
> Fichier de référence pour les agents IA (Codebuff, Cursor, Claude Code, GitHub Copilot…) qui travaillent sur un dépôt de l'organisation **FWS**. Un agent doit lire ce fichier en premier : il contient les instructions à respecter. Le `README.md` présente l'organisation et le `CONTRIBUTING.md` détaille les conventions de collaboration.
|
||||
|
||||
## Contexte
|
||||
|
||||
- **FWS** est une organisation open source multi-projets : chaque projet choisit librement sa stack technique (sans restriction de langage).
|
||||
- Projet principal : **FWS ISO** — une distribution Linux basée sur Arch Linux, pensée pour simplifier l'installation et l'usage au quotidien.
|
||||
- Conventions détaillées : `CONTRIBUTING.md` (FR) / `CONTRIBUTING.en.md` (EN).
|
||||
|
||||
## Règles à respecter
|
||||
|
||||
### Commits
|
||||
|
||||
- Messages en **anglais**, format **Conventional Commits** : `<type>(<portée>): <description>`.
|
||||
- Types autorisés : `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`.
|
||||
- Titre court et impératif ; un corps n'est ajouté que pour expliquer le **pourquoi**, pas le comment.
|
||||
|
||||
### Nommage
|
||||
|
||||
- Branches : `type/description` (ex. `feat/login`, `fix/typo`).
|
||||
- Fichiers : **kebab-case** (ex. `my-component.ts`).
|
||||
- Identifiants (variables, fonctions, classes) : **anglais**.
|
||||
|
||||
### Code & commentaires
|
||||
|
||||
- Commentaires en **anglais**, style « pourquoi » : pas de commentaire si le code est explicite ; documenter le non-évident (choix d'implémentation, compromis, cas limites).
|
||||
- Respecter la stack technique et les conventions existantes du dépôt avant d'ajouter de nouvelles dépendances.
|
||||
|
||||
### Fichiers sensibles (`.gitignore`)
|
||||
|
||||
- Ne **jamais** versionner : fichiers d'environnement (`.env*`), données d'assistants de développement (`.freebuff/`), artefacts compilés (`dist/`, `build/`, `target/`, `__pycache__/`…), dépendances (`node_modules/`), secrets.
|
||||
- Un `.gitignore` doit exister à la racine de chaque dépôt.
|
||||
|
||||
### Tests
|
||||
|
||||
- Fichiers de test : `*.test.*` ; noms de tests `describe` / `it` en anglais.
|
||||
- Vérifier que les tests (et le typecheck / lint quand ils existent) passent avant de considérer une tâche terminée.
|
||||
|
||||
### Issues & signalement de bugs
|
||||
|
||||
- Les bugs et demandes sont suivis via les **issues** et, lorsqu'il existe, le tableau Kanban du projet.
|
||||
- Une pull request qui corrige un bug référence l'issue dans son titre ou sa description (`Fixes #123`).
|
||||
- Ne pas fermer ni modifier une issue sans demande explicite de l'utilisateur.
|
||||
|
||||
### Commits demandés par l'utilisateur
|
||||
|
||||
- Lorsque l'utilisateur demande explicitement de créer un commit, l'IA doit le faire après avoir vérifié les changements et les contrôles disponibles, sans attendre une confirmation supplémentaire.
|
||||
- Le titre et le corps du commit ne doivent jamais mentionner l'IA, l'assistant, Codebuff ou l'outil utilisé.
|
||||
- Ne pas ajouter l'IA comme auteur ou co-auteur dans le message du commit.
|
||||
|
||||
## Bonnes pratiques pour un agent
|
||||
|
||||
- Lire `AGENTS.md`, le `README.md` et le `CONTRIBUTING.md` avant d'éditer du code.
|
||||
- Les commits doivent être signés.
|
||||
- Faire les changements les plus petits possibles qui répondent à la demande.
|
||||
- Ne pas pousser, fusionner ni publier sans demande explicite de l'utilisateur.
|
||||
- Suivre les cartes du tableau Kanban lorsqu'il existe pour organiser le travail.
|
||||
- En cas de doute, demander plutôt que de deviner.
|
||||
+47
-144
@@ -1,154 +1,57 @@
|
||||
# Fonctionnement du JavaScript
|
||||
# Fonctionnement du site (PHP)
|
||||
|
||||
Ce projet fonctionne comme un site statique avec un seul point d'entrée HTML. Le JavaScript sert à lire l'URL, charger le bon fichier dans `p/`, injecter son contenu dans le `main`, et reprendre aussi les styles définis dans le `<head>` de la page chargée.
|
||||
Le site est **entièrement rendu côté serveur (PHP)**. Il n'y a plus de routeur
|
||||
JavaScript : chaque URL sert une page HTML complète. Les seuls scripts restants
|
||||
sont des améliorations progressives (carrousel, menu déroulant, « Voir plus »).
|
||||
|
||||
## Principe général
|
||||
## Architecture
|
||||
|
||||
1. `index.html` garde le header, le footer et le conteneur principal.
|
||||
2. Chaque page vit dans un dossier sous `p/`.
|
||||
3. Le script lit la route demandée dans l'URL.
|
||||
4. Le script charge `p/<route>/index.html` avec `fetch`.
|
||||
5. Le contenu de la page est injecté dans le `main`.
|
||||
6. Les styles déclarés dans le `head` de cette page sont copiés dans le `head` du document courant.
|
||||
1. **`page.php`** (racine) est le point d'entrée unique. Il lit la route dans
|
||||
l'URL (`?p/dl/`, `?p=dl`, `?p/paquets/1/`…), inclut le corps de page
|
||||
correspondant, puis assemble la coquille (header/nav/footer).
|
||||
2. **`inc/site.php`** contient les helpers : connexion SQLite partagée,
|
||||
paquets (base + fusion des releases Gitea), fetch HTTP avec cache fichier
|
||||
(`cache/`, gitignoré), rendu Markdown (portage PHP de l'ancien
|
||||
`downloads.js`), dates en français, troncature HTML.
|
||||
3. **`p/<route>/index.php`** (et `p/paquets/detail.php` pour `/?p/paquets/N/`)
|
||||
contiennent le corps de chaque page. Ils définissent `$title`,
|
||||
`$description`, `$extraCss[]` et `$extraJs[]` avant l'affichage.
|
||||
4. `index.php` à la racine délègue à `page.php` (DirectoryIndex Apache).
|
||||
|
||||
## Données
|
||||
|
||||
- **Paquets** : table SQLite `packages` (base `api/bugs/data/fws_bugs.sqlite`,
|
||||
partagée avec le panneau d'admin). Éditables dans `/admin/bugs` (onglet
|
||||
📦 Paquets) + bouton 🔄 Gitea qui synchronise `latest` et l'historique depuis
|
||||
l'API Gitea du dépôt lié. Repli automatique sur `p/paquets/packages.json`
|
||||
si la base est vide. API publique conservée : `/api/packages.php`.
|
||||
- **Téléchargements** : releases ISO rendues serveur — Gitea `FWS/ISO` s'il
|
||||
existe, sinon GitHub (cache 10 min dans `cache/`).
|
||||
- **Équipe** : rendu serveur depuis `p/equipe/creators.json`.
|
||||
|
||||
## Fichiers impliqués
|
||||
|
||||
- [index.html](../index.html) contient le chrome global du site.
|
||||
- [p/assets/main-nav/app.js](../p/assets/main-nav/app.js) contient le routeur JavaScript.
|
||||
- [p/index/index.html](../p/index/index.html) contient la page principale.
|
||||
- [p/dl/index.html](../p/dl/index.html) contient la page DL.
|
||||
- [page.php](../page.php) — front controller + coquille HTML.
|
||||
- [inc/site.php](../inc/site.php) — helpers (DB, Gitea/GitHub, Markdown…).
|
||||
- [index.php](../index.php) — shim vers `page.php`.
|
||||
- `p/index|dl|paquets|equipe|contact/index.php`, `p/paquets/detail.php`,
|
||||
`p/404.php` — corps de pages.
|
||||
- [p/assets/main-nav/nav.js](../p/assets/main-nav/nav.js) — ouverture du menu
|
||||
déroulant Paquets.
|
||||
- [p/assets/js/note-toggle.js](../p/assets/js/note-toggle.js) — « Voir plus /
|
||||
Voir moins » de la note de release.
|
||||
- [p/assets/js/hero-carousel.js](../p/assets/js/hero-carousel.js) — carrousel
|
||||
de l'accueil.
|
||||
|
||||
## Comment le script lit l'URL
|
||||
## Supprimés (devenus inutiles avec le rendu serveur)
|
||||
|
||||
La fonction `routeFromLocation()` lit la route courante depuis plusieurs formes possibles d'URL.
|
||||
- `index.html` (racine), tous les `p/**/index.html`
|
||||
- `p/assets/main-nav/app.js` (routeur SPA)
|
||||
- `p/assets/js/packages.js`, `downloads.js`, `creators-loader.js`
|
||||
|
||||
Exemples reconnus:
|
||||
## Panneau admin & API (inchangés dans leur principe)
|
||||
|
||||
- `/?p/index/`
|
||||
- `/?p/dl/`
|
||||
- `/?p=contact`
|
||||
- `/p/about/`
|
||||
|
||||
La fonction `normalizeRoute(value)` nettoie ensuite la valeur pour obtenir une route simple comme `index`, `dl` ou `contact`.
|
||||
|
||||
## Chargement du contenu
|
||||
|
||||
La fonction `loadRoute(route)` fait le chargement réel.
|
||||
|
||||
### Route principale
|
||||
|
||||
Pour la route `index`, le script charge:
|
||||
|
||||
```text
|
||||
p/index/index.html
|
||||
```
|
||||
|
||||
### Autres routes
|
||||
|
||||
Pour une route comme `dl`, le script charge:
|
||||
|
||||
```text
|
||||
p/dl/index.html
|
||||
```
|
||||
|
||||
Le fichier chargé doit contenir un bloc avec `data-page-content`:
|
||||
|
||||
```html
|
||||
<main data-page-content>
|
||||
...
|
||||
</main>
|
||||
```
|
||||
|
||||
Le script n'injecte pas tout le document dans la page courante. Il prend seulement le contenu à l'intérieur de cet élément.
|
||||
|
||||
## Injection des styles du head
|
||||
|
||||
Le routeur copie maintenant aussi les balises suivantes depuis le `head` de la page chargée:
|
||||
|
||||
- `link rel="stylesheet"`
|
||||
- `style`
|
||||
|
||||
Ces balises sont clonées dans le `head` du document principal avec un attribut de suivi `data-page-style`.
|
||||
|
||||
Avant d'ajouter les nouveaux styles, le script supprime les styles injectés par la route précédente pour éviter les doublons et les conflits.
|
||||
|
||||
Exemple dans une page custom:
|
||||
|
||||
```html
|
||||
<head>
|
||||
<link rel="stylesheet" href="./page.css" />
|
||||
<style>
|
||||
.hero {
|
||||
background: black;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
```
|
||||
|
||||
Si cette page est chargée, le CSS est repris automatiquement.
|
||||
|
||||
## Mise à jour de l'URL
|
||||
|
||||
Après le chargement, le script met à jour l'URL avec l'API History.
|
||||
|
||||
Exemples:
|
||||
|
||||
- `index` devient `/?p/index/`
|
||||
- `dl` devient `/?p/dl/`
|
||||
|
||||
Le navigateur garde donc une URL partageable, sans recharger complètement la page.
|
||||
|
||||
## Navigation au clic
|
||||
|
||||
Le script écoute les clics sur les liens qui possèdent `data-route`.
|
||||
|
||||
Quand tu cliques sur un lien:
|
||||
|
||||
1. il bloque la navigation normale avec `event.preventDefault()`;
|
||||
2. il lit `data-route`;
|
||||
3. il appelle `render(route)`;
|
||||
4. il charge la page correspondante dans le `main`;
|
||||
5. il applique aussi ses styles de page.
|
||||
|
||||
## Retour arrière du navigateur
|
||||
|
||||
Le script écoute l'événement `popstate`.
|
||||
|
||||
Cela permet de revenir en arrière ou d'avancer dans l'historique tout en rechargeant la bonne route et les bons styles.
|
||||
|
||||
## Ajouter une nouvelle page
|
||||
|
||||
Pour ajouter une page, crée un nouveau dossier sous `p/`.
|
||||
|
||||
Exemple pour une page contact:
|
||||
|
||||
```text
|
||||
p/contact/index.html
|
||||
```
|
||||
|
||||
Puis ajoute éventuellement un fichier CSS dans cette page via son `head`.
|
||||
|
||||
Enfin, ajoute un lien dans `index.html`:
|
||||
|
||||
```html
|
||||
<a href="/?p/contact/" data-route="contact">Contact</a>
|
||||
```
|
||||
|
||||
Le JavaScript n'a pas besoin d'être modifié tant que la structure reste la même.
|
||||
|
||||
## Ce que ce système n'utilise pas
|
||||
|
||||
Ce projet n'utilise pas:
|
||||
|
||||
- Node.js,
|
||||
- un bundler,
|
||||
- un framework front,
|
||||
- des fichiers `.html` séparés dans la racine pour chaque page.
|
||||
|
||||
Tout repose sur un site statique et un routeur JavaScript léger.
|
||||
|
||||
## Point important
|
||||
|
||||
Le chargement via `fetch` fonctionne mieux quand le site est servi par un serveur statique, comme Five Server.
|
||||
|
||||
Si tu ouvres le fichier en `file://`, le navigateur peut bloquer l'accès aux fichiers internes pour des raisons de sécurité.
|
||||
- `admin/bugs/index.php` — signalements, invitations/comptes, paquets.
|
||||
- `admin/bugs/build.php` — onglet « Build ISO » (réservé au compte admin).
|
||||
- `api/bugs.php` — réception des signalements (`curl` ou navigateur).
|
||||
- `api/packages.php` — paquets au format JSON (consommé par des tiers).
|
||||
@@ -1,16 +1,75 @@
|
||||
Site statique one-page.
|
||||
Site du projet FWS Linux, rendu côté serveur en PHP.
|
||||
|
||||
Le projet ne dépend pas de Node.js, ni d'un build, ni d'un bundler.
|
||||
Aucune dépendance Node.js, aucun build, aucun bundler : `page.php` est le point
|
||||
d'entrée unique et assemble chaque page (header, nav, contenu, footer).
|
||||
|
||||
Utilisation:
|
||||
## Lancer le site en local
|
||||
|
||||
1. Ouvrir `index.html` dans un navigateur, ou
|
||||
2. Le servir avec n'importe quel serveur statique local, comme Five Server.
|
||||
Prérequis : **PHP 8** (avec les extensions `pdo_sqlite` et `sqlite3` pour les
|
||||
paquets ; le site reste fonctionnel sans elles, avec un repli sur
|
||||
`p/paquets/packages.json`).
|
||||
|
||||
Navigation:
|
||||
```bash
|
||||
bash tools/serve.sh # http://127.0.0.1:8080
|
||||
HOST=0.0.0.0 PORT=8080 bash tools/serve.sh # accessible depuis le réseau
|
||||
```
|
||||
|
||||
- `/?p/index/` charge `p/index/index.html` dans le `main`
|
||||
- `/?p/dl/` charge `p/dl/index.html` dans le `main`
|
||||
- Chaque sous-dossier de `p/` peut devenir une route, par exemple `p/contact/index.html` pour `/?p/contact/`
|
||||
- Les balises `link rel="stylesheet"` et `style` placées dans le `head` d'une page sont injectées automatiquement
|
||||
- Le header et le footer restent communs à toutes les vues
|
||||
Sous Windows (cmd / PowerShell) :
|
||||
|
||||
```bat
|
||||
tools\serve.cmd
|
||||
```
|
||||
|
||||
Ou directement, sans script :
|
||||
|
||||
```bash
|
||||
php -S 127.0.0.1:8080 tools/router.php
|
||||
```
|
||||
|
||||
`tools/router.php` reproduit le comportement du `.htaccess` de production
|
||||
(URLs propres, page 404 du site, assets, API, admin) : ce que vous voyez en
|
||||
local est identique au serveur. Un simple `php -S 127.0.0.1:8080` fonctionne
|
||||
aussi pour les routes `?p/…`, mais sans la page 404 personnalisée.
|
||||
|
||||
> **Apache (WAMP/XAMPP, production) :** déployer le contenu du dépôt dans la
|
||||
> racine web et activer `AllowOverride All` pour que `.htaccess` s'applique.
|
||||
> Le site fonctionne aussi dans un sous-dossier (`/FWS-Website/`) : les URLs
|
||||
> sont calculées à partir de la requête.
|
||||
|
||||
## Navigation
|
||||
|
||||
- `/?p/index/` — accueil
|
||||
- `/?p/dl/` — téléchargements
|
||||
- `/?p/paquets/`, `/?p/paquets/1/…` — paquets
|
||||
- `/?p/equipe/`, `/?p/contact/` — équipe, contact
|
||||
- `/?p/mentions-legales/`, `/?p/conditions/`, `/?p/confidentialite/` — légal
|
||||
- Toute autre route (ou erreur Apache 403/404) affiche la **page 404 animée**,
|
||||
avec Tux qui débranche un câble RJ45 d'un switch.
|
||||
|
||||
Les deux formes d'URL marchent : `?p=route` et `?p/route/`.
|
||||
|
||||
## Structure du projet
|
||||
|
||||
```
|
||||
.
|
||||
├── .htaccess # Config Apache (routing, cache, sécurité)
|
||||
├── index.php # Point d'entrée alternatif → page.php
|
||||
├── page.php # Front controller : coquille + résolution des routes
|
||||
├── inc/ # Bibliothèque du site (données, erreurs, markdown)
|
||||
├── p/ # Pages du site
|
||||
│ ├── 404.php # Page 404 (scène Tux + switch)
|
||||
│ ├── index/ dl/ … # Corps de chaque page (rendu serveur)
|
||||
│ └── assets/ # CSS, JS, images (img/, styles/, main-nav/, js/)
|
||||
├── api/bugs/ # API des signalements (SQLite)
|
||||
├── admin/bugs/ # Panneau d'administration
|
||||
├── cache/ # Cache HTTP local (généré, gitignoré)
|
||||
├── tools/ # Outils de développement (serveur local, routeur)
|
||||
└── Doc/ # Documentation du projet (Markdown)
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
||||
La documentation du projet est écrite en Markdown dans le dossier `Doc/` :
|
||||
|
||||
- [`Doc/fonctionnement-onepage.md`](Doc/fonctionnement-onepage.md) — historique
|
||||
du routeur côté client (le rendu est désormais côté serveur).
|
||||
@@ -0,0 +1,558 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS — Onglet « Build ISO » du panneau admin des signalements.
|
||||
*
|
||||
* URL : admin/bugs/build.php
|
||||
*
|
||||
* Réservé aux comptes autorisés (voir fws_bugs_can_build() dans
|
||||
* api/bugs/db.php, par défaut : « admin »). Lance le pipeline
|
||||
* admin/bugs/run-build.sh dans un process détaché (nohup) et expose un
|
||||
* mini-terminal : les logs sont lus en direct par polling (act=tail) et les
|
||||
* actions start / stop / clear sont protégées par CSRF comme le reste du
|
||||
* panneau.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../../api/bugs/db.php';
|
||||
|
||||
session_set_cookie_params([
|
||||
'httponly' => true,
|
||||
'samesite' => 'Lax',
|
||||
'secure' => (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || (($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https'),
|
||||
]);
|
||||
session_start();
|
||||
|
||||
function h_build(string $s): string
|
||||
{
|
||||
return htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
|
||||
function current_user_build(): ?array
|
||||
{
|
||||
return isset($_SESSION['admin_user_id']) ? [
|
||||
'id' => (int) $_SESSION['admin_user_id'],
|
||||
'name' => (string) $_SESSION['admin_username'],
|
||||
] : null;
|
||||
}
|
||||
|
||||
function csrf_token_build(): string
|
||||
{
|
||||
if (empty($_SESSION['csrf'])) {
|
||||
$_SESSION['csrf'] = bin2hex(random_bytes(32));
|
||||
}
|
||||
return $_SESSION['csrf'];
|
||||
}
|
||||
|
||||
function csrf_ok_build(): bool
|
||||
{
|
||||
return hash_equals($_SESSION['csrf'] ?? '', $_POST['csrf'] ?? '');
|
||||
}
|
||||
|
||||
/** Lecture du token Gitea stocké localement (api/bugs/data/build/git-auth.env, jamais commité). */
|
||||
function build_gitea_auth_build(): array
|
||||
{
|
||||
global $DATA;
|
||||
$f = $DATA . '/git-auth.env';
|
||||
$out = ['username' => '', 'token' => ''];
|
||||
if (is_file($f)) {
|
||||
$s = (string) file_get_contents($f);
|
||||
if (preg_match("/^FWS_GIT_USER='([^']*)'$/m", $s, $m) === 1) {
|
||||
$out['username'] = $m[1];
|
||||
}
|
||||
if (preg_match("/^FWS_GIT_TOKEN='([^']*)'$/m", $s, $m) === 1) {
|
||||
$out['token'] = $m[1];
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/** Écriture du token Gitea (token vide → fichier retiré). */
|
||||
function build_save_gitea_auth_build(string $username, string $token): void
|
||||
{
|
||||
global $DATA;
|
||||
if (!is_dir($DATA)) {
|
||||
@mkdir($DATA, 0775, true);
|
||||
}
|
||||
$f = $DATA . '/git-auth.env';
|
||||
if ($token === '') {
|
||||
@unlink($f);
|
||||
return;
|
||||
}
|
||||
$sq = static fn(string $v): string => str_replace(["\\", "'"], ["\\\\", "\\'"], $v);
|
||||
file_put_contents(
|
||||
$f,
|
||||
"FWS_GIT_USER='" . $sq($username !== '' ? $username : 'fws') . "'\n" .
|
||||
"FWS_GIT_TOKEN='" . $sq($token) . "'\n",
|
||||
LOCK_EX
|
||||
);
|
||||
@chmod($f, 0600);
|
||||
}
|
||||
|
||||
/* ── Chemins (sous api/bugs/data/, jamais commité) ── */
|
||||
|
||||
$DATA = __DIR__ . '/../../api/bugs/data/build';
|
||||
$LOG = $DATA . '/build.log';
|
||||
$PIDF = $DATA . '/build.pid';
|
||||
$RUN = __DIR__ . '/run-build.sh';
|
||||
|
||||
$user = current_user_build();
|
||||
|
||||
/** PID du process de build s'il tourne encore, sinon false. */
|
||||
function build_running_build(): int|false
|
||||
{
|
||||
global $PIDF;
|
||||
$pid = is_file($PIDF) ? trim((string) file_get_contents($PIDF)) : '';
|
||||
if ($pid === '' || !ctype_digit($pid)) {
|
||||
return false;
|
||||
}
|
||||
exec('kill -0 ' . (int) $pid . ' 2>/dev/null', $out, $rc);
|
||||
return $rc === 0 ? (int) $pid : false;
|
||||
}
|
||||
|
||||
/** Dernier code de sortie du pipeline lu dans le log (null si pas encore terminé). */
|
||||
function build_last_rc_build(): ?int
|
||||
{
|
||||
global $LOG;
|
||||
if (!is_file($LOG) || filesize($LOG) === 0) {
|
||||
return null;
|
||||
}
|
||||
$tail = (string) file_get_contents($LOG, false, null, max(0, filesize($LOG) - 4096));
|
||||
if (preg_match('/Fin du pipeline \(code (-?\d+)\)/', $tail, $m) === 1) {
|
||||
return (int) $m[1];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* ───────────────────────── API (act=…) ───────────────────────── */
|
||||
|
||||
$act = $_GET['act'] ?? $_POST['act'] ?? '';
|
||||
$isApi = $act !== '';
|
||||
|
||||
if ($isApi) {
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
header('Cache-Control: no-store');
|
||||
|
||||
if ($user === null) {
|
||||
http_response_code(401);
|
||||
exit(json_encode(['ok' => false, 'error' => 'Non connecté.']));
|
||||
}
|
||||
if (!fws_bugs_can_build($user['name'])) {
|
||||
http_response_code(403);
|
||||
exit(json_encode(['ok' => false, 'error' => 'Ce compte n’est pas autorisé à lancer des builds.']));
|
||||
}
|
||||
|
||||
$running = build_running_build();
|
||||
|
||||
if ($act === 'state') {
|
||||
echo json_encode(['ok' => true, 'running' => $running !== false, 'pid' => $running]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($act === 'auth_status') {
|
||||
$a = build_gitea_auth_build();
|
||||
echo json_encode(['ok' => true, 'configured' => $a['token'] !== '', 'username' => $a['username']]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($act === 'tail') {
|
||||
$pos = max(-1, (int) ($_GET['pos'] ?? 0));
|
||||
$size = is_file($LOG) ? (int) filesize($LOG) : 0;
|
||||
$start = 0;
|
||||
if ($pos === -1) {
|
||||
// Premier chargement : ne ramener que la fin d'un éventuel vieux log.
|
||||
$start = max(0, $size - 150000);
|
||||
} elseif ($pos > 0 && $pos <= $size) {
|
||||
$start = $pos;
|
||||
}
|
||||
$text = '';
|
||||
if ($size > $start) {
|
||||
$fh = fopen($LOG, 'rb');
|
||||
if ($fh !== false) {
|
||||
if ($start > 0) {
|
||||
fseek($fh, $start);
|
||||
}
|
||||
$raw = (string) stream_get_contents($fh);
|
||||
fclose($fh);
|
||||
// Nettoyage : codes ANSI retirés, octets invalides ignorés.
|
||||
$text = (string) preg_replace('/\x1B\[[0-9;?]*[ -\/]*[@-~]/', '', $raw);
|
||||
$text = (string) preg_replace('/\x1B\][^\x07\x1B]*(\x07|\x1B\\)/', '', $text);
|
||||
$text = iconv('UTF-8', 'UTF-8//IGNORE', $text);
|
||||
}
|
||||
}
|
||||
$running = build_running_build();
|
||||
echo json_encode([
|
||||
'ok' => true,
|
||||
'running' => $running !== false,
|
||||
'pos' => (int) $size,
|
||||
'rc' => build_last_rc_build(),
|
||||
'text' => $text,
|
||||
]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if (($_SERVER['REQUEST_METHOD'] ?? '') !== 'POST' || !csrf_ok_build()) {
|
||||
http_response_code(403);
|
||||
exit(json_encode(['ok' => false, 'error' => 'Jeton de sécurité invalide.']));
|
||||
}
|
||||
|
||||
if ($act === 'start') {
|
||||
if ($running !== false) {
|
||||
http_response_code(409);
|
||||
exit(json_encode(['ok' => false, 'error' => 'Un build est déjà en cours.']));
|
||||
}
|
||||
exec('timeout 8 docker info >/dev/null 2>&1', $out, $drc);
|
||||
if ($drc !== 0) {
|
||||
http_response_code(503);
|
||||
exit(json_encode(['ok' => false, 'error' => 'Moteur Docker injoignable (Docker Desktop arrêté ?).']));
|
||||
}
|
||||
if (!is_dir($DATA) && !@mkdir($DATA, 0775, true)) {
|
||||
http_response_code(500);
|
||||
exit(json_encode(['ok' => false, 'error' => 'Impossible de créer ' . $DATA]));
|
||||
}
|
||||
@unlink($LOG);
|
||||
@unlink($PIDF);
|
||||
$cmd = 'nohup bash ' . escapeshellarg($RUN) . ' </dev/null >> ' . escapeshellarg($LOG) . ' 2>&1 & echo $!';
|
||||
exec($cmd, $out2, $src);
|
||||
$pid = (int) ($out2[0] ?? 0);
|
||||
if ($pid > 0) {
|
||||
file_put_contents($PIDF, (string) $pid);
|
||||
}
|
||||
echo json_encode(['ok' => $src === 0 && $pid > 0, 'pid' => $pid]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($act === 'stop') {
|
||||
exec('docker rm -f fws-iso-build >/dev/null 2>&1', $o1, $rc1);
|
||||
$stopped = $running;
|
||||
if ($running !== false) {
|
||||
exec('kill ' . $running . ' 2>/dev/null');
|
||||
@unlink($PIDF);
|
||||
}
|
||||
echo json_encode(['ok' => true, 'stopped' => $stopped !== false || $rc1 === 0]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($act === 'clear') {
|
||||
if ($running !== false) {
|
||||
http_response_code(409);
|
||||
exit(json_encode(['ok' => false, 'error' => 'Arrêtez d’abord le build en cours.']));
|
||||
}
|
||||
@unlink($LOG);
|
||||
@unlink($PIDF);
|
||||
echo json_encode(['ok' => true]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($act === 'save_auth') {
|
||||
build_save_gitea_auth_build(
|
||||
trim((string) ($_POST['username'] ?? '')),
|
||||
trim((string) ($_POST['token'] ?? ''))
|
||||
);
|
||||
$a = build_gitea_auth_build();
|
||||
echo json_encode(['ok' => true, 'configured' => $a['token'] !== '', 'username' => $a['username']]);
|
||||
exit;
|
||||
}
|
||||
|
||||
http_response_code(400);
|
||||
exit(json_encode(['ok' => false, 'error' => 'Action inconnue.']));
|
||||
}
|
||||
|
||||
/* ───────────────────────── PAGES ───────────────────────── */
|
||||
|
||||
if ($user === null) {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
$allowed = fws_bugs_can_build($user['name']);
|
||||
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
?><!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex,nofollow">
|
||||
<title>Build ISO — FWS Linux</title>
|
||||
<style>
|
||||
:root { color-scheme: dark; }
|
||||
* { box-sizing: border-box; }
|
||||
body {
|
||||
margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
|
||||
background: #0b1120; color: #e2e8f0; line-height: 1.5;
|
||||
}
|
||||
.wrap { max-width: 1000px; margin: 0 auto; padding: 24px 16px 80px; }
|
||||
header.top {
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
gap: 12px; padding: 14px 0; border-bottom: 1px solid #1e293b; margin-bottom: 20px;
|
||||
}
|
||||
header.top h1 { font-size: 1.15rem; margin: 0; }
|
||||
header.top .sub { font-size: .8rem; color: #94a3b8; }
|
||||
a { color: #38bdf8; text-decoration: none; }
|
||||
a:hover { text-decoration: underline; }
|
||||
.btn {
|
||||
display: inline-block; border: 1px solid #334155; background: #1e293b; color: #e2e8f0;
|
||||
padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: .85rem;
|
||||
text-decoration: none; line-height: 1.4;
|
||||
}
|
||||
.btn:hover { background: #334155; text-decoration: none; }
|
||||
.btn.primary { background: #0284c7; border-color: #0284c7; color: #fff; }
|
||||
.btn.danger { background: transparent; border-color: #7f1d1d; color: #f87171; }
|
||||
.btn.danger:hover { background: #7f1d1d; color: #fff; }
|
||||
.btn:disabled { opacity: .45; cursor: not-allowed; }
|
||||
.card {
|
||||
background: #111a2e; border: 1px solid #1e293b; border-radius: 12px;
|
||||
padding: 16px; margin-bottom: 12px;
|
||||
}
|
||||
.card h3 { margin: 0 0 4px; font-size: 1rem; }
|
||||
.card .meta { font-size: .78rem; color: #94a3b8; display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px; }
|
||||
.navtabs { display: flex; gap: 8px; margin: 0 0 16px; }
|
||||
.navtabs a { border: 1px solid #334155; padding: 5px 14px; border-radius: 99px; font-size: .85rem; text-decoration: none; color: #cbd5e1; }
|
||||
.navtabs a.active { background: #0284c7; border-color: #0284c7; color: #fff; }
|
||||
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: .9rem; }
|
||||
.flash.err { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
|
||||
.status-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
|
||||
.dot { width: 10px; height: 10px; border-radius: 50%; background: #64748b; flex: none; }
|
||||
.dot.run { background: #4ade80; animation: pulse 1.2s ease-in-out infinite; }
|
||||
@keyframes pulse { 50% { opacity: .25; } }
|
||||
pre.term {
|
||||
background: #020617; border: 1px solid #1e293b; border-radius: 8px;
|
||||
padding: 12px; overflow: auto; max-height: 62vh; font-size: .76rem; line-height: 1.45;
|
||||
white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Consolas, "Cascadia Mono", monospace;
|
||||
color: #bae6fd;
|
||||
}
|
||||
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
|
||||
.hint { font-size: .78rem; color: #64748b; margin-top: 10px; }
|
||||
.hint code { background: #0b1120; border: 1px solid #1e293b; padding: 1px 5px; border-radius: 6px; }
|
||||
#authForm { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-top: 6px; }
|
||||
#authForm label { font-size: .78rem; color: #94a3b8; display: block; margin-bottom: 2px; }
|
||||
#authForm input[type=text], #authForm input[type=password] {
|
||||
width: 230px; padding: 7px 9px; background: #0b1120; border: 1px solid #334155;
|
||||
border-radius: 8px; color: #e2e8f0; font-size: .9rem;
|
||||
}
|
||||
#authState { font-size: .8rem; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
|
||||
<header class="top">
|
||||
<div>
|
||||
<h1>🔨 Build ISO</h1>
|
||||
<div class="sub">Connecté : <?= h_build($user['name']) ?> · dépôt : <code>D:\FWS-ISO</code> (branche main)</div>
|
||||
</div>
|
||||
<form method="post" action="index.php">
|
||||
<input type="hidden" name="action" value="logout">
|
||||
<input type="hidden" name="csrf" value="<?= h_build(csrf_token_build()) ?>">
|
||||
<button class="btn" type="submit">Déconnexion</button>
|
||||
</form>
|
||||
</header>
|
||||
|
||||
<div class="navtabs">
|
||||
<a href="index.php">🐞 Signalements</a>
|
||||
<a href="index.php?view=invites">👥 Invitations & comptes</a>
|
||||
<a href="build.php" class="active">🔨 Build ISO</a>
|
||||
</div>
|
||||
|
||||
<?php if (!$allowed): ?>
|
||||
<div class="card">
|
||||
<h3>Accès restreint</h3>
|
||||
<p>Votre compte (<strong><?= h_build($user['name']) ?></strong>) n'est pas autorisé à lancer des builds.
|
||||
Seul le compte <code>admin</code> le peut (voir <code>fws_bugs_can_build()</code> dans <code>api/bugs/db.php</code>).</p>
|
||||
<a class="btn" href="index.php">← Retour aux signalements</a>
|
||||
</div>
|
||||
|
||||
<?php else: ?>
|
||||
|
||||
<div class="card">
|
||||
<h3>🔑 Accès Gitea (pour le git pull)</h3>
|
||||
<p style="font-size:.82rem;color:#cbd5e1;margin:6px 0 2px">
|
||||
Le dépôt <code>D:\FWS-ISO</code> est privé et le build tourne dans un conteneur sans tes identifiants
|
||||
Windows : crée un token dans Gitea (<em>Settings → Applications → Generate New Token</em>, lecture du dépôt)
|
||||
puis enregistre-le ici. Il n'est stocké que sur ce serveur — jamais commité, jamais affiché dans les logs.
|
||||
</p>
|
||||
<span id="authState">…</span>
|
||||
<form id="authForm">
|
||||
<div>
|
||||
<label for="gUser">Utilisateur Gitea (défaut : fws)</label>
|
||||
<input type="text" id="gUser" name="username" autocomplete="off">
|
||||
</div>
|
||||
<div>
|
||||
<label for="gToken">Token</label>
|
||||
<input type="password" id="gToken" name="token" autocomplete="off" placeholder="token de lecture">
|
||||
</div>
|
||||
<button class="btn primary" type="submit">Enregistrer</button>
|
||||
<button class="btn danger" type="button" id="gClear">Retirer</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>🖥️ Terminal du build</h3>
|
||||
<div class="meta">
|
||||
<span id="stateLabel">État : inconnu…</span>
|
||||
<span>· Git Bash lancerait ici : <code style="font-size:.95em">git checkout main && git pull && bash build.sh</code></span>
|
||||
</div>
|
||||
|
||||
<pre class="term" id="term">Chargement du terminal…</pre>
|
||||
|
||||
<div class="actions">
|
||||
<button class="btn primary" id="btnStart" type="button">▶ Lancer le build</button>
|
||||
<button class="btn danger" id="btnStop" type="button">⏹ Arrêter</button>
|
||||
<button class="btn" id="btnClear" type="button">🗑 Effacer le log</button>
|
||||
<span id="rcLabel"></span>
|
||||
</div>
|
||||
|
||||
<p class="hint">
|
||||
Le build se déroule dans un conteneur <code>archlinux</code> jetable (via Docker Desktop, comme
|
||||
<code>build.sh</code> à la main) : passage sur <code>main</code> → <code>git pull</code> → <code>bash build.sh</code> ;
|
||||
en cas d'échec de build, <code>bash setup-aur.sh</code> est lancé puis <code>build.sh</code> est relancé.
|
||||
Si le checkout de <code>main</code> est bloqué par des modifications locales non commitées dans
|
||||
<code>D:\FWS-ISO</code>, le build s'arrête proprement sans rien toucher. L'ISO sort dans
|
||||
<code>D:\FWS-ISO\out\</code>. Peut prendre 30 min et plus — laissez l'onglet ouvert, les logs défilent en direct.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
(() => {
|
||||
const allowed = <?= $allowed ? 'true' : 'false' ?>;
|
||||
if (!allowed) return;
|
||||
|
||||
const CSRF = <?= json_encode(csrf_token_build()) ?>;
|
||||
const term = document.getElementById('term');
|
||||
const btnS = document.getElementById('btnStart');
|
||||
const btnT = document.getElementById('btnStop');
|
||||
const btnC = document.getElementById('btnClear');
|
||||
const stateL = document.getElementById('stateLabel');
|
||||
const rcL = document.getElementById('rcLabel');
|
||||
const csrfP = new URLSearchParams();
|
||||
csrfP.set('csrf', CSRF);
|
||||
|
||||
let pos = -1;
|
||||
let running = null;
|
||||
let finishedRc = null;
|
||||
|
||||
const authState = document.getElementById('authState');
|
||||
const authForm = document.getElementById('authForm');
|
||||
const gUser = document.getElementById('gUser');
|
||||
const gToken = document.getElementById('gToken');
|
||||
const gClear = document.getElementById('gClear');
|
||||
|
||||
async function refreshAuth() {
|
||||
const r = await api('auth_status');
|
||||
if (r.json && r.json.ok) {
|
||||
authState.textContent = r.json.configured
|
||||
? '✅ Token Gitea enregistré' + (r.json.username ? ' (compte : ' + r.json.username + ')' : '')
|
||||
: '⚠️ Aucun token Gitea : le git pull échouera (dépôt privé).';
|
||||
}
|
||||
}
|
||||
|
||||
authForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const p = new URLSearchParams(csrfP);
|
||||
p.set('username', gUser.value.trim());
|
||||
p.set('token', gToken.value);
|
||||
const r = await api('save_auth', p);
|
||||
if (r.json && r.json.ok) {
|
||||
gUser.value = gToken.value = '';
|
||||
await refreshAuth();
|
||||
} else {
|
||||
alert(r.json && r.json.error ? r.json.error : 'Erreur.');
|
||||
}
|
||||
});
|
||||
|
||||
gClear.addEventListener('click', async () => {
|
||||
if (!confirm('Retirer le token Gitea enregistré ?')) return;
|
||||
const p = new URLSearchParams(csrfP);
|
||||
p.set('username', '');
|
||||
p.set('token', '');
|
||||
const r = await api('save_auth', p);
|
||||
if (r.json && r.json.ok) await refreshAuth();
|
||||
});
|
||||
|
||||
function stick() {
|
||||
const near = term.scrollHeight - term.scrollTop - term.clientHeight < 90;
|
||||
if (near || running !== false) term.scrollTop = term.scrollHeight;
|
||||
}
|
||||
|
||||
function setUI() {
|
||||
btnS.disabled = running === true;
|
||||
btnT.disabled = running !== true;
|
||||
btnC.disabled = running === true;
|
||||
const dot = document.querySelector('.status-line .dot') ||
|
||||
(() => { const d = document.createElement('span'); d.className = 'dot'; stateL.prepend(d); return d; })();
|
||||
dot.className = 'dot' + (running ? ' run' : '');
|
||||
if (running === true) {
|
||||
stateL.textContent = 'État : build en cours… ';
|
||||
} else if (running === false) {
|
||||
stateL.textContent = 'État : inactif. ';
|
||||
}
|
||||
}
|
||||
|
||||
async function api(act, body) {
|
||||
const opt = body
|
||||
? { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: body }
|
||||
: { method: 'GET' };
|
||||
const r = await fetch('build.php?act=' + encodeURIComponent(act), opt);
|
||||
return { status: r.status, json: await r.json().catch(() => null) };
|
||||
}
|
||||
|
||||
async function poll() {
|
||||
try {
|
||||
const r = await fetch('build.php?act=tail&pos=' + pos);
|
||||
const j = await r.json();
|
||||
if (!j || j.ok !== true) return;
|
||||
if (j.text && j.text !== '') {
|
||||
const wasEmpty = term.textContent === 'Chargement du terminal…';
|
||||
if (wasEmpty) term.textContent = '';
|
||||
const atEnd = term.scrollHeight - term.scrollTop - term.clientHeight < 90;
|
||||
term.textContent += j.text;
|
||||
if (running !== false || atEnd) term.scrollTop = term.scrollHeight;
|
||||
}
|
||||
pos = j.pos;
|
||||
if (j.running !== running) {
|
||||
running = j.running;
|
||||
if (!running && j.rc !== null) {
|
||||
finishedRc = j.rc;
|
||||
rcL.textContent = 'Code de sortie : ' + j.rc + (j.rc === 0 ? ' ✅' : ' ❌');
|
||||
}
|
||||
if (running) { rcL.textContent = ''; finishedRc = null; }
|
||||
setUI();
|
||||
}
|
||||
} catch (e) { /* requête interrompue (navigation…) : on réessaie au prochain tick */ }
|
||||
}
|
||||
|
||||
btnS.addEventListener('click', async () => {
|
||||
if (running === true) return;
|
||||
if (!confirm('Lancer le build ISO ?\n\nPassage sur main → git pull → bash build.sh'
|
||||
+ ' (repli setup-aur.sh en cas d' + '\u2019échec).\nLe dépôt D:\\FWS-ISO ne doit pas être utilisé ailleurs pendant le build.')) return;
|
||||
const p = new URLSearchParams(csrfP); p.set('act', 'start');
|
||||
const r = await api('start', p);
|
||||
if (r.json && r.json.ok) { pos = -1; await poll(); } else { alert(r.json && r.json.error ? r.json.error : 'Erreur au démarrage.'); }
|
||||
});
|
||||
|
||||
btnT.addEventListener('click', async () => {
|
||||
if (running !== true) return;
|
||||
if (!confirm('Arrêter le build en cours ?')) return;
|
||||
const p = new URLSearchParams(csrfP); p.set('act', 'stop');
|
||||
const r = await api('stop', p);
|
||||
if (r.json && r.json.ok) { await poll(); } else { alert(r.json && r.json.error ? r.json.error : 'Erreur à l' + '\u2019arrêt.'); }
|
||||
});
|
||||
|
||||
btnC.addEventListener('click', async () => {
|
||||
if (running === true) return;
|
||||
const p = new URLSearchParams(csrfP); p.set('act', 'clear');
|
||||
const r = await api('clear', p);
|
||||
if (r.json && r.json.ok) { term.textContent = ''; pos = -1; rcL.textContent = ''; } else { alert(r.json && r.json.error ? r.json.error : 'Erreur.'); }
|
||||
});
|
||||
|
||||
setUI();
|
||||
refreshAuth();
|
||||
poll();
|
||||
setInterval(poll, 1000);
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — Création / réinitialisation des comptes admin du panneau des signalements.
|
||||
*
|
||||
* À lancer DANS le conteneur (uniquement en CLI) :
|
||||
*
|
||||
* docker exec -it fws-files php /var/www/html/admin/bugs/init.php
|
||||
*
|
||||
* Utilisation :
|
||||
* php init.php # création interactive (1er compte)
|
||||
* php init.php --user=admin --pass=mdp # création non interactive
|
||||
* php init.php --reset --user=admin --pass=nouveaumdp
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (PHP_SAPI !== 'cli') {
|
||||
http_response_code(403);
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
exit("Accès interdit : script CLI uniquement.\n");
|
||||
}
|
||||
|
||||
require __DIR__ . '/../../api/bugs/db.php';
|
||||
|
||||
function prompt(string $label): string
|
||||
{
|
||||
echo $label;
|
||||
$line = fgets(STDIN);
|
||||
return $line === false ? '' : rtrim($line, "\r\n");
|
||||
}
|
||||
|
||||
$args = $_SERVER['argv'] ?? [];
|
||||
$user = null;
|
||||
$pass = null;
|
||||
$reset = false;
|
||||
|
||||
foreach ($args as $i => $arg) {
|
||||
if (str_starts_with($arg, '--user=')) {
|
||||
$user = substr($arg, 7);
|
||||
} elseif (str_starts_with($arg, '--pass=')) {
|
||||
$pass = substr($arg, 7);
|
||||
} elseif ($arg === '--reset') {
|
||||
$reset = true;
|
||||
}
|
||||
}
|
||||
|
||||
echo "── Signalements FWS — gestion des comptes admin ──\n\n";
|
||||
|
||||
try {
|
||||
$pdo = fws_bugs_db();
|
||||
} catch (Throwable $e) {
|
||||
fwrite(STDERR, 'Erreur base de données : ' . $e->getMessage() . "\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$count = (int) $pdo->query('SELECT COUNT(*) FROM admin_users')->fetchColumn();
|
||||
echo 'Comptes admin existants : ' . $count . "\n\n";
|
||||
|
||||
/* Mode interactif */
|
||||
if ($user === null) {
|
||||
$user = trim(prompt('Nom d\'utilisateur : '));
|
||||
$pass = prompt('Mot de passe (min. 8 caractères) : ');
|
||||
if ($count > 0) {
|
||||
$confirm = strtolower(trim(prompt('Un compte existe déjà : voulez-vous AJOUTER ce compte ? (oui/non) : ')));
|
||||
if ($confirm !== 'oui' && $confirm !== 'o' && $confirm !== 'y' && $confirm !== 'yes') {
|
||||
exit("Annulé.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$user = trim((string) $user);
|
||||
if ($user === '' || !preg_match('/^[A-Za-z0-9_.\-]{2,32}$/', $user)) {
|
||||
fwrite(STDERR, "Nom d'utilisateur invalide (2 à 32 caractères : lettres, chiffres, . _ -).\n");
|
||||
exit(1);
|
||||
}
|
||||
if (strlen((string) $pass) < 8) {
|
||||
fwrite(STDERR, "Mot de passe trop court (8 caractères minimum).\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$stmt = $pdo->prepare('SELECT id FROM admin_users WHERE username = :u');
|
||||
$stmt->execute([':u' => $user]);
|
||||
$existing = $stmt->fetch();
|
||||
|
||||
$hash = password_hash((string) $pass, PASSWORD_DEFAULT);
|
||||
|
||||
if ($existing !== false) {
|
||||
if (!$reset) {
|
||||
fwrite(STDERR, "L'utilisateur « $user » existe déjà. Utilisez --reset pour changer son mot de passe.\n");
|
||||
exit(1);
|
||||
}
|
||||
$up = $pdo->prepare('UPDATE admin_users SET password_hash = :h WHERE id = :id');
|
||||
$up->execute([':h' => $hash, ':id' => $existing['id']]);
|
||||
echo "✅ Mot de passe de « $user » réinitialisé.\n";
|
||||
} else {
|
||||
$uid = fws_bugs_next_id($pdo, 'admin_users');
|
||||
$ins = $pdo->prepare('INSERT INTO admin_users (id, username, password_hash) VALUES (:id, :u, :h)');
|
||||
$ins->execute([':id' => $uid, ':u' => $user, ':h' => $hash]);
|
||||
echo "✅ Utilisateur « $user » créé (id $uid).\n";
|
||||
}
|
||||
|
||||
echo "\nPanneau : https://fwslinux.fr/admin/bugs/\n";
|
||||
exit(0);
|
||||
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — Inscription au panneau des signalements.
|
||||
*
|
||||
* La personne reçoit un code d'invitation À USAGE UNIQUE (généré dans le
|
||||
* panneau admin, onglet « Invitations & comptes »), puis crée ici son
|
||||
* compte avec un nom d'utilisateur et un mot de passe.
|
||||
*
|
||||
* URL : https://fwslinux.fr/admin/bugs/register.php
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/../../api/bugs/db.php';
|
||||
|
||||
function h(?string $s): string
|
||||
{
|
||||
return htmlspecialchars((string) $s, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
|
||||
$error = null;
|
||||
$ok = false;
|
||||
|
||||
/* Petit anti-spam : champ piège */
|
||||
$honeypot = trim((string) ($_POST['website'] ?? ''));
|
||||
$submitted = ($_SERVER['REQUEST_METHOD'] === 'POST') && $honeypot === '';
|
||||
|
||||
if ($submitted) {
|
||||
$code = trim((string) ($_POST['code'] ?? ''));
|
||||
$username = trim((string) ($_POST['username'] ?? ''));
|
||||
$password = (string) ($_POST['password'] ?? '');
|
||||
$confirm = (string) ($_POST['password2'] ?? '');
|
||||
|
||||
try {
|
||||
$pdo = fws_bugs_db();
|
||||
|
||||
/* 1) Le code est-il valable ? */
|
||||
$invite = fws_bugs_find_invite($pdo, $code);
|
||||
if ($invite === null) {
|
||||
$error = 'Ce code d\'invitation est inconnu. Vérifiez qu\'il a bien été copié.';
|
||||
} elseif ($invite['revoked_at'] !== null) {
|
||||
$error = 'Ce code d\'invitation a été révoqué. Demandez-en un nouveau.';
|
||||
} elseif ($invite['used_by'] !== null) {
|
||||
$error = 'Ce code d\'invitation a déjà été utilisé.';
|
||||
} elseif ($invite['expires_at'] !== null && $invite['expires_at'] < date('Y-m-d H:i:s')) {
|
||||
$error = 'Ce code d\'invitation a expiré. Demandez-en un nouveau.';
|
||||
} elseif (!preg_match('/^[A-Za-z0-9_.\-]{2,32}$/', $username)) {
|
||||
$error = 'Nom d\'utilisateur invalide (2 à 32 caractères : lettres, chiffres, . _ -).';
|
||||
} elseif (strlen($password) < 8) {
|
||||
$error = 'Mot de passe trop court (8 caractères minimum).';
|
||||
} elseif ($password !== $confirm) {
|
||||
$error = 'Les deux mots de passe ne correspondent pas.';
|
||||
}
|
||||
|
||||
/* 2) Création du compte + consommation du code (transaction) */
|
||||
if ($error === null) {
|
||||
$pdo->beginTransaction();
|
||||
try {
|
||||
$hash = password_hash($password, PASSWORD_DEFAULT);
|
||||
$uid = fws_bugs_next_id($pdo, 'admin_users');
|
||||
$ins = $pdo->prepare('INSERT INTO admin_users (id, username, password_hash) VALUES (:id, :u, :h)');
|
||||
$ins->execute([':id' => $uid, ':u' => $username, ':h' => $hash]);
|
||||
|
||||
$claim = $pdo->prepare("UPDATE invite_codes SET used_by = :uid, used_at = datetime('now') WHERE id = :id AND used_by IS NULL");
|
||||
$claim->execute([':uid' => $uid, ':id' => (int) $invite['id']]);
|
||||
if ($claim->rowCount() !== 1) {
|
||||
throw new RuntimeException('Code déjà utilisé entre-temps.');
|
||||
}
|
||||
$pdo->commit();
|
||||
$ok = true;
|
||||
} catch (Throwable $e) {
|
||||
$pdo->rollBack();
|
||||
if ($pdo->errorInfo()[1] === 19 && strpos((string) $e->getMessage(), 'UNIQUE') !== false) {
|
||||
$error = 'Ce nom d\'utilisateur est déjà pris. Choisissez-en un autre.';
|
||||
} else {
|
||||
error_log('[fws-bugs] inscription : ' . $e->getMessage());
|
||||
$error = 'Erreur interne lors de l\'inscription. Réessayez.';
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
$error = 'Erreur base de données : ' . h($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/* Succès → retour à la page de connexion avec un message */
|
||||
if ($ok) {
|
||||
header('Location: index.php?registered=1');
|
||||
exit;
|
||||
}
|
||||
|
||||
$fwsScheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https' : 'http';
|
||||
$baseUrl = $fwsScheme . '://' . ($_SERVER['HTTP_HOST'] ?? 'fwslinux.fr');
|
||||
$codeValue = $submitted ? $code : '';
|
||||
$userValue = $submitted ? $username : '';
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Créer un compte — Signalements FWS</title>
|
||||
<style>
|
||||
:root { color-scheme: dark; }
|
||||
* { box-sizing: border-box; }
|
||||
body { margin: 0; font-family: system-ui, sans-serif; background: #0f172a; color: #e2e8f0; }
|
||||
.wrap { max-width: 520px; margin: 0 auto; padding: 40px 16px; }
|
||||
.card { background: #111c33; border: 1px solid #1e293b; border-radius: 14px; padding: 28px; }
|
||||
h1 { font-size: 1.25rem; margin-top: 0; }
|
||||
label { font-size: .85rem; color: #cbd5e1; display: block; margin-top: 14px; }
|
||||
input[type=text], input[type=password], input[type=code] {
|
||||
width: 100%; padding: 10px 12px; margin: 6px 0 2px;
|
||||
background: #0b1120; border: 1px solid #334155; border-radius: 8px; color: #e2e8f0; font-size: .95rem;
|
||||
}
|
||||
input.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; }
|
||||
button { margin-top: 20px; padding: 11px 18px; border: 0; border-radius: 8px; background: #0284c7; color: #fff; font-size: 1rem; cursor: pointer; width: 100%; }
|
||||
button:hover { background: #0369a1; }
|
||||
.flash { padding: 10px 12px; border-radius: 8px; font-size: .88rem; margin-bottom: 14px; }
|
||||
.flash.err { background: #3d1414; color: #ffa198; }
|
||||
.hint { font-size: .8rem; color: #64748b; margin-top: 4px; }
|
||||
.back { display: inline-block; margin-top: 18px; font-size: .85rem; color: #94a3b8; text-decoration: none; }
|
||||
.note { font-size: .85rem; color: #94a3b8; background: #0b1120; border: 1px solid #1e293b; border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; line-height: 1.5; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrap">
|
||||
<div class="card">
|
||||
<h1>🎟️ Créer un compte</h1>
|
||||
<p class="note">Tu as reçu un <strong>code d'invitation à usage unique</strong> de l'équipe FWS.
|
||||
Saisis-le ci-dessous puis choisis ton nom d'utilisateur et ton mot de passe.</p>
|
||||
|
||||
<?php if ($error): ?><div class="flash err"><?= h($error) ?></div><?php endif; ?>
|
||||
|
||||
<form method="post" autocomplete="on">
|
||||
<label for="code">Code d'invitation</label>
|
||||
<input type="text" id="code" name="code" class="code" required autofocus
|
||||
value="<?= h($codeValue) ?>" placeholder="K7QM-2H4D-X9BP">
|
||||
|
||||
<label for="username">Nom d'utilisateur</label>
|
||||
<input type="text" id="username" name="username" required value="<?= h($userValue) ?>"
|
||||
placeholder="ex : alice" pattern="[A-Za-z0-9_.\-]{2,32}">
|
||||
<div class="hint">2 à 32 caractères : lettres, chiffres, . _ -</div>
|
||||
|
||||
<label for="password">Mot de passe</label>
|
||||
<input type="password" id="password" name="password" required minlength="8" placeholder="8 caractères minimum">
|
||||
|
||||
<label for="password2">Confirmer le mot de passe</label>
|
||||
<input type="password" id="password2" name="password2" required minlength="8">
|
||||
|
||||
<input name="website" style="display:none" tabindex="-1" autocomplete="off">
|
||||
<button type="submit">Créer mon compte</button>
|
||||
</form>
|
||||
|
||||
<a class="back" href="index.php">← Retour à la connexion</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,115 @@
|
||||
#!/bin/bash
|
||||
# =============================================================================
|
||||
# FWS — Pipeline « Build ISO » déclenché depuis le panneau admin
|
||||
# (admin/bugs/build.php → process détaché, logs dans le terminal).
|
||||
#
|
||||
# Exécuté DANS le conteneur web (fws-files), qui pilote le moteur Docker
|
||||
# Desktop via /var/run/docker.sock. Toutes les étapes se déroulent dans un
|
||||
# conteneur archlinux jetable (--privileged, exigé par mkarchiso), le dépôt
|
||||
# Windows D:\FWS-ISO étant monté sur /fws — exactement le repli Docker que
|
||||
# font build.sh / setup-aur.sh quand on les lance depuis Git Bash sans WSL.
|
||||
#
|
||||
# Étapes :
|
||||
# 1. passage sur la branche « main » (abandon propre si des modifications
|
||||
# locales non commitées empêchent le checkout — rien n'est jamais perdu)
|
||||
# 2. git pull origin main
|
||||
# 3. bash build.sh
|
||||
# 4. si build.sh échoue → bash setup-aur.sh, puis relance de build.sh
|
||||
# =============================================================================
|
||||
set -u
|
||||
|
||||
# ── Token Gitea (optionnel) : déposé par build.php dans
|
||||
# api/bugs/data/build/git-auth.env (jamais commité, jamais affiché).
|
||||
# Transmis au conteneur en variable d'environnement → git l'utilise pour
|
||||
# le pull sans qu'aucune donnée d'auth n'apparaisse dans les logs.
|
||||
AUTH_ENV="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../api/bugs/data/build/git-auth.env"
|
||||
GIT_AUTH=()
|
||||
if [ -f "$AUTH_ENV" ]; then
|
||||
. "$AUTH_ENV"
|
||||
fi
|
||||
if [ -n "${FWS_GIT_TOKEN:-}" ]; then
|
||||
AUTH64="$(printf '%s:%s' "${FWS_GIT_USER:-fws}" "$FWS_GIT_TOKEN" | base64 -w0 2>/dev/null || printf '%s:%s' "${FWS_GIT_USER:-fws}" "$FWS_GIT_TOKEN" | base64)"
|
||||
GIT_AUTH=(
|
||||
-e GIT_CONFIG_COUNT=1
|
||||
-e GIT_CONFIG_KEY_0=http.extraheader
|
||||
-e "GIT_CONFIG_VALUE_0=AUTHORIZATION: basic ${AUTH64}"
|
||||
)
|
||||
fi
|
||||
|
||||
IMG="docker.io/library/archlinux:latest"
|
||||
NAME="fws-iso-build"
|
||||
REPO_WIN='D:\FWS-ISO' # chemin Windows résolu par le moteur Docker Desktop
|
||||
|
||||
now() { date '+%H:%M:%S'; }
|
||||
|
||||
echo "[$(now)] ════════════ FWS — Build ISO ════════════"
|
||||
echo "[$(now)] Pipeline lancé depuis le panneau admin (conteneur web)."
|
||||
|
||||
rc=0
|
||||
|
||||
echo "[$(now)] docker pull ${IMG}…"
|
||||
if ! docker pull "$IMG"; then
|
||||
echo "[$(now)] ÉCHEC : pull de l'image archlinux impossible (Docker Desktop arrêté ou réseau coupé ?)."
|
||||
rc=70
|
||||
else
|
||||
# Nettoie un éventuel build précédent resté vivant (arrêt brutal).
|
||||
docker rm -f "$NAME" >/dev/null 2>&1
|
||||
|
||||
echo "[$(now)] Conteneur Arch : checkout main → pull → build.sh (repli setup-aur.sh)."
|
||||
docker run --rm --privileged --name "$NAME" \
|
||||
-e FWS_IN_CONTAINER=1 \
|
||||
"${GIT_AUTH[@]}" \
|
||||
-v fws-pacman-cache:/var/cache/pacman/pkg \
|
||||
-v "${REPO_WIN}:/fws" \
|
||||
-w /fws \
|
||||
"$IMG" \
|
||||
bash -lc '
|
||||
set -u
|
||||
cd /fws || { echo "==> /fws introuvable : le montage D:\FWS-ISO est-il actif ?"; exit 81; }
|
||||
|
||||
echo "==> Installation de git dans le conteneur (image fraîche sans git)…"
|
||||
pacman -Sy --noconfirm git >/dev/null 2>&1 \
|
||||
|| { echo "==> ÉCHEC : pacman -Sy git (réseau du conteneur ?)."; exit 80; }
|
||||
|
||||
echo "==> Branche actuelle : $(git branch --show-current)"
|
||||
echo "==> Passage sur main…"
|
||||
git checkout main 2>&1 || {
|
||||
echo
|
||||
echo "!! Impossible de passer sur main : des modifications locales non commitées"
|
||||
echo "!! dans D:\FWS-ISO empêchent le checkout (voir « git status »)."
|
||||
echo "!! Committe ou stash ces modifications, puis relance le build."
|
||||
exit 90
|
||||
}
|
||||
echo "==> git pull (origin main)…"
|
||||
GIT_TERMINAL_PROMPT=0 git pull --ff-only origin main || {
|
||||
echo "!! git pull a échoué (réseau, droits, ou conflit ?)."
|
||||
exit 91
|
||||
}
|
||||
|
||||
echo
|
||||
echo "==> bash build.sh"
|
||||
if bash build.sh; then
|
||||
echo "==> ✅ build.sh terminé sans erreur."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "!! build.sh a échoué → lancement de setup-aur.sh, puis nouvel essai de build.sh"
|
||||
if ! bash setup-aur.sh; then
|
||||
echo "!! setup-aur.sh a échoué."
|
||||
exit 92
|
||||
fi
|
||||
echo "==> bash build.sh (2e tentative)…"
|
||||
if bash build.sh; then
|
||||
echo "==> ✅ build.sh (2e tentative) terminé sans erreur."
|
||||
exit 0
|
||||
fi
|
||||
echo "!! Nouvel échec de build.sh."
|
||||
exit 93
|
||||
'
|
||||
rc=$?
|
||||
docker rm -f "$NAME" >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
echo "[$(now)] ════════════ Fin du pipeline (code ${rc}) ════════════"
|
||||
exit "$rc"
|
||||
+277
@@ -0,0 +1,277 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — API publique de signalement de bugs.
|
||||
*
|
||||
* POST https://fwslinux.fr/api/bugs.php (JSON ou formulaire)
|
||||
* GET https://fwslinux.fr/api/bugs.php (petite page de test dans le navigateur)
|
||||
*
|
||||
* Aucun plafond de taille ni de débit : l'API est faite pour curl/scripts
|
||||
* (envoi de logs volumineux) et les seuls garde-fous restants sont le champ
|
||||
* piège « website » et le contrôle de contenu vide.
|
||||
*
|
||||
* CORS ouvert : on accepte les requêtes de n'importe quelle origine
|
||||
* (curl, app d'installation, script, site…).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/bugs/db.php';
|
||||
require __DIR__ . '/bugs/discord.php';
|
||||
|
||||
/* Jamais d'avertissements/stack traces PHP visibles côté client */
|
||||
ini_set('display_errors', '0');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
|
||||
header('Access-Control-Allow-Headers: Content-Type, X-Requested-With');
|
||||
header('X-Content-Type-Options: nosniff');
|
||||
|
||||
$method = $_SERVER['REQUEST_METHOD'] ?? 'GET';
|
||||
|
||||
/* Pré-vol CORS (fetch depuis le navigateur) */
|
||||
if ($method === 'OPTIONS') {
|
||||
http_response_code(204);
|
||||
exit;
|
||||
}
|
||||
|
||||
/* GET → page HTML de test, pratique pour envoyer un signalement depuis un navigateur */
|
||||
if ($method === 'GET') {
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
render_test_page();
|
||||
exit;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
if ($method !== 'POST') {
|
||||
http_response_code(405);
|
||||
echo json_encode(['ok' => false, 'error' => 'Méthode non autorisée. Utilisez POST.'], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
/* Anti-spam : champ piège « website » rempli par les robots → on ignore sans le dire */
|
||||
$honeypot = trim((string) ($_POST['website'] ?? ''));
|
||||
if ($honeypot !== '') {
|
||||
http_response_code(201);
|
||||
echo json_encode(['ok' => true, 'id' => null, 'message' => 'Merci.'], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
/* Lecture du corps : JSON ou formulaire classique */
|
||||
$rawBody = file_get_contents('php://input');
|
||||
$ct = $_SERVER['CONTENT_TYPE'] ?? '';
|
||||
$data = $_POST;
|
||||
|
||||
if (stripos($ct, 'application/json') !== false) {
|
||||
$decoded = json_decode($rawBody === false ? '' : $rawBody, true);
|
||||
if (!is_array($decoded)) {
|
||||
http_response_code(400);
|
||||
echo json_encode(['ok' => false, 'error' => 'JSON invalide.'], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
$data = $decoded;
|
||||
}
|
||||
|
||||
/* Champs acceptés, avec des alias tolérés */
|
||||
$fields = [
|
||||
'app' => strval($data['app'] ?? $data['application'] ?? ''),
|
||||
'version' => strval($data['version'] ?? ''),
|
||||
'type' => strval($data['type'] ?? $data['category'] ?? 'bug'),
|
||||
'title' => strval($data['title'] ?? $data['subject'] ?? ''),
|
||||
'description' => strval($data['description'] ?? $data['message'] ?? $data['details'] ?? ''),
|
||||
'email' => strval($data['email'] ?? $data['contact'] ?? ''),
|
||||
'system_info' => strval($data['system_info'] ?? $data['system'] ?? $data['hardware'] ?? ''),
|
||||
'logs' => strval($data['logs'] ?? $data['log'] ?? $data['journal'] ?? ''),
|
||||
];
|
||||
|
||||
/* Aucun plafond sur les champs : les logs d'installation peuvent peser
|
||||
très lourd et un client curl doit pouvoir tout envoyer. */
|
||||
$title = trim($fields['title']);
|
||||
$description = trim($fields['description']);
|
||||
$logs = trim($fields['logs']);
|
||||
$app = trim($fields['app']);
|
||||
$version = trim($fields['version']);
|
||||
$email = trim($fields['email']);
|
||||
$systemInfo = trim($fields['system_info']);
|
||||
$type = trim($fields['type']);
|
||||
|
||||
/* Un signalement doit contenir au moins un peu de contenu utile */
|
||||
if ($title === '' && $description === '' && $logs === '') {
|
||||
http_response_code(400);
|
||||
echo json_encode([
|
||||
'ok' => false,
|
||||
'error' => 'Contenu vide : envoyez au moins un titre, une description ou des logs.',
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
/* Connexion à la base (aucun anti-flood : l'API est ouverte par design) */
|
||||
try {
|
||||
$pdo = fws_bugs_db();
|
||||
} catch (Throwable $e) {
|
||||
error_log('[fws-bugs] ' . $e->getMessage());
|
||||
http_response_code(500);
|
||||
echo json_encode(['ok' => false, 'error' => 'Erreur interne de la base de données.'], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
$ip = fws_bugs_client_ip();
|
||||
|
||||
/* Insertion — l'id repart de 1 et saute ceux déjà pris */
|
||||
try {
|
||||
$bugId = fws_bugs_next_id($pdo, 'bug_reports');
|
||||
$stmt = $pdo->prepare(
|
||||
'INSERT INTO bug_reports
|
||||
(id, app, version, type, title, description, email, system_info, logs, ip, user_agent)
|
||||
VALUES
|
||||
(:id, :app, :version, :type, :title, :description, :email, :system_info, :logs, :ip, :ua)'
|
||||
);
|
||||
$stmt->execute([
|
||||
':id' => $bugId,
|
||||
':app' => $app,
|
||||
':version' => $version,
|
||||
':type' => $type !== '' ? $type : 'bug',
|
||||
':title' => $title,
|
||||
':description' => $description,
|
||||
':email' => $email,
|
||||
':system_info' => $systemInfo,
|
||||
':logs' => $logs,
|
||||
':ip' => $ip,
|
||||
':ua' => mb_substr((string) ($_SERVER['HTTP_USER_AGENT'] ?? ''), 0, 300),
|
||||
]);
|
||||
} catch (Throwable $e) {
|
||||
error_log('[fws-bugs] insertion : ' . $e->getMessage());
|
||||
http_response_code(500);
|
||||
echo json_encode(['ok' => false, 'error' => 'Erreur interne lors de l\'enregistrement.'], JSON_UNESCAPED_UNICODE);
|
||||
exit;
|
||||
}
|
||||
|
||||
http_response_code(201);
|
||||
echo json_encode([
|
||||
'ok' => true,
|
||||
'id' => $bugId,
|
||||
'message' => 'Signalement enregistré. Merci !',
|
||||
], JSON_UNESCAPED_UNICODE);
|
||||
|
||||
/* Envoie la réponse au client tout de suite ; la notif Discord suit en arrière-plan. */
|
||||
if (function_exists('fastcgi_finish_request')) {
|
||||
fastcgi_finish_request();
|
||||
} else {
|
||||
flush();
|
||||
}
|
||||
|
||||
/* Notification Discord (best-effort : n'affecte jamais la réponse de l'API) */
|
||||
try {
|
||||
$discord = fws_bugs_discord_notify([
|
||||
'id' => $bugId,
|
||||
'app' => $app,
|
||||
'version' => $version,
|
||||
'type' => $type !== '' ? $type : 'bug',
|
||||
'title' => $title,
|
||||
'description' => $description,
|
||||
'email' => $email,
|
||||
'system_info' => $systemInfo,
|
||||
'logs' => $logs,
|
||||
'status' => 'nouveau',
|
||||
]);
|
||||
if (is_array($discord) && !empty($discord['thread_id'])) {
|
||||
fws_bugs_save_discord_info($pdo, $bugId, (string) $discord['thread_id'], (string) ($discord['post_url'] ?? ''));
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
error_log('[fws-bugs] discord : ' . $e->getMessage());
|
||||
}
|
||||
exit;
|
||||
|
||||
/* ──────────────────────────────────────────── */
|
||||
|
||||
function render_test_page(): void
|
||||
{
|
||||
$base = htmlspecialchars(strtok($_SERVER['REQUEST_URI'] ?? '/api/bugs.php', '?'), ENT_QUOTES, 'UTF-8');
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Envoyer un signalement — FWS Linux</title>
|
||||
<style>
|
||||
:root { color-scheme: light dark; }
|
||||
body { font-family: system-ui, sans-serif; max-width: 720px; margin: 40px auto; padding: 0 16px; line-height: 1.5; }
|
||||
h1 { font-size: 1.4rem; }
|
||||
label { display: block; margin: 14px 0 4px; font-weight: 600; }
|
||||
input, select, textarea { width: 100%; padding: 8px; box-sizing: border-box; border-radius: 6px; border: 1px solid #888; font: inherit; }
|
||||
textarea { min-height: 90px; }
|
||||
button { margin-top: 18px; padding: 10px 18px; border: 0; border-radius: 8px; background: #1f6feb; color: #fff; font-size: 1rem; cursor: pointer; }
|
||||
#result { margin-top: 16px; padding: 12px; border-radius: 8px; white-space: pre-wrap; font-family: monospace; font-size: .85rem; }
|
||||
#result.ok { background: #143d1e; color: #7ee787; }
|
||||
#result.err { background: #3d1414; color: #ffa198; }
|
||||
.note { font-size: .85rem; opacity: .7; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>🐞 Envoyer un signalement</h1>
|
||||
<p class="note">Page de test — le vrai envoi est fait par l'application (curl / script) sur <code>POST <?= $base ?></code>.</p>
|
||||
<form id="f">
|
||||
<label>Application / outil
|
||||
<input name="app" placeholder="ex : installateur FWS, PacManage, DeskManager, site…">
|
||||
</label>
|
||||
<label>Version
|
||||
<input name="version" placeholder="ex : 0.6.0">
|
||||
</label>
|
||||
<label>Type
|
||||
<select name="type">
|
||||
<option value="bug">Bug</option>
|
||||
<option value="crash">Crash</option>
|
||||
<option value="installation">Problème d'installation</option>
|
||||
<option value="suggestion">Suggestion</option>
|
||||
<option value="autre">Autre</option>
|
||||
</select>
|
||||
</label>
|
||||
<label>Titre *
|
||||
<input name="title" required placeholder="Résumé court du problème">
|
||||
</label>
|
||||
<label>Description
|
||||
<textarea name="description" placeholder="Ce qui s'est passé, les étapes pour reproduire…"></textarea>
|
||||
</label>
|
||||
<label>E-mail (optionnel)
|
||||
<input name="email" type="email" placeholder="pour être recontacté">
|
||||
</label>
|
||||
<label>Système / matériel
|
||||
<input name="system_info" placeholder="ex : CPU, GPU, RAM, mode BIOS/UEFI…">
|
||||
</label>
|
||||
<label>Logs (optionnel)
|
||||
<textarea name="logs" placeholder="collez la sortie du journal d'installation…"></textarea>
|
||||
</label>
|
||||
<input name="website" style="display:none" tabindex="-1" autocomplete="off">
|
||||
<button type="submit">Envoyer le signalement</button>
|
||||
</form>
|
||||
<div id="result" hidden></div>
|
||||
<script>
|
||||
const form = document.getElementById('f');
|
||||
const res = document.getElementById('result');
|
||||
form.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
const body = Object.fromEntries(new FormData(form).entries());
|
||||
delete body.website;
|
||||
try {
|
||||
const r = await fetch(location.href, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(body)
|
||||
});
|
||||
const j = await r.json();
|
||||
res.hidden = false;
|
||||
res.className = r.ok ? 'ok' : 'err';
|
||||
res.textContent = JSON.stringify(j, null, 2);
|
||||
} catch (err) {
|
||||
res.hidden = false;
|
||||
res.className = 'err';
|
||||
res.textContent = 'Erreur réseau : ' + err;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — configuration locale des notifications Discord + build ISO.
|
||||
*
|
||||
* Copie ce fichier en « config.local.php » et remplis-le :
|
||||
*
|
||||
* cp config.local.php.example config.local.php
|
||||
*
|
||||
* 1) webhook_url (obligatoire) : webhook du canal FORUM
|
||||
* Discord → canal forum → Paramètres → Intégrations → Webhooks → Copier.
|
||||
* L'URL ressemble à : https://discord.com/api/webhooks/<id>/<token>
|
||||
*
|
||||
* 2) bot_token (optionnel mais recommandé) : token d'un bot Discord
|
||||
* https://discord.com/developers/applications → New Application → Bot →
|
||||
* Reset Token → invite-le dans ton serveur avec les permissions
|
||||
* « Manage Threads » et « Manage Tags ».
|
||||
* Avec un bot, les tags « Nouveau / En cours / Résolu / Ignoré » sont
|
||||
* créés automatiquement et mis à jour quand le statut change sur le site.
|
||||
*
|
||||
* 3) tags (optionnel si bot) : IDs des tags créés à la main dans Discord.
|
||||
* Sans bot : crée les tags dans le canal forum puis colle ici leurs IDs
|
||||
* (Activer le mode développeur Discord → réseau du navigateur, ou via un
|
||||
* outil type Discord API avec le bot).
|
||||
*
|
||||
* 4) gitea_token (requis pour l'onglet « Build ISO ») : le dépôt
|
||||
* D:\FWS-ISO est privé sur gitea.nocode-var.tech, et le build tourne dans
|
||||
* un conteneur qui n'a pas tes identifiants Windows. Génère un token dans
|
||||
* Gitea → Settings → Applications → Generate New Token (scope : lecture
|
||||
* du dépôt / read:repository), puis colle-le ici.
|
||||
* Le token n'est JAMAIS commité, ni affiché dans les logs du build.
|
||||
*
|
||||
* config.local.php n'est PAS commité (secret) — il est dans .gitignore.
|
||||
*/
|
||||
return [
|
||||
'webhook_url' => 'https://discord.com/api/webhooks/REMPLACE_PAR_ID/REMPLACE_PAR_TOKEN',
|
||||
'bot_token' => '',
|
||||
'gitea_username' => '', // optionnel : nom du compte Gitea (défaut « fws »)
|
||||
'gitea_token' => '', // token Gitea (lecture dépôt) pour le build ISO
|
||||
'tags' => [
|
||||
'nouveau' => '',
|
||||
'en_cours' => '',
|
||||
'resolu' => '',
|
||||
'ignore' => '',
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,8 @@
|
||||
# La base de données ne doit jamais être commitée
|
||||
*.sqlite
|
||||
*.sqlite-wal
|
||||
*.sqlite-shm
|
||||
fws_bugs.sqlite
|
||||
|
||||
# Logs / états de l'onglet « Build ISO » (admin/bugs/build.php)
|
||||
/build/
|
||||
@@ -0,0 +1,3 @@
|
||||
# Bloque tout accès direct (navigateur, curl…) à la base SQLite.
|
||||
# Seul le code PHP du serveur (api/admin) peut lire ce répertoire.
|
||||
Require all denied
|
||||
+410
@@ -0,0 +1,410 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — base de données des signalements de bugs.
|
||||
* SQLite, fichier stocké dans api/bugs/data/ (répertoire protégé par .htaccess).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/* Filet de sécurité : aucune erreur PHP ne fuit jamais côté client
|
||||
* (JSON sous /api/, page HTML discrète sinon). */
|
||||
require_once dirname(__DIR__, 2) . '/inc/errors.php';
|
||||
|
||||
/* ───────────── UTF-8 (partagé avec inc/site.php, gardes function_exists) ── */
|
||||
|
||||
if (!function_exists('fws_utf8_str')) {
|
||||
/** UTF-8 valide obligatoire : les octets invalides (Windows-1252…) sont
|
||||
* convertis, sinon json_encode échoue et casse tout l'appelant. */
|
||||
function fws_utf8_str(string $s): string
|
||||
{
|
||||
if (mb_check_encoding($s, 'UTF-8')) {
|
||||
return $s;
|
||||
}
|
||||
$conv = @mb_convert_encoding($s, 'UTF-8', 'Windows-1252');
|
||||
return is_string($conv) ? $conv : (string) mb_convert_encoding($s, 'UTF-8', 'UTF-8');
|
||||
}
|
||||
|
||||
function fws_utf8_arr(array $a): array
|
||||
{
|
||||
$out = [];
|
||||
foreach ($a as $k => $v) {
|
||||
if (is_array($v)) {
|
||||
$out[$k] = fws_utf8_arr($v);
|
||||
} elseif (is_string($v)) {
|
||||
$out[$k] = fws_utf8_str($v);
|
||||
} else {
|
||||
$out[$k] = $v;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
|
||||
function fws_bugs_db(): PDO
|
||||
{
|
||||
static $pdo = null;
|
||||
if ($pdo instanceof PDO) {
|
||||
return $pdo;
|
||||
}
|
||||
|
||||
$dir = __DIR__ . '/data';
|
||||
if (!is_dir($dir)) {
|
||||
mkdir($dir, 0775, true);
|
||||
}
|
||||
|
||||
try {
|
||||
$pdo = new PDO('sqlite:' . $dir . '/fws_bugs.sqlite');
|
||||
} catch (Throwable $e) {
|
||||
/* Driver PDO SQLite absent (cas fréquent : WAMP/XAMPP où pdo_sqlite
|
||||
et sqlite3 sont à activer dans php.ini). Message clair au lieu d'un
|
||||
crash avec stack trace. */
|
||||
throw new RuntimeException(
|
||||
'Extension PDO SQLite indisponible : activez "extension=pdo_sqlite" et "extension=sqlite3" dans php.ini.',
|
||||
0,
|
||||
$e
|
||||
);
|
||||
}
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);
|
||||
|
||||
/* Sur un bind-mount Docker Desktop, tout appartient à root : on rend le
|
||||
fichier DB inscriptible par Apache (www-data) quoi qu'il arrive. */
|
||||
@chmod($dir . '/fws_bugs.sqlite', 0666);
|
||||
@chmod($dir, 0777);
|
||||
|
||||
/* Pas de WAL : sur un bind-mount Docker Desktop, les fichiers -wal/-shm
|
||||
créés tantôt par root (CLI) tantôt par www-data (Apache) se marchent
|
||||
dessus. Le mode journal classique + fichier 666 est plus fiable. */
|
||||
$pdo->exec('PRAGMA journal_mode = DELETE');
|
||||
$pdo->exec('PRAGMA busy_timeout = 5000');
|
||||
|
||||
fws_bugs_schema($pdo);
|
||||
@chmod($dir . '/fws_bugs.sqlite', 0666);
|
||||
return $pdo;
|
||||
}
|
||||
|
||||
function fws_bugs_schema(PDO $pdo): void
|
||||
{
|
||||
$pdo->exec(
|
||||
'CREATE TABLE IF NOT EXISTS bug_reports (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
app TEXT NOT NULL DEFAULT \'\',
|
||||
version TEXT NOT NULL DEFAULT \'\',
|
||||
type TEXT NOT NULL DEFAULT \'bug\',
|
||||
title TEXT NOT NULL DEFAULT \'\',
|
||||
description TEXT NOT NULL DEFAULT \'\',
|
||||
email TEXT NOT NULL DEFAULT \'\',
|
||||
system_info TEXT NOT NULL DEFAULT \'\',
|
||||
logs TEXT NOT NULL DEFAULT \'\',
|
||||
ip TEXT NOT NULL DEFAULT \'\',
|
||||
user_agent TEXT NOT NULL DEFAULT \'\',
|
||||
status TEXT NOT NULL DEFAULT \'nouveau\',
|
||||
created_at TEXT NOT NULL DEFAULT (datetime(\'now\'))
|
||||
)'
|
||||
);
|
||||
$pdo->exec('CREATE INDEX IF NOT EXISTS idx_reports_created ON bug_reports(created_at DESC)');
|
||||
$pdo->exec('CREATE INDEX IF NOT EXISTS idx_reports_status ON bug_reports(status)');
|
||||
|
||||
/* Migration : colonnes Discord (ajoutées sur les bases déjà existantes) */
|
||||
$cols = $pdo->query('PRAGMA table_info(bug_reports)')->fetchAll();
|
||||
$hasThread = false;
|
||||
$hasUrl = false;
|
||||
foreach ($cols as $c) {
|
||||
if (($c['name'] ?? '') === 'discord_thread_id') $hasThread = true;
|
||||
if (($c['name'] ?? '') === 'discord_post_url') $hasUrl = true;
|
||||
}
|
||||
if (!$hasThread) {
|
||||
$pdo->exec("ALTER TABLE bug_reports ADD COLUMN discord_thread_id TEXT NOT NULL DEFAULT ''");
|
||||
}
|
||||
if (!$hasUrl) {
|
||||
$pdo->exec("ALTER TABLE bug_reports ADD COLUMN discord_post_url TEXT NOT NULL DEFAULT ''");
|
||||
}
|
||||
|
||||
$pdo->exec(
|
||||
'CREATE TABLE IF NOT EXISTS admin_users (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
username TEXT NOT NULL UNIQUE,
|
||||
password_hash TEXT NOT NULL,
|
||||
created_at TEXT NOT NULL DEFAULT (datetime(\'now\'))
|
||||
)'
|
||||
);
|
||||
|
||||
/* Codes d'invitation à usage unique pour créer des comptes */
|
||||
$pdo->exec(
|
||||
'CREATE TABLE IF NOT EXISTS invite_codes (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
code TEXT NOT NULL UNIQUE,
|
||||
created_by TEXT NOT NULL DEFAULT \'\',
|
||||
created_at TEXT NOT NULL DEFAULT (datetime(\'now\')),
|
||||
expires_at TEXT,
|
||||
used_by INTEGER,
|
||||
used_at TEXT,
|
||||
revoked_at TEXT
|
||||
)'
|
||||
);
|
||||
|
||||
/* Paquets du site (données gérées depuis le panneau admin) */
|
||||
$pdo->exec(
|
||||
'CREATE TABLE IF NOT EXISTS packages (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
slug TEXT NOT NULL DEFAULT \'\',
|
||||
name TEXT NOT NULL DEFAULT \'\',
|
||||
tagline TEXT NOT NULL DEFAULT \'\',
|
||||
description TEXT NOT NULL DEFAULT \'\',
|
||||
since TEXT,
|
||||
since_label TEXT NOT NULL DEFAULT \'FWS\',
|
||||
latest_name TEXT NOT NULL DEFAULT \'\',
|
||||
latest_date TEXT,
|
||||
links TEXT NOT NULL DEFAULT \'[]\',
|
||||
screens TEXT NOT NULL DEFAULT \'[]\',
|
||||
changelog TEXT NOT NULL DEFAULT \'[]\',
|
||||
updated_at TEXT NOT NULL DEFAULT (datetime(\'now\'))
|
||||
)'
|
||||
);
|
||||
|
||||
/* Schéma (re)créé : s'assurer que le fichier reste inscriptible par Apache */
|
||||
@chmod(__DIR__ . '/data/fws_bugs.sqlite', 0666);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prochain identifiant libre pour une table, en repartant de 1 :
|
||||
* si l'id 1 est déjà pris, on saute au plus petit id inutilisé.
|
||||
*/
|
||||
function fws_bugs_next_id(PDO $pdo, string $table): int
|
||||
{
|
||||
if (!in_array($table, ['bug_reports', 'admin_users', 'invite_codes', 'packages'], true)) {
|
||||
throw new InvalidArgumentException('Table inconnue : ' . $table);
|
||||
}
|
||||
$used = [];
|
||||
foreach ($pdo->query('SELECT id FROM ' . $table . ' ORDER BY id') as $row) {
|
||||
$used[(int) $row['id']] = true;
|
||||
}
|
||||
$id = 1;
|
||||
while (isset($used[$id])) {
|
||||
$id++;
|
||||
}
|
||||
return $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Génère un code d'invitation à usage unique (ex. « K7QM-2H4D-X9BP »).
|
||||
* Alphabet sans caractères ambigus (pas de I/O/0/1).
|
||||
*/
|
||||
function fws_bugs_create_invite(PDO $pdo, string $createdBy, int $days): string
|
||||
{
|
||||
$alphabet = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
|
||||
for ($attempt = 0; $attempt < 5; $attempt++) {
|
||||
$raw = '';
|
||||
for ($i = 0; $i < 12; $i++) {
|
||||
$raw .= $alphabet[random_int(0, strlen($alphabet) - 1)];
|
||||
}
|
||||
$code = substr($raw, 0, 4) . '-' . substr($raw, 4, 4) . '-' . substr($raw, 8, 4);
|
||||
$expires = $days > 0 ? date('Y-m-d H:i:s', time() + $days * 86400) : null;
|
||||
try {
|
||||
$id = fws_bugs_next_id($pdo, 'invite_codes');
|
||||
$st = $pdo->prepare('INSERT INTO invite_codes (id, code, created_by, expires_at) VALUES (:id, :c, :b, :e)');
|
||||
$st->execute([':id' => $id, ':c' => $code, ':b' => $createdBy, ':e' => $expires]);
|
||||
return $code;
|
||||
} catch (Throwable $e) {
|
||||
/* collision ultra improbable → on régénère */
|
||||
}
|
||||
}
|
||||
throw new RuntimeException('Impossible de générer un code d\'invitation.');
|
||||
}
|
||||
|
||||
/**
|
||||
* Cherche un code d'invitation (insensible à la casse et aux tirets).
|
||||
*/
|
||||
function fws_bugs_find_invite(PDO $pdo, string $code): ?array
|
||||
{
|
||||
$norm = strtoupper(str_replace(['-', ' '], '', $code));
|
||||
if ($norm === '') {
|
||||
return null;
|
||||
}
|
||||
$st = $pdo->prepare("SELECT * FROM invite_codes WHERE REPLACE(UPPER(code), '-', '') = :c LIMIT 1");
|
||||
$st->execute([':c' => $norm]);
|
||||
$row = $st->fetch();
|
||||
return $row === false ? null : $row;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enregistre le lien du post Discord créé pour un signalement.
|
||||
*/
|
||||
function fws_bugs_save_discord_info(PDO $pdo, int $id, string $threadId, string $postUrl): void
|
||||
{
|
||||
$st = $pdo->prepare('UPDATE bug_reports SET discord_thread_id = :t, discord_post_url = :u WHERE id = :id');
|
||||
$st->execute([':t' => $threadId, ':u' => $postUrl, ':id' => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* IP réelle en tenant compte du proxy (X-Forwarded-For).
|
||||
*/
|
||||
function fws_bugs_client_ip(): string
|
||||
{
|
||||
$xff = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? '';
|
||||
if ($xff !== '') {
|
||||
$parts = explode(',', $xff);
|
||||
$ip = trim($parts[0]);
|
||||
if ($ip !== '') {
|
||||
return substr($ip, 0, 64);
|
||||
}
|
||||
}
|
||||
return substr((string) ($_SERVER['REMOTE_ADDR'] ?? ''), 0, 64);
|
||||
}
|
||||
|
||||
/**
|
||||
* Comptes autorisés à lancer un build ISO (onglet « Build ISO » du panneau).
|
||||
* Le build pilote le moteur Docker : à n'accorder qu'aux comptes de confiance.
|
||||
*/
|
||||
function fws_bugs_can_build(string $username): bool
|
||||
{
|
||||
return in_array(strtolower(trim($username)), ['admin'], true);
|
||||
}
|
||||
|
||||
/* ───────────────────────── paquets du site ───────────────────────── */
|
||||
|
||||
/**
|
||||
* Convertit une ligne brute de la table `packages` au format JSON
|
||||
* utilisé par le site (identique à l'ancien packages.json).
|
||||
*/
|
||||
function fws_packages_row_to_json(array $r): array
|
||||
{
|
||||
$latest = null;
|
||||
if ((string) ($r['latest_name'] ?? '') !== '') {
|
||||
$latest = [
|
||||
'name' => fws_utf8_str((string) $r['latest_name']),
|
||||
'date' => ($r['latest_date'] ?? null) !== null ? fws_utf8_str((string) $r['latest_date']) : null,
|
||||
];
|
||||
}
|
||||
return fws_utf8_arr([
|
||||
'id' => (string) $r['slug'],
|
||||
'name' => (string) $r['name'],
|
||||
'tagline' => (string) $r['tagline'],
|
||||
'description' => (string) $r['description'],
|
||||
'since' => ($r['since'] ?? null) !== null ? (string) $r['since'] : null,
|
||||
'sinceLabel' => (string) ($r['since_label'] ?? 'FWS'),
|
||||
'latest' => $latest,
|
||||
'links' => json_decode((string) $r['links'], true) ?: [],
|
||||
'screens' => json_decode((string) $r['screens'], true) ?: [],
|
||||
'changelog' => json_decode((string) $r['changelog'], true) ?: [],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tous les paquets, ordonnés par id (l'ordre = la position sur le site,
|
||||
* ex : /?p/paquets/1/ est l'id 1).
|
||||
*/
|
||||
function fws_packages_all(PDO $pdo): array
|
||||
{
|
||||
$out = [];
|
||||
foreach ($pdo->query('SELECT * FROM packages ORDER BY id ASC') as $r) {
|
||||
$out[] = fws_packages_row_to_json($r);
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Enregistre un paquet (insert si id = 0, sinon update).
|
||||
* Les colonnes JSON (links, screens, changelog) sont passées en tableaux PHP.
|
||||
*/
|
||||
function fws_packages_save(PDO $pdo, array $d): int
|
||||
{
|
||||
$id = (int) ($d['id'] ?? 0);
|
||||
$slug = trim((string) ($d['slug'] ?? ''));
|
||||
if ($slug === '') {
|
||||
$slug = trim(preg_replace('/[^a-zA-Z0-9]+/', '-', (string) ($d['name'] ?? '')) ?? '', '-');
|
||||
}
|
||||
$sinceLabel = trim((string) ($d['since_label'] ?? ''));
|
||||
if ($sinceLabel === '') {
|
||||
$sinceLabel = 'FWS';
|
||||
}
|
||||
$data = [
|
||||
':slug' => fws_utf8_str($slug),
|
||||
':name' => fws_utf8_str(trim((string) ($d['name'] ?? ''))),
|
||||
':tagline' => fws_utf8_str(trim((string) ($d['tagline'] ?? ''))),
|
||||
':description' => fws_utf8_str(trim((string) ($d['description'] ?? ''))),
|
||||
':since' => ($d['since'] ?? '') !== '' ? (string) $d['since'] : null,
|
||||
':since_label' => fws_utf8_str($sinceLabel),
|
||||
':latest_name' => fws_utf8_str(trim((string) ($d['latest_name'] ?? ''))),
|
||||
':latest_date' => ($d['latest_date'] ?? '') !== '' ? (string) $d['latest_date'] : null,
|
||||
':links' => (string) json_encode(fws_utf8_arr((array) ($d['links'] ?? [])), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
||||
/* 5 captures maximum par paquet (gardée de force côté serveur). */
|
||||
':screens' => (string) json_encode(array_slice(fws_utf8_arr((array) ($d['screens'] ?? [])), 0, 5), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
||||
':changelog' => (string) json_encode(fws_utf8_arr((array) ($d['changelog'] ?? [])), JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
|
||||
];
|
||||
|
||||
if ($id > 0) {
|
||||
$data[':id'] = $id;
|
||||
$st = $pdo->prepare(
|
||||
'UPDATE packages SET slug = :slug, name = :name, tagline = :tagline,
|
||||
description = :description, since = :since, since_label = :since_label,
|
||||
latest_name = :latest_name, latest_date = :latest_date,
|
||||
links = :links, screens = :screens, changelog = :changelog,
|
||||
updated_at = datetime(\'now\') WHERE id = :id'
|
||||
);
|
||||
$st->execute($data);
|
||||
return $id;
|
||||
}
|
||||
|
||||
$id = fws_bugs_next_id($pdo, 'packages');
|
||||
$data[':id'] = $id;
|
||||
$st = $pdo->prepare(
|
||||
'INSERT INTO packages (id, slug, name, tagline, description, since, since_label,
|
||||
latest_name, latest_date, links, screens, changelog)
|
||||
VALUES (:id, :slug, :name, :tagline, :description, :since, :since_label,
|
||||
:latest_name, :latest_date, :links, :screens, :changelog)'
|
||||
);
|
||||
$st->execute($data);
|
||||
return $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Supprime un paquet (l'id pourra être réutilisé ensuite).
|
||||
*/
|
||||
function fws_packages_delete(PDO $pdo, int $id): void
|
||||
{
|
||||
$st = $pdo->prepare('DELETE FROM packages WHERE id = :id');
|
||||
$st->execute([':id' => $id]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Import initial : si la table `packages` est vide et que l'ancien
|
||||
* packages.json existe toujours, on l'importe une seule fois.
|
||||
*/
|
||||
function fws_packages_seed_if_empty(PDO $pdo): int
|
||||
{
|
||||
$count = (int) $pdo->query('SELECT COUNT(*) FROM packages')->fetchColumn();
|
||||
if ($count > 0) {
|
||||
return 0;
|
||||
}
|
||||
$file = dirname(__DIR__) . '/../p/paquets/packages.json';
|
||||
if (!is_file($file)) {
|
||||
return 0;
|
||||
}
|
||||
$data = json_decode((string) file_get_contents($file), true);
|
||||
if (!is_array($data)) {
|
||||
return 0;
|
||||
}
|
||||
$n = 0;
|
||||
foreach ($data as $p) {
|
||||
if (!is_array($p)) {
|
||||
continue;
|
||||
}
|
||||
fws_packages_save($pdo, [
|
||||
'id' => 0,
|
||||
'slug' => (string) ($p['id'] ?? ''),
|
||||
'name' => (string) ($p['name'] ?? ''),
|
||||
'tagline' => (string) ($p['tagline'] ?? ''),
|
||||
'description' => (string) ($p['description'] ?? ''),
|
||||
'since' => (string) ($p['since'] ?? ''),
|
||||
'since_label' => (string) ($p['sinceLabel'] ?? 'FWS'),
|
||||
'latest_name' => (string) ($p['latest']['name'] ?? ''),
|
||||
'latest_date' => (string) ($p['latest']['date'] ?? ''),
|
||||
'links' => $p['links'] ?? [],
|
||||
'screens' => $p['screens'] ?? [],
|
||||
'changelog' => $p['changelog'] ?? [],
|
||||
]);
|
||||
$n++;
|
||||
}
|
||||
return $n;
|
||||
}
|
||||
@@ -0,0 +1,366 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — notification Discord des signalements de bugs (canal FORUM).
|
||||
*
|
||||
* Chaque signalement crée un NOUVEAU POST dans le canal forum via le webhook
|
||||
* (thread_name), avec le tag du statut appliqué, puis le résumé + les logs.
|
||||
* Quand un admin change le statut sur le site, un message est posté dans le
|
||||
* fil Discord (et le tag est mis à jour si un bot_token est configuré).
|
||||
*
|
||||
* Configuration : api/bugs/config.local.php
|
||||
* - webhook_url : webhook du canal FORUM (obligatoire)
|
||||
* - bot_token : token d'un bot Discord (optionnel)
|
||||
* Avec bot → les tags « Nouveau / En cours / Résolu / Ignoré » sont
|
||||
* créés automatiquement et mis à jour quand le statut
|
||||
* change sur le site.
|
||||
* Sans bot → crée les tags dans l'UI Discord et renseigne leurs IDs
|
||||
* dans le tableau « tags » du fichier de config.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
const FWS_BUGS_STATUS_LABELS = [
|
||||
'nouveau' => '🆕 Nouveau',
|
||||
'en_cours' => '🔧 En cours',
|
||||
'resolu' => '✅ Résolu',
|
||||
'ignore' => '🙈 Ignoré',
|
||||
];
|
||||
|
||||
/**
|
||||
* Configuration lue depuis config.local.php (jamais commité).
|
||||
* Accepte soit une simple chaîne (URL du webhook), soit un tableau :
|
||||
* [ 'webhook_url' => ..., 'bot_token' => ..., 'tags' => [status => tagId] ]
|
||||
*/
|
||||
function fws_bugs_discord_config(): array
|
||||
{
|
||||
static $cfg = null;
|
||||
if ($cfg !== null) {
|
||||
return $cfg;
|
||||
}
|
||||
$cfg = ['webhook' => '', 'bot_token' => '', 'tags' => []];
|
||||
$local = __DIR__ . '/config.local.php';
|
||||
if (is_file($local)) {
|
||||
$v = require $local;
|
||||
if (is_string($v)) {
|
||||
$cfg['webhook'] = $v;
|
||||
} elseif (is_array($v)) {
|
||||
$cfg['webhook'] = (string) ($v['webhook_url'] ?? $v['webhook'] ?? '');
|
||||
$cfg['bot_token'] = (string) ($v['bot_token'] ?? '');
|
||||
$cfg['tags'] = is_array($v['tags'] ?? null) ? $v['tags'] : [];
|
||||
}
|
||||
}
|
||||
$cfg['webhook'] = trim($cfg['webhook']);
|
||||
if (strpos($cfg['webhook'], 'REMPLACE_PAR') !== false || strpos($cfg['webhook'], 'COLLE_ICI') !== false) {
|
||||
$cfg['webhook'] = '';
|
||||
}
|
||||
$cfg['bot_token'] = trim($cfg['bot_token']);
|
||||
return $cfg;
|
||||
}
|
||||
|
||||
function fws_bugs_discord_enabled(): bool
|
||||
{
|
||||
return fws_bugs_discord_config()['webhook'] !== '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Appel API Discord générique (webhook ou endpoint canal avec bot).
|
||||
* $auth = 'Bot xxx' pour les endpoints de canaux, '' pour le webhook.
|
||||
* Retourne le JSON décodé, ou null en cas d'échec (erreur loggée).
|
||||
*/
|
||||
function fws_bugs_discord_api(string $method, string $url, array $payload = [], string $auth = ''): ?array
|
||||
{
|
||||
$ch = curl_init($url);
|
||||
$headers = [
|
||||
'Content-Type: application/json',
|
||||
'User-Agent: FWS-Bugs/1.0 (https://fwslinux.fr)',
|
||||
];
|
||||
if ($auth !== '') {
|
||||
$headers[] = 'Authorization: ' . $auth;
|
||||
}
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_HTTPHEADER => $headers,
|
||||
CURLOPT_CONNECTTIMEOUT => 4,
|
||||
CURLOPT_TIMEOUT => 8,
|
||||
CURLOPT_SSL_VERIFYPEER => true,
|
||||
]);
|
||||
if ($method === 'GET') {
|
||||
curl_setopt($ch, CURLOPT_HTTPGET, true);
|
||||
} else {
|
||||
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||
}
|
||||
$body = curl_exec($ch);
|
||||
$code = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
|
||||
$err = curl_error($ch);
|
||||
curl_close($ch);
|
||||
|
||||
if ($code < 200 || $code >= 300 || $body === false) {
|
||||
error_log(sprintf(
|
||||
'[fws-bugs] discord %s %s : HTTP %d %s',
|
||||
$method,
|
||||
preg_replace('#//[^/]+/webhooks/\d+/[^/?]+#', '//discord.com/api/webhooks/<id>/<token>', $url) ?? $url,
|
||||
$code,
|
||||
$err !== '' ? $err : substr((string) $body, 0, 250)
|
||||
));
|
||||
return null;
|
||||
}
|
||||
$decoded = json_decode((string) $body, true);
|
||||
if (is_array($decoded)) {
|
||||
return $decoded;
|
||||
}
|
||||
/* 2xx sans corps JSON (ex : 204 No Content des POST sans wait=true) =
|
||||
succès : on renvoie [] pour ne pas être confondu avec un échec. */
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Infos du webhook (channel_id, guild_id) via GET /webhooks/{id}/{token}.
|
||||
*/
|
||||
function fws_bugs_discord_webhook_info(): ?array
|
||||
{
|
||||
static $info = false;
|
||||
if ($info !== false) {
|
||||
return $info;
|
||||
}
|
||||
$info = null;
|
||||
$hook = fws_bugs_discord_config()['webhook'];
|
||||
if ($hook === '') {
|
||||
return null;
|
||||
}
|
||||
if (!preg_match('#/webhooks/(\d+)/([^/?]+)#', $hook, $m)) {
|
||||
return null;
|
||||
}
|
||||
$res = fws_bugs_discord_api('GET', 'https://discord.com/api/webhooks/' . $m[1] . '/' . $m[2]);
|
||||
if (is_array($res) && !empty($res['channel_id'])) {
|
||||
$info = $res;
|
||||
}
|
||||
return $info;
|
||||
}
|
||||
|
||||
/**
|
||||
* IDs des tags Discord pour chaque statut du site.
|
||||
* Sans bot : utilise les IDs renseignés dans config.local.php.
|
||||
* Avec bot : les récupère depuis le canal et les crée s'ils manquent.
|
||||
*
|
||||
* @return array<string,string> [statut => tagId]
|
||||
*/
|
||||
function fws_bugs_discord_ensure_tags(): array
|
||||
{
|
||||
static $tags = null;
|
||||
if ($tags !== null) {
|
||||
return $tags;
|
||||
}
|
||||
$cfg = fws_bugs_discord_config();
|
||||
|
||||
$tags = [];
|
||||
foreach (($cfg['tags'] ?? []) as $k => $v) {
|
||||
if (isset(FWS_BUGS_STATUS_LABELS[$k]) && is_string($v) && trim($v) !== '') {
|
||||
$tags[$k] = trim($v);
|
||||
}
|
||||
}
|
||||
if ($cfg['bot_token'] === '') {
|
||||
return $tags;
|
||||
}
|
||||
|
||||
$info = fws_bugs_discord_webhook_info();
|
||||
$channelId = is_array($info) ? (string) ($info['channel_id'] ?? '') : '';
|
||||
if ($channelId === '') {
|
||||
return $tags;
|
||||
}
|
||||
$bot = 'Bot ' . $cfg['bot_token'];
|
||||
$channelUrl = 'https://discord.com/api/channels/' . $channelId;
|
||||
|
||||
$channel = fws_bugs_discord_api('GET', $channelUrl, [], $bot);
|
||||
$available = is_array($channel) ? ($channel['available_tags'] ?? []) : [];
|
||||
$byName = [];
|
||||
foreach ($available as $t) {
|
||||
if (is_array($t) && !empty($t['name']) && !empty($t['id'])) {
|
||||
$byName[(string) $t['name']] = (string) $t['id'];
|
||||
}
|
||||
}
|
||||
|
||||
$defs = [
|
||||
'nouveau' => ['Nouveau', '🆕'],
|
||||
'en_cours' => ['En cours', '🔧'],
|
||||
'resolu' => ['Résolu', '✅'],
|
||||
'ignore' => ['Ignoré', '🙈'],
|
||||
];
|
||||
foreach ($defs as $status => [$tagName, $emoji]) {
|
||||
if (isset($tags[$status])) {
|
||||
continue;
|
||||
}
|
||||
$tagId = $byName[$tagName] ?? '';
|
||||
if ($tagId === '') {
|
||||
$created = fws_bugs_discord_api(
|
||||
'POST',
|
||||
$channelUrl . '/tags',
|
||||
['name' => $tagName, 'emoji_name' => $emoji, 'moderated' => false],
|
||||
$bot
|
||||
);
|
||||
$tagId = is_array($created) ? (string) ($created['id'] ?? '') : '';
|
||||
}
|
||||
if ($tagId !== '') {
|
||||
$tags[$status] = $tagId;
|
||||
}
|
||||
}
|
||||
return $tags;
|
||||
}
|
||||
|
||||
/**
|
||||
* Envoie un morceau de logs dans le fil, encadré pour rester sous la limite
|
||||
* Discord. Renvoie false si Discord refuse.
|
||||
*/
|
||||
function fws_bugs_discord_send_log_chunk(string $msgUrl, string $chunk): bool
|
||||
{
|
||||
/* Pas d'en-tête « Logs (N/M) » : chaque message aligne la suite
|
||||
des logs, ce qui donne un fil continu dans le post. */
|
||||
$body = str_contains($chunk, '```') ? $chunk : "```\n" . $chunk . "\n```";
|
||||
if (mb_strlen($body) > 1990) {
|
||||
$body = mb_substr($body, 0, 1990);
|
||||
}
|
||||
return fws_bugs_discord_api('POST', $msgUrl, ['content' => $body]) !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Crée le post dans le canal forum et y envoie le résumé + les logs.
|
||||
* Best-effort : ne renvoie jamais d'erreur.
|
||||
*
|
||||
* @param array $bug colonnes du signalement (app, version, type, title,
|
||||
* description, email, system_info, logs, status)
|
||||
* @return array|null ['thread_id' => ..., 'post_url' => ...] ou null en échec
|
||||
*/
|
||||
function fws_bugs_discord_notify(array $bug): ?array
|
||||
{
|
||||
$cfg = fws_bugs_discord_config();
|
||||
if ($cfg['webhook'] === '') {
|
||||
return null;
|
||||
}
|
||||
$base = rtrim($cfg['webhook'], '/');
|
||||
|
||||
$title = trim((string) ($bug['title'] ?? ''));
|
||||
if ($title === '') {
|
||||
$title = 'Signalement de bug';
|
||||
}
|
||||
$name = mb_substr($title, 0, 95); // 100 max côté Discord
|
||||
|
||||
$desc = trim((string) ($bug['description'] ?? ''));
|
||||
$sys = trim((string) ($bug['system_info'] ?? ''));
|
||||
$email = trim((string) ($bug['email'] ?? ''));
|
||||
$status = isset(FWS_BUGS_STATUS_LABELS[$bug['status'] ?? '']) ? (string) $bug['status'] : 'nouveau';
|
||||
|
||||
$lines = [];
|
||||
$lines[] = '**App :** ' . ($bug['app'] !== '' ? $bug['app'] : '—')
|
||||
. ' · **Version :** ' . ($bug['version'] !== '' ? $bug['version'] : '—')
|
||||
. ' · **Type :** ' . ($bug['type'] !== '' ? $bug['type'] : 'bug');
|
||||
if ($desc !== '') {
|
||||
$lines[] = '';
|
||||
$lines[] = $desc;
|
||||
}
|
||||
if ($sys !== '') {
|
||||
$lines[] = '';
|
||||
$lines[] = '**Système / matériel :**';
|
||||
$lines[] = $sys;
|
||||
}
|
||||
if ($email !== '') {
|
||||
$lines[] = '';
|
||||
$lines[] = '**Contact :** ' . $email;
|
||||
}
|
||||
$summary = mb_substr(implode("\n", $lines), 0, 1800);
|
||||
|
||||
/* Créer le post : le webhook doit être sur un canal FORUM. Discord crée
|
||||
le post dès qu'on passe thread_name (+ tag via applied_tags), et
|
||||
renvoie le message (wait=true) dont channel_id est l'id du post. */
|
||||
$payload = [
|
||||
'content' => $summary,
|
||||
'thread_name' => $name,
|
||||
];
|
||||
$tags = fws_bugs_discord_ensure_tags();
|
||||
if (isset($tags[$status])) {
|
||||
$payload['applied_tags'] = [$tags[$status]];
|
||||
}
|
||||
|
||||
$first = fws_bugs_discord_api('POST', $base . '?wait=true', $payload);
|
||||
$threadId = is_array($first) ? (string) ($first['channel_id'] ?? '') : '';
|
||||
if ($threadId === '') {
|
||||
error_log('[fws-bugs] discord : échec création du post « ' . $name . ' »');
|
||||
return null;
|
||||
}
|
||||
|
||||
/* URL du post pour l'admin (guild_id via les infos du webhook) */
|
||||
$postUrl = '';
|
||||
$info = fws_bugs_discord_webhook_info();
|
||||
if (is_array($info) && !empty($info['guild_id'])) {
|
||||
$postUrl = 'https://discord.com/channels/' . $info['guild_id'] . '/' . $threadId;
|
||||
}
|
||||
|
||||
/* ── Logs par morceaux (1900 car. max, 12 messages max) ── */
|
||||
$logs = trim((string) ($bug['logs'] ?? ''));
|
||||
if ($logs !== '') {
|
||||
/* L'API accepte des logs de taille illimitée : on découpe donc à la
|
||||
volée et on s'arrête dès que le quota de messages est atteint, au
|
||||
lieu de construire le tableau complet en mémoire. */
|
||||
$msgUrl = $base . '?thread_id=' . $threadId;
|
||||
$maxMsgs = 12;
|
||||
$sent = 0;
|
||||
$cur = '';
|
||||
foreach (preg_split('/\r?\n/', $logs) as $line) {
|
||||
if ($cur !== '' && mb_strlen($cur) + mb_strlen($line) + 1 > 1850) {
|
||||
if (!fws_bugs_discord_send_log_chunk($msgUrl, $cur)) {
|
||||
break; // Discord refuse → on s'arrête proprement
|
||||
}
|
||||
$cur = '';
|
||||
if (++$sent >= $maxMsgs) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
$cur .= ($cur === '' ? '' : "\n") . $line;
|
||||
}
|
||||
if ($cur !== '' && $sent < $maxMsgs) {
|
||||
fws_bugs_discord_send_log_chunk($msgUrl, $cur);
|
||||
}
|
||||
}
|
||||
|
||||
return ['thread_id' => $threadId, 'post_url' => $postUrl];
|
||||
}
|
||||
|
||||
/**
|
||||
* Préviens Discord quand le statut d'un signalement change sur le site.
|
||||
* Poste un message dans le fil, et met à jour le tag si un bot est configuré.
|
||||
*
|
||||
* @param array $bug id, thread_id, old_status, new_status, actor
|
||||
*/
|
||||
function fws_bugs_discord_status_change(array $bug): void
|
||||
{
|
||||
$cfg = fws_bugs_discord_config();
|
||||
$threadId = trim((string) ($bug['thread_id'] ?? ''));
|
||||
if ($cfg['webhook'] === '' || $threadId === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$old = isset(FWS_BUGS_STATUS_LABELS[$bug['old_status'] ?? '']) ? FWS_BUGS_STATUS_LABELS[$bug['old_status']] : (string) ($bug['old_status'] ?? '?');
|
||||
$new = isset(FWS_BUGS_STATUS_LABELS[$bug['new_status'] ?? '']) ? FWS_BUGS_STATUS_LABELS[$bug['new_status']] : (string) ($bug['new_status'] ?? '?');
|
||||
$actor = trim((string) ($bug['actor'] ?? ''));
|
||||
|
||||
$msg = '📌 **Statut mis à jour** : ' . $old . ' → **' . $new . '**';
|
||||
if ($actor !== '') {
|
||||
$msg .= "\nPar : " . $actor;
|
||||
}
|
||||
fws_bugs_discord_api('POST', $cfg['webhook'] . '?thread_id=' . $threadId, ['content' => mb_substr($msg, 0, 1900)]);
|
||||
|
||||
/* Mise à jour du tag : possible seulement avec un bot (MANAGE_THREADS) */
|
||||
if ($cfg['bot_token'] !== '') {
|
||||
$info = fws_bugs_discord_webhook_info();
|
||||
$channelId = is_array($info) ? (string) ($info['channel_id'] ?? '') : '';
|
||||
$tags = fws_bugs_discord_ensure_tags();
|
||||
$newStatus = (string) ($bug['new_status'] ?? '');
|
||||
if ($channelId !== '' && isset($tags[$newStatus])) {
|
||||
fws_bugs_discord_api(
|
||||
'PUT',
|
||||
'https://discord.com/api/channels/' . $channelId . '/threads/' . $threadId . '/applied-tags',
|
||||
['applied_tags' => [$tags[$newStatus]]],
|
||||
'Bot ' . $cfg['bot_token']
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — API publique des paquets.
|
||||
*
|
||||
* GET /api/packages.php → liste des paquets au même format que
|
||||
* l'ancien p/paquets/packages.json (consommée par packages.js).
|
||||
*
|
||||
* Les données sont stockées dans la base SQLite partagée (api/bugs/data/)
|
||||
* et modifiables depuis le panneau admin (admin/bugs/index.php?view=packages).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/bugs/db.php';
|
||||
|
||||
try {
|
||||
$pdo = fws_bugs_db();
|
||||
/* Premier démarrage : la table est vide → on importe packages.json une fois. */
|
||||
fws_packages_seed_if_empty($pdo);
|
||||
$packages = fws_packages_all($pdo);
|
||||
} catch (Throwable $e) {
|
||||
error_log('[fws-packages] ' . $e->getMessage());
|
||||
http_response_code(500);
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode(['ok' => false, 'error' => 'Erreur base de données.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
echo json_encode($packages, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
|
||||
+243
@@ -0,0 +1,243 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS — filet de sécurité des erreurs PHP.
|
||||
*
|
||||
* Inclu par inc/site.php (pages du site) et api/bugs/db.php (API + admin),
|
||||
* donc actif partout. Garanties :
|
||||
*
|
||||
* 1. Aucune erreur PHP n'est jamais affichée au client (display_errors off) ;
|
||||
* 2. Les erreurs sont journalisées dans api/bugs/data/php-errors.log
|
||||
* (répertoire interdit au web et gitignoré) ;
|
||||
* 3. Exception non interceptée ou erreur fatale → réponse propre :
|
||||
* JSON sous /api/, page HTML discrète sinon (jamais de stack trace,
|
||||
* jamais de chemin de fichier, jamais de message système).
|
||||
*
|
||||
* Idempotent : peut être inclus plusieurs fois sans risque.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/* ── 1/2. Journalisation locale, jamais d'affichage ────────────────────── */
|
||||
|
||||
ini_set('display_errors', '0');
|
||||
ini_set('display_startup_errors', '0');
|
||||
ini_set('log_errors', '1');
|
||||
error_reporting(E_ALL);
|
||||
|
||||
/* ── Base URL (Windows : WAMP/XAMPP servent le site depuis un sous-dossier de
|
||||
* www, ex /FWS-Website/ ; Linux : racine du domaine). Calculée une fois,
|
||||
* depuis SCRIPT_NAME — indépendant du point d'entrée (page.php, index.php,
|
||||
* /p/dl/, admin/…). Toutes les URLs du site passent par fws_url()/fws_asset().
|
||||
*/
|
||||
if (!function_exists('fws_base_url')) {
|
||||
function fws_base_url(): string
|
||||
{
|
||||
static $base = null;
|
||||
if ($base !== null) {
|
||||
return $base;
|
||||
}
|
||||
$script = str_replace('\\', '/', (string) ($_SERVER['SCRIPT_NAME'] ?? ''));
|
||||
$dir = rtrim(str_replace('\\', '/', (string) dirname($script)), '/');
|
||||
/* Le site est déployé à la racine du domaine : les dossiers sensibles
|
||||
(inc, api, admin, cache, p/<route>) sont forcément à la racine.
|
||||
Sinon, on est servi depuis un sous-dossier (WAMP : /FWS-Website). */
|
||||
if (preg_match('~/((?:inc|api|admin|cache)|p/(?:index|dl|paquets|equipe|contact|assets))(?:/|$)~', $dir, $m)) {
|
||||
$base = substr($dir, 0, (int) strrpos($dir, $m[0]));
|
||||
} else {
|
||||
$base = $dir;
|
||||
}
|
||||
return $base;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('fws_url')) {
|
||||
/** URL d'une route ou d'un asset local, préfixée par la base URL. */
|
||||
function fws_url(string $path): string
|
||||
{
|
||||
if ($path === '' || preg_match('~^(?:[a-z][a-z0-9+.-]*:|//)~i', $path)) {
|
||||
return $path; /* absolu, mailto:, tel:, //… : inchangé */
|
||||
}
|
||||
$base = fws_base_url();
|
||||
if ($base !== '' && ($path === $base || str_starts_with($path, $base . '/'))) {
|
||||
return $path; /* déjà préfixé (idempotence) */
|
||||
}
|
||||
return $base . '/' . ltrim($path, '/');
|
||||
}
|
||||
}
|
||||
|
||||
/* En CLI (scripts d'administration dans le conteneur), on affiche tout :
|
||||
* c'est interactif, l'opérateur doit voir les problèmes. */
|
||||
if (PHP_SAPI === 'cli') {
|
||||
ini_set('display_errors', '1');
|
||||
}
|
||||
|
||||
/* ── Portabilité : polyfills mbstring ──────────────────────────────────────
|
||||
* L'extension mbstring est absente de certaines installations PHP de Windows
|
||||
* (et de quelques images Docker minimales). Le site doit tourner quand même :
|
||||
* on fournit des équivalents UTF-8 corrects pour les 4 fonctions mb_* du
|
||||
* projet. Si mbstring est présente (cas Linux standard), on n'y touche pas.
|
||||
*/
|
||||
if (!function_exists('mb_strlen')) {
|
||||
function fws_mb_chars(string $s): array
|
||||
{
|
||||
$c = preg_split('//u', $s, -1, PREG_SPLIT_NO_EMPTY);
|
||||
return is_array($c) ? $c : ((str_split($s) === false) ? [] : str_split($s));
|
||||
}
|
||||
function mb_strlen(string $s, ?string $enc = null): int
|
||||
{
|
||||
return count(fws_mb_chars($s));
|
||||
}
|
||||
function mb_substr(string $s, int $start, ?int $len = null, ?string $enc = null): string
|
||||
{
|
||||
$c = fws_mb_chars($s);
|
||||
$n = count($c);
|
||||
if ($start < 0) {
|
||||
$start = max(0, $n + $start);
|
||||
}
|
||||
if ($len === null) {
|
||||
$len = $n;
|
||||
} elseif ($len < 0) {
|
||||
$len = max(0, $n - $start + $len);
|
||||
}
|
||||
return implode('', array_slice($c, $start, $len));
|
||||
}
|
||||
function mb_check_encoding(string $s, ?string $enc = null): bool
|
||||
{
|
||||
return (bool) preg_match('//u', $s);
|
||||
}
|
||||
function mb_convert_encoding(string $s, string $to, ?string $from = null): string
|
||||
{
|
||||
if (function_exists('iconv') && strcasecmp($to, 'UTF-8') === 0) {
|
||||
$conv = @iconv((string) $from, 'UTF-8//TRANSLIT//IGNORE', $s);
|
||||
if (is_string($conv)) {
|
||||
return $conv;
|
||||
}
|
||||
}
|
||||
/* Dernier recours : on retire les octets qui cassent l'UTF-8. */
|
||||
$clean = preg_replace('/[\x80-\xFF]+/', '?', $s);
|
||||
return is_string($clean) ? $clean : $s;
|
||||
}
|
||||
}
|
||||
|
||||
/* Journal : api/bugs/data/ (déjà interdit au web par .htaccess + gitigné). */
|
||||
$fwsErrorLogDir = dirname(__DIR__) . '/api/bugs/data';
|
||||
if (!is_dir($fwsErrorLogDir)) {
|
||||
@mkdir($fwsErrorLogDir, 0770, true);
|
||||
}
|
||||
if (is_dir($fwsErrorLogDir) && is_writable($fwsErrorLogDir)) {
|
||||
ini_set('error_log', $fwsErrorLogDir . '/php-errors.log');
|
||||
}
|
||||
unset($fwsErrorLogDir);
|
||||
|
||||
/* ── 3. Réponses d'erreur propres ──────────────────────────────────────── */
|
||||
|
||||
if (!function_exists('fws_error_wants_json')) {
|
||||
|
||||
/**
|
||||
* Le client attend-il du JSON ?
|
||||
*
|
||||
* Un navigateur (navigation réelle) demande explicitement du HTML
|
||||
* (« Accept: text/html, … ») → il recevra une page visuelle.
|
||||
* Tout le reste — curl (Accept générique), scripts, apps, appels fetch()
|
||||
* ou clients qui annoncent du JSON — reçoit du JSON.
|
||||
*/
|
||||
function fws_error_wants_json(): bool
|
||||
{
|
||||
$accept = strtolower((string) ($_SERVER['HTTP_ACCEPT'] ?? ''));
|
||||
if (str_contains($accept, 'text/html')) {
|
||||
return false; /* navigateur → page visuelle */
|
||||
}
|
||||
return true; /* curl, scripts, API clients → JSON */
|
||||
}
|
||||
|
||||
/**
|
||||
* Réponse d'erreur finale : JSON ou page HTML minimaliste, sans aucun
|
||||
* détail technique. Ne fait rien si les en-têtes sont déjà partis.
|
||||
*/
|
||||
function fws_error_render(int $status, string $message): void
|
||||
{
|
||||
if (headers_sent()) {
|
||||
return; /* trop tard pour propre : on referme silencieusement */
|
||||
}
|
||||
|
||||
http_response_code($status);
|
||||
|
||||
if (fws_error_wants_json()) {
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
header('X-Content-Type-Options: nosniff');
|
||||
header('Cache-Control: no-store');
|
||||
echo json_encode(['ok' => false, 'error' => $message], JSON_UNESCAPED_UNICODE);
|
||||
return;
|
||||
}
|
||||
|
||||
header('Content-Type: text/html; charset=utf-8');
|
||||
header('Cache-Control: no-store');
|
||||
$msg = htmlspecialchars($message, ENT_QUOTES, 'UTF-8');
|
||||
echo <<<HTML
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>Erreur | FWS Linux</title>
|
||||
<style>
|
||||
body{margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;
|
||||
font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
|
||||
background:#0f172a;color:#e2e8f0}
|
||||
main{text-align:center;padding:2rem}
|
||||
h1{font-size:2.2rem;color:#38bdf8;margin:0 0 .5rem}
|
||||
p{color:#94a3b8;margin:0 0 1.5rem}
|
||||
a{color:#38bdf8;text-decoration:none;font-weight:500}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<h1>Oups…</h1>
|
||||
<p>{$msg}</p>
|
||||
<a href="/?p=index/">Retour à l'accueil</a>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
HTML;
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('fws_error_install')) {
|
||||
|
||||
/** Pose les handlers (une seule fois, jamais en CLI). */
|
||||
function fws_error_install(): void
|
||||
{
|
||||
static $installed = false;
|
||||
if ($installed || PHP_SAPI === 'cli') {
|
||||
return;
|
||||
}
|
||||
$installed = true;
|
||||
|
||||
/* Exception non interceptée → 500 propre. */
|
||||
set_exception_handler(static function (Throwable $e): void {
|
||||
error_log('[fws] exception non interceptée : ' . $e->getMessage()
|
||||
. ' — ' . $e->getFile() . ':' . $e->getLine());
|
||||
fws_error_render(500, 'Une erreur inattendue est survenue. Merci de réessayer plus tard.');
|
||||
});
|
||||
|
||||
/* Erreur fatale (mémoire, parse, include manquant…) → 500 propre.
|
||||
* NB : les warnings/notices restent simplement journalisés — on ne
|
||||
* les transforme pas en exceptions pour ne pas casser les pages. */
|
||||
register_shutdown_function(static function (): void {
|
||||
$e = error_get_last();
|
||||
if ($e === null) {
|
||||
return;
|
||||
}
|
||||
$fatals = [E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR];
|
||||
if (!in_array((int) $e['type'], $fatals, true)) {
|
||||
return;
|
||||
}
|
||||
error_log('[fws] erreur fatale : ' . $e['message']
|
||||
. ' — ' . $e['file'] . ':' . $e['line']);
|
||||
fws_error_render(500, 'Une erreur inattendue est survenue. Merci de réessayer plus tard.');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
fws_error_install();
|
||||
+625
@@ -0,0 +1,625 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — bibliothèque du site.
|
||||
*
|
||||
* Tout est rendu côté serveur (PHP) : les pages sont de vraies pages HTML.
|
||||
* Les données viennent de la base SQLite (paquets, modifiables dans
|
||||
* /admin/bugs) et des API Gitea / GitHub (releases, avec cache fichier).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/* Filet de sécurité : aucune erreur PHP ne fuit jamais côté client. */
|
||||
require_once __DIR__ . '/errors.php';
|
||||
|
||||
define('FWS_SITE_ROOT', dirname(__DIR__));
|
||||
define('FWS_SITE_CACHE_DIR', FWS_SITE_ROOT . '/cache');
|
||||
define('FWS_SITE_CACHE_TTL', 600); // 10 minutes
|
||||
|
||||
/* ───────────────────────── utilitaires ───────────────────────── */
|
||||
|
||||
/** Échappement HTML. */
|
||||
function e(?string $s): string
|
||||
{
|
||||
return htmlspecialchars((string) $s, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
|
||||
/**
|
||||
* URL d'un asset local avec version (…?v=<date du fichier>) : chaque mise
|
||||
* à jour d'un CSS/JS est immédiatement re-téléchargée par les navigateurs,
|
||||
* au lieu d'être bloquée par le cache « 7 jours » du .htaccess.
|
||||
*/
|
||||
function fws_asset(string $path): string
|
||||
{
|
||||
$abs = FWS_SITE_ROOT . $path;
|
||||
$mtime = @filemtime($abs);
|
||||
return fws_url($path) . ($mtime ? '?v=' . $mtime : '');
|
||||
}
|
||||
|
||||
/* fws_utf8_str / fws_utf8_arr sont définies dans api/bugs/db.php (chargé
|
||||
ci-dessous via fws_site_db()) avec des gardes function_exists : elles
|
||||
sont donc disponibles quel que soit l'ordre d'inclusion. */
|
||||
|
||||
/** Date ISO → « 29 août 2026 » (ou la valeur brute si non parsable). */
|
||||
function fws_format_date(?string $iso): string
|
||||
{
|
||||
if ($iso === null || trim($iso) === '') {
|
||||
return '';
|
||||
}
|
||||
static $mois = [
|
||||
1 => 'janvier', 'février', 'mars', 'avril', 'mai', 'juin',
|
||||
'juillet', 'août', 'septembre', 'octobre', 'novembre', 'décembre',
|
||||
];
|
||||
try {
|
||||
$d = new DateTimeImmutable($iso);
|
||||
return trim($d->format('j')) . ' ' . $mois[(int) $d->format('n')] . ' ' . $d->format('Y');
|
||||
} catch (Throwable $e) {
|
||||
return $iso;
|
||||
}
|
||||
}
|
||||
|
||||
/* ───────────────────────── paquets (base SQLite) ───────────────────────── */
|
||||
|
||||
/**
|
||||
* Connexion à la base du site (celle des bugs, partagée). Renvoie null si la
|
||||
* base n'est pas disponible : le site doit rester fonctionnel sans DB.
|
||||
*/
|
||||
function fws_site_db(): ?PDO
|
||||
{
|
||||
static $pdo = null;
|
||||
static $failed = false;
|
||||
if ($pdo instanceof PDO || $failed) {
|
||||
return $failed ? null : $pdo;
|
||||
}
|
||||
try {
|
||||
require_once __DIR__ . '/../api/bugs/db.php';
|
||||
$pdo = fws_bugs_db();
|
||||
} catch (Throwable $e) {
|
||||
error_log('[fws-site] base indisponible : ' . $e->getMessage());
|
||||
$failed = true;
|
||||
return null;
|
||||
}
|
||||
return $pdo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Paquets du site : base SQLite (source de vérité, éditable dans /admin/bugs)
|
||||
* avec repli sur p/paquets/packages.json si la base est vide ou absente.
|
||||
* Chaque entrée est nettoyée (UTF-8 valide) pour ne jamais casser json_encode
|
||||
* ni le rendu HTML.
|
||||
*/
|
||||
function fws_site_packages(): array
|
||||
{
|
||||
static $cache = null;
|
||||
if ($cache !== null) {
|
||||
return $cache;
|
||||
}
|
||||
|
||||
$out = [];
|
||||
|
||||
$pdo = fws_site_db();
|
||||
if ($pdo !== null) {
|
||||
try {
|
||||
$has = $pdo->query(
|
||||
"SELECT COUNT(*) FROM sqlite_master WHERE type='table' AND name='packages'"
|
||||
)->fetchColumn();
|
||||
if ((int) $has > 0) {
|
||||
foreach ($pdo->query('SELECT * FROM packages ORDER BY id ASC') as $r) {
|
||||
$out[] = fws_site_package_row($r);
|
||||
}
|
||||
}
|
||||
} catch (Throwable $e) {
|
||||
error_log('[fws-site] lecture paquets : ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/* Repli : l'ancien fichier JSON (avant la DB, ou base vide). */
|
||||
if ($out === []) {
|
||||
/* dbId = 0 : les URLs /?p/paquets/N/ se rabattent sur la position. */
|
||||
$file = FWS_SITE_ROOT . '/p/paquets/packages.json';
|
||||
if (is_file($file)) {
|
||||
$data = json_decode((string) file_get_contents($file), true);
|
||||
if (is_array($data)) {
|
||||
foreach ($data as $p) {
|
||||
if (is_array($p)) {
|
||||
$out[] = fws_site_package_shape($p);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Release + historique tirés de Gitea (URL des liens du paquet). */
|
||||
foreach ($out as $i => $pkg) {
|
||||
$out[$i] = fws_site_package_with_releases($pkg);
|
||||
}
|
||||
|
||||
$cache = $out;
|
||||
return $cache;
|
||||
}
|
||||
|
||||
/** Normalise un paquet quelconque (JSON ou DB) vers la forme du site.
|
||||
* « dbId » = identifiant en base (0 si venant du fichier JSON de repli) :
|
||||
* c'est lui qui pilote les URLs /?p/paquets/N/. */
|
||||
function fws_site_package_shape(array $p): array
|
||||
{
|
||||
return fws_utf8_arr([
|
||||
'id' => (string) ($p['id'] ?? ''),
|
||||
'name' => (string) ($p['name'] ?? ''),
|
||||
'tagline' => (string) ($p['tagline'] ?? ''),
|
||||
'description' => (string) ($p['description'] ?? ''),
|
||||
'since' => (string) ($p['since'] ?? '') !== '' ? (string) $p['since'] : null,
|
||||
'sinceLabel' => (string) ($p['sinceLabel'] ?? 'FWS'),
|
||||
'latest' => isset($p['latest']) && is_array($p['latest'])
|
||||
? [
|
||||
'name' => (string) ($p['latest']['name'] ?? ''),
|
||||
'date' => (string) ($p['latest']['date'] ?? '') !== '' ? (string) $p['latest']['date'] : null,
|
||||
]
|
||||
: null,
|
||||
'links' => is_array($p['links'] ?? null) ? array_values($p['links']) : [],
|
||||
'screens' => is_array($p['screens'] ?? null) ? array_values($p['screens']) : [],
|
||||
'changelog' => is_array($p['changelog'] ?? null) ? array_values($p['changelog']) : [],
|
||||
'dbId' => (int) ($p['dbId'] ?? 0),
|
||||
]);
|
||||
}
|
||||
|
||||
/** Ligne brute DB → forme du site (même format que l'ancien packages.json). */
|
||||
function fws_site_package_row(array $r): array
|
||||
{
|
||||
return fws_site_package_shape([
|
||||
'dbId' => (int) ($r['id'] ?? 0),
|
||||
'id' => $r['slug'] ?? '',
|
||||
'name' => $r['name'] ?? '',
|
||||
'tagline' => $r['tagline'] ?? '',
|
||||
'description' => $r['description'] ?? '',
|
||||
'since' => $r['since'] ?? null,
|
||||
'sinceLabel' => $r['since_label'] ?? 'FWS',
|
||||
'latest' => [
|
||||
'name' => $r['latest_name'] ?? '',
|
||||
'date' => $r['latest_date'] ?? '',
|
||||
],
|
||||
'links' => json_decode((string) ($r['links'] ?? '[]'), true) ?: [],
|
||||
'screens' => json_decode((string) ($r['screens'] ?? '[]'), true) ?: [],
|
||||
'changelog' => json_decode((string) ($r['changelog'] ?? '[]'), true) ?: [],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enrichit un paquet avec les releases Gitea (à partir de l'URL « Releases »
|
||||
* ou « Gitea » de ses liens) : latest + changelog réels, en cache fichier.
|
||||
*/
|
||||
function fws_site_package_with_releases(array $pkg): array
|
||||
{
|
||||
$repo = fws_site_gitea_repo_from_links($pkg['links'] ?? []);
|
||||
if ($repo === null) {
|
||||
return $pkg;
|
||||
}
|
||||
|
||||
$releases = fws_site_gitea_releases($repo['owner'], $repo['name']);
|
||||
if ($releases === []) {
|
||||
/* Pas de release Gitea : on garde latest/changelog de la DB. */
|
||||
return $pkg;
|
||||
}
|
||||
|
||||
$first = $releases[0];
|
||||
$pkg['latest'] = [
|
||||
'name' => (string) ($first['tag_name'] ?? ''),
|
||||
'date' => isset($first['published_at']) ? substr((string) $first['published_at'], 0, 10) : null,
|
||||
];
|
||||
|
||||
$changelog = [];
|
||||
foreach ($releases as $rel) {
|
||||
$notes = trim(strip_tags((string) fws_markdown((string) ($rel['body'] ?? ''))));
|
||||
if (mb_strlen($notes) > 200) {
|
||||
$notes = rtrim(mb_substr($notes, 0, 200)) . '…';
|
||||
}
|
||||
$changelog[] = [
|
||||
'version' => (string) ($rel['tag_name'] ?? ''),
|
||||
'date' => isset($rel['published_at']) ? substr((string) $rel['published_at'], 0, 10) : null,
|
||||
'notes' => $notes !== '' ? $notes : '',
|
||||
];
|
||||
}
|
||||
$pkg['changelog'] = $changelog;
|
||||
|
||||
return $pkg;
|
||||
}
|
||||
|
||||
/** Trouve owner/name du dépôt Gitea dans les liens d'un paquet (null sinon). */
|
||||
function fws_site_gitea_repo_from_links(array $links): ?array
|
||||
{
|
||||
foreach ($links as $link) {
|
||||
$url = (string) ($link['url'] ?? '');
|
||||
if (preg_match('~^https?://gitea\.nocode-var\.tech/([^/]+)/([^/]+)/?$~i', $url, $m)) {
|
||||
return ['owner' => $m[1], 'name' => $m[2]];
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* ───────────────────────── HTTP + cache fichier ───────────────────────── */
|
||||
|
||||
/** GET JSON avec cache fichier (cache/ gitignoré) ; [] en cas d'échec. */
|
||||
function fws_site_fetch_json(string $url, array $headers = []): array
|
||||
{
|
||||
$key = 'http_' . sha1($url);
|
||||
$file = FWS_SITE_CACHE_DIR . '/' . $key . '.json';
|
||||
|
||||
if (is_file($file) && (time() - (int) filemtime($file)) < FWS_SITE_CACHE_TTL) {
|
||||
$data = json_decode((string) file_get_contents($file), true);
|
||||
if (is_array($data)) {
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
$cacheOk = is_dir(FWS_SITE_CACHE_DIR) || @mkdir(FWS_SITE_CACHE_DIR, 0777, true);
|
||||
if ($cacheOk && !is_writable(FWS_SITE_CACHE_DIR)) {
|
||||
@chmod(FWS_SITE_CACHE_DIR, 0777);
|
||||
$cacheOk = is_writable(FWS_SITE_CACHE_DIR);
|
||||
}
|
||||
|
||||
$data = [];
|
||||
if (function_exists('curl_init')) {
|
||||
$ch = curl_init($url);
|
||||
$allHeaders = ['Accept: application/json', 'User-Agent: FWS-Linux-Website'];
|
||||
foreach ($headers as $h) {
|
||||
$allHeaders[] = $h;
|
||||
}
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_TIMEOUT => 8,
|
||||
CURLOPT_CONNECTTIMEOUT => 4,
|
||||
CURLOPT_HTTPHEADER => $allHeaders,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
]);
|
||||
$body = curl_exec($ch);
|
||||
$code = (int) curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
|
||||
curl_close($ch);
|
||||
if (is_string($body) && $code >= 200 && $code < 300) {
|
||||
$decoded = json_decode($body, true);
|
||||
if (is_array($decoded)) {
|
||||
$data = $decoded;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!$cacheOk) {
|
||||
/* Répertoire de cache non accessible (droits) : on répond quand même,
|
||||
simplement sans persistance entre les requêtes. */
|
||||
return $data;
|
||||
}
|
||||
|
||||
if ($data !== []) {
|
||||
@file_put_contents($file, json_encode($data, JSON_UNESCAPED_UNICODE), LOCK_EX);
|
||||
} elseif (is_file($file)) {
|
||||
/* API injoignable : on sert le dernier cache connu (périmé mais mieux que rien). */
|
||||
$data = json_decode((string) file_get_contents($file), true) ?: [];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/** Releases d'un dépôt Gitea (les plus récentes d'abord). */
|
||||
function fws_site_gitea_releases(string $owner, string $name): array
|
||||
{
|
||||
static $memo = [];
|
||||
$key = $owner . '/' . $name;
|
||||
if (isset($memo[$key])) {
|
||||
return $memo[$key];
|
||||
}
|
||||
$url = 'https://gitea.nocode-var.tech/api/v1/repos/'
|
||||
. rawurlencode($owner) . '/' . rawurlencode($name) . '/releases?limit=10';
|
||||
$data = fws_site_fetch_json($url);
|
||||
$out = [];
|
||||
/* L'API renvoie un tableau, ou {message:...} si le dépôt n'existe pas. */
|
||||
if (isset($data[0]) && is_array($data[0]) && isset($data[0]['tag_name'])) {
|
||||
foreach ($data as $rel) {
|
||||
if (is_array($rel) && isset($rel['tag_name'])) {
|
||||
$out[] = $rel;
|
||||
}
|
||||
}
|
||||
}
|
||||
$memo[$key] = $out;
|
||||
return $out;
|
||||
}
|
||||
|
||||
/* ───────────────────────── releases ISO (page Téléchargements) ─────────── */
|
||||
|
||||
/**
|
||||
* Releases de l'ISO pour la page Téléchargements : Gitea FWS/ISO s'il existe,
|
||||
* sinon GitHub (comme avant). Renvoie ['mode' => 'gitea'|'github'|'none', 'items' => [...]].
|
||||
*/
|
||||
function fws_site_iso_releases(): array
|
||||
{
|
||||
$gitea = fws_site_gitea_releases('FWS', 'ISO');
|
||||
if ($gitea !== []) {
|
||||
return ['mode' => 'gitea', 'items' => $gitea];
|
||||
}
|
||||
|
||||
$gh = fws_site_fetch_json(
|
||||
'https://api.github.com/repos/You-re-like-Windows-a-bitch/ISO/releases?per_page=6',
|
||||
['Accept: application/vnd.github+json']
|
||||
);
|
||||
if (isset($gh[0]) && is_array($gh[0]) && isset($gh[0]['tag_name'])) {
|
||||
return ['mode' => 'github', 'items' => $gh];
|
||||
}
|
||||
|
||||
$tags = fws_site_fetch_json(
|
||||
'https://api.github.com/repos/You-re-like-Windows-a-bitch/ISO/tags?per_page=6',
|
||||
['Accept: application/vnd.github+json']
|
||||
);
|
||||
if (isset($tags[0]) && is_array($tags[0]) && isset($tags[0]['name'])) {
|
||||
return ['mode' => 'tags', 'items' => $tags];
|
||||
}
|
||||
|
||||
return ['mode' => 'none', 'items' => []];
|
||||
}
|
||||
|
||||
/** Libellé d'une release (Gitea : « name » sinon tag ; GitHub : idem). */
|
||||
function fws_site_release_label(array $rel): string
|
||||
{
|
||||
$name = trim((string) ($rel['name'] ?? ''));
|
||||
$tag = (string) ($rel['tag_name'] ?? ($rel['ref'] ?? ''));
|
||||
return $name !== '' ? $name : ($tag !== '' ? $tag : 'Sans nom');
|
||||
}
|
||||
|
||||
/** URL de téléchargement directe d'une release (asset .iso sinon page). */
|
||||
function fws_site_release_download_url(array $rel): string
|
||||
{
|
||||
$assets = $rel['assets'] ?? [];
|
||||
if (is_array($assets)) {
|
||||
foreach ($assets as $asset) {
|
||||
if (is_array($asset)
|
||||
&& preg_match('/\.iso$/i', (string) ($asset['name'] ?? ''))
|
||||
&& isset($asset['browser_download_url'])) {
|
||||
return (string) $asset['browser_download_url'];
|
||||
}
|
||||
}
|
||||
foreach ($assets as $asset) {
|
||||
if (is_array($asset) && isset($asset['browser_download_url'])) {
|
||||
return (string) $asset['browser_download_url'];
|
||||
}
|
||||
}
|
||||
}
|
||||
return (string) ($rel['html_url'] ?? ($rel['zipball_url'] ?? '#'));
|
||||
}
|
||||
|
||||
/** Date de publication d'une release (date ISO brute, sans l'heure). */
|
||||
function fws_site_release_date(array $rel): ?string
|
||||
{
|
||||
foreach (['published_at', 'created_at'] as $k) {
|
||||
if (!empty($rel[$k])) {
|
||||
return substr((string) $rel[$k], 0, 10);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* ───────────────────────── Markdown (portage PHP de downloads.js) ──────── */
|
||||
|
||||
function fws_md_escape(string $t): string
|
||||
{
|
||||
return htmlspecialchars($t, ENT_NOQUOTES, 'UTF-8');
|
||||
}
|
||||
|
||||
function fws_md_inline(string $t): string
|
||||
{
|
||||
$t = fws_md_escape($t);
|
||||
$t = preg_replace('/\*\*\*(.+?)\*\*\*/s', '<strong><em>$1</em></strong>', $t) ?? $t;
|
||||
$t = preg_replace('/\*\*(.+?)\*\*/s', '<strong>$1</strong>', $t) ?? $t;
|
||||
$t = preg_replace('/\*(.+?)\*/s', '<em>$1</em>', $t) ?? $t;
|
||||
$t = preg_replace('/`([^`]+)`/', '<code>$1</code>', $t) ?? $t;
|
||||
$t = preg_replace('/!\[([^\]]*)\]\(([^)\s]+)\)/', '<img alt="$1" src="$2" loading="lazy">', $t) ?? $t;
|
||||
$t = preg_replace('/\[([^\]]+)\]\(([^)\s]+)\)/', '<a href="$2" target="_blank" rel="noreferrer">$1</a>', $t) ?? $t;
|
||||
return $t;
|
||||
}
|
||||
|
||||
/** Rendu Markdown minimal (titres, listes, tables, citations, code…) + sanitisé. */
|
||||
function fws_markdown(string $md): string
|
||||
{
|
||||
if (trim($md) === '') {
|
||||
return '';
|
||||
}
|
||||
|
||||
$lines = preg_split('/\r?\n/', $md) ?: [];
|
||||
$html = '';
|
||||
$inCode = false;
|
||||
$code = '';
|
||||
$codeLang = '';
|
||||
$listBuf = '';
|
||||
$listKind = '';
|
||||
$tableRows = [];
|
||||
$tableHeader = true;
|
||||
$quoteBuf = '';
|
||||
|
||||
$flushList = function () use (&$html, &$listBuf, &$listKind) {
|
||||
if ($listBuf !== '') {
|
||||
$html .= '<' . $listKind . ">\n" . $listBuf . '</' . $listKind . ">\n";
|
||||
$listBuf = '';
|
||||
$listKind = '';
|
||||
}
|
||||
};
|
||||
$flushTable = function () use (&$html, &$tableRows, &$tableHeader) {
|
||||
if ($tableRows !== []) {
|
||||
$html .= "<table>\n" . implode("\n", $tableRows) . "\n</table>\n";
|
||||
$tableRows = [];
|
||||
$tableHeader = true;
|
||||
}
|
||||
};
|
||||
$flushQuote = function () use (&$html, &$quoteBuf) {
|
||||
if ($quoteBuf !== '') {
|
||||
$html .= '<blockquote>' . $quoteBuf . "</blockquote>\n";
|
||||
$quoteBuf = '';
|
||||
}
|
||||
};
|
||||
$flushAll = function () use ($flushList, $flushTable, $flushQuote) {
|
||||
$flushList();
|
||||
$flushTable();
|
||||
$flushQuote();
|
||||
};
|
||||
$cells = function (string $line): array {
|
||||
$line = preg_replace('/^\|/', '', $line) ?? $line;
|
||||
$line = preg_replace('/\|$/', '', $line) ?? $line;
|
||||
return array_map('trim', explode('|', $line));
|
||||
};
|
||||
$isSep = function (string $line): bool {
|
||||
return (bool) preg_match('/^\|?[\s|:\-]+\|?$/', $line) && strpos($line, '-') !== false;
|
||||
};
|
||||
|
||||
foreach ($lines as $line) {
|
||||
if (strncmp($line, '```', 3) === 0) {
|
||||
$flushAll();
|
||||
if ($inCode) {
|
||||
$langAttr = $codeLang !== '' ? ' class="language-' . e($codeLang) . '"' : '';
|
||||
$html .= '<pre><code' . $langAttr . '>' . fws_md_escape(trim($code)) . "</code></pre>\n";
|
||||
$code = '';
|
||||
$codeLang = '';
|
||||
$inCode = false;
|
||||
} else {
|
||||
$inCode = true;
|
||||
$codeLang = trim(substr($line, 3));
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($inCode) {
|
||||
$code .= ($code !== '' ? "\n" : '') . $line;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (trim($line) === '') {
|
||||
$flushAll();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (preg_match('/^(#{1,6})\s+(.+)$/', $line, $m)) {
|
||||
$flushAll();
|
||||
$lvl = strlen($m[1]);
|
||||
$html .= '<h' . $lvl . '>' . fws_md_inline($m[2]) . '</h' . $lvl . ">\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (preg_match('/^[-*_]{3,}\s*$/', trim($line))) {
|
||||
$flushAll();
|
||||
$html .= "<hr>\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strncmp(ltrim($line), '>', 1) === 0) {
|
||||
$flushList();
|
||||
$flushTable();
|
||||
$quoteBuf .= '<p>' . fws_md_inline((string) preg_replace('/^>\s?/', '', $line)) . '</p>';
|
||||
continue;
|
||||
}
|
||||
$flushQuote();
|
||||
|
||||
if (strpos($line, '|') !== false && !$isSep($line)) {
|
||||
$flushList();
|
||||
$tag = $tableHeader ? 'th' : 'td';
|
||||
$row = '<tr>';
|
||||
foreach ($cells($line) as $c) {
|
||||
$row .= '<' . $tag . '>' . fws_md_inline($c) . '</' . $tag . '>';
|
||||
}
|
||||
$row .= '</tr>';
|
||||
$tableRows[] = $row;
|
||||
$tableHeader = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($isSep($line)) {
|
||||
$tableHeader = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (preg_match('/^(\s*)[-*+]\s+(.+)$/', $line, $m)) {
|
||||
$flushTable();
|
||||
if ($listKind !== 'ul') {
|
||||
$flushList();
|
||||
$listKind = 'ul';
|
||||
}
|
||||
$listBuf .= '<li>' . fws_md_inline($m[2]) . "</li>\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if (preg_match('/^(\s*)\d+\.\s+(.+)$/', $line, $m)) {
|
||||
$flushTable();
|
||||
if ($listKind !== 'ol') {
|
||||
$flushList();
|
||||
$listKind = 'ol';
|
||||
}
|
||||
$listBuf .= '<li>' . fws_md_inline($m[2]) . "</li>\n";
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($listBuf !== '' && preg_match('/^\s{2,}/', $line)) {
|
||||
$listBuf = (string) preg_replace('/<\/li>\n$/', ' ' . fws_md_inline(trim($line)) . "</li>\n", $listBuf);
|
||||
continue;
|
||||
}
|
||||
|
||||
$flushList();
|
||||
$flushTable();
|
||||
$html .= '<p>' . fws_md_inline($line) . "</p>\n";
|
||||
}
|
||||
|
||||
$flushAll();
|
||||
if ($inCode) {
|
||||
$langAttr = $codeLang !== '' ? ' class="language-' . e($codeLang) . '"' : '';
|
||||
$html .= '<pre><code' . $langAttr . '>' . fws_md_escape(trim($code)) . "</code></pre>\n";
|
||||
}
|
||||
|
||||
return fws_sanitize_html($html);
|
||||
}
|
||||
|
||||
/** Retire scripts/événements/URL javascript: du HTML généré côté serveur. */
|
||||
function fws_sanitize_html(string $html): string
|
||||
{
|
||||
$html = (string) preg_replace('#<\s*(script|iframe|object|embed|link|style)\b[^>]*>.*?<\s*/\s*\1\s*>#is', '', $html);
|
||||
$html = (string) preg_replace('#<\s*(script|iframe|object|embed|link|style)\b[^>]*/?>#i', '', $html);
|
||||
$html = (string) preg_replace_callback(
|
||||
'/\son\w+\s*=\s*("[^"]*"|\'[^\']*\'|[^\s>]+)/i',
|
||||
static function ($m) {
|
||||
return '';
|
||||
},
|
||||
$html
|
||||
);
|
||||
$html = (string) preg_replace('/(href|src)\s*=\s*(["\'])\s*javascript:[^"\']*\2/i', '$1="#"', $html);
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tronque un rendu HTML vers ~N caractères de texte (portage de truncateHtml),
|
||||
* sans couper au milieu d'une balise : on retire les blocs entiers en trop.
|
||||
* Renvoie ['html' => …, 'truncated' => bool].
|
||||
*/
|
||||
function fws_truncate_html(string $html, int $limit = 600): array
|
||||
{
|
||||
$text = trim((string) preg_replace('/\s+/u', ' ', strip_tags($html)));
|
||||
if (mb_strlen($text) <= $limit) {
|
||||
return ['html' => $html, 'truncated' => false];
|
||||
}
|
||||
|
||||
$blocks = preg_split('/(?=<)/', $html) ?: [$html];
|
||||
$acc = '';
|
||||
$count = 0;
|
||||
$out = '';
|
||||
foreach ($blocks as $block) {
|
||||
if ($block === '') {
|
||||
continue;
|
||||
}
|
||||
$blockText = trim((string) preg_replace('/\s+/u', ' ', strip_tags($block)));
|
||||
/* On ne coupe qu'avant un bloc porteur de texte : les blocs vides
|
||||
(fermetures </p>, </div>…) suivent toujours leur ouverture, sinon
|
||||
on produirait du HTML non fermé. */
|
||||
if ($blockText !== '' && $count > 0 && $count + mb_strlen($blockText) > $limit) {
|
||||
break;
|
||||
}
|
||||
$out .= $block;
|
||||
if ($blockText !== '') {
|
||||
$count += mb_strlen($blockText);
|
||||
}
|
||||
}
|
||||
if ($out === '') {
|
||||
$out = '<p>' . e(mb_substr($text, 0, $limit)) . '…</p>';
|
||||
return ['html' => $out, 'truncated' => true];
|
||||
}
|
||||
return ['html' => $out, 'truncated' => true];
|
||||
}
|
||||
-83
@@ -1,83 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description"
|
||||
content="Site statique one-page avec navigation par URL et chargement dynamique du contenu." />
|
||||
<title>Fws Web</title>
|
||||
<link rel="stylesheet" href="p/assets/main-styles/styles.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="page-shell">
|
||||
<header class="site-header">
|
||||
<div class="header-brand-block">
|
||||
<a class="brand" href="/?p/index/" data-route="index" aria-label="Retour à l'accueil">
|
||||
<img class="brand-mark" src="p/assets/img/logo.png" alt="Logo Fws Linux" />
|
||||
<span class="brand-text">
|
||||
<strong>Fws Linux</strong>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="site-nav" aria-label="Navigation principale">
|
||||
<a href="/?p/index/" data-route="index">Accueil</a>
|
||||
<a href="/?p/dl/" data-route="dl">Downloads</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main id="app-main" class="site-main" aria-live="polite">
|
||||
<noscript>Ce site a besoin de JavaScript pour charger les pages dans la zone principale.</noscript>
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<div class="footer-content">
|
||||
<div class="footer-brand-row">
|
||||
<div class="footer-brand-block">
|
||||
<img class="footer-brand-mark" src="p/assets/img/logo.png" alt="Logo Fws Linux" />
|
||||
<div>
|
||||
<strong>Fws Linux</strong>
|
||||
<p>Un site simple, rapide, et pensé pour naviguer entre plusieurs pages sans quitter l'accueil.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="footer-note">Contact, aide, et liens utiles au même endroit.</p>
|
||||
</div>
|
||||
|
||||
<div class="footer-links-grid">
|
||||
<section>
|
||||
<h2>Navigation</h2>
|
||||
<a href="/?p/index/" data-route="index">Accueil</a>
|
||||
<a href="/?p/dl/" data-route="dl">Downloads</a>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Contact</h2>
|
||||
<a href="mailto:contact@fwslinux.fr">Envoyer un mail</a>
|
||||
<a href="tel:+33000000000">Téléphone</a>
|
||||
<a href="/?p/contact/" data-route="contact">Page de contact</a>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Réseaux</h2>
|
||||
<a href="https://github.com/" target="_blank" rel="noreferrer">GitHub</a>
|
||||
<a href="https://www.instagram.com/" target="_blank" rel="noreferrer">Instagram</a>
|
||||
<a href="https://www.linkedin.com/" target="_blank" rel="noreferrer">LinkedIn</a>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="footer-bottom">
|
||||
<p>© <span id="footer-year">2026</span> Fws Linux</p>
|
||||
<p class="footer-release">Dernière release : non affichée</p>
|
||||
<p class="footer-commit">Dernier commit : non affiché</p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script src="p/assets/main-nav/app.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — point d'entrée alternatif (/index.php) : délègue à page.php.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/page.php';
|
||||
@@ -0,0 +1,225 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page 404 (incluse par page.php avec http_response_code(404)).
|
||||
*
|
||||
* La scène (Tux qui débranche le câble RJ45 d'un switch) est un SVG statique
|
||||
* dans son état « branché » ; p/assets/js/not-found.js anime ensuite Tux, le
|
||||
* connecteur et le câble (physique à ressort, câble recalculé chaque image).
|
||||
* Sans JavaScript, la scène reste propre et immobile.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!isset($title, $extraCss, $extraJs)) {
|
||||
http_response_code(404);
|
||||
exit('Page introuvable.');
|
||||
}
|
||||
|
||||
$title = 'Page introuvable | FWS Linux';
|
||||
$extraCss[] = fws_url('/p/assets/styles/404.css');
|
||||
$extraJs[] = fws_url('/p/assets/js/not-found.js');
|
||||
?>
|
||||
<section class="notfound" aria-labelledby="notfound-title">
|
||||
<div class="notfound-copy">
|
||||
<p class="notfound-code" aria-hidden="true">404</p>
|
||||
<h1 class="notfound-title" id="notfound-title">Cette page a été débranchée</h1>
|
||||
<p class="notfound-lead">Tux a tiré un peu fort sur le câble RJ45… La page demandée n'existe pas ou a été déplacée. Le reste du réseau tient bon.</p>
|
||||
<div class="notfound-actions">
|
||||
<a class="button button-primary" href="<?= e(fws_url('/?p/index/')) ?>">Retour à l'accueil</a>
|
||||
<a class="button button-secondary" href="<?= e(fws_url('/?p/contact/')) ?>">Signaler un lien cassé</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="notfound-visual" aria-hidden="true">
|
||||
<svg class="nf-scene" viewBox="0 0 720 440" xmlns="http://www.w3.org/2000/svg" focusable="false">
|
||||
<defs>
|
||||
<linearGradient id="nf-switch-body" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#3a4a68" />
|
||||
<stop offset="1" stop-color="#202b3e" />
|
||||
</linearGradient>
|
||||
<radialGradient id="nf-ambient" cx="50%" cy="50%" r="50%">
|
||||
<stop offset="0" stop-color="rgba(56,189,248,0.15)" />
|
||||
<stop offset="1" stop-color="rgba(56,189,248,0)" />
|
||||
</radialGradient>
|
||||
<radialGradient id="nf-ground-shadow" cx="50%" cy="50%" r="50%">
|
||||
<stop offset="0" stop-color="rgba(3,7,15,0.55)" />
|
||||
<stop offset="0.55" stop-color="rgba(3,7,15,0.26)" />
|
||||
<stop offset="1" stop-color="rgba(3,7,15,0)" />
|
||||
</radialGradient>
|
||||
<radialGradient id="nf-tux-glow" cx="50%" cy="50%" r="50%">
|
||||
<stop offset="0" stop-color="rgba(125,211,252,0.22)" />
|
||||
<stop offset="1" stop-color="rgba(125,211,252,0)" />
|
||||
</radialGradient>
|
||||
<linearGradient id="nf-body" gradientUnits="userSpaceOnUse" x1="140" y1="96" x2="300" y2="370">
|
||||
<stop offset="0" stop-color="#26334a" />
|
||||
<stop offset="0.5" stop-color="#0d1420" />
|
||||
<stop offset="1" stop-color="#05080e" />
|
||||
</linearGradient>
|
||||
<linearGradient id="nf-body-light" gradientUnits="userSpaceOnUse" x1="265" y1="236" x2="320" y2="270">
|
||||
<stop offset="0" stop-color="#1d2739" />
|
||||
<stop offset="1" stop-color="#080d15" />
|
||||
</linearGradient>
|
||||
<linearGradient id="nf-web" gradientUnits="userSpaceOnUse" x1="112" y1="326" x2="316" y2="384">
|
||||
<stop offset="0" stop-color="#fcd34d" />
|
||||
<stop offset="1" stop-color="#ef8f16" />
|
||||
</linearGradient>
|
||||
<linearGradient id="nf-belly" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#ffffff" />
|
||||
<stop offset="1" stop-color="#dae2ec" />
|
||||
</linearGradient>
|
||||
<linearGradient id="nf-beak" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#fcd34d" />
|
||||
<stop offset="1" stop-color="#f59e0b" />
|
||||
</linearGradient>
|
||||
<linearGradient id="nf-plug" x1="0" y1="0" x2="0" y2="1">
|
||||
<stop offset="0" stop-color="#e2e8f0" />
|
||||
<stop offset="1" stop-color="#b6c2d1" />
|
||||
</linearGradient>
|
||||
<clipPath id="nf-body-clip">
|
||||
<path d="M 215 96 C 172 96 145 124 143 164 C 142 192 155 212 157 232 C 145 258 134 294 134 322 C 134 354 167 370 215 370 C 263 370 296 354 296 322 C 296 294 285 258 273 232 C 275 212 288 192 287 164 C 285 124 258 96 215 96 Z" />
|
||||
</clipPath>
|
||||
</defs>
|
||||
|
||||
<!-- Ambiance -->
|
||||
<ellipse cx="420" cy="330" rx="340" ry="130" fill="url(#nf-ambient)" />
|
||||
<ellipse cx="212" cy="252" rx="190" ry="200" fill="url(#nf-tux-glow)" />
|
||||
|
||||
<!-- ── Switch ──────────────────────────────────────────────────────── -->
|
||||
<g id="nf-switch">
|
||||
<ellipse cx="515" cy="304" rx="196" ry="18" fill="url(#nf-ground-shadow)" />
|
||||
<rect x="326" y="196" width="16" height="40" rx="4" fill="#1b2434" />
|
||||
<rect x="688" y="196" width="16" height="40" rx="4" fill="#1b2434" />
|
||||
<rect x="340" y="120" width="350" height="172" rx="20" fill="url(#nf-switch-body)" stroke="rgba(148,163,184,0.28)" stroke-width="2" />
|
||||
<rect x="344" y="124" width="342" height="42" rx="16" fill="rgba(226,232,240,0.06)" />
|
||||
<circle cx="668" cy="146" r="7" fill="#22c55e" opacity="0.2" />
|
||||
<circle cx="668" cy="146" r="3.5" fill="#22c55e" />
|
||||
<text x="364" y="152" fill="rgba(226,232,240,0.75)" font-family="'Segoe UI', system-ui, sans-serif" font-size="16" font-weight="600">SW-FWS-01</text>
|
||||
|
||||
<!-- Pastille « link down » -->
|
||||
<g id="nf-badge" opacity="0">
|
||||
<circle cx="648" cy="150" r="18" fill="#ef4444" />
|
||||
<circle cx="648" cy="150" r="18" fill="none" stroke="rgba(255,255,255,0.35)" stroke-width="2" />
|
||||
<rect x="645.5" y="140" width="5" height="12" rx="2.5" fill="#ffffff" />
|
||||
<circle cx="648" cy="158" r="3" fill="#ffffff" />
|
||||
</g>
|
||||
|
||||
<!-- Bandeau des ports -->
|
||||
<rect x="356" y="196" width="318" height="68" rx="12" fill="#141d2b" stroke="rgba(15,23,42,0.6)" />
|
||||
|
||||
<?php foreach ([372, 414, 456, 498, 540, 582] as $i => $px): ?>
|
||||
<g>
|
||||
<rect x="<?= $px ?>" y="216" width="34" height="26" rx="5" fill="#0b1220" stroke="rgba(148,163,184,0.3)" />
|
||||
<rect x="<?= $px + 5 ?>" y="221" width="24" height="16" rx="3" fill="#070d18" />
|
||||
<rect x="<?= $px + 12 ?>" y="214" width="10" height="5" rx="2" fill="#2b3a52" />
|
||||
<?php foreach ([8, 13, 18, 23] as $g): ?>
|
||||
<rect x="<?= $px + $g ?>" y="230" width="2.5" height="5" rx="1" fill="rgba(245,158,11,0.55)" />
|
||||
<?php endforeach; ?>
|
||||
<text x="<?= $px + 17 ?>" y="259" text-anchor="middle" fill="rgba(148,163,184,0.45)" font-family="'Segoe UI', system-ui, sans-serif" font-size="10"><?= $i + 1 ?></text>
|
||||
</g>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<!-- Anneau du port utilisé -->
|
||||
<rect x="538" y="213" width="38" height="32" rx="7" fill="none" stroke="rgba(56,189,248,0.45)" />
|
||||
|
||||
<!-- LED du port utilisé -->
|
||||
<circle class="nf-led-green" cx="557" cy="186" r="12" fill="#22c55e" opacity="0.18" />
|
||||
<circle class="nf-led-green" cx="557" cy="186" r="6" fill="#22c55e" />
|
||||
<circle class="nf-led-red" cx="557" cy="186" r="12" fill="#ef4444" opacity="0" />
|
||||
<circle class="nf-led-red" cx="557" cy="186" r="6" fill="#ef4444" opacity="0" />
|
||||
|
||||
<!-- LED des autres ports -->
|
||||
<?php foreach ([389, 431, 473, 515, 599] as $lx): ?>
|
||||
<circle cx="<?= $lx ?>" cy="186" r="5" fill="#22c55e" opacity="0.32" />
|
||||
<?php endforeach; ?>
|
||||
</g>
|
||||
|
||||
<!-- Étincelle de débranchement -->
|
||||
<g id="nf-spark" opacity="0" transform="translate(557 228) scale(0.7) translate(-557 -228)">
|
||||
<g stroke="#fde68a" stroke-width="2.5" stroke-linecap="round">
|
||||
<line x1="557" y1="212" x2="557" y2="198" />
|
||||
<line x1="541" y1="216" x2="530" y2="206" />
|
||||
<line x1="573" y1="216" x2="584" y2="206" />
|
||||
<line x1="536" y1="232" x2="520" y2="232" />
|
||||
<line x1="578" y1="232" x2="594" y2="232" />
|
||||
</g>
|
||||
<circle cx="557" cy="205" r="3" fill="#fef3c7" />
|
||||
<circle cx="534" cy="212" r="2.4" fill="#fef3c7" />
|
||||
<circle cx="581" cy="213" r="2.4" fill="#fef3c7" />
|
||||
</g>
|
||||
|
||||
<!-- ── Tux ─────────────────────────────────────────────────────────── -->
|
||||
<!-- L'ombre est posée à plat au sol, hors du groupe #nf-tux : c'est le JS
|
||||
qui la tasse et la décale quand Tux se retrouve assis. -->
|
||||
<ellipse id="nf-shadow" cx="215" cy="376" rx="96" ry="17" fill="url(#nf-ground-shadow)" />
|
||||
|
||||
<g id="nf-tux">
|
||||
<!-- Aileron arrière -->
|
||||
<ellipse cx="132" cy="268" rx="19" ry="58" transform="rotate(12 132 268)" fill="url(#nf-body)" stroke="rgba(125,211,252,0.22)" stroke-width="2" />
|
||||
|
||||
<!-- Corps -->
|
||||
<path d="M 215 96 C 172 96 145 124 143 164 C 142 192 155 212 157 232 C 145 258 134 294 134 322 C 134 354 167 370 215 370 C 263 370 296 354 296 322 C 296 294 285 258 273 232 C 275 212 288 192 287 164 C 285 124 258 96 215 96 Z"
|
||||
fill="url(#nf-body)" stroke="rgba(125,211,252,0.32)" stroke-width="2" />
|
||||
|
||||
<g clip-path="url(#nf-body-clip)">
|
||||
<path d="M 215 200 C 178 200 162 240 160 286 C 158 320 178 340 215 340 C 252 340 272 320 270 286 C 268 240 252 200 215 200 Z" fill="url(#nf-belly)" />
|
||||
</g>
|
||||
|
||||
<g id="nf-eyes">
|
||||
<ellipse cx="190" cy="150" rx="27" ry="31" fill="#f8fafc" />
|
||||
<ellipse cx="238" cy="150" rx="27" ry="31" fill="#f8fafc" />
|
||||
<circle cx="194" cy="153" r="14" fill="#0b1220" />
|
||||
<circle cx="234" cy="153" r="14" fill="#0b1220" />
|
||||
<circle cx="188" cy="146" r="4.5" fill="#ffffff" />
|
||||
<circle cx="228" cy="146" r="4.5" fill="#ffffff" />
|
||||
</g>
|
||||
|
||||
<!-- Bec -->
|
||||
<path d="M 209 168 C 240 170 266 180 280 193 C 268 212 240 220 211 217 C 189 214 175 202 177 189 C 180 176 192 168 209 168 Z"
|
||||
fill="url(#nf-beak)" stroke="rgba(120,53,15,0.25)" stroke-width="1.5" />
|
||||
<path d="M 186 197 C 208 204 242 200 264 191" fill="none" stroke="rgba(120,53,15,0.45)" stroke-width="2.5" stroke-linecap="round" />
|
||||
|
||||
<!-- Pattes palmées (devant le corps pour rester visibles) -->
|
||||
<g id="nf-foot-l">
|
||||
<g transform="translate(168 346) rotate(-16) scale(-0.82 0.7)">
|
||||
<path d="M -8 -18 C 8 -24 26 -22 38 -14 C 48 -7 49 6 40 16 C 30 26 12 30 -4 26 C -12 18 -14 -6 -8 -18 Z" fill="url(#nf-web)" />
|
||||
<circle cx="48" cy="-16" r="12.5" fill="url(#nf-web)" />
|
||||
<circle cx="49" cy="6" r="12.5" fill="url(#nf-web)" />
|
||||
<circle cx="36" cy="27" r="12.5" fill="url(#nf-web)" />
|
||||
</g>
|
||||
<path d="M 158 342 C 150 343 141 344 133 346 M 156 346 C 150 352 142 357 134 360" fill="none" stroke="rgba(146,64,14,0.45)" stroke-width="2" stroke-linecap="round" />
|
||||
</g>
|
||||
<g id="nf-foot-r">
|
||||
<g transform="translate(262 346) rotate(16) scale(0.82 0.7)">
|
||||
<path d="M -8 -18 C 8 -24 26 -22 38 -14 C 48 -7 49 6 40 16 C 30 26 12 30 -4 26 C -12 18 -14 -6 -8 -18 Z" fill="url(#nf-web)" />
|
||||
<circle cx="48" cy="-16" r="12.5" fill="url(#nf-web)" />
|
||||
<circle cx="49" cy="6" r="12.5" fill="url(#nf-web)" />
|
||||
<circle cx="36" cy="27" r="12.5" fill="url(#nf-web)" />
|
||||
</g>
|
||||
<path d="M 272 342 C 280 343 289 344 297 346 M 274 346 C 280 352 288 357 296 360" fill="none" stroke="rgba(146,64,14,0.45)" stroke-width="2" stroke-linecap="round" />
|
||||
</g>
|
||||
</g>
|
||||
|
||||
<!-- ── Câble (recalculé par le JS) ─────────────────────────────────── -->
|
||||
<path class="nf-cable" d="M 534 236 C 466 328, 372 328, 304 256" fill="none" stroke="#38bdf8" stroke-width="13" stroke-linecap="round" stroke-linejoin="round" opacity="0.12" />
|
||||
<path class="nf-cable" d="M 534 236 C 466 328, 372 328, 304 256" fill="none" stroke="#475569" stroke-width="9" stroke-linecap="round" stroke-linejoin="round" />
|
||||
<path class="nf-cable" d="M 534 236 C 466 328, 372 328, 304 256" fill="none" stroke="#94a3b8" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" opacity="0.5" />
|
||||
|
||||
<!-- ── Aileron avant (tient le câble) ──────────────────────────────── -->
|
||||
<g id="nf-arm">
|
||||
<ellipse cx="285" cy="253" rx="25" ry="14.5" transform="rotate(6.5 285 253)" fill="url(#nf-body-light)" stroke="rgba(125,211,252,0.3)" stroke-width="2" />
|
||||
<ellipse cx="304" cy="256" rx="14.5" ry="12.5" fill="url(#nf-body-light)" stroke="rgba(125,211,252,0.3)" stroke-width="2" />
|
||||
</g>
|
||||
|
||||
<!-- ── Connecteur RJ45 ─────────────────────────────────────────────── -->
|
||||
<g id="nf-connector">
|
||||
<rect x="524" y="229" width="12" height="14" rx="3" fill="#475569" />
|
||||
<rect x="534" y="223" width="32" height="22" rx="4" fill="url(#nf-plug)" stroke="#94a3b8" stroke-width="1.5" />
|
||||
<rect x="540" y="216" width="14" height="9" rx="2" fill="#94a3b8" />
|
||||
<rect x="534" y="227" width="9" height="3" rx="1.5" fill="#f59e0b" />
|
||||
<rect x="534" y="232" width="9" height="3" rx="1.5" fill="#f59e0b" />
|
||||
<rect x="534" y="237" width="9" height="3" rx="1.5" fill="#f59e0b" />
|
||||
<rect x="546" y="226" width="14" height="3" rx="1.5" fill="rgba(255,255,255,0.6)" />
|
||||
</g>
|
||||
</svg>
|
||||
</div>
|
||||
</section>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 23 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 79 KiB |
@@ -0,0 +1,155 @@
|
||||
(() => {
|
||||
"use strict";
|
||||
|
||||
const existingCleanup = window.__heroCarouselCleanup;
|
||||
if (typeof existingCleanup === "function") {
|
||||
existingCleanup();
|
||||
}
|
||||
|
||||
const hero = document.querySelector(".hero-carousel");
|
||||
if (!hero) {
|
||||
return;
|
||||
}
|
||||
|
||||
const slides = Array.from(hero.querySelectorAll("[data-hero-slide]"));
|
||||
const prevButton = hero.querySelector("[data-hero-prev]");
|
||||
const nextButton = hero.querySelector("[data-hero-next]");
|
||||
const dotsContainer = hero.querySelector("[data-hero-dots]");
|
||||
|
||||
if (!slides.length || !prevButton || !nextButton || !dotsContainer) {
|
||||
return;
|
||||
}
|
||||
|
||||
let currentIndex = Math.max(
|
||||
0,
|
||||
slides.findIndex((slide) => slide.classList.contains("is-active"))
|
||||
);
|
||||
let autoRotateTimer = null;
|
||||
const rotateDelay = 5500;
|
||||
const abortController = new AbortController();
|
||||
const { signal } = abortController;
|
||||
|
||||
const dots = slides.map((_, index) => {
|
||||
const dot = document.createElement("button");
|
||||
dot.type = "button";
|
||||
dot.className = "hero-dot";
|
||||
dot.setAttribute("role", "tab");
|
||||
dot.setAttribute("aria-label", `Aller a l'image ${index + 1}`);
|
||||
dot.dataset.index = index.toString();
|
||||
dotsContainer.appendChild(dot);
|
||||
return dot;
|
||||
});
|
||||
|
||||
function updateUI() {
|
||||
slides.forEach((slide, index) => {
|
||||
const isActive = index === currentIndex;
|
||||
slide.classList.toggle("is-active", isActive);
|
||||
slide.setAttribute("aria-hidden", String(!isActive));
|
||||
});
|
||||
|
||||
dots.forEach((dot, index) => {
|
||||
const isActive = index === currentIndex;
|
||||
dot.classList.toggle("is-active", isActive);
|
||||
dot.setAttribute("aria-selected", String(isActive));
|
||||
dot.tabIndex = isActive ? 0 : -1;
|
||||
});
|
||||
}
|
||||
|
||||
function goTo(index) {
|
||||
if (index < 0) {
|
||||
currentIndex = slides.length - 1;
|
||||
} else if (index >= slides.length) {
|
||||
currentIndex = 0;
|
||||
} else {
|
||||
currentIndex = index;
|
||||
}
|
||||
updateUI();
|
||||
}
|
||||
|
||||
function stopAutoRotate() {
|
||||
if (autoRotateTimer !== null) {
|
||||
window.clearInterval(autoRotateTimer);
|
||||
autoRotateTimer = null;
|
||||
}
|
||||
}
|
||||
|
||||
function startAutoRotate() {
|
||||
stopAutoRotate();
|
||||
autoRotateTimer = window.setInterval(() => {
|
||||
goTo(currentIndex + 1);
|
||||
}, rotateDelay);
|
||||
}
|
||||
|
||||
prevButton.addEventListener(
|
||||
"click",
|
||||
() => {
|
||||
goTo(currentIndex - 1);
|
||||
startAutoRotate();
|
||||
},
|
||||
{ signal }
|
||||
);
|
||||
|
||||
nextButton.addEventListener(
|
||||
"click",
|
||||
() => {
|
||||
goTo(currentIndex + 1);
|
||||
startAutoRotate();
|
||||
},
|
||||
{ signal }
|
||||
);
|
||||
|
||||
dotsContainer.addEventListener(
|
||||
"click",
|
||||
(event) => {
|
||||
const button = event.target.closest(".hero-dot");
|
||||
if (!button) {
|
||||
return;
|
||||
}
|
||||
|
||||
const targetIndex = Number.parseInt(button.dataset.index || "0", 10);
|
||||
goTo(targetIndex);
|
||||
startAutoRotate();
|
||||
},
|
||||
{ signal }
|
||||
);
|
||||
|
||||
hero.addEventListener(
|
||||
"mouseenter",
|
||||
() => {
|
||||
stopAutoRotate();
|
||||
},
|
||||
{ signal }
|
||||
);
|
||||
|
||||
hero.addEventListener(
|
||||
"mouseleave",
|
||||
() => {
|
||||
startAutoRotate();
|
||||
},
|
||||
{ signal }
|
||||
);
|
||||
|
||||
document.addEventListener(
|
||||
"visibilitychange",
|
||||
() => {
|
||||
if (document.hidden) {
|
||||
stopAutoRotate();
|
||||
} else {
|
||||
startAutoRotate();
|
||||
}
|
||||
},
|
||||
{ signal }
|
||||
);
|
||||
|
||||
updateUI();
|
||||
startAutoRotate();
|
||||
|
||||
window.__heroCarouselCleanup = () => {
|
||||
stopAutoRotate();
|
||||
abortController.abort();
|
||||
};
|
||||
|
||||
document.addEventListener("page:before-route-change", window.__heroCarouselCleanup, {
|
||||
once: true,
|
||||
});
|
||||
})();
|
||||
@@ -0,0 +1,372 @@
|
||||
/**
|
||||
* FWS Linux — animation de la page 404.
|
||||
*
|
||||
* Une seule fois, puis on s'arrête sur l'image finale : Tux s'approche du switch,
|
||||
* saisit le câble RJ45 et tire (le connecteur sort du port, la LED passe au
|
||||
* rouge, une pastille « link down » apparaît). Le coup de fil le déséquilibre :
|
||||
* il tombe en arrière sur le fesse et reste assis, le câble toujours dans la
|
||||
* main, tandis que le connecteur finit au sol au pied du switch.
|
||||
*
|
||||
* Tant qu'il est branché, le connecteur suit sa cible via un ressort
|
||||
* sous-amorti ; une fois débranché il devient un point libre soumis à la gravité
|
||||
* (rebond, frottement, torsion jusqu'à l'arrêt à plat). Le tracé du câble est
|
||||
* recalculé à chaque image : le mou, le balancement et la traînée au sol en
|
||||
* découlent.
|
||||
*
|
||||
* Sans JavaScript, la scène reste dans son état « branché » défini dans le SVG.
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var svg = document.querySelector('.nf-scene');
|
||||
if (!svg) {
|
||||
return;
|
||||
}
|
||||
|
||||
var el = {
|
||||
switchBox: svg.querySelector('#nf-switch'),
|
||||
shadow: svg.querySelector('#nf-shadow'),
|
||||
tux: svg.querySelector('#nf-tux'),
|
||||
arm: svg.querySelector('#nf-arm'),
|
||||
connector: svg.querySelector('#nf-connector'),
|
||||
cables: svg.querySelectorAll('.nf-cable'),
|
||||
ledGreen: svg.querySelectorAll('.nf-led-green'),
|
||||
ledRed: svg.querySelectorAll('.nf-led-red'),
|
||||
badge: svg.querySelector('#nf-badge'),
|
||||
spark: svg.querySelector('#nf-spark'),
|
||||
footL: svg.querySelector('#nf-foot-l'),
|
||||
footR: svg.querySelector('#nf-foot-r'),
|
||||
eyes: svg.querySelector('#nf-eyes')
|
||||
};
|
||||
|
||||
if (!el.tux || !el.arm || !el.connector || !el.cables.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Géométrie — doit rester synchronisée avec le dessin dans p/404.php. */
|
||||
var G = {
|
||||
walk: [215, 358], // pivot de la marche, entre les deux pattes
|
||||
hip: [215, 322], // fesse : pivot de la chute en arrière
|
||||
shoulder: [265, 250],
|
||||
hand: [304, 256],
|
||||
footL: [168, 346], // chevilles : pivot de la contre-rotation des pattes
|
||||
footR: [262, 346],
|
||||
plugPivot: [555, 236],
|
||||
connAttach: [534, 236],
|
||||
ground: 374
|
||||
};
|
||||
|
||||
/* Pose finale : assis, dos voûté, câble toujours en main. Les valeurs sont
|
||||
calées pour que le bas du corps touche le sol et que la tête reste dans le
|
||||
cadre (viewBox 0 0 720 440). */
|
||||
var SIT = { deg: -32, x: -20, y: -10, arm: -24, foot: 50, footDropL: 6, footDropR: 62 };
|
||||
|
||||
/* Timeline (ms) : tout se joue une fois, puis l'image finale reste. */
|
||||
var APPROACH_A = 700, APPROACH_B = 1500;
|
||||
var PULL_A = 1800;
|
||||
/* La chute part exactement du décrochage : plus de temps mort entre les deux. */
|
||||
var RELEASE = 2900, FALL_A = RELEASE, FALL_B = 4050;
|
||||
var TOTAL = 5500;
|
||||
|
||||
var APPROACH_X = 14, PULL_X = 22, STUMBLE_X = 18;
|
||||
var GRAVITY = 1600;
|
||||
|
||||
/* ── Helpers ─────────────────────────────────────────────────────────── */
|
||||
|
||||
function clamp01(x) { return x < 0 ? 0 : (x > 1 ? 1 : x); }
|
||||
function lerp(a, b, k) { return a + (b - a) * k; }
|
||||
function smoothstep(e0, e1, x) {
|
||||
var t = clamp01((x - e0) / (e1 - e0));
|
||||
return t * t * (3 - 2 * t);
|
||||
}
|
||||
function easeInOut(t) {
|
||||
return t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;
|
||||
}
|
||||
|
||||
function mul(A, B) {
|
||||
return [
|
||||
A[0] * B[0] + A[2] * B[1],
|
||||
A[1] * B[0] + A[3] * B[1],
|
||||
A[0] * B[2] + A[2] * B[3],
|
||||
A[1] * B[2] + A[3] * B[3],
|
||||
A[0] * B[4] + A[2] * B[5] + A[4],
|
||||
A[1] * B[4] + A[3] * B[5] + A[5]
|
||||
];
|
||||
}
|
||||
function tr(x, y) { return [1, 0, 0, 1, x, y]; }
|
||||
function rot(deg, cx, cy) {
|
||||
var r = deg * Math.PI / 180, c = Math.cos(r), s = Math.sin(r);
|
||||
return [c, s, -s, c, cx - c * cx + s * cy, cy - s * cx - c * cy];
|
||||
}
|
||||
function apply(m, x, y) { return [m[0] * x + m[2] * y + m[4], m[1] * x + m[3] * y + m[5]]; }
|
||||
function tx(x, y, deg, px, py) {
|
||||
return 'translate(' + x.toFixed(2) + ' ' + y.toFixed(2) + ')'
|
||||
+ (deg ? ' rotate(' + deg.toFixed(2) + ' ' + px.toFixed(1) + ' ' + py.toFixed(1) + ')' : '');
|
||||
}
|
||||
function setOpacity(list, value) {
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
list[i].setAttribute('opacity', value.toFixed(3));
|
||||
}
|
||||
}
|
||||
function setCable(d) {
|
||||
for (var i = 0; i < el.cables.length; i++) {
|
||||
el.cables[i].setAttribute('d', d);
|
||||
}
|
||||
}
|
||||
|
||||
/* ── État persistant ─────────────────────────────────────────────────── */
|
||||
|
||||
var springX = 0, springV = 0; // connecteur tant qu'il est dans le port
|
||||
var gait = 0;
|
||||
var released = false; // le connecteur est-il tombé ?
|
||||
var plug = { x: 0, y: 0, vx: 0, vy: 0, rest: false };
|
||||
var connDeg = 0, connDegV = 0;
|
||||
|
||||
function springStep(pos, vel, target, k, d, dt) {
|
||||
var acc = -k * (pos - target) - d * vel;
|
||||
vel += acc * dt;
|
||||
pos += vel * dt;
|
||||
return [pos, vel];
|
||||
}
|
||||
|
||||
/* Chute du connecteur : gravité, rebond amorti, frottement au sol. */
|
||||
function fallPoint(pt, dt) {
|
||||
if (pt.rest) {
|
||||
return;
|
||||
}
|
||||
pt.vy += GRAVITY * dt;
|
||||
pt.vx *= 0.995;
|
||||
pt.x += pt.vx * dt;
|
||||
pt.y += pt.vy * dt;
|
||||
if (pt.y >= G.ground) {
|
||||
pt.y = G.ground;
|
||||
if (pt.vy > 40) {
|
||||
pt.vy = -pt.vy * 0.34; // rebond
|
||||
pt.vx *= 0.55;
|
||||
} else {
|
||||
pt.vy = 0;
|
||||
}
|
||||
pt.vx *= 0.84; // frottement
|
||||
if (Math.abs(pt.vx) < 7 && Math.abs(pt.vy) < 1) {
|
||||
pt.vx = 0;
|
||||
pt.rest = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Un pas d'animation ──────────────────────────────────────────────── */
|
||||
|
||||
function advance(t, dt) {
|
||||
var approach = smoothstep(APPROACH_A, APPROACH_B, t);
|
||||
|
||||
/* Courbe de traction : Tux tire, puis se laisse retomber en arrière. */
|
||||
var pull;
|
||||
if (t <= PULL_A) {
|
||||
pull = 0;
|
||||
} else if (t < RELEASE) {
|
||||
pull = easeInOut((t - PULL_A) / (RELEASE - PULL_A));
|
||||
} else if (t < FALL_A) {
|
||||
pull = 1;
|
||||
} else {
|
||||
pull = 1 - 0.5 * clamp01((t - FALL_A) / (FALL_B - FALL_A));
|
||||
}
|
||||
|
||||
/* Chute : de la station debout à la pose assise. Courbe rapide au départ
|
||||
(il perd l'équilibre dès que le câble lâche), puis amortie à l'arrivée. */
|
||||
var fall = 1 - Math.pow(1 - clamp01((t - FALL_A) / (FALL_B - FALL_A)), 2.4);
|
||||
|
||||
var sinceRel = (t - RELEASE) / 1000;
|
||||
var yank = 0, yankRot = 0;
|
||||
if (t >= RELEASE) {
|
||||
yank = -11 * Math.sin(sinceRel * 27) * Math.exp(-sinceRel * 6.5);
|
||||
yankRot = 3.4 * Math.sin(sinceRel * 27) * Math.exp(-sinceRel * 6.5);
|
||||
}
|
||||
/* Rebond d'assise : petit amorti au moment où le fesse touche le sol. */
|
||||
var sinceSit = (t - FALL_B) / 1000;
|
||||
var settle = t > FALL_B ? 2 * Math.sin(sinceSit * 32) * Math.exp(-sinceSit * 4.5) : 0;
|
||||
|
||||
var bob = Math.sin(t / 520) * 1.3 * (1 - fall);
|
||||
/* L'élan : il se met à reculer pendant la traction, atteint son maximum à
|
||||
l'instant du décrochage, puis s'amortit. C'est ce recul qui bascule le
|
||||
poids du corps et déclenche la chute. */
|
||||
var slip = clamp01(1 - (t - RELEASE) / 900);
|
||||
var standX = APPROACH_X * approach - PULL_X * pull - STUMBLE_X * slip + yank;
|
||||
var standRot = 4 * approach - 11 * pull - 9 * slip + yankRot;
|
||||
var standY = -1.5 * approach - 2 * pull + bob;
|
||||
|
||||
/* Démarche : la phase avance avec la vitesse de déplacement. */
|
||||
var walk = smoothstep(APPROACH_A - 120, APPROACH_A + 260, t)
|
||||
* (1 - smoothstep(APPROACH_B - 140, APPROACH_B + 200, t))
|
||||
* (1 - fall);
|
||||
gait += dt * 8.5 * walk;
|
||||
var swing = Math.sin(gait) * 8.5 * walk;
|
||||
var liftL = Math.max(0, Math.sin(gait)) * 5.5 * walk;
|
||||
var liftR = Math.max(0, Math.sin(gait + Math.PI)) * 5.5 * walk;
|
||||
|
||||
/* Assis, les deux pattes sont posées à plat au sol devant le corps : on
|
||||
compense la rotation du corps pour les remettre de niveau, et on les
|
||||
descend d'autant pour qu'elles touchent terre. */
|
||||
var footSpin = SIT.foot * fall;
|
||||
el.footL.setAttribute('transform',
|
||||
tx(swing * 0.5, -liftL + SIT.footDropL * fall, footSpin, G.footL[0], G.footL[1]));
|
||||
el.footR.setAttribute('transform',
|
||||
tx(-swing * 0.5, -liftR + SIT.footDropR * fall, footSpin, G.footR[0], G.footR[1]));
|
||||
|
||||
/* Corps : on interpole le pivot (pattes → fesse), l'angle et le décalage. */
|
||||
var pvX = lerp(G.walk[0], G.hip[0], fall);
|
||||
var pvY = lerp(G.walk[1], G.hip[1], fall);
|
||||
var ang = lerp(standRot, SIT.deg, fall) + settle;
|
||||
var ox = lerp(standX, SIT.x, fall);
|
||||
var oy = lerp(standY, SIT.y, fall);
|
||||
var bodyTf = tx(ox, oy, ang, pvX, pvY);
|
||||
|
||||
el.tux.setAttribute('transform', bodyTf);
|
||||
|
||||
/* Aileron avant : tend le bras, puis garde le câble en l'air en s'asseyant. */
|
||||
var armRot = (16 * approach - 26 * pull) * (1 - fall) + SIT.arm * fall;
|
||||
el.arm.setAttribute('transform',
|
||||
bodyTf + ' rotate(' + armRot.toFixed(2) + ' ' + G.shoulder[0] + ' ' + G.shoulder[1] + ')');
|
||||
|
||||
/* L'ombre s'aplatit et se décale vers la fesse quand Tux se pose. */
|
||||
if (el.shadow) {
|
||||
el.shadow.setAttribute('transform',
|
||||
'translate(' + (215 - 40 * fall).toFixed(1) + ' 376)'
|
||||
+ ' scale(1 ' + (1 - 0.5 * fall).toFixed(3) + ')'
|
||||
+ ' translate(-215 -376)');
|
||||
}
|
||||
|
||||
/* Regard : vers le connecteur pendant la traction, vers le câble au sol
|
||||
une fois assis. */
|
||||
var gx = 0, gy = 0;
|
||||
if (t >= FALL_B) { gx = 3; gy = 2.5; }
|
||||
else if (t >= RELEASE) { gx = 1.5; gy = -0.5; }
|
||||
else if (t >= PULL_A) { gx = -1; gy = 0; }
|
||||
if (el.eyes) {
|
||||
el.eyes.setAttribute('transform', 'translate(' + gx + ' ' + gy + ')');
|
||||
}
|
||||
|
||||
var bodyM = mul(tr(ox, oy), rot(ang, pvX, pvY));
|
||||
var armM = mul(bodyM, rot(armRot, G.shoulder[0], G.shoulder[1]));
|
||||
var hand = apply(armM, G.hand[0], G.hand[1]);
|
||||
|
||||
/* Connecteur : ressort vers sa cible tant qu'il est dans le port. */
|
||||
var sp = springStep(springX, springV, -34 * pull, 190, 15, dt);
|
||||
springX = sp[0];
|
||||
springV = sp[1];
|
||||
var seated = [G.connAttach[0] + springX, G.connAttach[1]];
|
||||
|
||||
/* Point A = extrémité « connecteur » du câble ; point B = main de Tux.
|
||||
Après le débranchement, A devient un point libre et B reste dans la main
|
||||
jusqu'à la fin : c'est ce qui fait que Tux retombe en gardant le câble. */
|
||||
var A, B, deg;
|
||||
if (t < RELEASE) {
|
||||
A = seated;
|
||||
B = hand;
|
||||
deg = 0;
|
||||
released = false;
|
||||
} else {
|
||||
if (!released) {
|
||||
released = true;
|
||||
plug.x = seated[0];
|
||||
plug.y = seated[1];
|
||||
plug.vx = springV * 0.4 - 150;
|
||||
plug.vy = -30;
|
||||
connDeg = 0;
|
||||
connDegV = -140;
|
||||
}
|
||||
fallPoint(plug, dt);
|
||||
connDegV += (-(connDeg - 6) * 95 - connDegV * 11) * dt;
|
||||
connDeg += connDegV * dt;
|
||||
A = [plug.x, plug.y];
|
||||
B = hand;
|
||||
deg = connDeg;
|
||||
}
|
||||
|
||||
/* Connecteur : translation calculée pour amener son point d'attache en A. */
|
||||
var R = rot(deg, G.plugPivot[0], G.plugPivot[1]);
|
||||
var ar = apply(R, G.connAttach[0], G.connAttach[1]);
|
||||
el.connector.setAttribute('transform',
|
||||
'translate(' + (A[0] - ar[0]).toFixed(2) + ' ' + (A[1] - ar[1]).toFixed(2) + ')'
|
||||
+ ' rotate(' + deg.toFixed(2) + ' ' + G.plugPivot[0] + ' ' + G.plugPivot[1] + ')');
|
||||
|
||||
/* Câble : affaissement réduit quand il se tend, jamais sous le sol. */
|
||||
var dx = A[0] - B[0], dy = A[1] - B[1];
|
||||
var taut = clamp01((Math.sqrt(dx * dx + dy * dy) - 210) / 240);
|
||||
var velWorld = released ? plug.vx : springV;
|
||||
var wob = Math.max(-16, Math.min(16, velWorld * 0.05));
|
||||
var sway = 5 * Math.sin(t / 620) + 2 * Math.sin(t / 370 + 1.3);
|
||||
var sag = 96 * (1 - 0.5 * taut) + (released ? 0 : sway);
|
||||
var lim = G.ground - 3;
|
||||
|
||||
var c1x = A[0] - 48 - 18 * taut;
|
||||
var c1y = Math.min(lim, A[1] + sag);
|
||||
var c2x = B[0] + (released ? 52 : 64);
|
||||
var c2y = Math.min(lim, Math.min(lim, B[1] + sag * 0.85) + wob);
|
||||
setCable('M ' + A[0].toFixed(2) + ' ' + A[1].toFixed(2)
|
||||
+ ' C ' + c1x.toFixed(2) + ' ' + c1y.toFixed(2)
|
||||
+ ', ' + c2x.toFixed(2) + ' ' + c2y.toFixed(2)
|
||||
+ ', ' + B[0].toFixed(2) + ' ' + B[1].toFixed(2));
|
||||
|
||||
/* LED : vert au départ, rouge clignotant une fois débranché */
|
||||
var greenA = clamp01(1 - smoothstep(RELEASE - 60, RELEASE + 40, t));
|
||||
var redA = (1 - greenA) * (0.55 + 0.45 * Math.abs(Math.sin(t / 90)));
|
||||
setOpacity(el.ledGreen, greenA);
|
||||
setOpacity(el.ledRed, redA);
|
||||
|
||||
/* Pastille « link down » */
|
||||
var badgeA = smoothstep(RELEASE, RELEASE + 220, t);
|
||||
el.badge.setAttribute('opacity', badgeA.toFixed(3));
|
||||
el.badge.setAttribute('transform',
|
||||
'translate(648 150) scale(' + (0.55 + 0.45 * badgeA).toFixed(3) + ') translate(-648 -150)');
|
||||
|
||||
/* Étincelle de débranchement */
|
||||
var sparkA = (t >= RELEASE && sinceRel < 0.55) ? Math.exp(-sinceRel * 7) : 0;
|
||||
el.spark.setAttribute('opacity', sparkA.toFixed(3));
|
||||
el.spark.setAttribute('transform',
|
||||
'translate(557 228) scale(' + (0.7 + sinceRel * 1.6).toFixed(3) + ') translate(-557 -228)');
|
||||
|
||||
/* Secousse du switch */
|
||||
var jx = 0, jr = 0;
|
||||
if (t >= RELEASE) {
|
||||
jx = 4 * Math.sin(sinceRel * 32) * Math.exp(-sinceRel * 7);
|
||||
jr = 0.55 * Math.sin(sinceRel * 32) * Math.exp(-sinceRel * 7);
|
||||
}
|
||||
el.switchBox.setAttribute('transform', tx(jx, 0, jr, 515, 206));
|
||||
}
|
||||
|
||||
/* ── Lancement ───────────────────────────────────────────────────────── */
|
||||
|
||||
var reduceMotion = window.matchMedia
|
||||
&& window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
|
||||
if (reduceMotion || typeof window.requestAnimationFrame !== 'function') {
|
||||
/* Accessibilité / vieux navigateurs : on saute directement à l'image finale. */
|
||||
var step = 1000 / 60;
|
||||
for (var sim = 0; sim < TOTAL; sim += step) {
|
||||
advance(sim, step / 1000);
|
||||
}
|
||||
advance(TOTAL, step / 1000);
|
||||
return;
|
||||
}
|
||||
|
||||
var start = null;
|
||||
var last = 0;
|
||||
|
||||
function frame(now) {
|
||||
if (start === null) {
|
||||
start = now;
|
||||
last = now;
|
||||
}
|
||||
var t = now - start;
|
||||
var dt = Math.min(0.05, (now - last) / 1000) || 0.016;
|
||||
last = now;
|
||||
if (t >= TOTAL) {
|
||||
advance(TOTAL, dt); // image finale, puis on s'arrête
|
||||
return;
|
||||
}
|
||||
advance(t, dt);
|
||||
window.requestAnimationFrame(frame);
|
||||
}
|
||||
|
||||
window.requestAnimationFrame(frame);
|
||||
})();
|
||||
@@ -0,0 +1,23 @@
|
||||
(() => {
|
||||
const note = document.querySelector("[data-current-release-note]");
|
||||
const toggle = document.querySelector("[data-toggle-release-note]");
|
||||
if (!note || !toggle) return;
|
||||
|
||||
const fullTemplate = note.querySelector("template[data-note-full]");
|
||||
if (!fullTemplate) return;
|
||||
const fullHtml = fullTemplate.innerHTML;
|
||||
const truncatedHtml = note.innerHTML;
|
||||
|
||||
toggle.addEventListener("click", () => {
|
||||
const expanded = toggle.dataset.expanded === "true";
|
||||
if (expanded) {
|
||||
note.innerHTML = truncatedHtml;
|
||||
toggle.textContent = "Voir plus";
|
||||
toggle.dataset.expanded = "false";
|
||||
} else {
|
||||
note.innerHTML = fullHtml;
|
||||
toggle.textContent = "Voir moins";
|
||||
toggle.dataset.expanded = "true";
|
||||
}
|
||||
});
|
||||
})();
|
||||
@@ -0,0 +1,122 @@
|
||||
(() => {
|
||||
/* Une seule exécution, même si le script est chargé deux fois. */
|
||||
if (window.__fwsPackagesUi) return;
|
||||
window.__fwsPackagesUi = true;
|
||||
|
||||
/* ── « Voir plus » de l'historique (liste des paquets) ── */
|
||||
document.addEventListener("click", (ev) => {
|
||||
const btn = ev.target.closest("[data-toggle-timeline]");
|
||||
if (!btn) return;
|
||||
const timeline = btn.closest(".paquet-changelog")?.querySelector("[data-expandable]");
|
||||
if (!timeline) return;
|
||||
const expanded = btn.dataset.expanded === "true";
|
||||
timeline.classList.toggle("is-expanded", !expanded);
|
||||
btn.dataset.expanded = expanded ? "false" : "true";
|
||||
btn.textContent = expanded ? (btn.dataset.label || "Voir plus") : "Voir moins";
|
||||
});
|
||||
|
||||
/* ── Popup central « aperçu de l'image » (page détail) ── */
|
||||
const zoomables = Array.from(document.querySelectorAll("img[data-zoom]"));
|
||||
if (zoomables.length === 0) return;
|
||||
|
||||
let overlay = null;
|
||||
let imgEl = null;
|
||||
let capEl = null;
|
||||
let countEl = null;
|
||||
let current = 0;
|
||||
|
||||
function buildOverlay() {
|
||||
if (overlay) return;
|
||||
overlay = document.createElement("div");
|
||||
overlay.className = "pkg-lightbox";
|
||||
overlay.setAttribute("role", "dialog");
|
||||
overlay.setAttribute("aria-modal", "true");
|
||||
overlay.setAttribute("aria-label", "Aperçu de l'image");
|
||||
overlay.innerHTML =
|
||||
'<button type="button" class="pkg-lightbox-close" data-lightbox-close aria-label="Fermer">×</button>' +
|
||||
'<button type="button" class="pkg-lightbox-nav pkg-lightbox-prev" data-lightbox-prev aria-label="Image précédente">‹</button>' +
|
||||
'<figure class="pkg-lightbox-figure">' +
|
||||
'<img class="pkg-lightbox-img" alt="">' +
|
||||
'<figcaption class="pkg-lightbox-figcap">' +
|
||||
'<span class="pkg-lightbox-caption"></span>' +
|
||||
'<span class="pkg-lightbox-count"></span>' +
|
||||
"</figcaption>" +
|
||||
"</figure>" +
|
||||
'<button type="button" class="pkg-lightbox-nav pkg-lightbox-next" data-lightbox-next aria-label="Image suivante">›</button>';
|
||||
document.body.appendChild(overlay);
|
||||
|
||||
imgEl = overlay.querySelector(".pkg-lightbox-img");
|
||||
capEl = overlay.querySelector(".pkg-lightbox-caption");
|
||||
countEl = overlay.querySelector(".pkg-lightbox-count");
|
||||
|
||||
/* Navigation clavier pendant que le popup est ouvert. */
|
||||
document.addEventListener("keydown", (ev) => {
|
||||
if (!overlay.classList.contains("is-open")) return;
|
||||
if (ev.key === "Escape") {
|
||||
ev.preventDefault();
|
||||
closeOverlay();
|
||||
} else if (ev.key === "ArrowLeft" && zoomables.length > 1) {
|
||||
showImage(current - 1);
|
||||
} else if (ev.key === "ArrowRight" && zoomables.length > 1) {
|
||||
showImage(current + 1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showImage(index) {
|
||||
current = (index + zoomables.length) % zoomables.length;
|
||||
const src = zoomables[current];
|
||||
imgEl.src = src.currentSrc || src.src;
|
||||
imgEl.alt = src.alt || "";
|
||||
const caption = src.dataset.caption || "";
|
||||
capEl.textContent = caption;
|
||||
capEl.style.display = caption ? "" : "none";
|
||||
countEl.textContent = (current + 1) + " / " + zoomables.length;
|
||||
countEl.style.display = zoomables.length > 1 ? "" : "none";
|
||||
|
||||
/* Relance l'animation d'apparition à chaque changement d'image. */
|
||||
const figure = overlay.querySelector(".pkg-lightbox-figure");
|
||||
figure.classList.remove("is-animating");
|
||||
void figure.offsetWidth; /* reflow : réinitialise l'animation CSS */
|
||||
figure.classList.add("is-animating");
|
||||
}
|
||||
|
||||
function openOverlay(index) {
|
||||
buildOverlay();
|
||||
showImage(index);
|
||||
overlay.classList.add("is-open");
|
||||
document.documentElement.classList.add("pkg-no-scroll");
|
||||
}
|
||||
|
||||
function closeOverlay() {
|
||||
if (!overlay) return;
|
||||
overlay.classList.remove("is-open");
|
||||
document.documentElement.classList.remove("pkg-no-scroll");
|
||||
}
|
||||
|
||||
/* Un seul gestionnaire délégué : clic sur une image → ouverture ;
|
||||
clic sur croix / flèches / fond → action correspondante. */
|
||||
document.addEventListener("click", (ev) => {
|
||||
const zoom = ev.target.closest("img[data-zoom]");
|
||||
if (zoom) {
|
||||
const idx = zoomables.indexOf(zoom);
|
||||
if (idx >= 0) {
|
||||
ev.preventDefault();
|
||||
openOverlay(idx);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!overlay || !overlay.classList.contains("is-open")) return;
|
||||
|
||||
if (ev.target.closest("[data-lightbox-close]")) {
|
||||
closeOverlay();
|
||||
} else if (ev.target.closest("[data-lightbox-prev]")) {
|
||||
showImage(current - 1);
|
||||
} else if (ev.target.closest("[data-lightbox-next]")) {
|
||||
showImage(current + 1);
|
||||
} else if (ev.target === overlay) {
|
||||
closeOverlay(); /* clic sur le fond uniquement, pas sur l'image */
|
||||
}
|
||||
});
|
||||
})();
|
||||
@@ -1,169 +0,0 @@
|
||||
(() => {
|
||||
const main = document.getElementById("app-main");
|
||||
const footerYear = document.getElementById("footer-year");
|
||||
const pageStyleSelectors = "[data-page-style='true']";
|
||||
|
||||
const links = Array.from(document.querySelectorAll("[data-route]"));
|
||||
|
||||
if (footerYear) {
|
||||
footerYear.textContent = new Date().getFullYear().toString();
|
||||
}
|
||||
|
||||
function clearInjectedPageStyles() {
|
||||
document.querySelectorAll(pageStyleSelectors).forEach((node) => node.remove());
|
||||
}
|
||||
|
||||
function injectPageStyles(parsedDocument, sourceUrl) {
|
||||
clearInjectedPageStyles();
|
||||
|
||||
const head = parsedDocument.head;
|
||||
if (!head) {
|
||||
return;
|
||||
}
|
||||
|
||||
const styleNodes = Array.from(head.querySelectorAll("link[rel='stylesheet'], style"));
|
||||
|
||||
styleNodes.forEach((node) => {
|
||||
const clonedNode = node.cloneNode(true);
|
||||
clonedNode.setAttribute("data-page-style", "true");
|
||||
|
||||
if (clonedNode.tagName === "LINK") {
|
||||
const href = clonedNode.getAttribute("href");
|
||||
if (href) {
|
||||
clonedNode.href = new URL(href, sourceUrl).toString();
|
||||
}
|
||||
}
|
||||
|
||||
document.head.appendChild(clonedNode);
|
||||
});
|
||||
}
|
||||
|
||||
function normalizeRoute(value) {
|
||||
const raw = (value ?? "").toString().trim().toLowerCase();
|
||||
if (!raw || raw === "/" || raw === "home" || raw === "index" || raw === "accueil") {
|
||||
return "index";
|
||||
}
|
||||
return raw.replace(/^\/+|\/+$/g, "") || "index";
|
||||
}
|
||||
|
||||
function routeFromLocation() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
|
||||
if (params.has("p")) {
|
||||
return normalizeRoute(params.get("p"));
|
||||
}
|
||||
|
||||
const rawSearch = window.location.search.replace(/^\?/, "");
|
||||
if (rawSearch.startsWith("p/")) {
|
||||
return normalizeRoute(rawSearch.slice(2));
|
||||
}
|
||||
|
||||
if (rawSearch.startsWith("p=")) {
|
||||
return normalizeRoute(rawSearch.slice(2));
|
||||
}
|
||||
|
||||
const path = window.location.pathname.replace(/^\/+|\/+$/g, "");
|
||||
if (path) {
|
||||
if (path.endsWith(".html")) {
|
||||
return "index";
|
||||
}
|
||||
|
||||
const parts = path.split("/");
|
||||
if (parts[0] === "p" && parts[1]) {
|
||||
return normalizeRoute(parts.slice(1).join("/"));
|
||||
}
|
||||
return normalizeRoute(parts[0]);
|
||||
}
|
||||
|
||||
return "index";
|
||||
}
|
||||
|
||||
function setActiveRoute(route) {
|
||||
links.forEach((link) => {
|
||||
const isActive = link.dataset.route === route;
|
||||
if (isActive) {
|
||||
link.setAttribute("aria-current", "page");
|
||||
} else {
|
||||
link.removeAttribute("aria-current");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function setCanonicalUrl(route, replace = false) {
|
||||
const url = route === "index" ? "/?p/index/" : `/?p/${route}/`;
|
||||
if (replace) {
|
||||
history.replaceState({ route }, "", url);
|
||||
return;
|
||||
}
|
||||
history.pushState({ route }, "", url);
|
||||
}
|
||||
|
||||
function routeToSource(route) {
|
||||
return `p/${route}/index.html`;
|
||||
}
|
||||
|
||||
function routeToTitle(route) {
|
||||
if (route === "index") {
|
||||
return "Fws Web";
|
||||
}
|
||||
|
||||
const label = route
|
||||
.split("/")
|
||||
.filter(Boolean)
|
||||
.map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
|
||||
.join(" / ");
|
||||
|
||||
return `Fws Web - ${label}`;
|
||||
}
|
||||
|
||||
async function loadRoute(route) {
|
||||
const source = routeToSource(route);
|
||||
const response = await fetch(source, { cache: "no-store" });
|
||||
if (!response.ok) {
|
||||
throw new Error(`Impossible de charger ${source} (${response.status})`);
|
||||
}
|
||||
|
||||
const html = await response.text();
|
||||
const parsed = new DOMParser().parseFromString(html, "text/html");
|
||||
injectPageStyles(parsed, response.url);
|
||||
const injected = parsed.querySelector("[data-page-content]") ?? parsed.body;
|
||||
main.innerHTML = injected.innerHTML.trim();
|
||||
}
|
||||
|
||||
function render(route, { replaceHistory = false } = {}) {
|
||||
const safeRoute = route || "index";
|
||||
|
||||
loadRoute(safeRoute)
|
||||
.then(() => {
|
||||
setActiveRoute(safeRoute);
|
||||
setCanonicalUrl(safeRoute, replaceHistory);
|
||||
document.title = routeToTitle(safeRoute);
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
})
|
||||
.catch((error) => {
|
||||
main.innerHTML = `<section class="hero"><h1>Erreur de chargement</h1><p class="lead">${error.message}</p></section>`;
|
||||
setActiveRoute("index");
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener("click", (event) => {
|
||||
const link = event.target.closest("[data-route]");
|
||||
if (!link) {
|
||||
return;
|
||||
}
|
||||
|
||||
const route = normalizeRoute(link.dataset.route);
|
||||
if (!route) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
render(route);
|
||||
});
|
||||
|
||||
window.addEventListener("popstate", () => {
|
||||
render(routeFromLocation(), { replaceHistory: true });
|
||||
});
|
||||
|
||||
render(routeFromLocation(), { replaceHistory: true });
|
||||
})();
|
||||
@@ -0,0 +1,55 @@
|
||||
(() => {
|
||||
/* Menu déroulant « Paquets » de la barre de navigation.
|
||||
Le reste (contenu, données, états actifs) est rendu côté serveur. */
|
||||
const root = document.querySelector("[data-nav-dropdown]");
|
||||
const burger = document.querySelector(".nav-burger");
|
||||
const nav = document.getElementById("app-nav");
|
||||
|
||||
/* Burger mobile : plie/déplie le panneau de navigation */
|
||||
if (burger && nav) {
|
||||
burger.addEventListener("click", () => {
|
||||
const open = nav.classList.toggle("is-open");
|
||||
burger.setAttribute("aria-expanded", open ? "true" : "false");
|
||||
burger.setAttribute("aria-label", open ? "Fermer le menu de navigation" : "Ouvrir le menu de navigation");
|
||||
});
|
||||
|
||||
/* Navigation choisie → le panneau se referme */
|
||||
nav.querySelectorAll("a").forEach((link) => {
|
||||
link.addEventListener("click", () => {
|
||||
nav.classList.remove("is-open");
|
||||
burger.setAttribute("aria-expanded", "false");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (!root) return;
|
||||
|
||||
const toggle = root.querySelector(".nav-dropdown-toggle");
|
||||
const panel = root.querySelector(".nav-dropdown-panel");
|
||||
if (!toggle || !panel) return;
|
||||
|
||||
function setOpen(open) {
|
||||
root.classList.toggle("is-open", open);
|
||||
toggle.setAttribute("aria-expanded", open ? "true" : "false");
|
||||
}
|
||||
|
||||
toggle.addEventListener("click", (event) => {
|
||||
event.stopPropagation();
|
||||
setOpen(!root.classList.contains("is-open"));
|
||||
});
|
||||
|
||||
document.addEventListener("click", (event) => {
|
||||
if (!root.contains(event.target)) setOpen(false);
|
||||
});
|
||||
|
||||
document.addEventListener("keydown", (event) => {
|
||||
if (event.key === "Escape" && root.classList.contains("is-open")) {
|
||||
setOpen(false);
|
||||
toggle.focus();
|
||||
}
|
||||
});
|
||||
|
||||
panel.querySelectorAll("a").forEach((link) => {
|
||||
link.addEventListener("click", () => setOpen(false));
|
||||
});
|
||||
})();
|
||||
@@ -1,129 +0,0 @@
|
||||
@import "./var.css";
|
||||
|
||||
.hero,
|
||||
.card {
|
||||
backdrop-filter: blur(18px);
|
||||
background: var(--bg-soft);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.hero {
|
||||
padding: clamp(1.5rem, 3vw, 2.75rem);
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
margin: 0 0 0.75rem;
|
||||
color: var(--accent);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.22em;
|
||||
font-size: 0.78rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.hero h1,
|
||||
.card h2 {
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
margin: 0;
|
||||
font-size: clamp(2.2rem, 5vw, 4.5rem);
|
||||
line-height: 0.98;
|
||||
max-width: 12ch;
|
||||
}
|
||||
|
||||
.lead {
|
||||
max-width: 62ch;
|
||||
color: var(--muted);
|
||||
font-size: 1.08rem;
|
||||
line-height: 1.7;
|
||||
margin: 1rem 0 0;
|
||||
}
|
||||
|
||||
.lead span,
|
||||
.card span {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.release-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
margin: 1.35rem 0 0;
|
||||
padding: 0.7rem 1rem;
|
||||
border: 1px solid rgba(148, 163, 184, 0.22);
|
||||
border-radius: 999px;
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
color: var(--muted);
|
||||
font-size: 0.95rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.release-badge span {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.85rem 1.2rem;
|
||||
text-decoration: none;
|
||||
border: 1px solid rgba(148, 163, 184, 0.22);
|
||||
border-radius: 999px;
|
||||
font-weight: 700;
|
||||
transition:
|
||||
transform 160ms ease,
|
||||
background 160ms ease,
|
||||
color 160ms ease,
|
||||
border-color 160ms ease;
|
||||
}
|
||||
|
||||
.button:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
color: #08101d;
|
||||
background: linear-gradient(145deg, var(--accent), var(--accent-strong));
|
||||
}
|
||||
|
||||
.button-secondary {
|
||||
color: var(--text);
|
||||
background: rgba(255, 255, 255, 0.04);
|
||||
}
|
||||
|
||||
.grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 1.25rem;
|
||||
}
|
||||
|
||||
.card h2 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.75rem;
|
||||
font-size: 1.45rem;
|
||||
}
|
||||
|
||||
.card p {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
@@ -1,314 +0,0 @@
|
||||
@import "./var.css";
|
||||
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--bg: var(--background-color);
|
||||
--bg-soft: rgba(15, 52, 96, 0.72);
|
||||
--panel: rgba(17, 25, 49, 0.82);
|
||||
--panel-border: rgba(22, 33, 62, 0.18);
|
||||
--text: var(--generic-text-color);
|
||||
--muted: var(--sidebar-text);
|
||||
--accent: var(--sidebar-text-highlight);
|
||||
--accent-strong: var(--sidebar-select);
|
||||
--shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
color: var(--text);
|
||||
font-family: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
|
||||
background:
|
||||
radial-gradient(circle at top left, rgba(56, 189, 248, 0.24), transparent 28%),
|
||||
radial-gradient(circle at right center, rgba(14, 165, 233, 0.14), transparent 32%),
|
||||
linear-gradient(160deg, #050816 0%, #0b1020 52%, #08101d 100%);
|
||||
}
|
||||
|
||||
body::before,
|
||||
body::after {
|
||||
content: "";
|
||||
position: fixed;
|
||||
inset: auto;
|
||||
pointer-events: none;
|
||||
filter: blur(18px);
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
body::before {
|
||||
width: 22rem;
|
||||
height: 22rem;
|
||||
top: -6rem;
|
||||
left: -8rem;
|
||||
background: rgba(56, 189, 248, 0.16);
|
||||
}
|
||||
|
||||
body::after {
|
||||
width: 18rem;
|
||||
height: 18rem;
|
||||
right: -4rem;
|
||||
bottom: 2rem;
|
||||
background: rgba(125, 211, 252, 0.12);
|
||||
}
|
||||
|
||||
.page-shell {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
grid-template-rows: auto 1fr auto;
|
||||
gap: 1.25rem;
|
||||
}
|
||||
|
||||
.site-header,
|
||||
.site-footer {
|
||||
backdrop-filter: blur(18px);
|
||||
background: var(--bg-soft);
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.header-brand-block{
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
max-width: 1200px;
|
||||
display: flex;
|
||||
/* align-items: center; */
|
||||
gap: 0.85rem;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.site-header {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.9rem;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.brand-mark {
|
||||
width: 2.75rem;
|
||||
height: 2.75rem;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.brand-text {
|
||||
display: grid;
|
||||
line-height: 1.05;
|
||||
}
|
||||
|
||||
.brand-text strong {
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
}
|
||||
|
||||
.brand-text small {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.site-nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.6rem;
|
||||
}
|
||||
|
||||
.site-nav a {
|
||||
border-radius: 999px;
|
||||
transition:
|
||||
transform 160ms ease,
|
||||
background 160ms ease,
|
||||
color 160ms ease,
|
||||
border-color 160ms ease;
|
||||
}
|
||||
|
||||
.site-nav a {
|
||||
padding: 0.7rem 1rem;
|
||||
color: var(--muted);
|
||||
text-decoration: none;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.site-nav a:hover,
|
||||
.site-nav a[aria-current="page"] {
|
||||
color: var(--text);
|
||||
border-color: rgba(125, 211, 252, 0.4);
|
||||
background: rgba(125, 211, 252, 0.08);
|
||||
}
|
||||
|
||||
.site-main {
|
||||
margin: 0 auto;
|
||||
max-width: 1200px;
|
||||
display: grid;
|
||||
gap: 1.25rem;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.site-nav a:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.site-footer {
|
||||
padding: 1.5rem 1.25rem;
|
||||
background: rgb(50, 54, 66);
|
||||
}
|
||||
|
||||
.site-footer p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.footer-brand-row {
|
||||
display: flex;
|
||||
align-items: start;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding-bottom: 1rem;
|
||||
border-bottom: 1px solid rgba(148, 163, 184, 0.16);
|
||||
}
|
||||
.footer-content {
|
||||
margin: 0 auto;
|
||||
max-width: 1200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
.footer-brand-block {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.85rem;
|
||||
max-width: 42rem;
|
||||
}
|
||||
|
||||
.footer-brand-mark {
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
border-radius: 0.95rem;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.footer-brand-block strong {
|
||||
display: block;
|
||||
color: var(--text);
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
.footer-brand-block p,
|
||||
.footer-note,
|
||||
.footer-bottom p {
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.footer-note {
|
||||
max-width: 20rem;
|
||||
}
|
||||
|
||||
.footer-links-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(0, 1fr));
|
||||
gap: 1rem;
|
||||
padding: 1.25rem 0;
|
||||
}
|
||||
|
||||
.footer-links-grid section {
|
||||
display: grid;
|
||||
gap: 0.6rem;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.footer-links-grid h2 {
|
||||
margin: 0 0 0.15rem;
|
||||
color: var(--text);
|
||||
font-size: 0.98rem;
|
||||
}
|
||||
|
||||
.footer-links-grid a {
|
||||
color: var(--muted);
|
||||
text-decoration: none;
|
||||
width: fit-content;
|
||||
transition: color 160ms ease, transform 160ms ease;
|
||||
}
|
||||
|
||||
.footer-links-grid a:hover {
|
||||
color: var(--text);
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
.footer-bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding-top: 1rem;
|
||||
border-top: 1px solid rgba(148, 163, 184, 0.16);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.footer-release,
|
||||
.footer-commit {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.footer-release span,
|
||||
.footer-commit span {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.footer-links-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.page-shell {
|
||||
width: min(100% - 1rem, 1120px);
|
||||
gap: 0.9rem;
|
||||
padding-top: 0.5rem;
|
||||
}
|
||||
|
||||
.site-header {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.site-nav {
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.site-nav a,
|
||||
.button {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.footer-brand-row,
|
||||
.footer-bottom {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.footer-brand-block {
|
||||
align-items: flex-start;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
:root {
|
||||
/* Couleurs de la sidebar */
|
||||
--sidebar-background: #1a1a2e;
|
||||
--sidebar-text: #e0e0e0;
|
||||
--sidebar-text-highlight: #00d4ff;
|
||||
--sidebar-select: #16213e;
|
||||
|
||||
/* Couleurs générales */
|
||||
--background-color: #0f3460;
|
||||
--highlighted-text-color: #ffffff;
|
||||
--generic-text-color: #e0e0e0;
|
||||
--error-text-color: #ff6b6b;
|
||||
--warning-text-color: #ffa500;
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
@import "./var.css";
|
||||
|
||||
/* ── 404 — Tux débranche le câble réseau ─────────────────────────────────────
|
||||
Mise en page uniquement : le mouvement (Tux, connecteur, câble) est piloté
|
||||
par p/assets/js/not-found.js. Le SVG est livré dans son état « branché »,
|
||||
donc la page reste propre même sans JavaScript. */
|
||||
|
||||
.notfound {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
|
||||
align-items: center;
|
||||
gap: clamp(1.5rem, 4vw, 3rem);
|
||||
padding: clamp(1.75rem, 4vw, 3.25rem);
|
||||
border-radius: 1.25rem;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
.notfound::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: -35% -10% auto;
|
||||
height: 70%;
|
||||
background: radial-gradient(60% 100% at 78% 0%, rgba(56, 189, 248, 0.16), transparent 70%);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.notfound-copy {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.notfound-code {
|
||||
margin: 0 0 0.35rem;
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: clamp(3.5rem, 11vw, 6.5rem);
|
||||
line-height: 0.9;
|
||||
letter-spacing: -0.04em;
|
||||
color: transparent;
|
||||
background: linear-gradient(180deg, var(--accent-soft), var(--accent-strong));
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.notfound-title {
|
||||
margin: 0 0 0.75rem;
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: clamp(1.6rem, 3.6vw, 2.6rem);
|
||||
line-height: 1.1;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.notfound-lead {
|
||||
margin: 0 0 1.5rem;
|
||||
max-width: 46ch;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.7;
|
||||
text-wrap: pretty;
|
||||
}
|
||||
|
||||
.notfound-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.notfound-visual {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.nf-scene {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/* ── Responsive ───────────────────────────────────────────────────────────── */
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.notfound {
|
||||
grid-template-columns: 1fr;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.notfound-visual {
|
||||
order: 2;
|
||||
max-width: 34rem;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.notfound-lead {
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.notfound-actions {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.notfound-actions .button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
@import "./var.css";
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
|
||||
color: var(--text);
|
||||
background: var(--surface-dim);
|
||||
background-image:
|
||||
radial-gradient(circle at top left, rgba(56, 189, 248, 0.06), transparent 40%),
|
||||
radial-gradient(circle at bottom right, rgba(125, 211, 252, 0.04), transparent 40%);
|
||||
}
|
||||
|
||||
.contact-header {
|
||||
max-width: 1120px;
|
||||
margin: 0 auto;
|
||||
padding: clamp(2.5rem, 6vw, 5rem) 1.25rem 1.25rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.contact-header h1 {
|
||||
margin: 0;
|
||||
font-family: "Georgia", "Times New Roman", serif;
|
||||
font-size: clamp(2rem, 6vw, 3.5rem);
|
||||
line-height: 1.1;
|
||||
letter-spacing: -0.02em;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.contact-header p {
|
||||
max-width: 62ch;
|
||||
margin: 1rem auto 0;
|
||||
color: var(--text-secondary);
|
||||
font-size: 1.05rem;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
hr {
|
||||
width: min(1120px, calc(100% - 2.5rem));
|
||||
margin: 0 auto;
|
||||
border: 0;
|
||||
height: 1px;
|
||||
background: var(--border);
|
||||
}
|
||||
|
||||
main {
|
||||
width: min(1120px, calc(100% - 2.5rem));
|
||||
margin: 1.5rem auto 0;
|
||||
padding: 0 0 3rem;
|
||||
}
|
||||
|
||||
main section {
|
||||
padding: clamp(1.4rem, 3vw, 2rem);
|
||||
border-radius: 1rem;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--surface);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
main section h2 {
|
||||
margin: 0 0 0.85rem;
|
||||
color: var(--text);
|
||||
font-family: "Georgia", "Times New Roman", serif;
|
||||
font-size: clamp(1.4rem, 3vw, 2.1rem);
|
||||
}
|
||||
|
||||
main section p {
|
||||
margin: 0 0 1rem;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
main section strong {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
main section a:not(.button) {
|
||||
color: var(--accent);
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.15em;
|
||||
}
|
||||
|
||||
main section a:not(.button):hover,
|
||||
main section a:not(.button):focus-visible {
|
||||
color: var(--accent-soft);
|
||||
}
|
||||
|
||||
main section a.button {
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.contact-header {
|
||||
padding-top: 2rem;
|
||||
}
|
||||
|
||||
main,
|
||||
hr {
|
||||
width: min(100% - 1rem, 1120px);
|
||||
}
|
||||
|
||||
main section {
|
||||
border-radius: 0.8rem;
|
||||
}
|
||||
|
||||
main section a.button {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* Très petits écrans : texte du hero resserré */
|
||||
@media (max-width: 380px) {
|
||||
.contact-header h1 {
|
||||
font-size: clamp(1.6rem, 8vw, 2rem);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
@import "./var.css";
|
||||
|
||||
/* ── Creators Grid ── */
|
||||
|
||||
.creators-grid {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 1.25rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.creator-card {
|
||||
flex: 1 1 280px;
|
||||
max-width: 100%;
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
padding: 1.25rem;
|
||||
border-radius: 0.75rem;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: var(--shadow-sm);
|
||||
transition: transform 200ms ease, box-shadow 200ms ease;
|
||||
}
|
||||
|
||||
.creator-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.creator-avatar {
|
||||
width: 4rem;
|
||||
height: 4rem;
|
||||
border-radius: 50%;
|
||||
object-fit: cover;
|
||||
flex-shrink: 0;
|
||||
border: 2px solid var(--border);
|
||||
}
|
||||
|
||||
.creator-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.3rem;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.creator-name {
|
||||
margin: 0;
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: 1.1rem;
|
||||
color: var(--text);
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.creator-role {
|
||||
color: var(--accent);
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.creator-joined {
|
||||
color: var(--muted);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.creator-email {
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.88rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.creator-email:hover {
|
||||
color: var(--accent);
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.creator-links {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.4rem;
|
||||
margin-top: 0.2rem;
|
||||
}
|
||||
|
||||
.creator-link {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 0.2rem 0.6rem;
|
||||
font-size: 0.82rem;
|
||||
font-weight: 500;
|
||||
color: var(--accent);
|
||||
background: var(--accent-bg);
|
||||
border: 1px solid rgba(56, 189, 248, 0.2);
|
||||
border-radius: 0.35rem;
|
||||
text-decoration: none;
|
||||
transition: background 160ms ease;
|
||||
}
|
||||
|
||||
.creator-link:hover {
|
||||
background: rgba(56, 189, 248, 0.18);
|
||||
}
|
||||
|
||||
.creators-error {
|
||||
color: var(--error-text-color);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.creator-card {
|
||||
flex: 1 1 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Carte en pile : avatar au-dessus des infos, rien ne déborde */
|
||||
.creator-card {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.creator-info {
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.creator-links {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.creator-email {
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
.versions-panel {
|
||||
margin-top: 1rem;
|
||||
padding: 1.25rem;
|
||||
border-radius: 1rem;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.latest-version h2 {
|
||||
margin: 0 0 0.35rem;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.latest-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.latest-meta {
|
||||
color: var(--text-secondary);
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
.latest-actions {
|
||||
display: flex;
|
||||
gap: 0.6rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.latest-note {
|
||||
margin: 0.85rem 0 0;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.6;
|
||||
max-height: none;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.latest-note h1,
|
||||
.latest-note h2,
|
||||
.latest-note h3,
|
||||
.latest-note h4 {
|
||||
color: var(--text);
|
||||
margin: 1.2rem 0 0.5rem;
|
||||
}
|
||||
|
||||
.latest-note h2 { font-size: 1.2rem; }
|
||||
.latest-note h3 { font-size: 1.05rem; }
|
||||
.latest-note p { margin: 0.5rem 0; }
|
||||
.latest-note ul, .latest-note ol { margin: 0.4rem 0; padding-left: 1.4rem; }
|
||||
.latest-note li { margin: 0.25rem 0; }
|
||||
|
||||
.latest-note table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 0.75rem 0;
|
||||
font-size: 0.92rem;
|
||||
}
|
||||
|
||||
.latest-note th,
|
||||
.latest-note td {
|
||||
padding: 0.45rem 0.65rem;
|
||||
border: 1px solid var(--border);
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.latest-note th {
|
||||
background: var(--surface-raised);
|
||||
font-weight: 600;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.latest-note blockquote {
|
||||
margin: 0.6rem 0;
|
||||
padding: 0.5rem 0.9rem;
|
||||
border-left: 3px solid var(--accent);
|
||||
background: var(--accent-bg);
|
||||
border-radius: 0 0.4rem 0.4rem 0;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.latest-note blockquote p { margin: 0; }
|
||||
|
||||
.latest-note code {
|
||||
background: var(--surface-raised);
|
||||
border: 1px solid var(--border-soft);
|
||||
padding: 0.15em 0.4em;
|
||||
border-radius: 0.3rem;
|
||||
font-size: 0.9em;
|
||||
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
|
||||
}
|
||||
|
||||
.latest-note pre {
|
||||
background: var(--surface-dim);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5rem;
|
||||
padding: 0.8rem 1rem;
|
||||
overflow-x: auto;
|
||||
margin: 0.6rem 0;
|
||||
}
|
||||
|
||||
.latest-note pre code {
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
font-size: 0.88rem;
|
||||
}
|
||||
|
||||
.latest-note hr {
|
||||
border: none;
|
||||
border-top: 1px solid var(--border);
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
.latest-note img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
margin: 0.75rem 0;
|
||||
border-radius: 0.65rem;
|
||||
}
|
||||
|
||||
.latest-note a {
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.latest-note a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.toggle-note {
|
||||
display: inline-block;
|
||||
margin-top: 0.5rem;
|
||||
padding: 0.35rem 0.9rem;
|
||||
font-size: 0.88rem;
|
||||
background: var(--accent-bg);
|
||||
color: var(--accent);
|
||||
border: 1px solid rgba(56, 189, 248, 0.2);
|
||||
border-radius: 0.4rem;
|
||||
cursor: pointer;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.toggle-note:hover {
|
||||
background: rgba(56, 189, 248, 0.18);
|
||||
}
|
||||
|
||||
.versions-archive { margin-top: 1rem; }
|
||||
|
||||
.versions-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.version-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
padding: 0.8rem 0.9rem;
|
||||
border-radius: 0.8rem;
|
||||
background: var(--surface-raised);
|
||||
border: 1px solid var(--border-soft);
|
||||
}
|
||||
|
||||
.version-item-empty { opacity: 0.8; }
|
||||
|
||||
.version-main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.2rem;
|
||||
}
|
||||
|
||||
.version-main a {
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.version-main a:hover { text-decoration: underline; }
|
||||
|
||||
.version-side {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
@media (max-width: 880px) {
|
||||
.latest-row, .version-item {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
}
|
||||
.version-side { width: 100%; }
|
||||
}
|
||||
|
||||
/* ── Mobile : les tableaux de release notes défilent localement ── */
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.versions-panel {
|
||||
padding: 1rem 0.85rem;
|
||||
}
|
||||
|
||||
/* wrapper nécessaire : surcharge la base « overflow: visible » de ce
|
||||
fichier (chargé après styles.css) pour que les tableaux débordent
|
||||
dans leur propre scroll au lieu de casser la page */
|
||||
.latest-note {
|
||||
overflow-x: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.latest-note table {
|
||||
min-width: 34rem;
|
||||
}
|
||||
|
||||
.latest-note pre code {
|
||||
font-size: 0.8rem;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.latest-actions .button {
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.toggle-note {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
@import "./var.css";
|
||||
|
||||
.equipe-hero {
|
||||
text-align: center;
|
||||
padding: clamp(1.5rem, 4vw, 3rem) 1.25rem;
|
||||
}
|
||||
|
||||
.equipe-hero h1 {
|
||||
margin: 0 0 0.5rem;
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: clamp(2rem, 5vw, 3rem);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.equipe-hero p {
|
||||
margin: 0;
|
||||
color: var(--text-secondary);
|
||||
font-size: 1.1rem;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.equipe-grid-section {
|
||||
padding: 0 1.25rem clamp(2rem, 4vw, 3rem);
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
@import "./var.css";
|
||||
|
||||
/* ── Legal pages (mentions légales, conditions, confidentialité) ── */
|
||||
|
||||
.legal-header {
|
||||
max-width: 1120px;
|
||||
margin: 0 auto;
|
||||
padding: clamp(2.5rem, 6vw, 5rem) 1.25rem 1.25rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.legal-header h1 {
|
||||
margin: 0;
|
||||
font-family: "Georgia", "Times New Roman", serif;
|
||||
font-size: clamp(2rem, 6vw, 3.5rem);
|
||||
line-height: 1.1;
|
||||
letter-spacing: -0.02em;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.legal-header p {
|
||||
max-width: 62ch;
|
||||
margin: 1rem auto 0;
|
||||
color: var(--text-secondary);
|
||||
font-size: 1.05rem;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.legal-main {
|
||||
width: min(1120px, calc(100% - 2.5rem));
|
||||
margin: 1.5rem auto 0;
|
||||
padding: 0 0 3rem;
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.legal-main section {
|
||||
padding: clamp(1.4rem, 3vw, 2rem);
|
||||
border-radius: 1rem;
|
||||
border: 1px solid var(--border);
|
||||
background: var(--surface);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.legal-main h2 {
|
||||
margin: 0 0 0.85rem;
|
||||
color: var(--text);
|
||||
font-family: "Georgia", "Times New Roman", serif;
|
||||
font-size: clamp(1.3rem, 3vw, 1.9rem);
|
||||
}
|
||||
|
||||
.legal-main p,
|
||||
.legal-main li {
|
||||
margin: 0 0 0.85rem;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.legal-main ul {
|
||||
margin: 0 0 1rem;
|
||||
padding-left: 1.25rem;
|
||||
}
|
||||
|
||||
.legal-main li:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.legal-main strong {
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.legal-main a:not(.button) {
|
||||
color: var(--accent);
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.15em;
|
||||
}
|
||||
|
||||
.legal-main a:not(.button):hover,
|
||||
.legal-main a:not(.button):focus-visible {
|
||||
color: var(--accent-soft);
|
||||
}
|
||||
|
||||
/* Contact sheet : label/value pairs without bullets. */
|
||||
.legal-sheet {
|
||||
margin: 0 0 0.5rem;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
display: grid;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.legal-sheet li {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* Field to complete by the maintainer (legal identity, IDE, venue). */
|
||||
.legal-updated {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.9rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.legal-header {
|
||||
padding-top: 2rem;
|
||||
}
|
||||
|
||||
.legal-main {
|
||||
width: min(100% - 1rem, 1120px);
|
||||
}
|
||||
|
||||
.legal-main section {
|
||||
border-radius: 0.8rem;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,521 @@
|
||||
@import "./var.css";
|
||||
|
||||
:root {
|
||||
--main-max: 1200px;
|
||||
}
|
||||
|
||||
main[data-page-content] {
|
||||
margin: 0 auto;
|
||||
max-width: var(--main-max);
|
||||
padding: 2rem 1.25rem;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.grid { display: block; }
|
||||
|
||||
/* ── Hero ── */
|
||||
|
||||
.hero {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: var(--shadow-md);
|
||||
border-radius: 1rem;
|
||||
padding: clamp(2rem, 4.5vw, 3.5rem);
|
||||
color: var(--text);
|
||||
min-height: clamp(22rem, 50vw, 30rem);
|
||||
}
|
||||
|
||||
.hero-carousel-track {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
|
||||
.hero-slide {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
opacity: 0;
|
||||
transform: scale(1.02);
|
||||
transition: opacity 700ms ease, transform 1000ms ease;
|
||||
}
|
||||
|
||||
.hero-slide::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background:
|
||||
linear-gradient(110deg, rgba(15, 23, 42, 0.82) 18%, rgba(15, 23, 42, 0.35) 58%, rgba(15, 23, 42, 0.7) 100%),
|
||||
radial-gradient(circle at 72% 20%, rgba(56, 189, 248, 0.15), transparent 48%);
|
||||
}
|
||||
|
||||
.hero-slide.is-active {
|
||||
opacity: 1;
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
.hero-inner {
|
||||
width: 100%;
|
||||
max-width: 52rem;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
color: var(--accent);
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.16em;
|
||||
text-transform: uppercase;
|
||||
margin: 0 0 0.6rem;
|
||||
}
|
||||
|
||||
.hero-title {
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: clamp(2.5rem, 7vw, 4.5rem);
|
||||
line-height: 1;
|
||||
margin: 0 0 0.25rem;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.hero-subtitle {
|
||||
font-size: clamp(1rem, 2.2vw, 1.3rem);
|
||||
color: var(--accent-soft);
|
||||
margin: 0 0 1rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.lead {
|
||||
color: var(--text-secondary);
|
||||
max-width: 68ch;
|
||||
margin: 0 0 1.25rem;
|
||||
text-wrap: pretty;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.hero-actions {
|
||||
display: flex;
|
||||
gap: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.hero-controls {
|
||||
position: absolute;
|
||||
right: clamp(1rem, 2.5vw, 2rem);
|
||||
bottom: clamp(1rem, 2.8vw, 1.75rem);
|
||||
z-index: 3;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.45rem;
|
||||
padding: 0.4rem 0.55rem;
|
||||
border-radius: 999px;
|
||||
backdrop-filter: blur(10px);
|
||||
background: rgba(30, 41, 59, 0.7);
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.hero-control {
|
||||
width: 2.2rem;
|
||||
height: 2.2rem;
|
||||
border: 0;
|
||||
border-radius: 999px;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
font-size: 1.32rem;
|
||||
color: var(--text-secondary);
|
||||
background: rgba(148, 163, 184, 0.15);
|
||||
cursor: pointer;
|
||||
transition: all 180ms ease;
|
||||
}
|
||||
|
||||
.hero-control:hover {
|
||||
transform: translateY(-1px);
|
||||
background: var(--accent-bg);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.hero-dots {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
margin: 0 0.15rem;
|
||||
}
|
||||
|
||||
.hero-dot {
|
||||
width: 0.6rem;
|
||||
height: 0.6rem;
|
||||
border-radius: 999px;
|
||||
border: 0;
|
||||
background: rgba(148, 163, 184, 0.3);
|
||||
cursor: pointer;
|
||||
transition: all 180ms ease;
|
||||
}
|
||||
|
||||
.hero-dot.is-active {
|
||||
background: var(--accent);
|
||||
transform: scale(1.18);
|
||||
}
|
||||
|
||||
/* ── Feature Cards ── */
|
||||
|
||||
.features {
|
||||
margin-top: 1.5rem;
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.features .card {
|
||||
flex: 1 1 0;
|
||||
min-width: 0;
|
||||
min-height: 11rem;
|
||||
background: var(--surface);
|
||||
padding: 1.5rem;
|
||||
border-radius: 0.75rem;
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: var(--shadow-sm);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
|
||||
}
|
||||
|
||||
.features .card h2 {
|
||||
margin: 0;
|
||||
font-family: "Georgia", serif;
|
||||
font-size: clamp(1.25rem, 1.6vw, 1.6rem);
|
||||
line-height: 1.1;
|
||||
color: var(--text);
|
||||
transition: transform 220ms ease;
|
||||
}
|
||||
|
||||
.features .card p {
|
||||
margin: 0;
|
||||
font-size: clamp(0.95rem, 1.05vw, 1.08rem);
|
||||
line-height: 1.6;
|
||||
color: var(--text-secondary);
|
||||
position: absolute;
|
||||
left: 1.5rem;
|
||||
right: 1.5rem;
|
||||
bottom: 1.35rem;
|
||||
padding: 0.85rem 1rem;
|
||||
background: var(--surface-raised);
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid var(--border-soft);
|
||||
opacity: 0;
|
||||
transform: translateY(0.5rem);
|
||||
transition: opacity 180ms ease, transform 220ms ease;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.features:not(:hover) .card:first-child,
|
||||
.features .card:first-child:hover,
|
||||
.features .card:first-child:focus {
|
||||
flex-grow: 2.6;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.features:not(:hover) .card:first-child p,
|
||||
.features .card:first-child:hover p,
|
||||
.features .card:first-child:focus p {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.features:hover .card:first-child:not(:hover):not(:focus) {
|
||||
flex-grow: 1;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.features:hover .card:first-child:not(:hover):not(:focus) p {
|
||||
opacity: 0;
|
||||
transform: translateY(0.5rem);
|
||||
}
|
||||
|
||||
.features .card:hover,
|
||||
.features .card:focus {
|
||||
flex-grow: 2.6;
|
||||
justify-content: flex-start;
|
||||
transform: translateY(-4px);
|
||||
box-shadow: var(--shadow-lg);
|
||||
border-color: var(--accent-soft);
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.features .card:hover p,
|
||||
.features .card:focus p {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.features .card:focus {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
/* ── Environment Choices ── */
|
||||
|
||||
.env-choices {
|
||||
margin-top: 1.8rem;
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
padding: clamp(1.2rem, 2.4vw, 1.8rem);
|
||||
border-radius: 1rem;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.env-choices-header h2 {
|
||||
margin: 0 0 0.45rem;
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: clamp(1.6rem, 3vw, 2.2rem);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.env-choices-header p {
|
||||
margin: 0.5rem 0 1rem;
|
||||
color: var(--text-secondary);
|
||||
max-width: 78ch;
|
||||
line-height: 1.7;
|
||||
}
|
||||
|
||||
.env-row {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(170px, 0.9fr) minmax(0, 2.1fr);
|
||||
gap: clamp(0.85rem, 2vw, 1.35rem);
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.env-row.is-reverse {
|
||||
grid-template-columns: minmax(0, 2.1fr) minmax(170px, 0.9fr);
|
||||
}
|
||||
|
||||
.env-media,
|
||||
.env-text {
|
||||
margin: 0;
|
||||
border-radius: 0.8rem;
|
||||
border: 1px solid var(--border);
|
||||
overflow: hidden;
|
||||
background: var(--surface-raised);
|
||||
}
|
||||
|
||||
.env-media {
|
||||
min-height: clamp(140px, 20vw, 190px);
|
||||
}
|
||||
|
||||
.env-media img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.env-text {
|
||||
padding: clamp(1rem, 2.4vw, 1.4rem);
|
||||
display: grid;
|
||||
align-content: center;
|
||||
gap: 0.55rem;
|
||||
}
|
||||
|
||||
.env-text h3 {
|
||||
margin: 0;
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: clamp(1.25rem, 2vw, 1.6rem);
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.env-text p {
|
||||
margin: 0;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
/* ── Downloads (inline styles) ── */
|
||||
|
||||
.downloads {
|
||||
margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
.downloads-header h1 { margin: 0 0 0.35rem; }
|
||||
|
||||
.download-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 1rem;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.download-card {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
align-items: stretch;
|
||||
padding: 0.8rem;
|
||||
border-radius: 0.75rem;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.download-media { width: 220px; flex: 0 0 220px; overflow: hidden; border-radius: 0.5rem; }
|
||||
.download-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||||
|
||||
.download-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 0.6rem; }
|
||||
|
||||
.download-actions { display: flex; gap: 0.6rem; margin-top: auto; }
|
||||
|
||||
@media (max-width: 880px) {
|
||||
.download-grid { grid-template-columns: 1fr; }
|
||||
.download-media { width: 140px; flex-basis: 140px; }
|
||||
}
|
||||
|
||||
/* Versions toolbar */
|
||||
.version-toolbar {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: 0.8rem;
|
||||
}
|
||||
|
||||
.version-current { color: var(--muted); }
|
||||
|
||||
.versions-archive {
|
||||
margin-top: 0.8rem;
|
||||
padding: 0.8rem;
|
||||
border-radius: 0.6rem;
|
||||
background: var(--surface-raised);
|
||||
border: 1px solid var(--border-soft);
|
||||
}
|
||||
|
||||
.versions-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
|
||||
.version-item { display: flex; justify-content: space-between; align-items: center; padding: 0.4rem 0.6rem; border-radius: 0.45rem; }
|
||||
.version-meta { color: var(--muted); margin-left: 0.6rem; font-size: 0.92rem; }
|
||||
.version-actions { display: flex; gap: 0.5rem; }
|
||||
|
||||
/* ── Responsive tablette ── */
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.features {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.features .card {
|
||||
flex: 1 1 45%;
|
||||
min-height: 9rem;
|
||||
}
|
||||
|
||||
/* La mécanique hover-grow de l'accordéon n'a pas de sens au doigt :
|
||||
chaque carte affiche sa description en permanence. */
|
||||
.features .card p {
|
||||
position: static;
|
||||
margin-top: 0.4rem;
|
||||
padding: 0;
|
||||
background: none;
|
||||
border: 0;
|
||||
opacity: 1;
|
||||
transform: none;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.features .card:hover,
|
||||
.features .card:focus {
|
||||
flex-grow: 0;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.features:not(:hover) .card:first-child,
|
||||
.features:hover .card:first-child:not(:hover):not(:focus) {
|
||||
flex-grow: 0;
|
||||
}
|
||||
|
||||
.env-row,
|
||||
.env-row.is-reverse {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
/* Ordre visuel : l'image au-dessus du texte, même pour les rangées inversées */
|
||||
.env-row.is-reverse .env-text { order: 2; }
|
||||
.env-row.is-reverse .env-media { order: 1; }
|
||||
|
||||
.env-media {
|
||||
min-height: 10rem;
|
||||
}
|
||||
|
||||
.download-media {
|
||||
width: 120px;
|
||||
flex-basis: 120px;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Responsive mobile ── */
|
||||
|
||||
@media (max-width: 640px) {
|
||||
main[data-page-content] {
|
||||
padding: 1.25rem 1rem;
|
||||
}
|
||||
|
||||
.hero {
|
||||
min-height: 26rem;
|
||||
}
|
||||
|
||||
.hero-controls {
|
||||
position: static;
|
||||
margin-top: 1.25rem;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hero-inner {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.features {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.features .card {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
padding: 1.15rem;
|
||||
}
|
||||
|
||||
.env-choices {
|
||||
padding: 1.1rem 0.9rem;
|
||||
}
|
||||
|
||||
.env-text {
|
||||
padding: 1rem 0.9rem;
|
||||
}
|
||||
|
||||
.download-card {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.download-media {
|
||||
width: 100%;
|
||||
flex-basis: auto;
|
||||
max-height: 10rem;
|
||||
}
|
||||
|
||||
.download-media img {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.version-item {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.version-actions {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.version-actions .button {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,803 @@
|
||||
/* ── Menu déroulant « Paquets » (barre de navigation) ── */
|
||||
|
||||
.nav-dropdown {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.nav-dropdown-toggle {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4rem;
|
||||
padding: 0.5rem 1rem;
|
||||
border: 0;
|
||||
background: transparent;
|
||||
color: var(--text-secondary);
|
||||
font-family: inherit;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 500;
|
||||
border-radius: 0.5rem;
|
||||
cursor: pointer;
|
||||
transition: all 160ms ease;
|
||||
}
|
||||
|
||||
.nav-dropdown-toggle:hover,
|
||||
.nav-dropdown-toggle[aria-current="page"] {
|
||||
color: var(--accent);
|
||||
background: var(--accent-bg);
|
||||
}
|
||||
|
||||
.nav-dropdown-toggle:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.nav-dropdown-caret {
|
||||
width: 0.55rem;
|
||||
height: 0.55rem;
|
||||
border-right: 2px solid currentColor;
|
||||
border-bottom: 2px solid currentColor;
|
||||
transform: rotate(45deg) translateY(-2px);
|
||||
transition: transform 160ms ease;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.is-open .nav-dropdown-caret {
|
||||
transform: rotate(-135deg) translateY(-1px);
|
||||
}
|
||||
|
||||
.nav-dropdown-panel {
|
||||
position: absolute;
|
||||
top: calc(100% + 0.55rem);
|
||||
left: 50%;
|
||||
z-index: 300;
|
||||
width: min(92vw, 26rem);
|
||||
padding: 0.4rem;
|
||||
background: color-mix(in srgb, var(--surface-raised) 88%, transparent);
|
||||
backdrop-filter: blur(14px);
|
||||
-webkit-backdrop-filter: blur(14px);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 18px 50px rgba(2, 6, 23, 0.55), var(--shadow-lg);
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transform: translateX(-50%) translateY(-6px) scale(0.98);
|
||||
transform-origin: top center;
|
||||
transition: opacity 170ms ease, transform 170ms ease, visibility 170ms;
|
||||
}
|
||||
|
||||
.nav-dropdown.is-open .nav-dropdown-panel {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: translateX(-50%) translateY(0) scale(1);
|
||||
}
|
||||
|
||||
/* En-tête du panneau : titre + compteur */
|
||||
.nav-dropdown-head {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
justify-content: space-between;
|
||||
gap: 0.75rem;
|
||||
padding: 0.55rem 0.7rem 0.5rem;
|
||||
border-bottom: 1px solid var(--border-soft);
|
||||
}
|
||||
|
||||
.nav-dropdown-head strong {
|
||||
color: var(--text);
|
||||
font-size: 0.8rem;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.07em;
|
||||
}
|
||||
|
||||
.nav-dropdown-head small {
|
||||
color: var(--muted);
|
||||
font-size: 0.72rem;
|
||||
}
|
||||
|
||||
.nav-dropdown-panel-inner {
|
||||
display: grid;
|
||||
gap: 0.2rem;
|
||||
max-height: min(58vh, 24rem);
|
||||
overflow: auto;
|
||||
padding: 0.4rem 0.15rem 0.2rem;
|
||||
scrollbar-width: thin;
|
||||
}
|
||||
|
||||
.nav-dropdown-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.65rem;
|
||||
padding: 0.55rem 0.6rem;
|
||||
border-radius: 0.65rem;
|
||||
text-decoration: none;
|
||||
color: var(--text-secondary);
|
||||
transition: background 130ms ease, color 130ms ease, transform 130ms ease;
|
||||
}
|
||||
|
||||
/* Item avec miniature (première image du paquet) */
|
||||
.nav-dropdown-item.has-thumb {
|
||||
grid-template-columns: auto 1fr;
|
||||
}
|
||||
.nav-dropdown-thumb {
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
border-radius: 0.55rem;
|
||||
object-fit: cover;
|
||||
border: 1px solid var(--border);
|
||||
display: block;
|
||||
flex: none;
|
||||
background: var(--surface);
|
||||
}
|
||||
.nav-dropdown-text {
|
||||
display: grid;
|
||||
gap: 0.1rem;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.nav-dropdown-item:hover,
|
||||
.nav-dropdown-item:focus-visible {
|
||||
background: var(--accent-bg);
|
||||
color: var(--text);
|
||||
outline: none;
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
.nav-dropdown-item strong {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.4rem;
|
||||
color: var(--text);
|
||||
font-size: 0.92rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.nav-dropdown-version {
|
||||
padding: 0.05rem 0.45rem;
|
||||
font-size: 0.65rem;
|
||||
font-weight: 700;
|
||||
color: var(--accent);
|
||||
background: var(--accent-bg);
|
||||
border: 1px solid rgba(56, 189, 248, 0.3);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.nav-dropdown-item small {
|
||||
color: var(--muted);
|
||||
font-size: 0.76rem;
|
||||
line-height: 1.35;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.nav-dropdown-all {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.4rem;
|
||||
margin: 0.3rem 0.15rem 0.1rem;
|
||||
padding: 0.6rem 0.75rem;
|
||||
border-top: 1px solid var(--border-soft);
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
font-size: 0.88rem;
|
||||
font-weight: 600;
|
||||
border-radius: 0.65rem;
|
||||
transition: background 130ms ease, color 130ms ease;
|
||||
}
|
||||
|
||||
.nav-dropdown-all:hover {
|
||||
background: var(--accent-bg);
|
||||
color: var(--accent-strong);
|
||||
}
|
||||
|
||||
.nav-dropdown-error {
|
||||
margin: 0;
|
||||
padding: 0.6rem 0.75rem;
|
||||
color: var(--error-text-color);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
/* ── Page « Paquets » ── */
|
||||
|
||||
.paquets-hero {
|
||||
text-align: center;
|
||||
padding: 1.5rem 0 0.5rem;
|
||||
}
|
||||
|
||||
.paquets-hero h1 {
|
||||
margin: 0 0 0.5rem;
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: 2.25rem;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.paquets-list {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
}
|
||||
|
||||
.paquet-card {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
padding: 1.25rem 1.25rem 1.5rem;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.75rem;
|
||||
box-shadow: var(--shadow-sm);
|
||||
scroll-margin-top: 6rem;
|
||||
}
|
||||
|
||||
.paquet-head {
|
||||
display: grid;
|
||||
gap: 0.4rem;
|
||||
}
|
||||
|
||||
.paquet-title-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 0.6rem;
|
||||
}
|
||||
|
||||
.paquet-title-row h2 {
|
||||
margin: 0;
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: 1.35rem;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.paquet-since {
|
||||
padding: 0.15rem 0.5rem;
|
||||
font-size: 0.72rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
color: var(--accent);
|
||||
background: var(--accent-bg);
|
||||
border: 1px solid rgba(56, 189, 248, 0.25);
|
||||
border-radius: 999px;
|
||||
}
|
||||
|
||||
.paquet-detail-link {
|
||||
margin-left: auto;
|
||||
padding: 0.35rem 0.75rem;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
border: 1px solid var(--accent-soft);
|
||||
border-radius: 0.5rem;
|
||||
transition: color 160ms ease, background 160ms ease;
|
||||
}
|
||||
|
||||
.paquet-detail-link:hover {
|
||||
color: var(--text);
|
||||
background: var(--accent-bg);
|
||||
}
|
||||
|
||||
.paquet-tagline {
|
||||
margin: 0;
|
||||
color: var(--accent-soft);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.paquet-latest {
|
||||
margin: 0;
|
||||
color: var(--muted);
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.paquet-description {
|
||||
margin: 0;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.paquet-body {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 1.25rem;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.paquet-changelog,
|
||||
.paquet-screens {
|
||||
display: grid;
|
||||
gap: 0.6rem;
|
||||
}
|
||||
|
||||
.paquet-changelog > h3,
|
||||
.paquet-screens > h3 {
|
||||
margin: 0;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.paquet-timeline {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: grid;
|
||||
gap: 0.65rem;
|
||||
border-left: 2px solid var(--border);
|
||||
margin-left: 0.25rem;
|
||||
}
|
||||
|
||||
.paquet-timeline-item {
|
||||
position: relative;
|
||||
padding-left: 1rem;
|
||||
display: grid;
|
||||
gap: 0.1rem;
|
||||
}
|
||||
|
||||
.paquet-timeline-item::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: -5px;
|
||||
top: 0.3rem;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
background: var(--accent);
|
||||
}
|
||||
|
||||
.paquet-timeline-version {
|
||||
color: var(--text);
|
||||
font-size: 0.95rem;
|
||||
}
|
||||
|
||||
.paquet-timeline-date {
|
||||
color: var(--muted);
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
.paquet-timeline-notes {
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.9rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.paquet-screens-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
||||
gap: 0.6rem;
|
||||
}
|
||||
|
||||
.paquet-screens-grid figure {
|
||||
margin: 0;
|
||||
display: grid;
|
||||
gap: 0.3rem;
|
||||
}
|
||||
|
||||
.paquet-screens-grid img {
|
||||
width: 100%;
|
||||
aspect-ratio: 16 / 10;
|
||||
object-fit: cover;
|
||||
border-radius: 0.5rem;
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.paquet-screens-grid figcaption {
|
||||
color: var(--muted);
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
/* ── Historique limité (« Voir plus ») ── */
|
||||
|
||||
.paquet-timeline-item.paquet-timeline-extra {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.paquet-timeline.is-expanded .paquet-timeline-extra {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.paquet-more {
|
||||
justify-self: start;
|
||||
padding: 0.3rem 0.8rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
color: var(--accent);
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
transition: border-color 140ms ease, color 140ms ease;
|
||||
}
|
||||
|
||||
.paquet-more:hover {
|
||||
border-color: var(--accent);
|
||||
color: var(--accent-strong, var(--accent));
|
||||
}
|
||||
|
||||
/* ── Images cliquables (page détail) ── */
|
||||
|
||||
.paquet-screens-grid img[data-zoom] {
|
||||
cursor: zoom-in;
|
||||
transition: opacity 140ms ease;
|
||||
}
|
||||
|
||||
.paquet-screens-grid img[data-zoom]:hover {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.paquet-zoom-hint {
|
||||
color: var(--muted);
|
||||
font-size: 0.72rem;
|
||||
}
|
||||
|
||||
/* ── Popup central « aperçu de l'image » ── */
|
||||
|
||||
html.pkg-no-scroll {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.pkg-lightbox {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 2rem;
|
||||
background: rgba(2, 6, 23, 0.55);
|
||||
backdrop-filter: blur(10px);
|
||||
-webkit-backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.pkg-lightbox.is-open {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.pkg-lightbox-figure {
|
||||
margin: 0;
|
||||
display: grid;
|
||||
gap: 0.55rem;
|
||||
max-width: min(1000px, 90vw);
|
||||
animation: pkg-pop 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
|
||||
}
|
||||
|
||||
.pkg-lightbox-figure.is-animating {
|
||||
animation: pkg-pop 220ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
|
||||
}
|
||||
|
||||
@keyframes pkg-pop {
|
||||
from { opacity: 0; transform: scale(0.92); }
|
||||
to { opacity: 1; transform: scale(1); }
|
||||
}
|
||||
|
||||
.pkg-lightbox-img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
max-height: 78vh;
|
||||
object-fit: contain;
|
||||
border-radius: 0.8rem;
|
||||
border: 1px solid var(--border);
|
||||
box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.pkg-lightbox-figcap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.8rem;
|
||||
}
|
||||
|
||||
.pkg-lightbox-caption {
|
||||
color: #e2e8f0;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.pkg-lightbox-count {
|
||||
color: #94a3b8;
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
.pkg-lightbox-close {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
right: 1.2rem;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
border: 1px solid rgba(148, 163, 184, 0.4);
|
||||
border-radius: 999px;
|
||||
background: rgba(15, 23, 42, 0.75);
|
||||
color: #e2e8f0;
|
||||
font-size: 1.4rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pkg-lightbox-close:hover {
|
||||
border-color: #e2e8f0;
|
||||
}
|
||||
|
||||
.pkg-lightbox-nav {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 2.8rem;
|
||||
height: 2.8rem;
|
||||
border: 1px solid rgba(148, 163, 184, 0.35);
|
||||
border-radius: 999px;
|
||||
background: rgba(15, 23, 42, 0.75);
|
||||
color: #e2e8f0;
|
||||
font-size: 1.6rem;
|
||||
line-height: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pkg-lightbox-prev { left: 1.2rem; }
|
||||
.pkg-lightbox-next { right: 1.2rem; }
|
||||
|
||||
.pkg-lightbox-nav:hover {
|
||||
border-color: #e2e8f0;
|
||||
background: rgba(30, 41, 59, 0.9);
|
||||
}
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.pkg-lightbox {
|
||||
padding: 1rem;
|
||||
}
|
||||
.pkg-lightbox-nav {
|
||||
top: auto;
|
||||
bottom: 1.2rem;
|
||||
transform: none;
|
||||
}
|
||||
.pkg-lightbox-prev { left: auto; right: 4.2rem; }
|
||||
.pkg-lightbox-next { right: 1.2rem; }
|
||||
}
|
||||
|
||||
.paquet-links {
|
||||
grid-column: 1 / -1;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.paquet-links > h3 {
|
||||
flex-basis: 100%;
|
||||
margin: 0;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.paquet-empty {
|
||||
margin: 0;
|
||||
padding: 0.6rem 0.8rem;
|
||||
border: 1px dashed var(--border);
|
||||
border-radius: 0.5rem;
|
||||
color: var(--muted);
|
||||
font-size: 0.85rem;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
/* ── Page détail « Paquets / N » ── */
|
||||
|
||||
.paquet-detail-page {
|
||||
display: grid;
|
||||
gap: 1.5rem;
|
||||
max-width: 56rem;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.paquet-detail-back {
|
||||
justify-self: start;
|
||||
color: var(--accent);
|
||||
text-decoration: none;
|
||||
font-size: 0.95rem;
|
||||
font-weight: 500;
|
||||
transition: color 160ms ease, transform 160ms ease;
|
||||
}
|
||||
|
||||
.paquet-detail-back:hover {
|
||||
color: var(--accent-strong);
|
||||
transform: translateX(-2px);
|
||||
}
|
||||
|
||||
.paquet-detail-hero {
|
||||
display: grid;
|
||||
gap: 0.75rem;
|
||||
padding: 2rem 2rem 2.25rem;
|
||||
text-align: center;
|
||||
justify-items: center;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 1rem;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.paquet-detail-hero .paquet-since {
|
||||
justify-self: center;
|
||||
}
|
||||
|
||||
.paquet-detail-hero h1 {
|
||||
margin: 0;
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: 2.75rem;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.paquet-detail-hero .paquet-tagline {
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
.paquet-detail-hero .paquet-description {
|
||||
max-width: 40rem;
|
||||
}
|
||||
|
||||
.paquet-detail-latest {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
flex-wrap: wrap;
|
||||
justify-content: center;
|
||||
margin-top: 0.5rem;
|
||||
padding: 0.4rem 1rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 999px;
|
||||
background: var(--surface-raised);
|
||||
}
|
||||
|
||||
.paquet-detail-latest-empty {
|
||||
color: var(--muted);
|
||||
font-style: italic;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.paquet-detail-version {
|
||||
font-size: 1.4rem;
|
||||
font-weight: 700;
|
||||
color: var(--accent);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.paquet-detail-date {
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.paquet-detail-body {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
gap: 1.5rem;
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.paquet-detail-page > .paquet-links {
|
||||
grid-column: auto;
|
||||
}
|
||||
|
||||
/* ── Responsive ── */
|
||||
|
||||
/* Tablette : grilles deux colonnes → une, panels déroulants déjà statiques <900px */
|
||||
@media (max-width: 900px) {
|
||||
.paquet-body,
|
||||
.paquet-detail-body {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.paquet-detail-hero {
|
||||
padding: 1.5rem 1.25rem 1.75rem;
|
||||
}
|
||||
|
||||
.paquet-detail-hero h1 {
|
||||
font-size: 2rem;
|
||||
}
|
||||
|
||||
.paquet-detail-link {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* La popup garde la place : flèches en bas, comme le bloc 720px existant */
|
||||
.pkg-lightbox {
|
||||
padding: 0.9rem;
|
||||
}
|
||||
|
||||
.pkg-lightbox-img {
|
||||
max-height: 62vh;
|
||||
}
|
||||
|
||||
.pkg-lightbox-nav {
|
||||
top: auto;
|
||||
bottom: 1.2rem;
|
||||
transform: none;
|
||||
width: 2.6rem;
|
||||
height: 2.6rem;
|
||||
}
|
||||
|
||||
.pkg-lightbox-prev { left: auto; right: 4.4rem; }
|
||||
.pkg-lightbox-next { right: 1rem; }
|
||||
|
||||
.pkg-lightbox-close {
|
||||
top: 0.8rem;
|
||||
right: 0.8rem;
|
||||
}
|
||||
|
||||
.pkg-lightbox-figcap {
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.nav-dropdown-toggle {
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.nav-dropdown-panel {
|
||||
position: static;
|
||||
left: auto;
|
||||
min-width: 0;
|
||||
max-width: none;
|
||||
transform: none;
|
||||
width: 100%;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Le conteneur flex desktop mettrait toggle et panneau côte à côte : en mobile on empile */
|
||||
.nav-dropdown {
|
||||
display: block;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav-dropdown.is-open .nav-dropdown-panel {
|
||||
display: block;
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.paquet-links {
|
||||
grid-column: auto;
|
||||
}
|
||||
|
||||
.paquets-hero h1 {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
|
||||
.paquet-card {
|
||||
padding: 1.1rem 1rem 1.3rem;
|
||||
}
|
||||
|
||||
.paquet-title-row h2 {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
.paquet-timeline {
|
||||
margin-left: 0;
|
||||
padding-left: 0.9rem;
|
||||
}
|
||||
|
||||
.paquet-screens-grid {
|
||||
grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
|
||||
}
|
||||
|
||||
.paquet-links .button {
|
||||
flex: 1 1 100%;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.paquet-detail-back {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
/* Très petits écrans : captures en une colonne (après le bloc 700px pour gagner) */
|
||||
@media (max-width: 480px) {
|
||||
.paquet-screens-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,501 @@
|
||||
@import "./var.css";
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* ── Skip link (accessibilité) ── */
|
||||
|
||||
.skip-link {
|
||||
position: absolute;
|
||||
top: -100%;
|
||||
left: 0.5rem;
|
||||
z-index: 9999;
|
||||
padding: 0.6rem 1rem;
|
||||
background: var(--accent);
|
||||
color: var(--surface-dim);
|
||||
font-weight: 600;
|
||||
border-radius: 0 0 0.5rem 0.5rem;
|
||||
text-decoration: none;
|
||||
transition: top 200ms ease;
|
||||
}
|
||||
|
||||
.skip-link:focus {
|
||||
top: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
scroll-behavior: smooth;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
color: var(--text);
|
||||
font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
|
||||
background: var(--surface-dim);
|
||||
background-image:
|
||||
radial-gradient(circle at top left, rgba(56, 189, 248, 0.08), transparent 40%),
|
||||
radial-gradient(circle at bottom right, rgba(125, 211, 252, 0.05), transparent 40%);
|
||||
}
|
||||
|
||||
.page-shell {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
min-height: 100vh;
|
||||
display: grid;
|
||||
grid-template-rows: auto 1fr auto;
|
||||
gap: 0;
|
||||
}
|
||||
|
||||
/* ── Header ── */
|
||||
|
||||
.site-header {
|
||||
background: var(--surface);
|
||||
border-bottom: 1px solid var(--border);
|
||||
box-shadow: var(--shadow-sm);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.header-brand-block {
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
max-width: 1200px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.85rem;
|
||||
justify-content: space-between;
|
||||
padding: 0.75rem 1.25rem;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.75rem;
|
||||
color: var(--text);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.brand-mark {
|
||||
width: 2.75rem;
|
||||
height: 2.75rem;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.brand-text {
|
||||
display: grid;
|
||||
font-size: 1.5rem;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
.brand-text strong {
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.brand-text small {
|
||||
color: var(--muted);
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
/* ── Navigation ── */
|
||||
|
||||
.site-nav {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.35rem;
|
||||
}
|
||||
|
||||
/* Burger mobile : bouton visible <900px, la nav devient un panneau dépliant */
|
||||
|
||||
.nav-burger {
|
||||
display: none;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: 5px;
|
||||
width: 2.75rem;
|
||||
height: 2.75rem;
|
||||
padding: 0 0.6rem;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5rem;
|
||||
background: var(--surface-raised);
|
||||
cursor: pointer;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.nav-burger span {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
border-radius: 2px;
|
||||
background: var(--text);
|
||||
transition: transform 180ms ease, opacity 180ms ease;
|
||||
}
|
||||
|
||||
.nav-burger[aria-expanded="true"] span:nth-child(1) {
|
||||
transform: translateY(7px) rotate(45deg);
|
||||
}
|
||||
|
||||
.nav-burger[aria-expanded="true"] span:nth-child(2) {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.nav-burger[aria-expanded="true"] span:nth-child(3) {
|
||||
transform: translateY(-7px) rotate(-45deg);
|
||||
}
|
||||
|
||||
.site-nav a {
|
||||
padding: 0.5rem 1rem;
|
||||
color: var(--text-secondary);
|
||||
text-decoration: none;
|
||||
border-radius: 0.5rem;
|
||||
font-weight: 500;
|
||||
font-size: 0.95rem;
|
||||
transition: all 160ms ease;
|
||||
}
|
||||
|
||||
.site-nav a:hover,
|
||||
.site-nav a[aria-current="page"] {
|
||||
color: var(--accent);
|
||||
background: var(--accent-bg);
|
||||
}
|
||||
|
||||
.site-nav a:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
/* ── Main ── */
|
||||
|
||||
.site-main {
|
||||
margin: 0 auto;
|
||||
max-width: 1200px;
|
||||
width: 100%;
|
||||
padding: 2rem 1.25rem;
|
||||
display: grid;
|
||||
gap: 2rem;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
/* ── Footer ── */
|
||||
|
||||
.site-footer {
|
||||
background: var(--surface);
|
||||
border-top: 1px solid var(--border);
|
||||
padding: 2rem 1.25rem;
|
||||
}
|
||||
|
||||
.site-footer p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.footer-brand-row {
|
||||
display: flex;
|
||||
align-items: start;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding-bottom: 1.25rem;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.footer-content {
|
||||
margin: 0 auto;
|
||||
max-width: 1200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.footer-brand-block {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.85rem;
|
||||
max-width: 42rem;
|
||||
}
|
||||
|
||||
.footer-brand-mark {
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
border-radius: 0.5rem;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
flex: none;
|
||||
}
|
||||
|
||||
.footer-brand-block strong {
|
||||
display: block;
|
||||
color: var(--text);
|
||||
font-family: "Georgia", "Palatino Linotype", serif;
|
||||
font-size: 1.05rem;
|
||||
}
|
||||
|
||||
.footer-brand-block p,
|
||||
.footer-note,
|
||||
.footer-bottom p {
|
||||
color: var(--muted);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.footer-note {
|
||||
max-width: 20rem;
|
||||
}
|
||||
|
||||
.footer-links-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, minmax(0, 1fr));
|
||||
gap: 1.5rem;
|
||||
padding: 1.5rem 0;
|
||||
}
|
||||
|
||||
.footer-links-grid section,
|
||||
.footer-links-grid nav {
|
||||
display: grid;
|
||||
gap: 0.5rem;
|
||||
align-content: start;
|
||||
}
|
||||
|
||||
.footer-links-grid h2 {
|
||||
margin: 0 0 0.25rem;
|
||||
color: var(--text);
|
||||
font-size: 0.9rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.footer-links-grid a {
|
||||
color: var(--text-secondary);
|
||||
text-decoration: none;
|
||||
width: fit-content;
|
||||
font-size: 0.95rem;
|
||||
transition: color 160ms ease, transform 160ms ease;
|
||||
}
|
||||
|
||||
.footer-links-grid a:hover {
|
||||
color: var(--accent);
|
||||
transform: translateX(2px);
|
||||
}
|
||||
|
||||
.footer-bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
padding-top: 1.25rem;
|
||||
border-top: 1px solid var(--border);
|
||||
font-size: 0.9rem;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.footer-hosting {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.footer-hosting a {
|
||||
color: var(--text-secondary);
|
||||
text-decoration: none;
|
||||
border-bottom: 1px solid var(--border);
|
||||
transition: color 160ms ease;
|
||||
}
|
||||
|
||||
.footer-hosting a:hover,
|
||||
.footer-hosting a:focus-visible {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.footer-release,
|
||||
.footer-commit {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.footer-release span,
|
||||
.footer-commit span {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
/* ── Buttons ── */
|
||||
|
||||
.button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.7rem 1.4rem;
|
||||
border-radius: 0.5rem;
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
font-size: 0.95rem;
|
||||
border: 1px solid transparent;
|
||||
cursor: pointer;
|
||||
transition: all 180ms ease;
|
||||
user-select: none;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
background: var(--accent);
|
||||
color: var(--surface-dim);
|
||||
box-shadow: 0 2px 8px rgba(56, 189, 248, 0.25);
|
||||
}
|
||||
|
||||
.button-secondary {
|
||||
background: var(--surface-raised);
|
||||
color: var(--text-secondary);
|
||||
border-color: var(--border);
|
||||
}
|
||||
|
||||
.button:hover,
|
||||
.button:focus-visible {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.button-primary:hover,
|
||||
.button-primary:focus-visible {
|
||||
background: var(--accent-strong);
|
||||
box-shadow: 0 4px 16px rgba(56, 189, 248, 0.3);
|
||||
}
|
||||
|
||||
.button-secondary:hover,
|
||||
.button-secondary:focus-visible {
|
||||
background: rgba(56, 189, 248, 0.12);
|
||||
border-color: var(--accent-soft);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.button:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.button[aria-disabled="true"],
|
||||
.button:disabled {
|
||||
opacity: 0.5;
|
||||
pointer-events: none;
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* ── Responsive ── */
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.footer-links-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
/* Header : burger à droite, nav en panneau dépliant sous la marque */
|
||||
.header-brand-block {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
padding: 0.6rem 1rem;
|
||||
gap: 0.6rem;
|
||||
}
|
||||
|
||||
.nav-burger {
|
||||
display: flex;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.site-nav {
|
||||
display: none;
|
||||
flex-basis: 100%;
|
||||
flex-direction: column;
|
||||
gap: 0.3rem;
|
||||
padding: 0.35rem 0 0.5rem;
|
||||
border-top: 1px solid var(--border-soft);
|
||||
}
|
||||
|
||||
.site-nav.is-open {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.site-nav a,
|
||||
.nav-dropdown-toggle {
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
padding: 0.65rem 1rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
/* Le panneau déroulant devient statique : il se déploie dans le flux */
|
||||
.nav-dropdown {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav-dropdown-panel {
|
||||
position: static;
|
||||
left: auto;
|
||||
min-width: 0;
|
||||
max-width: none;
|
||||
width: 100%;
|
||||
transform: none;
|
||||
box-shadow: none;
|
||||
background: var(--surface);
|
||||
}
|
||||
|
||||
.nav-dropdown.is-open .nav-dropdown-panel {
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.nav-dropdown-panel-inner {
|
||||
max-height: 16rem;
|
||||
}
|
||||
|
||||
.site-main {
|
||||
padding: 1.25rem 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 700px) {
|
||||
.page-shell {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.header-brand-block {
|
||||
padding: 0.55rem 0.85rem;
|
||||
}
|
||||
|
||||
.brand-text {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.footer-brand-row,
|
||||
.footer-bottom {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.footer-brand-block {
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.footer-bottom p {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hero-actions .button {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
/* Très petits écrans (<380px) : marges réduites, tailles resserrées */
|
||||
@media (max-width: 380px) {
|
||||
.site-main {
|
||||
padding: 1rem 0.65rem;
|
||||
}
|
||||
|
||||
.hero {
|
||||
min-height: 24rem;
|
||||
}
|
||||
|
||||
.hero-title {
|
||||
font-size: clamp(2rem, 9vw, 2.5rem);
|
||||
}
|
||||
|
||||
.footer-links-grid {
|
||||
gap: 1rem;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
:root {
|
||||
/* Accent colors */
|
||||
--accent: #38bdf8;
|
||||
--accent-soft: #7dd3fc;
|
||||
--accent-strong: #0ea5e9;
|
||||
--accent-bg: rgba(56, 189, 248, 0.1);
|
||||
|
||||
/* Surfaces — slate doux, pas noir pur */
|
||||
--surface: #1e293b;
|
||||
--surface-raised: #273449;
|
||||
--surface-dim: #0f172a;
|
||||
|
||||
/* Text */
|
||||
--text: #e2e8f0;
|
||||
--text-secondary: #94a3b8;
|
||||
--muted: #64748b;
|
||||
|
||||
/* Borders */
|
||||
--border: rgba(148, 163, 184, 0.15);
|
||||
--border-soft: rgba(148, 163, 184, 0.08);
|
||||
|
||||
/* Shadows */
|
||||
--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
|
||||
--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.15);
|
||||
--shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.2);
|
||||
--shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 2px 4px rgba(0, 0, 0, 0.15);
|
||||
|
||||
/* Status */
|
||||
--error-text-color: #f87171;
|
||||
--warning-text-color: #fbbf24;
|
||||
--success-text-color: #34d399;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page Conditions d'utilisation (rendu serveur, coquille page.php).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct (/p/conditions/…) : on délègue au front controller. */
|
||||
require __DIR__ . '/../../page.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = "Conditions d'utilisation | FWS Linux";
|
||||
$description = "Conditions d'utilisation du site et de la distribution FWS Linux : usage, licences libres, téléchargements, responsabilité et droit applicable suisse.";
|
||||
$extraCss[] = fws_url('/p/assets/styles/legal.css');
|
||||
?>
|
||||
<header class="legal-header">
|
||||
<h1>Conditions d'utilisation</h1>
|
||||
<p>Les présentes conditions régissent l'accès au site FWS Linux et l'utilisation de la distribution qui y est proposée.</p>
|
||||
</header>
|
||||
|
||||
<div class="legal-main">
|
||||
<section>
|
||||
<h2>1. Objet et acceptation</h2>
|
||||
<p>L'accès au site et son utilisation impliquent l'acceptation sans réserve des présentes conditions. Si vous ne les acceptez pas, merci de ne pas utiliser le site. Elles complètent les <a href="<?= e(fws_url('/?p/mentions-legales/')) ?>">mentions légales</a> et la <a href="<?= e(fws_url('/?p/confidentialite/')) ?>">politique de confidentialité</a>.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>2. Description du service</h2>
|
||||
<p>FWS Linux est une distribution open source basée sur Arch Linux. Le site fournit des informations sur le projet et permet de télécharger gratuitement des images disque (ISO) des différentes éditions, ainsi que des paquets développés par l'équipe.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>3. Accès et disponibilité</h2>
|
||||
<p>Le site est en principe accessible en continu, sauf interruption technique, maintenance ou cas de force majeure. L'éditeur ne garantit pas une disponibilité ininterrompue ni l'absence d'erreurs, et peut à tout moment faire évoluer, suspendre ou interrompre le site sans préavis.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>4. Licences et propriété intellectuelle</h2>
|
||||
<p>La distribution FWS Linux et les paquets publiés sont des logiciels libres, distribués sous les licences de leurs dépôts respectifs (notamment des licences de type GPL). Le code source est disponible publiquement sur GitHub et Gitea : vous pouvez l'utiliser, l'étudier, le modifier et le redistribuer selon les termes de ces licences.</p>
|
||||
<p>Les marques citées sur le site (« Linux », « Arch Linux », « Windows », etc.) appartiennent à leurs propriétaires respectifs et sont utilisées à titre descriptif uniquement.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>5. Obligations de l'utilisateur</h2>
|
||||
<p>Vous vous engagez à utiliser le site de manière loyale et licite. Il vous est notamment interdit de :</p>
|
||||
<ul>
|
||||
<li>porter atteinte aux droits de tiers ou à l'ordre public via le site ou ses services ;</li>
|
||||
<li>tenter d'intrure, de surcharger ou de perturber le fonctionnement du site ou de son hébergement ;</li>
|
||||
<li>extraire massivement ou automatiquement les contenus du site ;</li>
|
||||
<li>distribuer des copies altérées de la distribution en se prévalant de l'identité du projet.</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>6. Téléchargements et sécurité</h2>
|
||||
<p>Les images ISO et paquets sont fournis « en l'état », sans garantie d'adéquation à un usage particulier. Avant toute installation, il est recommandé de vérifier l'intégrité du fichier (sommes de contrôle et signatures publiées avec les releases).</p>
|
||||
<p>L'installation d'un système d'exploitation peut entraîner la perte définitive des données présentes sur la machine : pensez à sauvegarder vos fichiers avant toute manipulation. L'exécution d'applications Windows via Wine ou Winboat reste soumise aux licences des éditeurs de ces applications.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>7. Limitation de responsabilité</h2>
|
||||
<p>Dans toute la mesure permise par le droit suisse, l'éditeur ne peut être tenu responsable des dommages directs ou indirects — notamment perte de données, perte d'exploitation ou préjudice matériel — résultant de l'utilisation du site, des téléchargements proposés ou de l'installation de la distribution.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>8. Liens externes</h2>
|
||||
<p>Le site renvoie vers des services tiers (GitHub, Gitea, Discord, Zi-Host…). L'éditeur n'exerce aucun contrôle sur ces sites et décline toute responsabilité quant à leur contenu, leur disponibilité ou leurs pratiques en matière de données.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>9. Modification des conditions</h2>
|
||||
<p>Les présentes conditions peuvent être modifiées à tout moment. La version applicable est celle en ligne au moment de votre consultation ; sa date de mise à jour figure en bas de la présente page.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>10. Droit applicable et juridiction</h2>
|
||||
<p>Les présentes conditions sont soumises au droit suisse. Tout litige relève de la compétence exclusive des tribunaux de Lausanne, sous réserve des fors légaux impératifs.</p>
|
||||
</section>
|
||||
|
||||
<p class="legal-updated">Dernière mise à jour : 24 septembre 2026.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page Confidentialité (rendu serveur, coquille page.php).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct (/p/confidentialite/…) : on délègue au front controller. */
|
||||
require __DIR__ . '/../../page.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = 'Confidentialité | FWS Linux';
|
||||
$description = 'Politique de confidentialité de FWS Linux : aucune collecte de données par le site, journaux techniques de l\'hébergeur Zi-Host, services tiers et vos droits (LPD).';
|
||||
$extraCss[] = fws_url('/p/assets/styles/legal.css');
|
||||
?>
|
||||
<header class="legal-header">
|
||||
<h1>Politique de confidentialité</h1>
|
||||
<p>Comment vos données sont — ou ne sont pas — traitées lorsque vous utilisez ce site.</p>
|
||||
</header>
|
||||
|
||||
<div class="legal-main">
|
||||
<section>
|
||||
<h2>Responsable du traitement</h2>
|
||||
<p>Le responsable du traitement des données relatives à ce site est le projet FWS Linux. Toute question relative aux données peut nous être adressée via la <a href="<?= e(fws_url('/?p/contact/')) ?>">page de contact</a> ou à <a href="mailto:dami.scoot3@gmail.com">dami.scoot3@gmail.com</a>.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Ce que le site ne fait pas</h2>
|
||||
<p>La navigation et les téléchargements ne nécessitent ni compte, ni inscription, ni communication d'informations personnelles. En particulier, ce site :</p>
|
||||
<ul>
|
||||
<li>n'utilise <strong>aucun cookie</strong> ni traceur de mesure d'audience ;</li>
|
||||
<li>n'affiche <strong>aucune publicité</strong> ;</li>
|
||||
<li>ne crée <strong>aucun profil utilisateur</strong> ;</li>
|
||||
<li>ne demande <strong>aucune donnée personnelle</strong> pour télécharger les ISO ou les paquets.</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Journaux techniques de l'hébergeur</h2>
|
||||
<p>Comme tout site, les requêtes adressées à FWS Linux transitent par l'infrastructure de notre hébergeur <strong>Zi-Host</strong>, situé en Suisse. Dans le cadre de la sécurité et de la disponibilité du service, l'hébergeur est susceptible de traiter des journaux techniques (adresse IP, date et heure, page demandée, type de navigateur).</p>
|
||||
<p>Ces traitements sont régis par la <a href="https://zi-host.ch/legal/confidentialite" target="_blank" rel="noopener noreferrer">politique de confidentialité de Zi-Host</a>, qui décrit les finalités, les durées de conservation et les modalités d'exercice des droits.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Services tiers</h2>
|
||||
<p>Les informations de releases (ISO et paquets) sont récupérées <strong>côté serveur</strong> auprès des API de Gitea et GitHub : vos données personnelles ne sont pas transmises lors de ces échanges.</p>
|
||||
<p>Lorsque vous cliquez sur un lien externe (GitHub, Gitea, Discord, site de l'hébergeur…), vous quittez ce site. Les services concernés appliquent alors leurs propres conditions et politiques de confidentialité, que nous vous invitons à consulter :</p>
|
||||
<ul>
|
||||
<li>GitHub : <a href="https://docs.github.com/en/site-policy/privacy-policies/github-privacy-statement" target="_blank" rel="noopener noreferrer">Déclaration de confidentialité</a></li>
|
||||
<li>Discord : <a href="https://discord.com/privacy" target="_blank" rel="noopener noreferrer">Politique de confidentialité</a></li>
|
||||
<li>Zi-Host : <a href="https://zi-host.ch/legal/confidentialite" target="_blank" rel="noopener noreferrer">Protection des données</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Communications volontaires</h2>
|
||||
<p>Si vous prenez contact avec nous par email, via une issue GitHub ou sur notre serveur Discord, nous utilisons uniquement les informations que vous transmettez volontairement pour traiter votre demande. Nous ne les revendons ni ne les cédons à des tiers.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Cadre légal et vos droits</h2>
|
||||
<p>Le site est conçu pour être conforme à la loi fédérale suisse sur la protection des données (LPD, RS 235.1). Le site ne procédant à aucun traitement automatisé de données personnelles, aucun profilage ni décision automatisée n'a lieu.</p>
|
||||
<p>Conformément à la LPD (et, si vous êtes concerné, au RGPD), vous disposez notamment d'un droit d'accès, de rectification et de suppression des données vous concernant. Pour les exercer, écrivez à <a href="mailto:dami.scoot3@gmail.com">dami.scoot3@gmail.com</a>. Si vous estimez que vos droits ne sont pas respectés, vous pouvez saisir le <a href="https://www.edoeb.admin.ch/" target="_blank" rel="noopener noreferrer">Préposé fédéral à la protection des données</a>.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Modification de la présente politique</h2>
|
||||
<p>La présente politique peut être adaptée à tout moment, notamment si le site venait à intégrer de nouvelles fonctionnalités (formulaires, compte utilisateur, mesure d'audience…). La version applicable est celle en ligne, dont la date de mise à jour figure ci-dessous.</p>
|
||||
</section>
|
||||
|
||||
<p class="legal-updated">Dernière mise à jour : 24 septembre 2026.</p>
|
||||
</div>
|
||||
@@ -1,39 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Contact</title>
|
||||
<link rel="stylesheet" href="../assets/main-styles/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<main data-page-content>
|
||||
<section class="hero">
|
||||
<p class="eyebrow">Contact</p>
|
||||
<h1>Tu veux nous joindre ?</h1>
|
||||
<p class="lead">
|
||||
Cette page centralise les moyens de contact et les liens utiles pour écrire, appeler, ou retrouver le projet ailleurs.
|
||||
</p>
|
||||
<div class="hero-actions">
|
||||
<a class="button button-primary" href="mailto:contact@fwslinux.fr">Envoyer un mail</a>
|
||||
<a class="button button-secondary" href="/?p/index/" data-route="index">Retour à l'accueil</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="grid">
|
||||
<article class="card">
|
||||
<h2>Email</h2>
|
||||
<p>contact@fwslinux.fr pour les demandes générales et les retours rapides.</p>
|
||||
</article>
|
||||
<article class="card">
|
||||
<h2>Téléphone</h2>
|
||||
<p>+33 0 00 00 00 00 pour les appels ou le support direct.</p>
|
||||
</article>
|
||||
<article class="card">
|
||||
<h2>Réseaux</h2>
|
||||
<p>Le footer te donne aussi les liens vers GitHub, Instagram et LinkedIn.</p>
|
||||
</article>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page Contact (rendu serveur, contenu inchangé).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct (/p/contact/…) : on délègue au front controller. */
|
||||
require __DIR__ . '/../../page.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = 'Contact | FWS Linux';
|
||||
$description = 'Contactez l\'équipe de FWS Linux — ouvrez une issue ou une pull request sur GitHub pour signaler un bug ou contribuer au projet.';
|
||||
$extraCss[] = fws_url('/p/assets/styles/contact.css');
|
||||
?>
|
||||
<header class="contact-header">
|
||||
<h1>Contactez l'équipe de développement</h1>
|
||||
<p>Une question, un bug à signaler ou envie de contribuer ? Voici comment nous joindre.</p>
|
||||
</header>
|
||||
|
||||
<hr>
|
||||
|
||||
<main>
|
||||
<section>
|
||||
<h2>Notre seul canal officiel actuel</h2>
|
||||
<p>Le projet est en plein développement. Pour le moment, nous n'avons pas encore d'adresse email dédiée ni de réseaux sociaux.</p>
|
||||
<p>
|
||||
<strong>Suivez le projet et ouvrez des Issues / PR ici :</strong>
|
||||
</p>
|
||||
<a class="button button-primary" href="https://github.com/You-re-like-Windows-a-bitch/ISO" target="_blank" rel="noopener noreferrer">Notre GitHub</a>
|
||||
</section>
|
||||
|
||||
<hr>
|
||||
</main>
|
||||
@@ -1,40 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>DL</title>
|
||||
<link rel="stylesheet" href="../assets/main-styles/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<main data-page-content>
|
||||
<section class="hero">
|
||||
<p class="eyebrow">Route DL</p>
|
||||
<h1>Le contenu de la section DL charge ici.</h1>
|
||||
<p class="lead">
|
||||
Cette page vit dans <span>p/dl/index.html</span> et son contenu est injecté dans le
|
||||
<span>main</span> quand l'URL pointe vers <span>/?p/dl/</span>.
|
||||
</p>
|
||||
<div class="hero-actions">
|
||||
<a class="button button-primary" href="/" data-route="home">Retour à l'accueil</a>
|
||||
<a class="button button-secondary" href="/?p/dl/" data-route="dl">Recharger DL</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="grid">
|
||||
<article class="card">
|
||||
<h2>Vrai fichier</h2>
|
||||
<p>Le HTML est bien stocké dans le dossier <span>p/</span>, pas dans le fichier principal.</p>
|
||||
</article>
|
||||
<article class="card">
|
||||
<h2>Injection</h2>
|
||||
<p>Le script lit ce fichier puis injecte uniquement le bloc portant <span>data-page-content</span>.</p>
|
||||
</article>
|
||||
<article class="card">
|
||||
<h2>Extensible</h2>
|
||||
<p>Tu peux créer d'autres dossiers comme <span>p/contact/</span> ou <span>p/about/</span>.</p>
|
||||
</article>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page Téléchargements (rendu serveur).
|
||||
* Releases ISO : Gitea FWS/ISO s'il existe, sinon GitHub (cache 10 min).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct (/p/dl/…) : on délègue au front controller. */
|
||||
require __DIR__ . '/../../page.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$releases = fws_site_iso_releases();
|
||||
$items = $releases['items'];
|
||||
$mode = $releases['mode'];
|
||||
|
||||
$title = 'Téléchargements | FWS Linux';
|
||||
$description = 'Téléchargez FWS Linux — dernière version stable et archives des versions précédentes. ISO légère basée sur Arch Linux.';
|
||||
$extraCss[] = fws_url('/p/assets/styles/downloads.css');
|
||||
$extraJs[] = fws_url('/p/assets/js/note-toggle.js');
|
||||
|
||||
$latest = $items[0] ?? null;
|
||||
$previous = array_slice($items, 1, 5);
|
||||
|
||||
$latestNote = '';
|
||||
$latestTruncated = false;
|
||||
$latestNoteFull = '';
|
||||
if ($latest !== null && $mode !== 'tags') {
|
||||
$latestNoteFull = fws_markdown((string) ($latest['body'] ?? ''));
|
||||
if ($latestNoteFull === '') {
|
||||
$latestNoteFull = '<p>Release la plus récente.</p>';
|
||||
}
|
||||
$tr = fws_truncate_html($latestNoteFull, 600);
|
||||
$latestNote = $tr['html'];
|
||||
$latestTruncated = $tr['truncated'];
|
||||
}
|
||||
?>
|
||||
<section class="downloads" aria-labelledby="downloads-title">
|
||||
<header class="downloads-header">
|
||||
<h1 id="downloads-title">Téléchargements</h1>
|
||||
<div class="versions-panel">
|
||||
<div class="latest-version">
|
||||
<h2>Dernière version</h2>
|
||||
<div class="latest-row">
|
||||
<div class="latest-meta">
|
||||
<strong data-current-version><?php
|
||||
if ($latest === null) {
|
||||
echo 'Aucune release trouvée';
|
||||
} else {
|
||||
echo e(fws_site_release_label($latest));
|
||||
if ($mode === 'tags') {
|
||||
echo ' (tag)';
|
||||
}
|
||||
}
|
||||
?></strong>
|
||||
<span data-current-version-date><?php
|
||||
if ($latest !== null && $mode !== 'tags') {
|
||||
$d = fws_format_date(fws_site_release_date($latest));
|
||||
echo $d !== '' ? ' · ' . e($d) : '';
|
||||
}
|
||||
?></span>
|
||||
</div>
|
||||
<div class="latest-actions">
|
||||
<a class="button button-primary" data-latest-download href="<?php
|
||||
if ($latest !== null && $mode === 'tags') {
|
||||
echo e('https://github.com/You-re-like-Windows-a-bitch/ISO/releases/tag/' . rawurlencode((string) ($latest['name'] ?? $latest['ref'] ?? '')));
|
||||
} elseif ($latest !== null) {
|
||||
echo e(fws_site_release_download_url($latest));
|
||||
} else {
|
||||
echo e('https://github.com/You-re-like-Windows-a-bitch/ISO');
|
||||
}
|
||||
?>" target="_blank" rel="noopener noreferrer">Télécharger</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="latest-note" data-current-release-note><?php
|
||||
if ($mode === 'tags' && $latest !== null) {
|
||||
echo '<p>Aucune release publiée pour le moment, affichage des tags du dépôt.</p>';
|
||||
} elseif ($latest === null) {
|
||||
echo '<p>Le dépôt ne renvoie ni release ni tag public.</p>';
|
||||
} else {
|
||||
echo $latestNote;
|
||||
}
|
||||
?><?php if ($latestTruncated): ?><template data-note-full><?= $latestNoteFull ?></template><?php endif; ?></div>
|
||||
<button class="toggle-note" data-toggle-release-note style="<?= $latestTruncated ? 'display:inline-block' : 'display:none' ?>">Voir plus</button>
|
||||
</div>
|
||||
|
||||
<div class="versions-archive">
|
||||
<h3>Versions précédentes</h3>
|
||||
<ul class="versions-list" data-versions-list role="list"><?php
|
||||
if ($items === []) {
|
||||
echo '<li class="version-item version-item-empty"><div class="version-main"><strong>Aucune release trouvée</strong><span>Le dépôt n\'expose pas encore de release ou les releases ne sont pas accessibles.</span></div>'
|
||||
. '<div class="version-side"><a class="button button-secondary" href="https://github.com/You-re-like-Windows-a-bitch/ISO" target="_blank" rel="noreferrer">Voir le repo</a></div></li>';
|
||||
} elseif ($previous === []) {
|
||||
echo '<li class="version-item version-item-empty"><div class="version-main"><strong>Aucune release précédente</strong><span>Il n\'y a qu\'une seule release publiée pour le moment.</span></div></li>';
|
||||
} else {
|
||||
foreach ($previous as $rel) {
|
||||
$d = fws_format_date(fws_site_release_date($rel));
|
||||
$url = $mode === 'tags'
|
||||
? 'https://github.com/You-re-like-Windows-a-bitch/ISO/releases/tag/' . rawurlencode((string) ($rel['name'] ?? $rel['ref'] ?? ''))
|
||||
: fws_site_release_download_url($rel);
|
||||
echo '<li class="version-item"><div class="version-main"><strong>' . e(fws_site_release_label($rel)) . '</strong>'
|
||||
. '<span>' . ($d !== '' ? 'Publié le ' . e($d) : ($mode === 'tags' ? 'Tag GitHub' : 'Date inconnue')) . '</span></div>'
|
||||
. '<div class="version-side"><a class="button button-secondary" href="' . e($url) . '" target="_blank" rel="noreferrer">Télécharger</a></div></li>';
|
||||
}
|
||||
}
|
||||
?></ul>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</section>
|
||||
@@ -0,0 +1,43 @@
|
||||
[
|
||||
{
|
||||
"name": "BlackAngelTV",
|
||||
"role": "Owner",
|
||||
"avatar": "/p/assets/img/logo.png",
|
||||
"joined": "2026-03-17",
|
||||
"email": "dami.scoot3@gmail.com",
|
||||
"links": [
|
||||
{ "label": "GitHub", "url": "https://github.com/BlackAngelTVdev" },
|
||||
{"label": "Gitea", "url": "https://gitea.nocode-var.tech/BlackAngelTV"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "NoCode",
|
||||
"role": "Owner",
|
||||
"avatar": "/p/assets/img/logo.png",
|
||||
"joined": "2026-03-17",
|
||||
"email": null,
|
||||
"links": [
|
||||
{ "label": "GitHub", "url": "https://github.com/fkDeath" }, {"label": "Gitea", "url": "https://gitea.nocode-var.tech/nocode"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Söl",
|
||||
"role": "Graphic Designer",
|
||||
"avatar": "/p/assets/img/logo.png",
|
||||
"joined": "2026-04-26",
|
||||
"email": null,
|
||||
"links": [
|
||||
{ "label": "Portfolio (coming soon)", "url": "https://dev-sol.laxacube.ch" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Angi",
|
||||
"role": "Devlopper",
|
||||
"avatar": "/p/assets/img/logo.png",
|
||||
"joined": "2026-09-14",
|
||||
"email": "gianmarco.ruberti@gmail.com",
|
||||
"links": [
|
||||
{ "label": "GitHub", "url": "https://github.com/Gianmarco-Ruberti" }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page Équipe (rendu serveur depuis p/equipe/creators.json).
|
||||
* Remplace creators-loader.js.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct (/p/equipe/…) : on délègue au front controller. */
|
||||
require __DIR__ . '/../../page.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = "L'équipe | FWS Linux";
|
||||
$description = 'Découvrez les contributeurs de FWS Linux — l\'équipe qui développe et maintient cette distribution open-source.';
|
||||
$extraCss[] = fws_url('/p/assets/styles/equipe.css');
|
||||
$extraCss[] = fws_url('/p/assets/styles/creators.css');
|
||||
|
||||
$creators = [];
|
||||
$file = dirname(__DIR__) . '/equipe/creators.json';
|
||||
if (is_file($file)) {
|
||||
$data = json_decode((string) file_get_contents($file), true);
|
||||
if (is_array($data)) {
|
||||
$creators = fws_utf8_arr($data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<section class="equipe-hero">
|
||||
<h1>L'équipe</h1>
|
||||
<p>Les personnes qui contribuent au projet FWS Linux.</p>
|
||||
</section>
|
||||
|
||||
<section class="equipe-grid-section" aria-label="Liste des contributeurs">
|
||||
<?php if ($creators === []): ?>
|
||||
<p class="creators-error">Impossible de charger les données des créateurs.</p>
|
||||
<?php else: ?>
|
||||
<div class="creators-grid">
|
||||
<?php foreach ($creators as $creator): ?>
|
||||
<article class="creator-card">
|
||||
<?php if (!empty($creator['avatar'])): ?>
|
||||
<img class="creator-avatar" src="<?= e(fws_url((string) $creator['avatar'])) ?>" alt="<?= e((string) ($creator['name'] ?? $creator['role'] ?? '')) ?>" loading="lazy">
|
||||
<?php endif; ?>
|
||||
<div class="creator-info">
|
||||
<?php if (!empty($creator['name'])): ?>
|
||||
<h3 class="creator-name"><?= e((string) $creator['name']) ?></h3>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($creator['role'])): ?>
|
||||
<span class="creator-role"><?= e((string) $creator['role']) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($creator['joined'])): ?>
|
||||
<span class="creator-joined">A rejoint le <?= e(fws_format_date((string) $creator['joined'])) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($creator['email'])): ?>
|
||||
<a class="creator-email" href="mailto:<?= e((string) $creator['email']) ?>"><?= e((string) $creator['email']) ?></a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($creator['links'])): ?>
|
||||
<div class="creator-links">
|
||||
<?php foreach ($creator['links'] as $link): ?>
|
||||
<a class="creator-link" href="<?= e((string) ($link['url'] ?? '')) ?>" target="_blank" rel="noopener noreferrer"><?= e((string) ($link['label'] ?? '') !== '' ? (string) $link['label'] : (string) ($link['url'] ?? '')) ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
@@ -1,41 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Accueil</title>
|
||||
<link rel="stylesheet" href="../assets/main-styles/main.css" />
|
||||
</head>
|
||||
<body>
|
||||
<main data-page-content>
|
||||
<section class="hero">
|
||||
<p class="eyebrow">Navigation one-page</p>
|
||||
<h1>Le site change de contenu sans changer de page.</h1>
|
||||
<p class="lead">
|
||||
La page principale vit dans <span>p/index/index.html</span> et le script l'injecte dans le
|
||||
<span>main</span> quand l'URL pointe vers <span>/?p/index/</span>.
|
||||
</p>
|
||||
<p class="release-badge">Download FWS</p>
|
||||
<div class="hero-actions">
|
||||
<a class="button button-primary" href="/?p/dl/" data-route="dl">Aller vers DL</a>
|
||||
<a class="button button-secondary" href="/?p/index/" data-route="index">Rester sur l'accueil</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="grid">
|
||||
<article class="card">
|
||||
<h2>Header commun</h2>
|
||||
<p>Le bandeau du haut reste identique sur chaque vue.</p>
|
||||
</article>
|
||||
<article class="card">
|
||||
<h2>Footer commun</h2>
|
||||
<p>Le pied de page reste fixe, quelle que soit la section chargée.</p>
|
||||
</article>
|
||||
<article class="card">
|
||||
<h2>Injection réelle</h2>
|
||||
<p>Chaque route peut venir d'un vrai fichier <span>index.html</span> dans <span>p/</span>.</p>
|
||||
</article>
|
||||
</section>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page d'accueil (rendu serveur, markup identique à l'ancien).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct (/p/index/…) : on délègue au front controller. */
|
||||
require __DIR__ . '/../../page.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = 'Accueil | FWS Linux';
|
||||
$description = 'Découvrez FWS Linux — distribution open-source légère et rapide basée sur Arch Linux. Choisissez parmi KDE Plasma, Gnome, XFCE, Hyprland ou CLI.';
|
||||
$extraCss[] = fws_url('/p/assets/styles/main.css');
|
||||
$extraJs[] = fws_url('/p/assets/js/hero-carousel.js');
|
||||
?>
|
||||
<section class="hero hero-carousel" aria-label="Présentation de FWS Linux">
|
||||
<div class="hero-carousel-track" data-hero-track>
|
||||
<article class="hero-slide is-active" data-hero-slide style="background-image: url('<?= e(fws_url('/p/assets/img/hero/xfce.webp')) ?>');" aria-hidden="false"></article>
|
||||
<article class="hero-slide" data-hero-slide style="background-image: url('<?= e(fws_url('/p/assets/img/hero/install.webp')) ?>');" aria-hidden="true"></article>
|
||||
<article class="hero-slide" data-hero-slide style="background-image: url('<?= e(fws_url('/p/assets/img/hero/gnome.webp')) ?>');" aria-hidden="true"></article>
|
||||
</div>
|
||||
|
||||
<div class="hero-inner">
|
||||
<h1 class="hero-title">FWS Linux</h1>
|
||||
<p class="hero-subtitle">Un système léger, libre et compatible</p>
|
||||
<p class="lead">Open-source basé sur Arch Linux, FWS facilite la transition depuis Windows sans vous déposséder de vos données. Installation simplifiée, interface épurée, et compatibilité avec vos applications Windows grâce à Wine et Winboat.</p>
|
||||
<div class="hero-actions">
|
||||
<a class="button button-primary" href="<?= e(fws_url('/?p/dl/')) ?>">Télécharger</a>
|
||||
<a class="button button-secondary" href="<?= e(fws_url('/?p/contact/')) ?>">En savoir plus</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="hero-controls" aria-label="Contrôles du carrousel">
|
||||
<button class="hero-control" type="button" data-hero-prev aria-label="Image précédente">‹</button>
|
||||
<div class="hero-dots" data-hero-dots role="tablist" aria-label="Sélectionner une image"></div>
|
||||
<button class="hero-control" type="button" data-hero-next aria-label="Image suivante">›</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="features" aria-label="Fonctionnalités">
|
||||
<article class="card" tabindex="0">
|
||||
<h2>Installation simplifiée</h2>
|
||||
<p>Installateur graphique pour une configuration facile et rapide.</p>
|
||||
</article>
|
||||
<article class="card" tabindex="0">
|
||||
<h2>Léger et rapide</h2>
|
||||
<p>Conçu pour être peu gourmand en ressources : idéal pour redonner vie à d'anciens PC.</p>
|
||||
</article>
|
||||
<article class="card" tabindex="0">
|
||||
<h2>Respect de la vie privée</h2>
|
||||
<p>Pas de télémétrie intrusive ni de collecte de données : vous gardez le contrôle.</p>
|
||||
</article>
|
||||
<article class="card" tabindex="0">
|
||||
<h2>Compatibilité Windows</h2>
|
||||
<p>Exécutez vos logiciels Windows avec Wine et Winboat sans devoir rester sous Windows.</p>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<section class="env-choices" aria-labelledby="env-choices-title">
|
||||
<header class="env-choices-header">
|
||||
<h2 id="env-choices-title">Choisissez votre environnement à l'installation</h2>
|
||||
<p>FWS Linux vous laisse choisir l'interface qui correspond à votre usage. Vous pouvez démarrer en CLI minimale ou installer un bureau complet dès le début.</p>
|
||||
</header>
|
||||
|
||||
<article class="env-row is-reverse">
|
||||
<div class="env-text">
|
||||
<h3>KDE Plasma</h3>
|
||||
<p>Interface moderne, complète et hautement personnalisable. Un excellent choix si vous voulez un bureau riche avec de nombreux outils intégrés.</p>
|
||||
</div>
|
||||
<figure class="env-media">
|
||||
<img src="<?= e(fws_url('/p/assets/img/hero/KDE.webp')) ?>" alt="Capture d'écran de l'environnement KDE Plasma sur FWS Linux" loading="lazy" width="600" height="340" />
|
||||
</figure>
|
||||
</article>
|
||||
|
||||
<article class="env-row">
|
||||
<figure class="env-media">
|
||||
<img src="<?= e(fws_url('/p/assets/img/hero/gnome.webp')) ?>" alt="Capture d'écran de l'environnement GNOME sur FWS Linux" loading="lazy" width="600" height="340" />
|
||||
</figure>
|
||||
<div class="env-text">
|
||||
<h3>GNOME</h3>
|
||||
<p>Expérience épurée et orientée productivité. GNOME met l'accent sur la simplicité d'utilisation et un flux de travail propre sans surcharge visuelle.</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article class="env-row is-reverse">
|
||||
<div class="env-text">
|
||||
<h3>XFCE</h3>
|
||||
<p>Environnement léger et très stable, idéal pour les machines modestes ou pour privilégier les performances au quotidien.</p>
|
||||
</div>
|
||||
<figure class="env-media">
|
||||
<img src="<?= e(fws_url('/p/assets/img/hero/xfce.webp')) ?>" alt="Capture d'écran de l'environnement XFCE sur FWS Linux" loading="lazy" width="600" height="340" />
|
||||
</figure>
|
||||
</article>
|
||||
|
||||
<article class="env-row">
|
||||
<figure class="env-media">
|
||||
<img src="<?= e(fws_url('/p/assets/img/hero/hyprland.webp')) ?>" alt="Capture d'écran de l'environnement Hyprland sur FWS Linux" loading="lazy" width="600" height="340" />
|
||||
</figure>
|
||||
<div class="env-text">
|
||||
<h3>Hyprland</h3>
|
||||
<p>Tiling Wayland rapide et moderne, pensé pour un workflow clavier et une grande efficacité. Parfait pour les utilisateurs techniques qui aiment optimiser leur espace de travail.</p>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article class="env-row is-reverse">
|
||||
<div class="env-text">
|
||||
<h3>CLI (sans environnement)</h3>
|
||||
<p>Version minimale pour les utilisateurs avancés, les serveurs ou ceux qui veulent construire leur système à la carte. Aucun bureau graphique n'est préinstallé.</p>
|
||||
</div>
|
||||
<figure class="env-media">
|
||||
<img src="<?= e(fws_url('/p/assets/img/hero/install.webp')) ?>" alt="Capture d'écran de l'interface CLI de FWS Linux" loading="lazy" width="600" height="340" />
|
||||
</figure>
|
||||
</article>
|
||||
</section>
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page Mentions légales (rendu serveur, coquille page.php).
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct (/p/mentions-legales/…) : on délègue au front controller. */
|
||||
require __DIR__ . '/../../page.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = 'Mentions légales | FWS Linux';
|
||||
$description = 'Mentions légales du site FWS Linux : éditeur, hébergement en Suisse par Zi-Host, propriété intellectuelle et signalement de contenu.';
|
||||
$extraCss[] = fws_url('/p/assets/styles/legal.css');
|
||||
?>
|
||||
<header class="legal-header">
|
||||
<h1>Mentions légales</h1>
|
||||
<p>Informations légales relatives à l'éditeur du site, à son hébergement et à la propriété intellectuelle.</p>
|
||||
</header>
|
||||
|
||||
<div class="legal-main">
|
||||
<section>
|
||||
<h2>Éditeur du site</h2>
|
||||
<ul class="legal-sheet">
|
||||
<li><strong>Site :</strong> FWS Linux — site officiel de la distribution FWS Linux</li>
|
||||
<li><strong>Éditeur :</strong> FWS Linux, projet open source communautaire à but non lucratif</li>
|
||||
<li><strong>Responsable de la publication :</strong> BlackAngelTV</li>
|
||||
<li><strong>Contact :</strong> <a href="mailto:dami.scoot3@gmail.com">dami.scoot3@gmail.com</a> ou via la <a href="<?= e(fws_url('/?p/contact/')) ?>">page de contact</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Hébergement du site</h2>
|
||||
<p>Le présent site est hébergé sur l'infrastructure de notre partenaire :</p>
|
||||
<ul class="legal-sheet">
|
||||
<li><strong>Hébergeur :</strong> Zi-Host — <a href="https://zi-host.ch" target="_blank" rel="noopener noreferrer">zi-host.ch</a></li>
|
||||
<li><strong>Localisation :</strong> Suisse (nodes « Ziost » et « Tython »)</li>
|
||||
<li><strong>Signalement à l'hébergeur :</strong> <a href="mailto:abuse@zi-host.ch">abuse@zi-host.ch</a></li>
|
||||
</ul>
|
||||
<p>Tout signalement d'un contenu illicite doit indiquer l'URL concernée, la nature du contenu en cause ainsi que vos coordonnées.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Propriété intellectuelle</h2>
|
||||
<p>L'ensemble des éléments du site (textes, visuels, code) est la propriété du projet FWS Linux ou de ses contributeurs. Les sources du site et de la distribution sont publiées librement sur GitHub ; toute réutilisation est soumise aux licences des dépôts respectifs (licences libres).</p>
|
||||
<p>« Linux » est une marque déposée de Linus Torvalds. « Arch Linux » est une marque de ses détenteurs respectifs. « Windows » est une marque déposée de Microsoft Corporation. Ces marques sont mentionnées uniquement pour décrire la compatibilité technique du projet ; FWS Linux n'est ni affilié à, ni approuvé par ces sociétés.</p>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Signalement de contenu</h2>
|
||||
<p>Pour signaler un contenu illicite ou inapproprié publié sur ce site, écrivez à <a href="mailto:dami.scoot3@gmail.com">dami.scoot3@gmail.com</a> ou ouvrez une issue sur <a href="https://github.com/You-re-like-Windows-a-bitch/ISO" target="_blank" rel="noopener noreferrer">notre dépôt GitHub</a>. Les signalements sont traités dans les meilleurs délais.</p>
|
||||
</section>
|
||||
|
||||
<p class="legal-updated">Dernière mise à jour : 24 septembre 2026.</p>
|
||||
</div>
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page détail « /?p/paquets/N/ » (rendu serveur).
|
||||
* Le paquet N en grand : badge, tagline, description, dernière release,
|
||||
* historique, captures, liens. Pas de navigation précédent/suivant.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct : /p/paquets/detail.php n'est pas une URL publique. */
|
||||
http_response_code(404);
|
||||
exit('Page introuvable.');
|
||||
}
|
||||
|
||||
/* Le paquet N est identifié par son id en base ; repli sur la position. */
|
||||
$pkg = null;
|
||||
foreach ($packages as $i => $p) {
|
||||
if ((int) ($p['dbId'] ?? 0) === $detailId || ($p['dbId'] ?? 0) === 0 && ($i + 1) === $detailId) {
|
||||
$pkg = $p;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($pkg === null) {
|
||||
http_response_code(404);
|
||||
$title = 'Paquet introuvable | FWS Linux';
|
||||
echo '<section class="paquet-detail-page">'
|
||||
. '<p class="paquet-empty">Ce paquet n\'existe pas (il y en a ' . count($packages) . ').</p>'
|
||||
. '<a class="paquet-detail-back" href="' . e(fws_url('/?p/paquets/')) . '">← Tous les paquets</a>'
|
||||
. '</section>';
|
||||
return;
|
||||
}
|
||||
|
||||
$title = $pkg['name'] . ' | FWS Linux';
|
||||
$description = (string) ($pkg['tagline'] ?? '') !== '' ? (string) $pkg['tagline'] : (string) ($pkg['description'] ?? '');
|
||||
$extraJs[] = fws_url('/p/assets/js/packages-ui.js');
|
||||
|
||||
$latest = $pkg['latest'] ?? null;
|
||||
?>
|
||||
<section class="paquet-detail-page">
|
||||
<a class="paquet-detail-back" href="<?= e(fws_url('/?p/paquets/')) ?>">← Tous les paquets</a>
|
||||
|
||||
<div class="paquet-detail-hero">
|
||||
<span class="paquet-since" title="<?= !empty($pkg['since']) ? e('Depuis le ' . fws_format_date((string) $pkg['since'])) : '' ?>"><?= e($pkg['sinceLabel'] !== '' ? $pkg['sinceLabel'] : 'FWS') ?></span>
|
||||
<h1><?= e($pkg['name']) ?></h1>
|
||||
<?php if (!empty($pkg['tagline'])): ?><p class="paquet-tagline"><?= e($pkg['tagline']) ?></p><?php endif; ?>
|
||||
<?php if (!empty($pkg['description'])): ?><p class="paquet-description"><?= e($pkg['description']) ?></p><?php endif; ?>
|
||||
<div class="paquet-detail-latest<?php if ($latest === null || ($latest['name'] ?? '') === ''): ?> paquet-detail-latest-empty<?php endif; ?>">
|
||||
<?php if ($latest !== null && ($latest['name'] ?? '') !== ''): ?>
|
||||
<span class="paquet-detail-version"><?= e((string) $latest['name']) ?></span>
|
||||
<?php if (!empty($latest['date'])): ?>
|
||||
<span class="paquet-detail-date">Publiée le <?= e(fws_format_date((string) $latest['date'])) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
Aucune release publiée pour le moment.
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="paquet-detail-body">
|
||||
<?php if (empty($pkg['changelog'])): ?>
|
||||
<div class="paquet-changelog"><h3>Historique</h3><p class="paquet-empty">Historique en cours de rédaction.</p></div>
|
||||
<?php else: ?>
|
||||
<div class="paquet-changelog"><h3>Historique</h3>
|
||||
<ol class="paquet-timeline">
|
||||
<?php foreach ($pkg['changelog'] as $entry): ?>
|
||||
<li class="paquet-timeline-item">
|
||||
<strong class="paquet-timeline-version"><?= e((string) ($entry['version'] ?? '—')) ?></strong>
|
||||
<time class="paquet-timeline-date"<?= !empty($entry['date']) ? ' datetime="' . e((string) $entry['date']) . '"' : '' ?>><?= e(fws_format_date(isset($entry['date']) ? (string) $entry['date'] : null)) ?></time>
|
||||
<?php if (!empty($entry['notes'])): ?>
|
||||
<span class="paquet-timeline-notes"><?= e((string) $entry['notes']) ?></span>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (empty($pkg['screens'])): ?>
|
||||
<div class="paquet-screens"><h3>Captures d'écran</h3><p class="paquet-empty">Captures d'écran à venir.</p></div>
|
||||
<?php else: ?>
|
||||
<div class="paquet-screens"><h3>Captures d'écran</h3>
|
||||
<div class="paquet-screens-grid">
|
||||
<?php foreach ($pkg['screens'] as $screen): ?>
|
||||
<figure>
|
||||
<img src="<?= e(fws_url((string) ($screen['src'] ?? ''))) ?>" alt="<?= e((string) ($screen['alt'] ?? $pkg['name'])) ?>" loading="lazy" data-zoom<?php if (!empty($screen['caption'])): ?> data-caption="<?= e((string) $screen['caption']) ?>"<?php endif; ?>>
|
||||
<?php if (!empty($screen['caption'])): ?>
|
||||
<figcaption><?= e((string) $screen['caption']) ?> <span class="paquet-zoom-hint">— cliquez pour agrandir</span></figcaption>
|
||||
<?php else: ?>
|
||||
<figcaption><span class="paquet-zoom-hint">Cliquez pour agrandir</span></figcaption>
|
||||
<?php endif; ?>
|
||||
</figure>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="paquet-links">
|
||||
<h3>Liens utiles</h3>
|
||||
<?php if (empty($pkg['links'])): ?>
|
||||
<p class="paquet-empty">Aucun lien pour le moment.</p>
|
||||
<?php else: ?>
|
||||
<?php foreach ($pkg['links'] as $link): ?>
|
||||
<?php $url = (string) ($link['url'] ?? ''); $external = (bool) preg_match('/^https?:\/\//i', $url); ?>
|
||||
<a class="button button-secondary" href="<?= e($url) ?>"<?= $external ? ' target="_blank" rel="noopener noreferrer"' : '' ?>><?= e((string) ($link['label'] ?? '') !== '' ? (string) $link['label'] : $url) ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — page Paquets (liste) : rendu serveur depuis la base SQLite
|
||||
* (avec releases Gitea fusionnées). Remplace packages.js.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
if (!defined('FWS_PAGE_SHELL')) {
|
||||
/* Accès direct (/p/paquets/…) : on délègue au front controller. */
|
||||
require __DIR__ . '/../../page.php';
|
||||
exit;
|
||||
}
|
||||
|
||||
$title = 'Paquets | FWS Linux';
|
||||
$description = 'Les outils développés pour FWS Linux — historique de chaque paquet, captures d\'écran et liens utiles.';
|
||||
$extraJs[] = fws_url('/p/assets/js/packages-ui.js');
|
||||
|
||||
function fws_packages_empty(string $message): string
|
||||
{
|
||||
return '<p class="paquet-empty">' . e($message) . '</p>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Historique du paquet. En liste ($limited) : seules les 3 dernières
|
||||
* versions sont visibles, un bouton « Voir plus » affiche les autres.
|
||||
*/
|
||||
function fws_packages_changelog(array $pkg, bool $limited = false): string
|
||||
{
|
||||
$html = '<div class="paquet-changelog"><h3>Historique</h3>';
|
||||
if (empty($pkg['changelog'])) {
|
||||
$html .= fws_packages_empty('Historique en cours de rédaction.') . '</div>';
|
||||
return $html;
|
||||
}
|
||||
$entries = array_values($pkg['changelog']);
|
||||
$total = count($entries);
|
||||
$extraCount = 0;
|
||||
if ($limited && $total > 3) {
|
||||
$extraCount = $total - 3;
|
||||
}
|
||||
$html .= '<ol class="paquet-timeline"';
|
||||
if ($extraCount > 0) {
|
||||
$html .= ' data-expandable';
|
||||
}
|
||||
$html .= '>';
|
||||
foreach ($entries as $idx => $entry) {
|
||||
$html .= '<li class="paquet-timeline-item' . ($idx >= 3 ? ' paquet-timeline-extra' : '') . '">'
|
||||
. '<strong class="paquet-timeline-version">' . e((string) ($entry['version'] ?? '—')) . '</strong>'
|
||||
. '<time class="paquet-timeline-date"' . (empty($entry['date']) ? '' : ' datetime="' . e((string) $entry['date']) . '"') . '>'
|
||||
. e(fws_format_date(isset($entry['date']) ? (string) $entry['date'] : null)) . '</time>'
|
||||
. (!empty($entry['notes']) ? '<span class="paquet-timeline-notes">' . e((string) $entry['notes']) . '</span>' : '')
|
||||
. '</li>';
|
||||
}
|
||||
$html .= '</ol>';
|
||||
if ($extraCount > 0) {
|
||||
$html .= '<button type="button" class="paquet-more" data-toggle-timeline data-label="Voir plus (' . $extraCount . ')">Voir plus (' . $extraCount . ')</button>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
/* Les captures d'écran ne s'affichent que sur la page détail
|
||||
(« Voir en grand ») : la liste reste compacte. */
|
||||
|
||||
function fws_packages_links(array $pkg): string
|
||||
{
|
||||
$html = '<div class="paquet-links"><h3>Liens utiles</h3>';
|
||||
if (empty($pkg['links'])) {
|
||||
$html .= fws_packages_empty('Aucun lien pour le moment.') . '</div>';
|
||||
return $html;
|
||||
}
|
||||
foreach ($pkg['links'] as $link) {
|
||||
$url = (string) ($link['url'] ?? '');
|
||||
$external = (bool) preg_match('/^https?:\/\//i', $url);
|
||||
$html .= '<a class="button button-secondary" href="' . e($url) . '"'
|
||||
. ($external ? ' target="_blank" rel="noopener noreferrer"' : '') . '>'
|
||||
. e((string) ($link['label'] ?? '') !== '' ? (string) $link['label'] : $url) . '</a>';
|
||||
}
|
||||
$html .= '</div>';
|
||||
return $html;
|
||||
}
|
||||
|
||||
function fws_packages_card(array $pkg, int $position): string
|
||||
{
|
||||
$latest = $pkg['latest'] ?? null;
|
||||
$latestText = ($latest !== null && ($latest['name'] ?? '') !== '')
|
||||
? 'Dernière release : ' . $latest['name'] . (!empty($latest['date']) ? ' — ' . fws_format_date((string) $latest['date']) : '')
|
||||
: 'Aucune release publiée pour le moment.';
|
||||
|
||||
/* En liste : pas d'images (elles ne s'affichent que sur la page
|
||||
« Voir en grand »), et seules les 3 dernières versions. */
|
||||
$html = '<article class="paquet-card" id="paquet-' . e((string) $pkg['id']) . '">'
|
||||
. '<header class="paquet-head"><div class="paquet-title-row">'
|
||||
. '<h2>' . e($pkg['name']) . '</h2>'
|
||||
. '<span class="paquet-since" title="' . (!empty($pkg['since']) ? e('Depuis le ' . fws_format_date((string) $pkg['since'])) : '') . '">'
|
||||
. e($pkg['sinceLabel'] !== '' ? $pkg['sinceLabel'] : 'FWS') . '</span>'
|
||||
. '<a class="paquet-detail-link" href="' . e(fws_url('/?p/paquets/' . $position . '/')) . '">Voir en grand</a>'
|
||||
. '</div>'
|
||||
. (!empty($pkg['tagline']) ? '<p class="paquet-tagline">' . e($pkg['tagline']) . '</p>' : '')
|
||||
. '<p class="paquet-latest">' . e($latestText) . '</p>'
|
||||
. (!empty($pkg['description']) ? '<p class="paquet-description">' . e($pkg['description']) . '</p>' : '')
|
||||
. '</header>'
|
||||
. '<div class="paquet-body">' . fws_packages_changelog($pkg, true) . fws_packages_links($pkg) . '</div>'
|
||||
. '</article>';
|
||||
return $html;
|
||||
}
|
||||
?>
|
||||
<section class="paquets-hero">
|
||||
<h1>Paquets</h1>
|
||||
<p>Tous les outils développés pour FWS Linux, leur historique, leurs captures d'écran et les liens utiles.</p>
|
||||
</section>
|
||||
|
||||
<section class="paquets-list" aria-label="Liste des paquets FWS">
|
||||
<?php if ($packages === []): ?>
|
||||
<?= fws_packages_empty('Aucun paquet pour le moment. Revenez bientôt !') ?>
|
||||
<?php else: ?>
|
||||
<?php foreach ($packages as $i => $pkg): ?>
|
||||
<?= fws_packages_card($pkg, max($i + 1, (int) ($pkg['dbId'] ?? 0))) . "\n" ?>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</section>
|
||||
@@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"id": "fws-pacmanage",
|
||||
"name": "PacManage",
|
||||
"tagline": "Gestionnaire de paquets pour FWS",
|
||||
"description": "Gestionnaire de paquets graphique pour FWS : recherche unifiée multi-fournisseurs (Pacman, Flatpak…), système de plugins, mises à jour agrégées et intégration au bureau.",
|
||||
"since": "2026-08-29",
|
||||
"sinceLabel": "V1.0.0",
|
||||
"latest": { "name": "V1.2.1", "date": "2026-08-29" },
|
||||
"links": [
|
||||
{ "label": "Gitea", "url": "https://gitea.nocode-var.tech/FWS/FWS-PacManage" },
|
||||
{ "label": "Releases", "url": "https://gitea.nocode-var.tech/FWS/FWS-PacManage/releases" }
|
||||
],
|
||||
"screens": [],
|
||||
"changelog": [
|
||||
{ "version": "V1.2.1", "date": "2026-08-29", "notes": "" },
|
||||
{ "version": "V1.0.0", "date": "2026-08-29", "notes": "Version initiale : recherche unifiée Pacman + Flatpak, système de plugins, mises à jour agrégées et intégration au bureau." }
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "fws-deskmanger",
|
||||
"name": "DeskManger",
|
||||
"tagline": "Gestionnaire de bureau pour FWS",
|
||||
"description": "Le gestionnaire de bureau de FWS, actuellement en cours de développement.",
|
||||
"since": null,
|
||||
"sinceLabel": "En développement",
|
||||
"latest": null,
|
||||
"links": [
|
||||
{ "label": "Gitea", "url": "https://gitea.nocode-var.tech/FWS/FWS-DeskManger" },
|
||||
{ "label": "Releases", "url": "https://gitea.nocode-var.tech/FWS/FWS-DeskManger/releases" }
|
||||
],
|
||||
"screens": [],
|
||||
"changelog": []
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,303 @@
|
||||
<?php
|
||||
/**
|
||||
* FWS Linux — point d'entrée unique du site (rendu 100 % serveur).
|
||||
*
|
||||
* Les URLs restent identiques : /?p/index/, /?p/dl/, /?p/paquets/,
|
||||
* /?p/paquets/1/… (les deux formes « ?p=route » et « ?p/route » marchent).
|
||||
* Chaque page inclut son corps depuis p/<route>/index.php et la coquille
|
||||
* (header/nav/footer) est écrite une seule fois ici.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require __DIR__ . '/inc/site.php';
|
||||
|
||||
/* ───────────────────────── route ───────────────────────── */
|
||||
|
||||
function fws_site_current_route(): string
|
||||
{
|
||||
$raw = '';
|
||||
$qs = (string) ($_SERVER['QUERY_STRING'] ?? '');
|
||||
if ($qs !== '') {
|
||||
if (str_starts_with($qs, 'p=')) {
|
||||
$raw = substr($qs, 2);
|
||||
} elseif (str_starts_with($qs, 'p/')) {
|
||||
$raw = substr($qs, 2);
|
||||
}
|
||||
}
|
||||
if ($raw === '' && isset($_GET['p'])) {
|
||||
$raw = (string) $_GET['p'];
|
||||
}
|
||||
if ($raw === '') {
|
||||
/* Forme chemin : /p/dl/ (directement sous la base URL). En
|
||||
sous-dossier (WAMP), REQUEST_URI commence par /FWS-Website/ : on
|
||||
retire la base pour retrouver le début de la route. */
|
||||
$path = trim((string) (parse_url((string) ($_SERVER['REQUEST_URI'] ?? '/'), PHP_URL_PATH) ?: '/'), '/');
|
||||
if ($path !== '') {
|
||||
$base = ltrim(fws_base_url() . '/', '/');
|
||||
if ($base !== '' && str_starts_with($path, $base)) {
|
||||
$path = substr($path, strlen($base));
|
||||
$path = trim(preg_replace('/^\\/+|\\/+$/', '', $path) ?? '');
|
||||
}
|
||||
}
|
||||
if ($path !== '' && !str_contains($path, '.') && str_starts_with($path, 'p/')) {
|
||||
$raw = substr($path, 2);
|
||||
}
|
||||
}
|
||||
|
||||
$raw = strtolower(trim($raw));
|
||||
$raw = trim(preg_replace('/^\/+|\/+$/', '', $raw) ?? '');
|
||||
if ($raw === '' || $raw === 'home' || $raw === 'accueil' || $raw === 'index') {
|
||||
return 'index';
|
||||
}
|
||||
return $raw;
|
||||
}
|
||||
|
||||
$route = fws_site_current_route();
|
||||
|
||||
/* Résolution du corps de page : index, dl, paquets, paquets/N, equipe, contact. */
|
||||
$pageFile = null;
|
||||
$detailId = 0;
|
||||
if (preg_match('/^paquets\/(\d+)$/', $route, $m)) {
|
||||
$detailId = max(1, (int) $m[1]);
|
||||
$route = 'paquets/_detail';
|
||||
$pageFile = __DIR__ . '/p/paquets/detail.php';
|
||||
} else {
|
||||
$known = ['index', 'dl', 'paquets', 'equipe', 'contact', 'mentions-legales', 'conditions', 'confidentialite'];
|
||||
if (in_array($route, $known, true)) {
|
||||
$pageFile = __DIR__ . '/p/' . $route . '/index.php';
|
||||
}
|
||||
}
|
||||
|
||||
$is404 = $pageFile === null || !is_file($pageFile);
|
||||
|
||||
/* Erreurs Apache « douces » : les 403/404 déroutés ici via ErrorDocument
|
||||
* (voir .htaccess) rendent la page 404 du site — jamais de page Apache
|
||||
* brute, jamais de détail technique. */
|
||||
if (in_array((int) ($_GET['__e'] ?? 0), [403, 404], true)) {
|
||||
$pageFile = null;
|
||||
$is404 = true;
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Cache-Control: no-store');
|
||||
/* Chemins API : JSON pour curl/scripts, page visuelle pour un navigateur
|
||||
* (négociation via Accept, comme inc/errors.php). */
|
||||
$reqPath = (string) (parse_url((string) ($_SERVER['REQUEST_URI'] ?? '/'), PHP_URL_PATH) ?: '/');
|
||||
if (str_starts_with($reqPath, '/api') && fws_error_wants_json()) {
|
||||
http_response_code(404);
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
header('X-Content-Type-Options: nosniff');
|
||||
exit(json_encode(['ok' => false, 'error' => 'Ressource introuvable.'], JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
|
||||
/* Paquets : une seule lecture DB + cache Gitea pour toute la page
|
||||
(le corps ET la nav déroulante les consomment). */
|
||||
$packages = fws_site_packages();
|
||||
|
||||
/* ───────────────────────── corps de page ───────────────────────── */
|
||||
/* Le corps est rendu d'abord : il peut définir $title, $description,
|
||||
$canonical, $extraCss[] et $extraJs[] (données issues de la DB / API). */
|
||||
|
||||
/* NB : pas de null pour title/description — isset(null) est false et les
|
||||
gardes des pages incluses (« isset($title, …) ») échoueraient. */
|
||||
$title = '';
|
||||
$description = '';
|
||||
$canonical = null;
|
||||
$extraCss = [];
|
||||
$extraJs = [];
|
||||
|
||||
define('FWS_PAGE_SHELL', 1); /* les corps inclus peuvent vérifier qu'ils
|
||||
ne sont pas exécutés en accès direct */
|
||||
|
||||
ob_start();
|
||||
if ($is404) {
|
||||
http_response_code(404);
|
||||
include __DIR__ . '/p/404.php';
|
||||
} else {
|
||||
include $pageFile;
|
||||
}
|
||||
$body = ob_get_clean();
|
||||
|
||||
if ($title === null) {
|
||||
$labels = [
|
||||
'index' => 'Accueil', 'dl' => 'Téléchargements', 'paquets' => 'Paquets',
|
||||
'paquets/_detail' => 'Paquet', 'equipe' => "L'équipe", 'contact' => 'Contact',
|
||||
'mentions-legales' => 'Mentions légales', 'conditions' => "Conditions d'utilisation",
|
||||
'confidentialite' => 'Confidentialité',
|
||||
];
|
||||
$label = $labels[$route] ?? 'FWS Linux';
|
||||
$title = $label . ' | FWS Linux';
|
||||
}
|
||||
if ($description === null) {
|
||||
$description = 'FWS Linux — distribution open-source basée sur Arch Linux. Installation simplifiée, léger, respectueux de la vie privée, compatible Windows grâce à Wine et Winboat.';
|
||||
}
|
||||
if ($canonical === null) {
|
||||
$canonRoute = $route === 'paquets/_detail' ? 'paquets/' . $detailId : $route;
|
||||
/* Portabilité : hôte courant + base URL (sous-dossier WAMP inclus),
|
||||
au lieu du domaine de production codé en dur. */
|
||||
$fwsScheme = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|
||||
|| (($_SERVER['HTTP_X_FORWARDED_PROTO'] ?? '') === 'https') ? 'https' : 'http';
|
||||
$fwsHost = trim((string) ($_SERVER['HTTP_HOST'] ?? '')) !== ''
|
||||
? (string) $_SERVER['HTTP_HOST'] : 'fwslinux.fr';
|
||||
$canonical = $fwsScheme . '://' . $fwsHost . fws_url('/?p/' . ($canonRoute === 'index' ? 'index' : $canonRoute) . '/');
|
||||
}
|
||||
|
||||
function fws_site_active(string $route, string $prefix): string
|
||||
{
|
||||
return $route === $prefix || str_starts_with($route, $prefix . '/')
|
||||
? ' aria-current="page"' : '';
|
||||
}
|
||||
?><!doctype html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title><?= e($title) ?></title>
|
||||
<meta name="description" content="<?= e($description) ?>" />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<link rel="canonical" href="<?= e($canonical) ?>" />
|
||||
|
||||
<!-- Open Graph -->
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:title" content="<?= e($title) ?>" />
|
||||
<meta property="og:description" content="<?= e($description) ?>" />
|
||||
<meta property="og:image" content="<?= e(fws_url('/p/assets/img/logo.png')) ?>" />
|
||||
<meta property="og:locale" content="fr_FR" />
|
||||
|
||||
<link rel="stylesheet" href="<?= e(fws_asset('/p/assets/styles/styles.css')) ?>" />
|
||||
<link rel="stylesheet" href="<?= e(fws_asset('/p/assets/styles/paquets.css')) ?>" />
|
||||
<?php foreach ($extraCss as $css): ?>
|
||||
<link rel="stylesheet" href="<?= e(fws_asset($css)) ?>" />
|
||||
<?php endforeach; ?>
|
||||
<link rel="icon" type="image/png" href="<?= e(fws_url('/p/assets/img/logo.png')) ?>" />
|
||||
|
||||
<!-- Réseau : releases des paquets (Gitea) et de l'ISO (GitHub) -->
|
||||
<link rel="preconnect" href="https://gitea.nocode-var.tech" crossorigin />
|
||||
<link rel="dns-prefetch" href="https://gitea.nocode-var.tech" />
|
||||
<link rel="preconnect" href="https://api.github.com" crossorigin />
|
||||
<link rel="dns-prefetch" href="https://api.github.com" />
|
||||
<link rel="dns-prefetch" href="https://github.com" />
|
||||
<link rel="dns-prefetch" href="https://objects.githubusercontent.com" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a class="skip-link" href="#app-main">Aller au contenu principal</a>
|
||||
|
||||
<div class="page-shell">
|
||||
<header class="site-header" role="banner">
|
||||
<div class="header-brand-block">
|
||||
<a class="brand" href="<?= e(fws_url('/?p/index/')) ?>" aria-label="FWS Linux — Retour à l'accueil">
|
||||
<img class="brand-mark" src="<?= e(fws_url('/p/assets/img/logo.png')) ?>" alt="" width="44" height="44" />
|
||||
<span class="brand-text">
|
||||
<strong>FWS Linux</strong>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<button type="button" class="nav-burger" aria-expanded="false" aria-controls="app-nav" aria-label="Ouvrir le menu de navigation">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</button>
|
||||
|
||||
<nav class="site-nav" id="app-nav" aria-label="Navigation principale">
|
||||
<a href="<?= e(fws_url('/?p/index/')) ?>"<?= fws_site_active($route, 'index') ?>>Accueil</a>
|
||||
<a href="<?= e(fws_url('/?p/dl/')) ?>"<?= fws_site_active($route, 'dl') ?>>Téléchargements</a>
|
||||
|
||||
<div class="nav-dropdown" data-nav-dropdown>
|
||||
<button type="button" class="nav-dropdown-toggle" aria-expanded="false" aria-haspopup="true" aria-controls="nav-paquets-panel"<?= fws_site_active($route, 'paquets') ?>>
|
||||
Paquets
|
||||
<span class="nav-dropdown-caret" aria-hidden="true"></span>
|
||||
</button>
|
||||
<div class="nav-dropdown-panel" id="nav-paquets-panel" role="group" aria-label="Liste des paquets">
|
||||
<div class="nav-dropdown-head">
|
||||
<strong>Paquets FWS</strong>
|
||||
<small><?= count($packages) ?> disponible<?= count($packages) > 1 ? 's' : '' ?></small>
|
||||
</div>
|
||||
<div class="nav-dropdown-panel-inner">
|
||||
<?php if ($packages === []): ?>
|
||||
<p class="nav-dropdown-error">Aucun paquet pour le moment.</p>
|
||||
<?php else: ?>
|
||||
<?php foreach ($packages as $i => $pkg): ?>
|
||||
<?php $navThumb = (string) ($pkg['screens'][0]['src'] ?? ''); ?>
|
||||
<a class="nav-dropdown-item<?= $navThumb !== '' ? ' has-thumb' : '' ?>" href="<?= e(fws_url('/?p/paquets/' . max($i + 1, (int) $pkg['dbId']) . '/')) ?>">
|
||||
<?php if ($navThumb !== ''): ?>
|
||||
<img class="nav-dropdown-thumb" src="<?= e(fws_url($navThumb)) ?>" alt="" loading="lazy" width="30" height="30">
|
||||
<?php endif; ?>
|
||||
<span class="nav-dropdown-text">
|
||||
<strong><?= e($pkg['name']) ?><?php if (!empty($pkg['latest']['name'])): ?><span class="nav-dropdown-version"><?= e($pkg['latest']['name']) ?></span><?php endif; ?></strong>
|
||||
<small><?= e($pkg['tagline'] ?? '') ?></small>
|
||||
</span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<a class="nav-dropdown-all" href="<?= e(fws_url('/?p/paquets/')) ?>">Voir tous les paquets →</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main id="app-main" class="site-main">
|
||||
<?= $body ?>
|
||||
</main>
|
||||
|
||||
<footer class="site-footer" role="contentinfo">
|
||||
<div class="footer-content">
|
||||
<div class="footer-brand-row">
|
||||
<div class="footer-brand-block">
|
||||
<img class="footer-brand-mark" src="<?= e(fws_url('/p/assets/img/logo.png')) ?>" alt="" width="40" height="40" />
|
||||
<div>
|
||||
<strong>FWS Linux</strong>
|
||||
<p>Un système léger, libre et compatible</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="footer-links-grid">
|
||||
<nav aria-label="Navigation secondaire">
|
||||
<h2>Navigation</h2>
|
||||
<a href="<?= e(fws_url('/?p/index/')) ?>">Accueil</a>
|
||||
<a href="<?= e(fws_url('/?p/dl/')) ?>">Téléchargements</a>
|
||||
<a href="<?= e(fws_url('/?p/paquets/')) ?>">Paquets</a>
|
||||
<a href="<?= e(fws_url('/?p/equipe/')) ?>">Équipe</a>
|
||||
</nav>
|
||||
|
||||
<section>
|
||||
<h2>Contact</h2>
|
||||
<a href="<?= e(fws_url('/?p/contact/')) ?>">Page de contact</a>
|
||||
<a href="<?= e(fws_url('/?p/equipe/')) ?>">Équipe</a>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h2>Réseaux</h2>
|
||||
<a href="https://gitea.nocode-var.tech/FWS" target="_blank" rel="noopener noreferrer">Gitea</a>
|
||||
<a href="https://github.com/You-re-like-Windows-a-bitch/ISO" target="_blank" rel="noopener noreferrer">GitHub</a>
|
||||
<a href="https://discord.gg/6mnpPr2jq4" target="_blank" rel="noopener noreferrer">Discord</a>
|
||||
|
||||
</section>
|
||||
|
||||
<section aria-label="Informations légales">
|
||||
<h2>Légal</h2>
|
||||
<a href="<?= e(fws_url('/?p/mentions-legales/')) ?>">Mentions légales</a>
|
||||
<a href="<?= e(fws_url('/?p/conditions/')) ?>">Conditions d'utilisation</a>
|
||||
<a href="<?= e(fws_url('/?p/confidentialite/')) ?>">Confidentialité</a>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="footer-bottom">
|
||||
<p>© <?= date('Y') ?> FWS Linux</p>
|
||||
<p class="footer-hosting">Powered by <a href="https://zi-host.ch" target="_blank" rel="noopener noreferrer">ZI-HOST.ch</a></p>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script src="<?= e(fws_asset('/p/assets/main-nav/nav.js')) ?>"></script>
|
||||
<?php foreach ($extraJs as $js): ?>
|
||||
<script src="<?= e(fws_asset($js)) ?>"></script>
|
||||
<?php endforeach; ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* Routeur du serveur de développement `php -S` (voir tools/serve.sh).
|
||||
*
|
||||
* En production, Apache s'appuie sur .htaccess : page.php est le point
|
||||
* d'entrée unique et ErrorDocument renvoie les 404 vers la page du site.
|
||||
* Le serveur intégré de PHP ignore ces fichiers : ce routeur reproduit le
|
||||
* même comportement pour que les URLs propres, les assets, l'API, l'admin
|
||||
* et la page 404 soient identiques en local et sur le serveur.
|
||||
*
|
||||
* Usage : php -S 127.0.0.1:8080 tools/router.php
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
$root = dirname(__DIR__);
|
||||
$uri = (string) (parse_url((string) ($_SERVER['REQUEST_URI'] ?? '/'), PHP_URL_PATH) ?: '/');
|
||||
$path = $root . str_replace('/', DIRECTORY_SEPARATOR, rawurldecode($uri));
|
||||
|
||||
/* Fichier réel (asset statique, point d'entrée API/admin…) : on laisse le
|
||||
* serveur intégré le traiter normalement. */
|
||||
if ($uri !== '/' && is_file($path)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Répertoire réel avec un index.php. Les routes du site (/p/…) passent par le
|
||||
* front controller — plus fiable que leurs shims en accès direct. Les autres
|
||||
* (ex. /admin/bugs/) sont servis normalement, comme le ferait Apache. */
|
||||
if (is_dir($path) && is_file(rtrim($path, '/\\') . '/index.php')) {
|
||||
if (preg_match('~^/p/~', rawurldecode($uri))) {
|
||||
$_SERVER['SCRIPT_NAME'] = rtrim(rawurldecode($uri), '/') . '/index.php';
|
||||
$_SERVER['SCRIPT_FILENAME'] = $root . '/index.php';
|
||||
require $root . '/index.php';
|
||||
return;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Tout le reste : front controller, avec __e=404 pour imiter l'ErrorDocument
|
||||
* d'Apache — le site affiche alors sa propre page 404. SCRIPT_NAME est fixé
|
||||
* au point d'entrée pour que fws_base_url() résolve les assets depuis la
|
||||
* racine (le serveur intégré y mettrait sinon le chemin du routeur). */
|
||||
$_GET['__e'] = 404;
|
||||
$_SERVER['SCRIPT_NAME'] = '/index.php';
|
||||
$_SERVER['SCRIPT_FILENAME'] = $root . '/index.php';
|
||||
require $root . '/index.php';
|
||||
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
rem Serveur de développement local sous Windows (aucun Apache/WAMP requis).
|
||||
rem Usage : tools\serve.cmd (ou set PORT=8080 && tools\serve.cmd)
|
||||
cd /d "%~dp0.."
|
||||
if "%HOST%"=="" set HOST=127.0.0.1
|
||||
if "%PORT%"=="" set PORT=8080
|
||||
echo FWS Linux - serveur local : http://%HOST%:%PORT%
|
||||
php -S %HOST%:%PORT% tools\router.php
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# Serveur de développement local (aucun Apache/WAMP requis).
|
||||
# Usage : bash tools/serve.sh (ou HOST=0.0.0.0 PORT=8080 bash tools/serve.sh)
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
HOST="${HOST:-127.0.0.1}"
|
||||
PORT="${PORT:-8080}"
|
||||
|
||||
echo "FWS Linux — serveur local : http://${HOST}:${PORT}"
|
||||
exec php -S "${HOST}:${PORT}" tools/router.php
|
||||
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env node
|
||||
/* Tiny TCP forwarder: listens on 127.0.0.1:8765 and pipes to 127.0.0.1:8555.
|
||||
Exists only because the preview browser cannot attach to Docker's
|
||||
published port process. Ctrl+C to stop. */
|
||||
const net = require("net");
|
||||
|
||||
const LISTEN = 8765;
|
||||
const TARGET_PORT = 8555;
|
||||
const TARGET_HOST = "127.0.0.1";
|
||||
|
||||
const server = net.createServer((client) => {
|
||||
const upstream = net.connect(TARGET_PORT, TARGET_HOST);
|
||||
client.pipe(upstream);
|
||||
upstream.pipe(client);
|
||||
const cleanup = () => {
|
||||
client.destroy();
|
||||
upstream.destroy();
|
||||
};
|
||||
client.on("error", cleanup);
|
||||
upstream.on("error", cleanup);
|
||||
});
|
||||
|
||||
server.listen(LISTEN, "127.0.0.1", () => {
|
||||
console.log(`forwarding 127.0.0.1:${LISTEN} -> ${TARGET_HOST}:${TARGET_PORT}`);
|
||||
});
|
||||
Reference in new issue
Block a user