From dfa25324e150faedf4fad7d3a08a681d798d4093 Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Thu, 28 Aug 2025 00:18:56 +0200 Subject: [PATCH 1/5] ci(template-sync): use self-hosted runner label instead of linux --- .gitea/workflows/template-sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/template-sync.yml b/.gitea/workflows/template-sync.yml index e6710df..ceaae53 100644 --- a/.gitea/workflows/template-sync.yml +++ b/.gitea/workflows/template-sync.yml @@ -7,7 +7,7 @@ on: jobs: check-and-sync: - runs-on: linux + runs-on: self-hosted steps: - name: Lire TEMPLATE_VERSION et .4nk-sync.yml # Doit charger ref courant, source_repo et périmètre paths From fb1968f6102b841ee06e8e0d996176f9ca686656 Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Thu, 28 Aug 2025 00:22:20 +0200 Subject: [PATCH 2/5] ci(runners): use runs-on [self-hosted, linux] across workflows; docs: add runner labels setup --- .gitea/workflows/ci.yml | 30 +++++++++++++++--------------- .gitea/workflows/template-sync.yml | 2 +- docs/project/GITEA_SETUP.md | 6 ++++++ 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 224714e..bd5f628 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: # Job de vérification du code code-quality: name: Code Quality - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] steps: - name: Checkout code @@ -64,7 +64,7 @@ jobs: # Job de tests unitaires unit-tests: name: Unit Tests - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] steps: - name: Checkout code @@ -100,7 +100,7 @@ jobs: # Job de tests d'intégration integration-tests: name: Integration Tests - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] services: docker: @@ -147,7 +147,7 @@ jobs: # Job de tests de sécurité security-tests: name: Security Tests - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] steps: - name: Checkout code @@ -184,7 +184,7 @@ jobs: # Job de build et test Docker docker-build: name: Docker Build & Test - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] services: docker: @@ -227,7 +227,7 @@ jobs: # Job de tests de documentation documentation-tests: name: Documentation Tests - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] steps: - name: Checkout code @@ -242,7 +242,7 @@ jobs: markdownlint: name: Markdown Lint - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] steps: - name: Checkout code uses: actions/checkout@v3 @@ -272,7 +272,7 @@ jobs: bash-required: name: Bash Requirement - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] steps: - name: Checkout code uses: actions/checkout@v3 @@ -289,7 +289,7 @@ jobs: agents-smoke: name: Agents Smoke (no AI) - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] steps: - name: Checkout code uses: actions/checkout@v3 @@ -309,7 +309,7 @@ jobs: openia-agents: name: Agents with OpenIA - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] if: ${{ secrets.OPENAI_API_KEY != '' }} env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} @@ -333,7 +333,7 @@ jobs: deployment-checks: name: Deployment Checks - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] steps: - name: Checkout code uses: actions/checkout@v3 @@ -350,7 +350,7 @@ jobs: security-audit: name: Security Audit - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] steps: - name: Checkout code uses: actions/checkout@v3 @@ -368,7 +368,7 @@ jobs: # Job de release guard (cohérence release) release-guard: name: Release Guard - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] needs: [code-quality, unit-tests, documentation-tests, markdownlint, security-audit, deployment-checks, bash-required] steps: - name: Checkout code @@ -430,7 +430,7 @@ jobs: # Job de tests de performance performance-tests: name: Performance Tests - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] steps: - name: Checkout code @@ -455,7 +455,7 @@ jobs: # Job de notification notify: name: Notify - runs-on: ubuntu-latest + runs-on: [self-hosted, linux] needs: [code-quality, unit-tests, integration-tests, security-tests, docker-build, documentation-tests] if: always() diff --git a/.gitea/workflows/template-sync.yml b/.gitea/workflows/template-sync.yml index ceaae53..8bdfd05 100644 --- a/.gitea/workflows/template-sync.yml +++ b/.gitea/workflows/template-sync.yml @@ -7,7 +7,7 @@ on: jobs: check-and-sync: - runs-on: self-hosted + runs-on: [self-hosted, linux] steps: - name: Lire TEMPLATE_VERSION et .4nk-sync.yml # Doit charger ref courant, source_repo et périmètre paths diff --git a/docs/project/GITEA_SETUP.md b/docs/project/GITEA_SETUP.md index 347a7d6..282be70 100644 --- a/docs/project/GITEA_SETUP.md +++ b/docs/project/GITEA_SETUP.md @@ -22,6 +22,12 @@ - Nom: `RELEASE_TOKEN` ; Valeur: un token personnel avec portée API sur le dépôt - Le job `release-create` utilisera ce secret lors d’un push de tag `v*` +### Runner Gitea (labels) +- Configurez votre runner avec labels: `self-hosted,linux` +- Exemple (act_runner): + - Enregistrement: `./act_runner register --labels "self-hosted,linux"` + - Service: définissez `RUNNER_LABELS="self-hosted,linux"` + ## 4. Workflows requis - `code-quality`, `unit-tests`, `documentation-tests`, `security-audit` From 7aee843d9df74fd65c88d4aac815832c4b60cf1c Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Thu, 28 Aug 2025 00:24:42 +0200 Subject: [PATCH 3/5] docs(README): refonte ludique + Linux quickstart; ci: runners self-hosted,linux --- README.md | 160 +++++++++++++++++++----------------------------------- 1 file changed, 57 insertions(+), 103 deletions(-) diff --git a/README.md b/README.md index 1bf03ea..0cc9d30 100644 --- a/README.md +++ b/README.md @@ -1,128 +1,82 @@ -# 4NK Project Template — Qualité, Sécurité et Open Source +# 4NK Project Template — Qualité, Sécurité, Open Source ✨ -Ce dépôt est le template de référence 4NK. Il formalise la démarche de qualité, de sécurité et d’open source applicable à tous les projets 4NK et fournit des supports initiaux (modèles CI/CD, règles Cursor, scripts, guides). Chaque projet doit l’adapter à ses spécificités, et proposer des améliorations en retour (feedback) vers ce template. +Bienvenue dans le template 4NK. Objectifs: démarrer vite, rester propre, publier serein. Vous y trouverez des règles, des workflows CI, des scripts d’agents et une documentation prête à adapter. -## 📋 Table des Matières +## 📦 Ce que vous obtenez +- Standards de qualité et sécurité (lint, audit, release‑guard) +- Agents automatisés (qualité, docs, tests, sécurité, déploiement) +- CI Gitea prête à l’emploi (self‑hosted, linux) +- Documentation structurée: `docs/project/**` (ce dépôt) et `docs/templates/**` (modèles pour vos projets) -## 🏗️ Architecture +## 🐧 Linux (Debian) — Prérequis rapides -### 🔄 Flux de Données +```bash +sudo apt update +sudo apt install -y bash git curl jq ca-certificates +# Lint Markdown +curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - +sudo apt install -y nodejs +``` +## ⚙️ Configuration locale (secrets) -## 🚀 Démarrage Rapide +```bash +bash scripts/deploy/setup.sh # crée ~/.4nk_template/.env (chmod 600) +``` +À renseigner ensuite dans `~/.4nk_template/.env` (extraits): -### Prérequis +- OPENAI_API_KEY, OPENAI_MODEL (si agents IA) +- RELEASE_TOKEN (release via API Gitea) +- BASE_URL (optionnel, par défaut `https://git.4nkweb.com`) +Plus d’infos: `docs/project/CONFIGURATION.md` et `docs/project/GITEA_SETUP.md`. -### Installation +## 🤖 Exécuter les agents +```bash +scripts/agents/run.sh # exécution complète, rapports dans tests/reports/agents +scripts/agents/run.sh . . documentation # exécution ciblée (facultatif) +``` +Fallback Windows: `scripts/agents/run.ps1`. -### Configuration SSH (Recommandé) +Guide complet: `docs/project/AGENTS_RUNTIME.md`. +## 🔁 CI/CD (Gitea Actions) + +- Runners: labels requis `self-hosted,linux` (voir `docs/project/GITEA_SETUP.md`) +- Jobs clés: `markdownlint`, `agents-smoke`, `release-guard`, `release-create` +- Secrets/Variables: `RELEASE_TOKEN`, `OPENAI_API_KEY`, `BASE_URL`, `OPENAI_*` + +## 🚀 Release + +```bash +# Vérifier/mettre à jour la version +cat TEMPLATE_VERSION + +# Tagger (déclenche la release via API si RELEASE_TOKEN existe côté dépôt) +git tag -a vYYYY.MM.P -m 'release: vYYYY.MM.P (latest)' +git push origin vYYYY.MM.P +``` + +Changelog: `CHANGELOG.md`. Gardien de release: `release-guard` en CI. ## 📚 Documentation -### 📖 Guides Principaux - -- docs/TEMPLATE_ADAPTATION.md — Comment adapter ce template à votre projet -- docs/TEMPLATE_FEEDBACK.md — Comment proposer des améliorations au template - - -### 🔧 Guides Techniques - - -### 🧪 Guides de Test - -### 🌐 Guides Réseau - - -## 🔧 Configuration - -### Services Disponibles - - -### Variables d'Environnement - - -## 🧪 Tests et Monitoring - -### Tests de Base - -### Monitoring - - -### Tests de Performance - - -## 🌐 Réseau de Relais - -### Architecture Mesh - - -### Ajout de Nœuds Externes - - -### Configuration Externe - - -## 🛠️ Développement - -### Structure du Projet - - -### Ajout d'un Nouveau Service - - -### Modification de la Configuration - - -## 🚨 Dépannage - -### Problèmes Courants - -#### 1. Ports Déjà Utilisés - - -#### 2. Problèmes de Synchronisation - - -#### 3. Problèmes de Connectivité - -### Logs Détaillés - - -### Healthchecks - - -## 📈 Performance - -### Ressources Recommandées - -### Optimisations - +- Projet (ce dépôt): `docs/project/` +- Modèles à réutiliser: `docs/templates/` +- Standards de qualité: `docs/project/QUALITY_STANDARDS.md` ## 🤝 Contribution -1. Fork le repository -2. Créer une branche feature (`git checkout -b feature/nouvelle-fonctionnalite`) -3. Commit les changements (`git commit -am 'Ajout de nouvelle fonctionnalité'`) -4. Push la branche (`git push origin feature/nouvelle-fonctionnalite`) -5. Créer une Pull Request - -Pour les améliorations du template lui‑même (règles, CI, scripts), se référer à `docs/TEMPLATE_FEEDBACK.md` et utiliser le type d’issue « Template Feedback ». +- Fork → branche → PR (CI verte, docs/changelog à jour) +- Respect des règles éditoriales (français, pas de secrets, pas d’exemples applicatifs) ## 📄 Licence -Ce projet est sous licence MIT. Voir le fichier LICENSE pour plus de détails. +MIT — voir `LICENSE`. ## 🆘 Support -Pour obtenir de l'aide : - -1. Consulter la [documentation](docs/) -2. Vérifier les [issues existantes](https://git.4nkweb.com/4nk/4NK_node/issues) -3. Créer une nouvelle issue avec les détails du problème -4. Inclure les logs et la configuration utilisée - ---- +- Lire `docs/project/INDEX.md` +- Ouvrir une issue si besoin From d02901689c310f1c5c13109a87c35089c3b167ec Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Thu, 28 Aug 2025 00:27:09 +0200 Subject: [PATCH 4/5] chore(release): v2025.08.3 (README refonte; runners self-hosted,linux) --- CHANGELOG.md | 9 ++++++++- TEMPLATE_VERSION | 2 +- docs/project/GITEA_SETUP.md | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e3801c..5eb34ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,14 +26,21 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Déploiement: copie étendue (.cursor, AGENTS.md, LICENSE, CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, TEMPLATE_VERSION, .markdownlint.json, .cursorignore, .gitignore, security/, scripts/) ### Changed +## [2025.08.3] - 2025-08-27 + +### Changed +- README refondu (ludique) avec Quickstart Debian, exécution agents sans arguments, secrets et CI +- Workflows Gitea configurés pour runners `self-hosted, linux` (docs mises à jour) + + ## [2025.08.2] - 2025-08-27 ### Changed + - Renommage variable CI/Docs `GITEA_BASE_URL` → `BASE_URL` - Exécution des agents simplifiée: `scripts/agents/run.sh` sans arguments par défaut - CI mise à jour pour utiliser l’exécution sans paramètres - ## [2025.08.1] - 2025-08-27 ### Added diff --git a/TEMPLATE_VERSION b/TEMPLATE_VERSION index a90970d..408e425 100644 --- a/TEMPLATE_VERSION +++ b/TEMPLATE_VERSION @@ -1,2 +1,2 @@ -v2025.08.2 +v2025.08.3 diff --git a/docs/project/GITEA_SETUP.md b/docs/project/GITEA_SETUP.md index 282be70..42dcef1 100644 --- a/docs/project/GITEA_SETUP.md +++ b/docs/project/GITEA_SETUP.md @@ -23,6 +23,7 @@ - Le job `release-create` utilisera ce secret lors d’un push de tag `v*` ### Runner Gitea (labels) + - Configurez votre runner avec labels: `self-hosted,linux` - Exemple (act_runner): - Enregistrement: `./act_runner register --labels "self-hosted,linux"` From 5210126c82176a72f7e3e4bfaad70a1b91c9373c Mon Sep 17 00:00:00 2001 From: Nicolas Cantu Date: Thu, 28 Aug 2025 00:28:31 +0200 Subject: [PATCH 5/5] docs: minor normalize after release v2025.08.3 --- CHANGELOG.md | 3 ++- README.md | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5eb34ce..16ba9e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,13 +26,14 @@ et ce projet adhère au [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Déploiement: copie étendue (.cursor, AGENTS.md, LICENSE, CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, TEMPLATE_VERSION, .markdownlint.json, .cursorignore, .gitignore, security/, scripts/) ### Changed + ## [2025.08.3] - 2025-08-27 ### Changed + - README refondu (ludique) avec Quickstart Debian, exécution agents sans arguments, secrets et CI - Workflows Gitea configurés pour runners `self-hosted, linux` (docs mises à jour) - ## [2025.08.2] - 2025-08-27 ### Changed diff --git a/README.md b/README.md index 0cc9d30..523f3bf 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ sudo apt install -y nodejs ```bash bash scripts/deploy/setup.sh # crée ~/.4nk_template/.env (chmod 600) ``` + À renseigner ensuite dans `~/.4nk_template/.env` (extraits): - OPENAI_API_KEY, OPENAI_MODEL (si agents IA) @@ -38,6 +39,7 @@ Plus d’infos: `docs/project/CONFIGURATION.md` et `docs/project/GITEA_SETUP.md` scripts/agents/run.sh # exécution complète, rapports dans tests/reports/agents scripts/agents/run.sh . . documentation # exécution ciblée (facultatif) ``` + Fallback Windows: `scripts/agents/run.ps1`. Guide complet: `docs/project/AGENTS_RUNTIME.md`.