Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
92b6c2580e | |||
1a846b63f1 | |||
3cd729bb71 | |||
bfd833cc5b | |||
69bc6f984e | |||
cb55b82918 | |||
49749ed795 | |||
![]() |
b7308bec80 | ||
![]() |
dfe2135720 | ||
![]() |
179c4cd504 | ||
![]() |
3abab9c63b | ||
![]() |
e27867dd43 | ||
![]() |
02c470e3e0 | ||
![]() |
17c4fccbdf | ||
![]() |
fa87597d15 | ||
![]() |
9b9f238ab0 | ||
![]() |
d00e281a2a | ||
![]() |
3d596f8d19 | ||
![]() |
cfa9829d45 | ||
![]() |
1c54725cad |
36
.gitea/workflows/dev-test.yml
Normal file
36
.gitea/workflows/dev-test.yml
Normal file
@ -0,0 +1,36 @@
|
||||
name: dev-test
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- dev-test
|
||||
branches:
|
||||
- 'dev-test*'
|
||||
paths:
|
||||
- '.ci/tag.env'
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: docker
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: recursive
|
||||
- name: Setup Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Login to Gitea Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.4nkweb.com
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
- name: Sync submodules branches
|
||||
run: |
|
||||
bash scripts/sync_submodules.sh
|
||||
- name: Build and push images
|
||||
env:
|
||||
REGISTRY: git.4nkweb.com
|
||||
run: |
|
||||
DOCKER_TAG=$(if [ -f .ci/tag.env ]; then source .ci/tag.env && echo "$DOCKER_TAG"; else echo "${GITHUB_REF_NAME:-dev-test}"; fi)
|
||||
export DOCKER_TAG
|
||||
bash scripts/build_and_push.sh
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -10,3 +10,5 @@ sdk_relay/
|
||||
sdk_signer/
|
||||
sdk_signer_client/
|
||||
sdk_storage/
|
||||
blindbit-oracle/
|
||||
sp-client/
|
||||
|
68
.gitmodules
vendored
Normal file
68
.gitmodules
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
[submodule "bitcoin-core"]
|
||||
path = modules/bitcoin-core
|
||||
url = https://github.com/bitcoin/bitcoin.git
|
||||
branch = master
|
||||
[submodule "blindbit-oracle"]
|
||||
path = modules/blindbit-oracle
|
||||
url = https://github.com/setavenger/blindbit-oracle
|
||||
branch = master
|
||||
[submodule "sp-client"]
|
||||
path = modules/sp-client
|
||||
url = https://github.com/Sosthene00/sp-client.git
|
||||
branch = dev
|
||||
[submodule "sdk_common"]
|
||||
path = modules/sdk_common
|
||||
url = https://git.4nkweb.com/4nk/sdk_common.git
|
||||
branch = dev
|
||||
[submodule "sdk_client"]
|
||||
path = modules/sdk_client
|
||||
url = https://git.4nkweb.com/4nk/sdk_client.git
|
||||
branch = dev
|
||||
[submodule "sdk_relay"]
|
||||
path = modules/sdk_relay
|
||||
url = https://git.4nkweb.com/4nk/sdk_relay.git
|
||||
branch = dev
|
||||
[submodule "sdk_storage"]
|
||||
path = modules/sdk_storage
|
||||
url = https://git.4nkweb.com/4nk/sdk_storage.git
|
||||
branch = dev
|
||||
[submodule "sdk-signer-client"]
|
||||
path = modules/sdk-signer-client
|
||||
url = https://git.4nkweb.com/4nk/sdk-signer-client.git
|
||||
branch = dev
|
||||
[submodule "ihm_client"]
|
||||
path = modules/ihm_client
|
||||
url = https://git.4nkweb.com/4nk/ihm_client.git
|
||||
branch = dev
|
||||
[submodule "4NK_node"]
|
||||
path = deploy/4NK_node
|
||||
url = git@git.4nkweb.com:4nk/4NK_node.git
|
||||
branch = dev
|
||||
[submodule "4NK_IA"]
|
||||
path = modules/4NK_IA
|
||||
url = git@git.4nkweb.com:4nk/4NK_IA.git
|
||||
branch = dev
|
||||
[submodule "projects/id_verif/id_verif"]
|
||||
path = projects/id_verif/id_verif
|
||||
url = git@git.4nkweb.com:4nk/id_verif.git
|
||||
branch = dev
|
||||
[submodule "tor"]
|
||||
path = modules/tor
|
||||
url = https://github.com/torproject/tor.git
|
||||
branch = main
|
||||
[submodule "4NK_template"]
|
||||
path = deploy/4NK_template
|
||||
url = https://git.4nkweb.com/4nk/4NK_template.git
|
||||
branch = main
|
||||
[submodule "4NK_wallet"]
|
||||
path = projects/4NK_wallet/4NK_wallet
|
||||
url = https://git.4nkweb.com/4nk/4NK_wallet.git
|
||||
branch = main
|
||||
[submodule "lecoffre-front"]
|
||||
path = projects/lecoffre/lecoffre-front
|
||||
url = https://git.4nkweb.com/4nk/lecoffre-front.git
|
||||
branch = dev
|
||||
[submodule "lecoffre-back-mini"]
|
||||
path = projects/lecoffre/lecoffre-back-mini
|
||||
url = https://git.4nkweb.com/4nk/lecoffre-back-mini.git
|
||||
branch = dev
|
10
CHANGELOG.md
Normal file
10
CHANGELOG.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Changelog - 4NK_dev
|
||||
|
||||
## [v2025.09.1] - 2025-09-10
|
||||
- Normalisation des chemins des submodules (modules/, deploy/, projects/)
|
||||
- Ajout CI dev-test (workflow Gitea) + scripts build/push
|
||||
- Scripts de synchronisation et réajout des submodules
|
||||
|
||||
## [v2025.08.1] - 2025-08-28
|
||||
- Initialisation des modules et standardisation agents
|
||||
- Repos.csv + update_repos.sh
|
116
README.md
Normal file
116
README.md
Normal file
@ -0,0 +1,116 @@
|
||||
# 4NK Development Environment
|
||||
|
||||
Ce dépôt contient l'environnement de développement complet pour l'écosystème 4NK, incluant tous les modules SDK, clients et services.
|
||||
|
||||
## 🏗️ Architecture
|
||||
|
||||
### Projets SDK (Rust)
|
||||
- **sdk_common** : Bibliothèque commune avec types et utilitaires partagés
|
||||
- **sdk_client** : Client SDK principal avec support WASM (migration flate2 en cours)
|
||||
- **sdk_storage** : Service de stockage distribué
|
||||
- **sdk_signer** : Service de signature avec interface TypeScript
|
||||
|
||||
### Clients (Node.js/TypeScript)
|
||||
- **sdk_signer_client** : Client TypeScript pour sdk_signer
|
||||
- **ihm_client** : Interface utilisateur web
|
||||
|
||||
### Services
|
||||
- **4NK_node** : Infrastructure Docker complète avec Bitcoin, Tor, et services 4NK
|
||||
- **sdk_relay** : Service de relais pour la communication P2P
|
||||
|
||||
### Outils
|
||||
- **4NK_template** : Template Docker pour les nouveaux projets
|
||||
- **4NK_wallet** : Application wallet
|
||||
|
||||
## 🚀 Démarrage rapide
|
||||
|
||||
### Prérequis
|
||||
- Docker et Docker Compose v2
|
||||
- Rust (latest stable)
|
||||
- Node.js 18+
|
||||
- Git
|
||||
|
||||
### Installation
|
||||
```bash
|
||||
# Cloner le dépôt
|
||||
git clone <repository-url>
|
||||
cd 4NK_dev
|
||||
|
||||
# Configurer l'environnement
|
||||
./setup_dev_env.sh
|
||||
|
||||
# Démarrer l'infrastructure
|
||||
cd 4NK_node
|
||||
./scripts/manage_services.sh start
|
||||
```
|
||||
|
||||
## 📦 Gestion des dépendances WASM
|
||||
|
||||
### État actuel
|
||||
- **sdk_common** : ✅ Migré vers `flate2` (remplace `zstd`)
|
||||
- **sdk_client** : 🔄 Stub WASM temporaire avec `flate2` (en attente de migration complète)
|
||||
- **sdk_signer** : ✅ Compatible avec le stub WASM
|
||||
|
||||
### Migration en cours
|
||||
1. **Phase 1** : ✅ Migration `sdk_common` vers `flate2`
|
||||
2. **Phase 2** : 🔄 Migration `sdk_client` vers `k256` et `flate2`
|
||||
3. **Phase 3** : ⏳ Intégration complète WASM
|
||||
4. **Phase 4** : ⏳ Déploiement
|
||||
|
||||
## 🛠️ Développement
|
||||
|
||||
### Compilation des projets
|
||||
```bash
|
||||
# Compiler tous les projets Rust
|
||||
for project in sdk_common sdk_client sdk_storage; do
|
||||
cd $project && cargo build --release && cd ..
|
||||
done
|
||||
|
||||
# Compiler les projets Node.js
|
||||
for project in sdk_signer sdk_signer_client ihm_client; do
|
||||
cd $project && npm install && npm run build && cd ..
|
||||
done
|
||||
```
|
||||
|
||||
### Gestion des services
|
||||
```bash
|
||||
# Arrêter tous les services
|
||||
cd 4NK_node && ./scripts/manage_services.sh stop
|
||||
|
||||
# Nettoyer l'environnement
|
||||
./scripts/manage_services.sh clean
|
||||
|
||||
# Redémarrer les services
|
||||
./scripts/manage_services.sh start
|
||||
```
|
||||
|
||||
## 📚 Documentation
|
||||
|
||||
- [Résultats de compilation](COMPILATION_RESULTS.md) - Statut détaillé de tous les projets
|
||||
- [Modules Docker](docs/modules.md) - Documentation des modules Docker
|
||||
- [Changelog](CHANGELOG.md) - Historique des versions
|
||||
|
||||
## 🔧 Scripts utiles
|
||||
|
||||
- `setup_dev_env.sh` : Configuration de l'environnement de développement
|
||||
- `update_repos.sh` : Mise à jour des dépôts depuis repos.csv
|
||||
- `4NK_node/scripts/manage_services.sh` : Gestion des services Docker
|
||||
|
||||
## 📋 Structure des branches
|
||||
|
||||
- **main** : Branche principale pour 4NK_dev et 4NK_node
|
||||
- **docker-support** : Branche de développement pour les SDKs et clients
|
||||
- **dev** : Branche de développement pour certaines fonctionnalités
|
||||
|
||||
## 🤝 Contribution
|
||||
|
||||
1. Créer une branche depuis `docker-support` ou `main` selon le projet
|
||||
2. Développer et tester localement
|
||||
3. Pousser les modifications sur la branche appropriée
|
||||
4. Créer une pull request
|
||||
|
||||
## 📄 Licence
|
||||
|
||||
MIT License - voir les fichiers LICENSE individuels dans chaque projet.
|
||||
|
||||
|
11
code.code-workspace
Normal file
11
code.code-workspace
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": ".."
|
||||
},
|
||||
{
|
||||
"path": "../../.4nk_template"
|
||||
}
|
||||
],
|
||||
"settings": {}
|
||||
}
|
1
deploy4NK_node
Submodule
1
deploy4NK_node
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 2f663d20a28ff0dc42ef0ebf29cc405329fd23a8
|
1
deploy4NK_template
Submodule
1
deploy4NK_template
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 6ced5d29231b711bd0c8eab591091c810d0147d7
|
35
docs/ci_dev_test.md
Normal file
35
docs/ci_dev_test.md
Normal file
@ -0,0 +1,35 @@
|
||||
# Politique CI "dev-test"
|
||||
|
||||
Ce flux construit et pousse des images Docker pour chaque sous-dépôt listé dans `.gitmodules` qui contient un `Dockerfile`. Les images sont poussées dans le registry Gitea `git.4nkweb.com` sous le namespace `4nk` avec le tag `dev-test`.
|
||||
|
||||
## Déclencheur
|
||||
|
||||
- Tag Git: `dev-test`
|
||||
|
||||
## Séquence
|
||||
|
||||
1. Checkout du dépôt avec submodules (recursive)
|
||||
2. Synchronisation des submodules sur la branche déclarée dans `.gitmodules`
|
||||
3. Authentification au registry Gitea via secrets `REGISTRY_USERNAME` et `REGISTRY_PASSWORD`
|
||||
4. Build et push des images Docker présentes dans chaque sous-module
|
||||
|
||||
## Variables d’environnement
|
||||
|
||||
- `REGISTRY`: `git.4nkweb.com`
|
||||
- `NAMESPACE`: `4nk`
|
||||
- `DOCKER_TAG`: `dev-test`
|
||||
|
||||
## Scripts
|
||||
|
||||
- `scripts/sync_submodules.sh`: synchronise les branches des submodules
|
||||
- `scripts/build_and_push.sh`: build et push les images existantes
|
||||
|
||||
## Secrets requis
|
||||
|
||||
- `REGISTRY_USERNAME`: compte autorisé sur le registry
|
||||
- `REGISTRY_PASSWORD`: mot de passe ou token
|
||||
|
||||
## Notes
|
||||
|
||||
- Les submodules sans `Dockerfile` sont ignorés.
|
||||
- Les branches utilisées sont celles définies dans `.gitmodules` (clé `branch`).
|
127
docs/etat_services.md
Normal file
127
docs/etat_services.md
Normal file
@ -0,0 +1,127 @@
|
||||
# État des Services 4NK Node
|
||||
|
||||
**Date :** 3 septembre 2025
|
||||
**Heure :** 18:10 UTC
|
||||
**Environnement :** Docker Compose sur Debian
|
||||
|
||||
## Résumé Global
|
||||
|
||||
- **Services fonctionnels :** 4/7 (57%) ⬆️
|
||||
- **Services en erreur :** 3/7 (43%) ⬇️
|
||||
- **Services redémarrant :** 0/7 (0%) ✅
|
||||
|
||||
## Détail des Services
|
||||
|
||||
### ✅ Services Fonctionnels
|
||||
|
||||
#### 1. **4nk-bitcoin** (bitcoin)
|
||||
- **Statut :** `Up About a minute`
|
||||
- **Ports :** 29000, 18443, 38332-38333
|
||||
- **État :** ✅ **FONCTIONNEL - RPC corrigé**
|
||||
- **Notes :** Credentials RPC ajoutés, réseau Docker autorisé (192.168.240.0/20)
|
||||
|
||||
#### 2. **4nk-tor** (tor)
|
||||
- **Statut :** `Up 2 hours`
|
||||
- **Ports :** 9050-9051
|
||||
- **État :** ✅ **FONCTIONNEL**
|
||||
- **Notes :** Service Tor opérationnel, listeners SOCKS et Control actifs
|
||||
|
||||
#### 3. **4nk-blindbit** (blindbit) ⭐ **CORRIGÉ**
|
||||
- **Statut :** `Up 31 seconds (health: starting)`
|
||||
- **Ports :** 8000
|
||||
- **État :** ✅ **FONCTIONNEL - RPC authentifié**
|
||||
- **Notes :** Connexion RPC réussie, synchronisation active, service HTTP opérationnel
|
||||
|
||||
#### 4. **4nk-sdk-storage** (sdk_storage)
|
||||
- **Statut :** `Up 2 hours (unhealthy)`
|
||||
- **Ports :** 8081
|
||||
- **État :** ✅ **FONCTIONNEL mais non vérifié**
|
||||
- **Notes :** Service démarré mais health check échoue
|
||||
|
||||
### ❌ Services en Erreur
|
||||
|
||||
#### 5. **4nk-sdk-signer** (sdk_signer)
|
||||
- **Statut :** `Arrêté`
|
||||
- **Erreur :** `SyntaxError: Unexpected token 'export'`
|
||||
- **Cause :** Incompatibilité ES modules vs CommonJS
|
||||
- **Fichier problématique :** `/app/pkg/sdk_client.js`
|
||||
- **Détail :** Le code WASM généré utilise la syntaxe ES6 `export` mais Node.js s'attend à du CommonJS
|
||||
|
||||
#### 6. **4nk-sdk-relay** (sdk_relay)
|
||||
- **Statut :** `Arrêté`
|
||||
- **Erreur :** `Failed to find conf file`
|
||||
- **Cause :** Fichier de configuration manquant
|
||||
- **Impact :** Service critique pour la communication entre composants
|
||||
|
||||
#### 7. **4nk-ihm-client** (ihm_client)
|
||||
- **Statut :** `Up 2 hours (unhealthy)`
|
||||
- **Ports :** 3003, 8080
|
||||
- **État :** ✅ **Démarré mais non vérifié**
|
||||
- **Notes :** Interface utilisateur accessible mais health check échoue
|
||||
|
||||
## Problèmes Résolus ✅
|
||||
|
||||
### **Authentification RPC Bitcoin-BlindBit (RÉSOLU)**
|
||||
- **Problème :** BlindBit recevait des erreurs 403 Forbidden
|
||||
- **Cause :** Configuration réseau incorrecte (`rpcallowip=172.24.0.0/16` au lieu de `192.168.240.0/20`)
|
||||
- **Solution :**
|
||||
1. Ajout des credentials RPC (`rpcuser=bitcoin`, `rpcpassword=bitcoin`)
|
||||
2. Correction du réseau autorisé (`rpcallowip=192.168.240.0/20`)
|
||||
3. Redémarrage de Bitcoin pour appliquer la configuration
|
||||
- **Résultat :** BlindBit se connecte maintenant avec succès à Bitcoin
|
||||
|
||||
## Problèmes Identifiés
|
||||
|
||||
### 1. **Incompatibilité ES Modules (CRITIQUE)**
|
||||
- **Service :** sdk_signer
|
||||
- **Problème :** Le code WASM généré par `wasm-pack` utilise la syntaxe ES6
|
||||
- **Solution :** Configurer le projet pour utiliser ES modules ou convertir en CommonJS
|
||||
|
||||
### 2. **Configuration Manquante (CRITIQUE)**
|
||||
- **Service :** sdk_relay
|
||||
- **Problème :** Fichier de configuration introuvable
|
||||
- **Solution :** Vérifier la présence et la validité des fichiers de config
|
||||
|
||||
### 3. **Health Checks (FAIBLE)**
|
||||
- **Services :** sdk_storage, ihm_client
|
||||
- **Problème :** Health checks échouent malgré un fonctionnement apparent
|
||||
- **Solution :** Ajuster les critères de health check
|
||||
|
||||
## Recommandations
|
||||
|
||||
### Priorité 1 : Corriger sdk_signer ✅
|
||||
- **Statut :** En attente
|
||||
- **Action :** Résoudre l'incompatibilité ES modules
|
||||
|
||||
### Priorité 2 : Corriger sdk_relay ✅
|
||||
- **Statut :** En attente
|
||||
- **Action :** Identifier et corriger le fichier de configuration manquant
|
||||
|
||||
### Priorité 3 : Améliorer les health checks ✅
|
||||
- **Statut :** En attente
|
||||
- **Action :** Ajuster les critères de vérification
|
||||
|
||||
## Actions Effectuées
|
||||
|
||||
1. ✅ **Ajouté les credentials RPC** dans `conf/bitcoin.conf`
|
||||
2. ✅ **Corrigé la configuration réseau** (`rpcallowip=192.168.240.0/20`)
|
||||
3. ✅ **Redémarré Bitcoin** pour appliquer la configuration
|
||||
4. ✅ **Testé la connexion RPC** avec succès
|
||||
5. ✅ **Relancé BlindBit** avec succès
|
||||
6. ✅ **Vérifié le fonctionnement** du service
|
||||
|
||||
## Impact sur l'Architecture
|
||||
|
||||
- **Communication inter-services :** ✅ BlindBit-Bitcoin fonctionne
|
||||
- **Signature des transactions :** ❌ Impossible (sdk_signer défaillant)
|
||||
- **Confidentialité :** ✅ **Disponible (blindbit fonctionnel)**
|
||||
- **Interface utilisateur :** Partiellement fonctionnelle
|
||||
- **Stockage :** Fonctionnel mais non vérifié
|
||||
|
||||
## Prochaines Étapes
|
||||
|
||||
1. ✅ **BlindBit corrigé** - Service opérationnel
|
||||
2. 🔄 **Corriger sdk_signer** - Résoudre l'incompatibilité ES modules
|
||||
3. 🔄 **Corriger sdk_relay** - Résoudre la configuration manquante
|
||||
4. 🔄 **Améliorer les health checks** - Optimiser la surveillance des services
|
||||
5. 🔄 **Tester l'intégration complète** - Vérifier la communication inter-services
|
@ -1,37 +0,0 @@
|
||||
# Modules Docker (4NK_dev)
|
||||
|
||||
## 4NK_node
|
||||
- S’appuie sur le `docker-compose.yml` existant dans `4NK_node/`.
|
||||
- Scripts:
|
||||
- `modules/4NK_node/build.sh` : construit les services avec `docker compose build`.
|
||||
- `modules/4NK_node/up.sh` : démarre les services en détaché.
|
||||
- `modules/4NK_node/down.sh` : arrête et nettoie les services.
|
||||
- `modules/4NK_node/logs.sh` : affiche les logs (suivi).
|
||||
- `modules/4NK_node/clean.sh` : down -v + prune d’images.
|
||||
- Version/tag: lit `4NK_node/VERSION` si présent, sinon utilise `git describe` pour définir `COMPOSE_PROJECT_NAME`.
|
||||
|
||||
## 4NK_template
|
||||
- Dockerfile multi-stage Node fourni dans `modules/4NK_template/Dockerfile`.
|
||||
- Scripts:
|
||||
- `modules/4NK_template/build.sh` : build de l’image à partir de `4NK_template/`.
|
||||
- `modules/4NK_template/run.sh` : exécute l’image, mappe le port 3000.
|
||||
- `modules/4NK_template/clean.sh` : supprime l’image construite et fait un prune.
|
||||
- Version/tag: lit `4NK_template/VERSION` si présent, sinon `git describe`.
|
||||
|
||||
## Prérequis
|
||||
- Docker et Docker Compose (plugin) installés.
|
||||
|
||||
## Utilisation (séquentielle)
|
||||
1. Construire 4NK_node
|
||||
- `bash modules/4NK_node/build.sh`
|
||||
2. Démarrer 4NK_node
|
||||
- `bash modules/4NK_node/up.sh`
|
||||
3. Construire 4NK_template
|
||||
- `bash modules/4NK_template/build.sh`
|
||||
4. Lancer 4NK_template
|
||||
- `bash modules/4NK_template/run.sh`
|
||||
5. Logs 4NK_node
|
||||
- `bash modules/4NK_node/logs.sh`
|
||||
6. Arrêt 4NK_node
|
||||
- `bash modules/4NK_node/down.sh`
|
||||
|
1
modules/4NK_IA
Submodule
1
modules/4NK_IA
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 0c8c0f1c390f4109a192c32f1da3fba07a204d12
|
1
modules/bitcoin-core
Submodule
1
modules/bitcoin-core
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 2c8a478db4b84e03cc376e52f463b828ab9366f6
|
1
modules/blindbit-oracle
Submodule
1
modules/blindbit-oracle
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a6a5e879ca0198931cbc6e5a1a8a76d9b653c532
|
1
modules/ihm_client
Submodule
1
modules/ihm_client
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit c8ac815e2bc1673468d476058137663b585600de
|
1
modules/sdk-signer-client
Submodule
1
modules/sdk-signer-client
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 1c9c625bb6641ee7e12c81244553082d5e5c17ff
|
1
modules/sdk_client
Submodule
1
modules/sdk_client
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit c09135c4eb785fa5ef242cd106bb1e628d5f68fa
|
1
modules/sdk_common
Submodule
1
modules/sdk_common
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit e205229e9219f6c3ad322a462903d2a740731aa3
|
1
modules/sdk_relay
Submodule
1
modules/sdk_relay
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a056d44cbf61f75f7c71add30d94e30168de7018
|
1
modules/sdk_signer
Submodule
1
modules/sdk_signer
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 83b21cb815458a6b662eb7d4d76f4fac25ca9b29
|
1
modules/sdk_storage
Submodule
1
modules/sdk_storage
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 120a3dc8d0b8398a4c83e27e24eff14c76f66a8f
|
1
modules/sp-client
Submodule
1
modules/sp-client
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit b1710e7d16592e52a2a77618ceb4d56d5d51db8e
|
1
modules/tor
Submodule
1
modules/tor
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 27d4ba90f6dbf0c80d518a358b9600ae789509e4
|
1
proect/id_verif/id_verif
Submodule
1
proect/id_verif/id_verif
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 9e2d56383b1ddea92149f2e201cad630d5e57b30
|
1
project/4NK_wallet/4NK_wallet
Submodule
1
project/4NK_wallet/4NK_wallet
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 6e505b2f32467af5852928215d2dc18d26917824
|
1
project/lecoffre/lecoffre-back-mini
Submodule
1
project/lecoffre/lecoffre-back-mini
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit cfa9514be9a5e4deae9dccb2fe03780b8707ea43
|
1
project/lecoffre/lecoffre-front
Submodule
1
project/lecoffre/lecoffre-front
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a78666b4a985e4e3e4deb19f4cbb10e4e4202c9b
|
11
repos.csv
11
repos.csv
@ -1,11 +0,0 @@
|
||||
name,url,type,target,directory
|
||||
sdk_storage,https://git.4nkweb.com/4nk/sdk_storage.git,branch,docker-support,sdk_storage
|
||||
sdk_signer_client,https://git.4nkweb.com/4nk/sdk_signer_client.git,create_from,master->docker-support,sdk_signer_client
|
||||
sdk_signer,https://git.4nkweb.com/4nk/sdk_signer.git,branch,docker-support,sdk_signer
|
||||
ihm_client,https://git.4nkweb.com/4nk/ihm_client.git,branch,docker-support,ihm_client
|
||||
sdk_relay,https://git.4nkweb.com/4nk/sdk_relay.git,branch,docker-support,sdk_relay
|
||||
sdk_common,https://git.4nkweb.com/4nk/sdk_common.git,branch,docker-support,sdk_common
|
||||
4NK_wallet,https://git.4nkweb.com/4nk/4NK_wallet.git,create_from,main->docker-support,4NK_wallet
|
||||
sdk_client,https://git.4nkweb.com/4nk/sdk_client.git,branch,docker-support,sdk_client
|
||||
4NK_template,https://git.4nkweb.com/4nk/4NK_template.git,branch,main,4NK_template
|
||||
4NK_node,git@git.4nkweb.com:4nk/4NK_node.git,branch,main,4NK_node
|
|
57
scripts/build_and_push.sh
Normal file
57
scripts/build_and_push.sh
Normal file
@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
REGISTRY=${REGISTRY:-git.4nkweb.com}
|
||||
NAMESPACE=${NAMESPACE:-4nk}
|
||||
DOCKER_TAG=${DOCKER_TAG:-dev-test}
|
||||
|
||||
echo "[docker] registry=${REGISTRY} namespace=${NAMESPACE} tag=${DOCKER_TAG}"
|
||||
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "[docker][erreur] docker introuvable" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "[docker][erreur] .gitmodules introuvable dans $(pwd)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Parcourt les submodules déclarés
|
||||
mapfile -t submodules < <(git config -f .gitmodules --name-only --get-regexp 'submodule\..*\.path' | sed -E 's/\.path$//')
|
||||
|
||||
for name in "${submodules[@]}"; do
|
||||
path=$(git config -f .gitmodules --get "${name}.path" || true)
|
||||
url=$(git config -f .gitmodules --get "${name}.url" || true)
|
||||
branch=$(git config -f .gitmodules --get "${name}.branch" || echo "master")
|
||||
|
||||
if [ -z "${path}" ] || [ -z "${url}" ]; then
|
||||
echo "[docker][warn] entrée incomplète pour ${name}, ignoré" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
image_name=$(basename "${path}")
|
||||
full_ref="${REGISTRY}/${NAMESPACE}/${image_name}:${DOCKER_TAG}"
|
||||
|
||||
if [ ! -d "${path}" ]; then
|
||||
echo "[docker][warn] sous-dossier ${path} manquant, on saute" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
if [ ! -f "${path}/Dockerfile" ]; then
|
||||
echo "[docker] aucun Dockerfile dans ${path}, ignoré"
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "[docker] build ${full_ref} depuis ${path} (branche ${branch})"
|
||||
docker buildx build \
|
||||
--pull \
|
||||
--tag "${full_ref}" \
|
||||
"${path}"
|
||||
|
||||
echo "[docker] push ${full_ref}"
|
||||
docker push "${full_ref}"
|
||||
done
|
||||
|
||||
echo "[docker] terminé"
|
39
scripts/commit_tag_env.sh
Normal file
39
scripts/commit_tag_env.sh
Normal file
@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Usage: ./scripts/commit_tag_env.sh <TAG_NAME>
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "[ci] usage: $0 <TAG_NAME>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TAG_NAME="$1"
|
||||
ROOT_DIR="/home/desk/code/4NK_dev"
|
||||
TAG_BRANCH="$TAG_NAME"
|
||||
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
echo "[ci] préparer la branche ${TAG_BRANCH} (source dev si besoin)"
|
||||
git fetch origin --prune >/dev/null 2>&1 || true
|
||||
|
||||
if git show-ref --verify --quiet "refs/heads/${TAG_BRANCH}"; then
|
||||
git checkout "${TAG_BRANCH}"
|
||||
else
|
||||
if git ls-remote --exit-code --heads origin "${TAG_BRANCH}" >/dev/null 2>&1; then
|
||||
git checkout -b "${TAG_BRANCH}" "origin/${TAG_BRANCH}"
|
||||
else
|
||||
git checkout -B "${TAG_BRANCH}" "origin/dev"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "[ci] écrire .ci/tag.env avec DOCKER_TAG=${TAG_NAME}"
|
||||
mkdir -p .ci
|
||||
printf "DOCKER_TAG=%s\n" "$TAG_NAME" > .ci/tag.env
|
||||
|
||||
git add .ci/tag.env
|
||||
git commit -m "ci(tag): set DOCKER_TAG=${TAG_NAME} in .ci/tag.env"
|
||||
git push origin "HEAD:refs/heads/${TAG_BRANCH}"
|
||||
|
||||
echo "[ci] terminé: branche ${TAG_BRANCH} mise à jour"
|
6
scripts/readd_submodules.sh
Normal file
6
scripts/readd_submodules.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
|
||||
git submodule update --init --recursive
|
||||
echo "[readd] git submodule update --init --recursive terminé"
|
48
scripts/sync_submodules.sh
Normal file
48
scripts/sync_submodules.sh
Normal file
@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
echo "[sync] lecture des submodules depuis .gitmodules"
|
||||
|
||||
if [ ! -f .gitmodules ]; then
|
||||
echo "[sync][erreur] .gitmodules introuvable dans $(pwd)" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Récupère la liste des sous-modules (noms logiques)
|
||||
mapfile -t submodules < <(git config -f .gitmodules --name-only --get-regexp 'submodule\..*\.path' | sed -E 's/\.path$//')
|
||||
|
||||
for name in "${submodules[@]}"; do
|
||||
path=$(git config -f .gitmodules --get "${name}.path" || true)
|
||||
url=$(git config -f .gitmodules --get "${name}.url" || true)
|
||||
branch=$(git config -f .gitmodules --get "${name}.branch" || echo "master")
|
||||
|
||||
if [ -z "${path}" ] || [ -z "${url}" ]; then
|
||||
echo "[sync][warn] entrée incomplète pour ${name}, ignoré" >&2
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "[sync] => ${path} (${url}) branch=${branch}"
|
||||
|
||||
if [ ! -d "${path}/.git" ]; then
|
||||
echo "[sync] init submodule ${path}"
|
||||
git submodule update --init --recursive -- "${path}"
|
||||
fi
|
||||
|
||||
echo "[sync] fetch ${path}"
|
||||
git -C "${path}" fetch --all --prune
|
||||
|
||||
echo "[sync] checkout ${branch} dans ${path}"
|
||||
if ! git -C "${path}" checkout "${branch}" 2>/dev/null; then
|
||||
if git -C "${path}" rev-parse --verify "origin/${branch}" >/dev/null 2>&1; then
|
||||
git -C "${path}" checkout -b "${branch}" "origin/${branch}"
|
||||
else
|
||||
echo "[sync][warn] branche ${branch} introuvable pour ${path}, on reste sur la branche courante" >&2
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "[sync] pull ${path}"
|
||||
git -C "${path}" pull --ff-only || true
|
||||
done
|
||||
|
||||
echo "[sync] terminé"
|
91
scripts/tag.sh
Normal file
91
scripts/tag.sh
Normal file
@ -0,0 +1,91 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
# Usage: ./tag.sh [TAG_NAME]
|
||||
# Par défaut, TAG_NAME="dev-test"
|
||||
|
||||
TAG_NAME="${1:-dev-test}"
|
||||
ROOT_DIR="/home/desk/code/4NK_dev"
|
||||
|
||||
print_info() { echo "[tag] $*"; }
|
||||
print_warn() { echo "[tag][warn] $*"; }
|
||||
|
||||
delete_tag_if_exists() {
|
||||
local tag="$1"
|
||||
if git show-ref --tags --quiet --verify "refs/tags/${tag}"; then
|
||||
git tag -d "${tag}" >/dev/null || true
|
||||
git push origin ":refs/tags/${tag}" >/dev/null || true
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_branch_checked_out() {
|
||||
local branch="$1"
|
||||
if git rev-parse --verify "origin/${branch}" >/dev/null 2>&1; then
|
||||
git checkout "${branch}" >/dev/null 2>&1 || git checkout -b "${branch}" "origin/${branch}" >/dev/null 2>&1 || true
|
||||
git pull --ff-only >/dev/null 2>&1 || true
|
||||
else
|
||||
print_info "branche ${branch} introuvable, utilisation de la branche courante"
|
||||
fi
|
||||
}
|
||||
|
||||
tag_current_repo() {
|
||||
local tag="$1"
|
||||
local ref_sha
|
||||
ref_sha=$(git rev-parse --verify HEAD)
|
||||
delete_tag_if_exists "${tag}"
|
||||
git tag -a "${tag}" -m "CI ${tag} trigger" "${ref_sha}"
|
||||
git push origin "refs/tags/${tag}"
|
||||
}
|
||||
|
||||
get_submodule_names() {
|
||||
git config -f .gitmodules --name-only --get-regexp 'submodule\..*\.path' | sed -E 's/\.path$//'
|
||||
}
|
||||
|
||||
tag_root_repo() {
|
||||
cd "${ROOT_DIR}"
|
||||
print_info "repository racine: $(basename "${ROOT_DIR}") -> ${TAG_NAME}"
|
||||
local dev_head
|
||||
dev_head=$(git rev-parse --verify refs/heads/dev)
|
||||
delete_tag_if_exists "${TAG_NAME}"
|
||||
git tag -a "${TAG_NAME}" -m "CI ${TAG_NAME} trigger" "${dev_head}"
|
||||
git push origin "refs/tags/${TAG_NAME}"
|
||||
}
|
||||
|
||||
tag_submodules() {
|
||||
print_info "lecture des submodules depuis .gitmodules"
|
||||
local names
|
||||
mapfile -t names < <(get_submodule_names)
|
||||
for name in "${names[@]}"; do
|
||||
local sm_path sm_url sm_branch
|
||||
sm_path=$(git config -f .gitmodules --get "${name}.path" || true)
|
||||
sm_url=$(git config -f .gitmodules --get "${name}.url" || true)
|
||||
sm_branch=$(git config -f .gitmodules --get "${name}.branch" || echo dev)
|
||||
|
||||
if [ -z "${sm_path}" ] || [ -z "${sm_url}" ]; then
|
||||
print_warn "entrée incomplète: ${name}, ignorée"
|
||||
continue
|
||||
fi
|
||||
if [ ! -d "${sm_path}" ]; then
|
||||
print_warn "dossier manquant: ${sm_path}, on saute"
|
||||
continue
|
||||
fi
|
||||
|
||||
print_info "${sm_path} (${sm_url}) -> ${TAG_NAME} sur branche ${sm_branch}"
|
||||
(
|
||||
cd "${sm_path}"
|
||||
git fetch --all --prune >/dev/null 2>&1 || true
|
||||
ensure_branch_checked_out "${sm_branch}"
|
||||
tag_current_repo "${TAG_NAME}"
|
||||
) || print_warn "échec sur ${sm_path}, on continue"
|
||||
done
|
||||
}
|
||||
|
||||
main() {
|
||||
cd "${ROOT_DIR}"
|
||||
tag_root_repo
|
||||
tag_submodules
|
||||
print_info "terminé: ${TAG_NAME} posé sur le repo racine et submodules accessibles"
|
||||
}
|
||||
|
||||
main "$@"
|
26
tests/ci_dev_test.md
Normal file
26
tests/ci_dev_test.md
Normal file
@ -0,0 +1,26 @@
|
||||
# Plan de tests CI "dev-test"
|
||||
|
||||
## Objectifs
|
||||
|
||||
- Vérifier que le tag `dev-test` déclenche le workflow.
|
||||
- Vérifier la synchronisation des submodules sur leurs branches.
|
||||
- Vérifier la construction et le push des images Docker pour les submodules avec `Dockerfile`.
|
||||
|
||||
## Pré-requis
|
||||
|
||||
- Secrets `REGISTRY_USERNAME` et `REGISTRY_PASSWORD` configurés.
|
||||
- Accès au registry `git.4nkweb.com`.
|
||||
|
||||
## Scénarios
|
||||
|
||||
1. Tag `dev-test` sur le dépôt parent
|
||||
- Attendu: workflow lancé, logs de sync visibles.
|
||||
2. Submodule avec `Dockerfile`
|
||||
- Attendu: image buildée et poussée avec tag `dev-test`.
|
||||
3. Submodule sans `Dockerfile`
|
||||
- Attendu: ignoré proprement.
|
||||
|
||||
## Vérifications
|
||||
|
||||
- Présence des images `git.4nkweb.com/4nk/<submodule>:dev-test` dans le registry.
|
||||
- Logs d’exécution sans erreurs fatales.
|
@ -1,38 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
CSV_FILE="repos.csv"
|
||||
IFS=,
|
||||
while read -r name url type target directory; do
|
||||
if [ "$name" = "name" ]; then continue; fi
|
||||
echo "\n[Repo] $name -> $directory"
|
||||
if [ ! -d "$directory" ]; then
|
||||
echo "[Clone] $url"
|
||||
git clone --progress "$url" "$directory" || true
|
||||
fi
|
||||
echo "[Fetch] $directory"
|
||||
git -C "$directory" fetch --all --prune --tags --progress || true
|
||||
case "$type" in
|
||||
branch)
|
||||
echo "[Checkout] $target"
|
||||
if git -C "$directory" show-ref --verify --quiet "refs/remotes/origin/$target"; then
|
||||
git -C "$directory" checkout "$target" 2>/dev/null || git -C "$directory" checkout -B "$target" "origin/$target"
|
||||
git -C "$directory" reset --hard "origin/$target"
|
||||
else
|
||||
echo "[Warn] Branche $target introuvable pour $name"
|
||||
fi
|
||||
;;
|
||||
create_from)
|
||||
base="${target%%->*}"
|
||||
newb="${target##*->}"
|
||||
echo "[Create] $newb depuis $base"
|
||||
if git -C "$directory" show-ref --verify --quiet "refs/remotes/origin/$base"; then
|
||||
git -C "$directory" checkout -B "$newb" "origin/$base"
|
||||
else
|
||||
echo "[Error] Base $base introuvable pour $name"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "[Warn] Type inconnu: $type"
|
||||
;;
|
||||
esac
|
||||
done < "$CSV_FILE"
|
Loading…
x
Reference in New Issue
Block a user