docs(configuration,architecture): document tags :dev en cours de création; chore(compose): montages logs et torrc; network: ipam + hostnames

This commit is contained in:
Debian 2025-09-08 14:06:54 +00:00
parent 29a07760a1
commit 17e8b50f7a
51 changed files with 1098 additions and 503 deletions

View File

@ -105,5 +105,7 @@ backups/sql/
!AGENTS.md
certs/
log/
*/certs/
*/log/
*/conf/
*/archive/

4
.gitignore vendored
View File

@ -1,3 +1,5 @@
archive/
# Dépendances
node_modules/
@ -17,7 +19,6 @@ pnpm-debug.log*
# Environnements
.env
.env.*
# Éditeurs / OS
.DS_Store
@ -32,7 +33,6 @@ tests/reports/
*.backup
certs/
log/
*.log
# Ignore real configuration files, but keep example configs
*.conf

View File

@ -1,4 +1,11 @@
## Changed (2025-09-08)
# Changelog - 4NK Node
## [1.1.3] - 2025-09-07
### Added
- Mise à jour mineure de versionnage et documentation (ALIGNEMENT VERSION / TESTS)
## [1.1.2] - 2025-08-27
### Added

View File

@ -1 +1 @@
v2025.08.5
v2025.08.6

View File

@ -1 +1 @@
v1.1.2
v1.1.3

View File

@ -1,54 +0,0 @@
# Configuration Bitcoin Core Signet pour Docker 4NK_node
# Configuration globale
datadir=/home/bitcoin/.bitcoin
server=1
txindex=1
debug=1
loglevel=debug
logthreadnames=1
signet=1
onion=4nk-tor:9050
listenonion=1
proxy=4nk-tor:9050
listen=1
# Paramètres RPC
rpcuser=EXEMPLE
rpcpassword=EXEMPLE
rpcallowip=172.18.0.0/16
rpcworkqueue=32
rpcthreads=4
rpcdoccheck=1
# Paramètres ZMQ
zmqpubhashblock=tcp://0.0.0.0:29000
zmqpubrawtx=tcp://0.0.0.0:29000
# Configuration spécifique du signet custom
[signet]
whitelist=download@127.0.0.1
txindex=1
proxy=4nk-tor:9050
listenonion=1
listen=1
signetchallenge=0020341c43803863c252df326e73574a27d7e19322992061017b0dc893e2eab90821
# Nœuds onion du réseau signet custom
addnode=6xi33lwwslsx3yi3f7c56wnqtdx4v73vj2up3prrwebpwbz6qisnqbyd.onion:38333
addnode=d6i546e2sjezhyy2eupyc2wqtbgjnkubcjd4prhqurtlmp7nsp6yxqyd.onion:38333
# Ports Signet (P2P et RPC)
port=38333
rpcport=38332
rpcbind=0.0.0.0
rpcuser=bitcoin
rpcpassword=bitcoin
fallbackfee=0.0001
zmqpubrawblock=tcp://0.0.0.0:29000
zmqpubrawtx=tcp://0.0.0.0:29000
#zmqpubhashtx=tcp://0.0.0.0:29000
zmqpubhashblock=tcp://0.0.0.0:29000
#zmqpubsequence=tcp://0.0.0.0:29000
blockfilterindex=1

View File

@ -1,25 +0,0 @@
# Configuration pour blindbit-oracle
host = "0.0.0.0:8000"
# Définit la chaîne sur laquelle le wallet fonctionne
chain = "signet"
# Point d'accès RPC Bitcoin (sans cookie, autorisé par rpcallowip)
rpc_endpoint = "http://4nk-bitcoin:38332"
# Auth RPC Bitcoin
rpc_user = "bitcoin"
rpc_pass = "bitcoin"
# Hauteur de départ pour la synchronisation
sync_start_height = 1
# Paramètres de performance
max_parallel_tweak_computations = 4
max_parallel_requests = 4
# Configuration des index
tweaks_only = 0
tweaks_full_basic = 1
tweaks_full_with_dust_filter = 1
tweaks_cut_through_with_dust_filter = 1

View File

@ -1,25 +0,0 @@
# Configuration pour blindbit-oracle
host = "0.0.0.0:8000"
# Définit la chaîne sur laquelle le wallet fonctionne
chain = "signet"
# Point d'accès RPC Bitcoin (sans cookie, autorisé par rpcallowip)
rpc_endpoint = "http://4nk-bitcoin:38332"
# Auth RPC Bitcoin
rpc_user = "EXEMPLE"
rpc_pass = "EXEMPLE"
# Hauteur de départ pour la synchronisation
sync_start_height = 1
# Paramètres de performance
max_parallel_tweak_computations = 4
max_parallel_requests = 4
# Configuration des index
tweaks_only = 0
tweaks_full_basic = 1
tweaks_full_with_dust_filter = 1
tweaks_cut_through_with_dust_filter = 1

View File

@ -1,22 +0,0 @@
# Configuration sdk_relay pour Docker
# Services connectés via réseau Docker
# Bitcoin Core RPC (sans cookie, autorisé par rpcallowip)
core_url=http://4nk-bitcoin:38332
rpc_user=EXEMPLE
rpc_password=EXEMPLE
# core_wallet=relay_wallet
ws_url=0.0.0.0:8090
http_url=0.0.0.0:8091
wallet_name=relay_wallet.json
network=signet
blindbit_url=http://blindbit:8000
zmq_url=tcp://4nk-bitcoin:29000
data_dir=.4nk
# cookie non utilisé
# Mode développement
dev_mode=true
standalone=true
blindbit_enabled=true
relay_id=relay-1

View File

@ -1,22 +0,0 @@
# Configuration sdk_relay pour Docker
# Services connectés via réseau Docker
# Bitcoin Core RPC (sans cookie, autorisé par rpcallowip)
core_url=http://4nk-bitcoin:38332
rpc_user=EXEMPLE
rpc_password=EXEMPLE
core_wallet=relay_wallet
ws_url=0.0.0.0:8090
http_url=0.0.0.0:8091
wallet_name=relay_wallet.json
network=signet
blindbit_url=http://blindbit:8000
zmq_url=tcp://4nk-bitcoin:29000
data_dir=.4nk
# cookie non utilisé
# Mode développement
dev_mode=true
standalone=true
blindbit_enabled=true
relay_id=relay-2

View File

@ -1,22 +0,0 @@
# Configuration sdk_relay pour Docker
# Services connectés via réseau Docker
# Bitcoin Core RPC (sans cookie, autorisé par rpcallowip)
core_url=http://4nk-bitcoin:38332
rpc_user=EXEMPLE
rpc_password=EXEMPLE
core_wallet=relay_wallet
ws_url=0.0.0.0:8090
http_url=0.0.0.0:8091
wallet_name=relay_wallet.json
network=signet
blindbit_url=http://blindbit:8000
zmq_url=tcp://4nk-bitcoin:29000
data_dir=.4nk
# cookie non utilisé
# Mode développement
dev_mode=true
standalone=true
blindbit_enabled=true
relay_id=relay-3

View File

@ -4,29 +4,36 @@ version: '3.8'
services:
tor:
image: 4nk-node-tor:latest
image: torproject/tor:latest
container_name: 4nk-tor
hostname: tor.4nk.local
ports:
- "9050:9050"
- "9051:9051"
volumes:
- tor_data:/var/lib/tor
- ./modules/tor/conf/tor.conf:/etc/tor/torrc:ro
- ./modules/tor/data:/var/lib/tor
- ./modules/tor/log:/var/log/tor
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.10
restart: unless-stopped
bitcoin:
image: 4nk-node-bitcoin:latest
image: ruimarinho/bitcoin-core:latest
container_name: 4nk-bitcoin
hostname: bitcoin.4nk.local
ports:
- "38333:38333"
- "38332:38332"
- "29000:29000"
volumes:
- bitcoin_data:/home/bitcoin/.bitcoin
- ./conf/bitcoin.conf:/home/bitcoin/bitcoin.conf:ro
- ./modules/bitcoin/data:/home/bitcoin/.bitcoin
- ./modules/bitcoin/conf/bitcoin.conf:/home/bitcoin/.bitcoin/bitcoin.conf:ro
- ./modules/bitcoin/logs:/home/bitcoin/.bitcoin/logs
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.11
restart: unless-stopped
depends_on:
- tor
@ -34,6 +41,7 @@ services:
blindbit:
image: 4nk-node-blindbit:latest
container_name: 4nk-blindbit
hostname: blindbit.4nk.local
ports:
- "8000:8000"
@ -50,9 +58,12 @@ services:
command: ["/main", "--datadir", "/blindbit"]
working_dir: /
volumes:
- ./conf/blindbit.toml:/blindbit/blindbit.toml:ro
- ./modules/blindbit/conf/blindbit.toml:/blindbit/blindbit.toml:ro
- ./modules/blindbit/data:/blindbit
- ./modules/blindbit/logs:/blindbit/logs
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.12
restart: unless-stopped
depends_on:
- bitcoin
@ -64,14 +75,17 @@ services:
start_period: 40s
sdk_storage:
image: 4nk-node-sdk_storage:docker-support-v2
image: 4nk-node-sdk_storage:dev
container_name: 4nk-sdk-storage
hostname: sdk-storage.4nk.local
ports:
- "8081:8081"
volumes:
- ./conf/sdk_storage.conf:/usr/local/bin/sdk_storage.conf:ro
- ./modules/sdk_storage/conf/sdk_storage.conf:/usr/local/bin/sdk_storage.conf:ro
- ./modules/sdk_storage/log:/app/logs
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.13
restart: unless-stopped
depends_on:
- blindbit
@ -83,8 +97,9 @@ services:
start_period: 40s
sdk_relay1:
image: 4nk-node-sdk_relay1:docker-support-v2
image: 4nk-node-sdk_relay1:dev
container_name: 4nk-sdk-relay1
hostname: sdk-relay1.4nk.local
ports:
- "8090:8090"
- "8091:8091"
@ -92,10 +107,12 @@ services:
- RELAY_RPC_USER=bitcoin
- RELAY_RPC_PASSWORD=bitcoin
volumes:
- ./conf/sdk_relay1.conf:/home/bitcoin/.conf:ro
- ./modules/sdk_relay1/conf/sdk_relay1.conf:/home/bitcoin/.conf:ro
- ./modules/sdk_relay1/logs:/home/bitcoin/logs
working_dir: /home/bitcoin
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.14
restart: unless-stopped
depends_on:
- sdk_storage
@ -107,8 +124,9 @@ services:
start_period: 40s
sdk_relay2:
image: 4nk-node-sdk_relay2:docker-support-v2
image: 4nk-node-sdk_relay2:dev
container_name: 4nk-sdk-relay2
hostname: sdk-relay2.4nk.local
ports:
- "8092:8090"
- "8093:8091"
@ -116,10 +134,12 @@ services:
- RELAY_RPC_USER=bitcoin
- RELAY_RPC_PASSWORD=bitcoin
volumes:
- ./conf/sdk_relay2.conf:/home/bitcoin/.conf:ro
- ./modules/sdk_relay2/conf/sdk_relay2.conf:/home/bitcoin/.conf:ro
- ./modules/sdk_relay2/logs:/home/bitcoin/logs
working_dir: /home/bitcoin
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.15
restart: unless-stopped
depends_on:
- sdk_storage
@ -131,8 +151,9 @@ services:
start_period: 40s
sdk_relay3:
image: 4nk-node-sdk_relay3:docker-support-v2
image: 4nk-node-sdk_relay3:dev
container_name: 4nk-sdk-relay3
hostname: sdk-relay3.4nk.local
ports:
- "8094:8090"
- "8095:8091"
@ -140,10 +161,12 @@ services:
- RELAY_RPC_USER=bitcoin
- RELAY_RPC_PASSWORD=bitcoin
volumes:
- ./conf/sdk_relay3.conf:/home/bitcoin/.conf:ro
- ./modules/sdk_relay3/conf/sdk_relay3.conf:/home/bitcoin/.conf:ro
- ./modules/sdk_relay3/logs:/home/bitcoin/logs
working_dir: /home/bitcoin
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.16
restart: unless-stopped
depends_on:
- sdk_storage
@ -155,15 +178,18 @@ services:
start_period: 40s
sdk_signer:
image: 4nk-node-sdk_signer:docker-support-v2
image: 4nk-node-sdk_signer:dev
container_name: 4nk-sdk-signer
hostname: sdk-signer.4nk.local
ports:
- "9090:9090"
volumes:
- ./conf/sdk_signer.conf:/usr/local/bin/sdk_signer.conf:ro
- sdk_signer_data:/app/data
- ./modules/sdk_signer/conf/sdk_signer.conf:/usr/local/bin/sdk_signer.conf:ro
- ./modules/sdk_signer/data:/app/data
- ./modules/sdk_signer/logs:/usr/src/app/logs
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.17
restart: unless-stopped
depends_on:
- sdk_relay1
@ -177,13 +203,17 @@ services:
start_period: 40s
ihm_client:
image: 4nk-node-ihm_client:docker-support-v2
image: 4nk-node-ihm_client:dev
container_name: 4nk-ihm-client
hostname: ihm-client.4nk.local
ports:
- "8080:80"
- "3003:3003"
volumes:
- ./modules/ihm_client/logs:/var/log/ihm_client
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.18
restart: unless-stopped
depends_on:
- sdk_signer
@ -197,6 +227,7 @@ services:
miniback-postgres:
image: postgres:15
container_name: miniback-postgres
hostname: miniback-postgres.4nk.local
environment:
- POSTGRES_USER=miniback
- POSTGRES_PASSWORD=minibackpassword
@ -204,45 +235,59 @@ services:
volumes:
- miniback_pg_data:/var/lib/postgresql/data
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.30
restart: unless-stopped
ports:
- "5432:5432"
miniback:
image: 4nk-node-miniback:latest
image: 4nk-node-miniback:dev
container_name: miniback
hostname: miniback.4nk.local
env_file:
- ./conf/lecoffre-back-mini_env.conf
- ./projects/lecoffre/lecoffre-back-mini/conf/lecoffre-back-mini_env.conf
depends_on:
- miniback-postgres
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.31
restart: unless-stopped
volumes:
- ./logs/miniback:/logs
- ./conf/lecoffre-back-mini_env.conf:/app/.env:ro
- ./projects/lecoffre/lecoffre-back-mini/logs:/logs
- ./projects/lecoffre/lecoffre-back-mini/conf/lecoffre-back-mini_env.conf:/app/.env:ro
coffre_front:
image: lecoffre-front:latest
image: lecoffre-front:dev
container_name: coffre-front
hostname: coffre-front.4nk.local
volumes:
- ./projects/lecoffre/lecoffre-front/logs:/logs
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.32
restart: unless-stopped
coffre_back_mini:
image: lecoffre-back-mini:latest
image: lecoffre-back-mini:dev
container_name: coffre-back-mini
hostname: coffre-back-mini.4nk.local
networks:
- 4nk_network
4nk_network:
ipv4_address: 172.20.0.33
restart: unless-stopped
volumes:
tor_data:
bitcoin_data:
sdk_signer_data:
miniback_pg_data:
networks:
4nk_network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
4nk_projects_net:
driver: bridge
ipam:
config:
- subnet: 172.21.0.0/16

View File

@ -11,3 +11,10 @@
## Sécurité
## Observabilité
### Politique des images
- Externes : Tor (`torproject/tor:latest`), Bitcoin Core (`ruimarinho/bitcoin-core:latest`), Blindbit (`4nk-node-blindbit:latest`).
- Internes : images taguées `:dev` en cours de création (sdk_storage, sdk_relay1/2/3, sdk_signer, ihm_client, miniback, lecoffre-front, lecoffre-back-mini).
Les hostnames internes sont fixés en `.4nk.local` et une IP statique est réservée par service sur `4nk_network`.

34
docs/CONFIGURATION.md Normal file
View File

@ -0,0 +1,34 @@
## Configuration des images et tags
### Introduction
Ce document précise l'état courant de la politique de tags d'images et leur utilisation dans l'orchestrateur de `4NK_node`.
### Politique de tags (en cours de création)
- Les tags de build « dev » sont en cours de création pour les services applicatifs internes.
- À date, l'orchestrateur référence :
- Images externes stables (inchangées) : `torproject/tor:latest`, `ruimarinho/bitcoin-core:latest` et `4nk-node-blindbit:latest`.
- Images internes basculées sur le tag « dev » (en attente de disponibilité sur le registre) :
- `4nk-node-sdk_storage:dev`
- `4nk-node-sdk_relay1:dev`, `4nk-node-sdk_relay2:dev`, `4nk-node-sdk_relay3:dev`
- `4nk-node-sdk_signer:dev`
- `4nk-node-ihm_client:dev`
- `4nk-node-miniback:dev`
- `lecoffre-front:dev`, `lecoffre-back-mini:dev`
Lorsque les tags « dev » seront effectivement publiés, un `docker compose pull` puis un redémarrage permettront d'aligner les environnements.
### Réseaux et adresses
- Réseau principal `4nk_network` : `172.20.0.0/16`, IP et hostnames statiques par service.
- Réseau réservé projets `4nk_projects_net` : `172.21.0.0/16` (aucun service attaché pour l'instant).
### Montages de configuration et journaux
- Les fichiers de configuration sont montés depuis `modules/*/conf` et `projects/*/*/conf`.
- Les journaux applicatifs sont montés depuis `modules/*/logs` et `projects/*/*/logs` pour observabilité.
### Conclusion
Les tags « dev » sont en cours de création et déjà référencés dans l'orchestrateur afin d'anticiper leur disponibilité. Cette page sera actualisée dès publication effective. Les mises à jour corrélées sont reflétées dans `docs/ARCHITECTURE.md` et le `CHANGELOG.md`.

13
docs/NETWORK.md Normal file
View File

@ -0,0 +1,13 @@
tor: hostname=tor.4nk.local, ip=172.20.0.10
bitcoin: hostname=bitcoin.4nk.local, ip=172.20.0.11
blindbit: hostname=blindbit.4nk.local, ip=172.20.0.12
sdk_storage: hostname=sdk-storage.4nk.local, ip=172.20.0.13
sdk_relay1: hostname=sdk-relay1.4nk.local, ip=172.20.0.14
sdk_relay2: hostname=sdk-relay2.4nk.local, ip=172.20.0.15
sdk_relay3: hostname=sdk-relay3.4nk.local, ip=172.20.0.16
sdk_signer: hostname=sdk-signer.4nk.local, ip=172.20.0.17
ihm_client: hostname=ihm-client.4nk.local, ip=172.20.0.18
miniback-postgres: hostname=miniback-postgres.4nk.local, ip=172.20.0.30
miniback: hostname=miniback.4nk.local, ip=172.20.0.31
coffre_front: hostname=coffre-front.4nk.local, ip=172.20.0.32
coffre_back_mini: hostname=coffre-back-mini.4nk.local, ip=172.20.0.33

5
docs/RELEASE_NOTES.md Normal file
View File

@ -0,0 +1,5 @@
# Release 1.1.3 - 2025-09-07
- Mise à jour des versions `VERSION` et `TEMPLATE_VERSION`.
- Ajout des notes de release dédiées dans `docs/RELEASE_NOTES.md` et `tests/RELEASE_NOTES.md`.
- Mise à jour du changelog pour refléter cette release.

View File

@ -22,6 +22,9 @@ services:
- ./log/promtail-config.yml:/etc/promtail/config.yml:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/log/docker:/var/log/docker:ro
- ./modules:/workspace/modules:ro
- ./projects:/workspace/projects:ro
- ./log:/workspace/logs:ro
networks:
- 4nk_network
restart: unless-stopped

203
log/README.md Normal file
View File

@ -0,0 +1,203 @@
# 📊 Monitoring des Logs 4NK_node
Ce répertoire contient la configuration complète pour surveiller et analyser les logs de tous les services 4NK_node en temps réel.
## 🚀 Démarrage Rapide
### 1. Démarrer le monitoring
```bash
cd 4NK_node
./log/start-monitoring.sh
```
### 2. Accéder à Grafana
- **URL**: http://localhost:3000
- **Utilisateur**: `admin`
- **Mot de passe**: `admin`
### 3. Dashboard principal
Le dashboard principal est automatiquement configuré et accessible à :
http://localhost:3000/d/4nk-node-logs/4nk-node-vue-d-ensemble-des-logs
## 🏗️ Architecture
```
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Services │ │ Promtail │ │ Loki │
│ 4NK_node │───▶│ (Collecteur) │───▶│ (Stockage) │
│ │ │ │ │ │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │
▼ ▼
┌─────────────────┐ ┌─────────────────┐
│ Grafana │ │ Dashboards │
│ (Visualisation) │◄───│ (Analyses) │
└─────────────────┘ └─────────────────┘
```
## 📁 Structure des Fichiers
```
log/
├── README.md # Ce fichier
├── start-monitoring.sh # Script de démarrage
├── log-monitoring.yml # Docker Compose pour le monitoring
├── loki-config.yaml # Configuration Loki
├── promtail-config.yml # Configuration Promtail
├── grafana-datasources.yml # Sources de données Grafana
├── grafana-dashboards.yml # Configuration des dashboards
└── dashboards/
└── 4nk-node-overview.json # Dashboard principal
```
## 🔧 Services de Monitoring
### Loki (Port 3100)
- **Rôle**: Stockage et indexation des logs
- **Fonctionnalités**: Requêtes LogQL, rétention configurable
- **Stockage**: Fichiers locaux avec compression
### Promtail (Port 9080)
- **Rôle**: Collecte des logs Docker
- **Fonctionnalités**: Parsing JSON, étiquetage automatique
- **Collecte**: Logs de tous les conteneurs 4NK_node
### Grafana (Port 3000)
- **Rôle**: Interface de visualisation
- **Fonctionnalités**: Dashboards, alertes, requêtes temps réel
- **Accès**: Interface web avec authentification
## 📊 Dashboards Disponibles
### Dashboard Principal : "4NK Node - Vue d'ensemble des Logs"
- **Log Rate par Service**: Graphique temporel des logs par service
- **Total Logs (5m)**: Statistique du nombre total de logs
- **Logs en Temps Réel**: Affichage en direct des logs de tous les services
- **Répartition par Service**: Graphique circulaire des logs par service
- **Répartition par Niveau**: Graphique circulaire des logs par niveau (info, error, debug)
## 🔍 Requêtes LogQL Utiles
### Logs d'un service spécifique
```logql
{job="4nk_node", service="bitcoin"}
```
### Logs d'erreur
```logql
{job="4nk_node"} |= "error"
```
### Logs des dernières 5 minutes
```logql
{job="4nk_node"} [5m]
```
### Recherche de texte
```logql
{job="4nk_node"} |~ "connection.*failed"
```
## 🛠️ Commandes Utiles
### Démarrer le monitoring
```bash
docker compose -f log-monitoring.yml up -d
```
### Voir les logs des services de monitoring
```bash
docker compose -f log-monitoring.yml logs -f
```
### Arrêter le monitoring
```bash
docker compose -f log-monitoring.yml down
```
### Redémarrer un service spécifique
```bash
docker compose -f log-monitoring.yml restart grafana
```
### Vérifier le statut
```bash
docker compose -f log-monitoring.yml ps
```
## 📈 Métriques Surveillées
### Services 4NK_node
- **bitcoin**: Logs de synchronisation, connexions RPC
- **blindbit**: Logs de traitement des blocs, erreurs
- **sdk_relay1/2/3**: Logs de connexion Bitcoin, erreurs RPC
- **sdk_signer**: Logs de connexion aux relays, erreurs WebSocket
- **sdk_storage**: Logs de base de données, erreurs de stockage
- **ihm_client**: Logs de l'interface utilisateur
- **tor**: Logs de connexion, erreurs de proxy
### Niveaux de Log
- **INFO**: Informations générales, statut des services
- **ERROR**: Erreurs critiques, échecs de connexion
- **DEBUG**: Informations détaillées pour le débogage
- **WARN**: Avertissements, problèmes non critiques
## 🔒 Sécurité
- **Grafana**: Authentification requise (admin/admin)
- **Loki**: Pas d'authentification (accès local uniquement)
- **Promtail**: Pas d'authentification (collecte locale uniquement)
- **Ports exposés**: 3000 (Grafana), 3100 (Loki), 9080 (Promtail)
## 🚨 Dépannage
### Grafana ne démarre pas
```bash
docker compose -f log-monitoring.yml logs grafana
```
### Promtail ne collecte pas de logs
```bash
docker compose -f log-monitoring.yml logs promtail
```
### Loki ne stocke pas de logs
```bash
docker compose -f log-monitoring.yml logs loki
```
### Vérifier les permissions
```bash
ls -la log/
chmod +x log/start-monitoring.sh
```
## 📝 Personnalisation
### Ajouter un nouveau service
1. Modifier `promtail-config.yml`
2. Ajouter une nouvelle section `static_configs`
3. Redémarrer Promtail
### Créer un nouveau dashboard
1. Créer un fichier JSON dans `dashboards/`
2. Modifier `grafana-dashboards.yml` si nécessaire
3. Redémarrer Grafana
### Modifier la rétention des logs
1. Modifier `loki-config.yaml`
2. Ajuster `retention_period` et `chunk_retain_period`
3. Redémarrer Loki
## 🌟 Fonctionnalités Avancées
- **Alertes**: Configuration d'alertes sur des patterns de logs
- **Rétention**: Gestion automatique de la rétention des logs
- **Compression**: Compression automatique des anciens logs
- **Recherche**: Recherche full-text dans tous les logs
- **Filtrage**: Filtrage par service, niveau, timestamp
- **Export**: Export des logs en différents formats
---
**Note**: Ce système de monitoring est conçu pour un environnement de développement. Pour la production, considérez l'ajout d'authentification et de chiffrement.

View File

@ -0,0 +1,347 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": null,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"axisLabel": "",
"axisPlacement": "auto",
"barAlignment": 0,
"drawStyle": "line",
"fillOpacity": 10,
"gradientMode": "none",
"hideFrom": {
"legend": false,
"tooltip": false,
"vis": false
},
"lineInterpolation": "linear",
"lineWidth": 1,
"pointSize": 5,
"scaleDistribution": {
"type": "linear"
},
"showPoints": "never",
"spanNulls": false,
"stacking": {
"group": "A",
"mode": "none"
},
"thresholdsStyle": {
"mode": "off"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
},
"unit": "short"
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"editorMode": "code",
"expr": "rate({job=\"4nk_node\"} [5m])",
"queryType": "",
"refId": "A"
}
],
"title": "Log Rate par Service",
"type": "timeseries"
},
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"id": 2,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "10.0.0",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"editorMode": "code",
"expr": "count_over_time({job=\"4nk_node\"} [5m])",
"queryType": "",
"refId": "A"
}
],
"title": "Total Logs (5m)",
"type": "stat"
},
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 8
},
"id": 3,
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": false,
"showCommonLabels": false,
"showLabels": false,
"showTime": false,
"sortOrder": "Descending",
"wrapLogMessage": false
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"editorMode": "code",
"expr": "{job=\"4nk_node\"} | json | line_format \"{{.service}}: {{.msg}}\"",
"maxLines": 100,
"queryType": "",
"refId": "A"
}
],
"title": "Logs en Temps Réel - Tous les Services",
"type": "logs"
},
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "palette-classic"
},
"custom": {
"hideFrom": {
"legend": false,
"tooltip": false,
"vis": false
}
},
"mappings": []
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 16
},
"id": 4,
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"editorMode": "code",
"expr": "count_over_time({job=\"4nk_node\"} [5m]) by (service)",
"queryType": "",
"refId": "A"
}
],
"title": "Répartition des Logs par Service",
"type": "piechart"
},
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 16
},
"id": 5,
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"pieType": "pie",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"editorMode": "code",
"expr": "count_over_time({job=\"4nk_node\"} [5m]) by (level)",
"queryType": "",
"refId": "A"
}
],
"title": "Répartition des Logs par Niveau",
"type": "piechart"
}
],
"refresh": "5s",
"schemaVersion": 38,
"style": "dark",
"tags": [
"4nk_node",
"monitoring",
"logs"
],
"templating": {
"list": []
},
"time": {
"from": "now-1h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "4NK Node - Vue d'ensemble des Logs",
"uid": "4nk-node-logs",
"version": 1,
"weekStart": ""
}

View File

@ -0,0 +1,13 @@
apiVersion: 1
providers:
- name: '4NK Dashboards'
orgId: 1
folder: '4NK'
type: file
disableDeletion: false
editable: true
updateIntervalSeconds: 30
options:
path: /etc/grafana/provisioning/dashboards/dashboards
EOF

View File

@ -0,0 +1,11 @@
apiVersion: 1
datasources:
- name: Loki
type: loki
access: proxy
url: http://loki:3100
isDefault: true
jsonData:
maxLines: 5000
EOF

45
log/loki-config.yaml Normal file
View File

@ -0,0 +1,45 @@
server:
http_listen_port: 3100
grpc_listen_port: 9096
log_level: info
chunk_target_size: 1048576
schema_config:
configs:
- from: 2020-10-15
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb_shipper:
active_index_directory: /loki/index
cache_location: /loki/boltdb-cache
shared_store: filesystem
filesystem:
directory: /loki/chunks
limits_config:
enforce_metric_name: false
reject_old_samples: true
reject_old_samples_max_age: 168h
chunk_store_config:
max_look_back_period: 168h
compactor:
working_directory: /loki/boltdb-shipper-compactor
shared_store: filesystem
compactor_ring:
kvstore:
store: inmemory
ruler:
storage:
type: local
local:
directory: /loki/rules
ring:
kvstore:
store: inmemory
rule_path: /loki/rules-temp
alertmanager_url: http://localhost:9093
enable_api: true
EOF

32
log/promtail-config.yml Normal file
View File

@ -0,0 +1,32 @@
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /tmp/positions.yaml
clients:
- url: http://loki:3100/loki/api/v1/push
scrape_configs:
- job_name: 4nk_node_core_logs
static_configs:
- targets: [localhost]
labels:
job: 4nk_node_core
__path__: /workspace/logs/**/*.log
- job_name: 4nk_modules_logs
static_configs:
- targets: [localhost]
labels:
job: 4nk_modules
__path__: /workspace/modules/*/logs/**/*.log
- job_name: 4nk_projects_logs
static_configs:
- targets: [localhost]
labels:
job: 4nk_projects
__path__: /workspace/projects/*/*/logs/**/*.log
EOF

49
log/start-monitoring.sh Executable file
View File

@ -0,0 +1,49 @@
#!/bin/bash
# Script de démarrage du monitoring des logs 4NK_node
# Auteur: Assistant IA
# Date: $(date)
echo "🚀 Démarrage du monitoring des logs 4NK_node..."
# Vérifier que nous sommes dans le bon répertoire
if [ ! -f "log-monitoring.yml" ]; then
echo "❌ Erreur: Ce script doit être exécuté depuis le répertoire 4NK_node"
exit 1
fi
# Démarrer les services de monitoring
echo "📊 Démarrage de Loki (stockage des logs)..."
docker compose -f log-monitoring.yml up -d loki
echo "⏳ Attente du démarrage de Loki..."
sleep 10
echo "📥 Démarrage de Promtail (collecte des logs)..."
docker compose -f log-monitoring.yml up -d promtail
echo "⏳ Attente du démarrage de Promtail..."
sleep 5
echo "📈 Démarrage de Grafana (visualisation)..."
docker compose -f log-monitoring.yml up -d grafana
echo "⏳ Attente du démarrage de Grafana..."
sleep 10
# Vérifier le statut des services
echo "🔍 Vérification du statut des services..."
docker compose -f log-monitoring.yml ps
echo ""
echo "✅ Monitoring des logs démarré avec succès !"
echo ""
echo "🌐 Accès aux services :"
echo " - Grafana: http://localhost:3000 (admin/admin)"
echo " - Loki: http://localhost:3100"
echo " - Promtail: http://localhost:9080"
echo ""
echo "📊 Dashboard principal: http://localhost:3000/d/4nk-node-logs/4nk-node-vue-d-ensemble-des-logs"
echo ""
echo "📝 Pour arrêter: docker compose -f log-monitoring.yml down"
echo "📝 Pour voir les logs: docker compose -f log-monitoring.yml logs -f"

View File

@ -1,8 +0,0 @@
FROM alpine:latest
RUN apk add --no-cache bitcoin curl
RUN addgroup -g 1001 bitcoinuser && adduser -D -s /bin/sh -u 1001 -G bitcoinuser bitcoinuser
RUN mkdir -p /home/bitcoin/.bitcoin/signet && chown -R bitcoinuser:bitcoinuser /home/bitcoin
USER bitcoinuser
WORKDIR /home/bitcoin
EXPOSE 38333 18443 29000
CMD ["bitcoind", "-signet", "-conf=/home/bitcoin/bitcoin.conf"]

View File

@ -0,0 +1,69 @@
listen=1
daemon=1
[signet]
whitelist=download@bitcoin.4nk.local
txindex=1
proxy=tor.4nk.local:9050
listenonion=1
signetchallenge=0020341c43803863c252df326e73574a27d7e19322992061017b0dc893e2eab90821
addnode=6xi33lwwslsx3yi3f7c56wnqtdx4v73vj2up3prrwebpwbz6qisnqbyd.onion:38333
addnode=d6i546e2sjezhyy2eupyc2wqtbgjnkubcjd4prhqurtlmp7nsp6yxqyd.onion:38333
fallbackfee=0.0001
zmqpubrawblock=tcp://bitcoin.4nk.local:29000
zmqpubrawtx=tcp://bitcoin.4nk.local:29000
zmqpubhashblock=tcp://bitcoin.4nk.local:29000
blockfilterindex=1
# 0.0.0.0:8000 to expose outside of localhost
# default: "127.0.0.1:8000"
host = "bitcoin.4nk.local:8000"
# Defines on which chain the wallet runs. Allowed values: main, testnet, signet, regtest.
# default: signet
chain = "signet"
# default: http://127.0.0.1:8332
rpc_endpoint = "http://bitcoin.4nk.local:38332"
# required, unless rpc_user and rpc_pass are set
cookie_path = "$HOME/.bitcoin/signet/.cookie"
# required, unless cookie_path is set
rpc_pass = ""
# required, unless cookie_path is set
rpc_user = ""
# required (has to be >= 1)
sync_start_height = 1
# the default for this is 1, but should be set to a higher value to increase performance,
# one should set this in accordance to how many cores one wants to use
max_parallel_tweak_computations = 4
# (depends on max-rpc-workers of the underlying full node)
max_parallel_requests = 4
# optional - will only generate tweaks (still both cut-through and full-index)
# default: 0
tweaks_only = 0
# The base index. Only includes the tweaks. No dust filtering or cut-through possible
# default: 1
tweaks_full_basic = 1
# if this is set a full non-cut-through index will be created.
# This index can be used to filter for dust (?dustLimit=). If this is active the base index will not be created.
# All full index queries will be served from this with or without (?dustLimit=) set in the query.
# default 0
tweaks_full_with_dust_filter = 0
# This index applies cut-through and dust filtering.
# Beware that it will be stored in addition to any full index (with or without dust) if activated.
# It has more storage requirements than the simple indices.
# Currently still requires tweaks_only=0.
# default: 0
tweaks_cut_through_with_dust_filter = 0

View File

@ -1,37 +0,0 @@
# blindbit-oracle/Dockerfile
FROM golang:1.25-alpine as builder
RUN apk add --no-cache git
WORKDIR /app
# Cloner le repo blindbit-oracle
RUN git clone --branch dev --depth 1 https://github.com/setavenger/blindbit-oracle.git .
# Compiler le binaire
RUN if [ -d ./cmd ]; then \
go build -o /go/bin/blindbit-oracle ./cmd/blindbit-oracle; \
else \
go build -o /go/bin/blindbit-oracle ./...; \
fi
# Utiliser debian:bookworm-slim qui contient GLIBC 2.34
FROM debian:bookworm-slim
# Installation des dépendances nécessaires
RUN apt-get update && apt-get install -y ca-certificates curl && rm -rf /var/lib/apt/lists/*
# Copier le binaire depuis le builder
COPY --from=builder /go/bin/blindbit-oracle /usr/local/bin/blindbit-oracle
# Créer le répertoire de données
RUN mkdir -p /data
# Créer le volume pour les données
VOLUME ["/data"]
# Exposer le port par défaut
EXPOSE 8000
# Démarrer blindbit-oracle avec le répertoire de données spécifié
ENTRYPOINT ["blindbit-oracle", "-datadir", "/data"]

View File

@ -0,0 +1,50 @@
# 0.0.0.0:8000 to expose outside of localhost
# default: "127.0.0.1:8000"
host = "blindbit.4nk.local:8000"
# Defines on which chain the wallet runs. Allowed values: main, testnet, signet, regtest.
# default: signet
chain = "signet"
# default: http://bitcoin.4nk.local:8332
rpc_endpoint = "http://bitcoin.4nk.local:38332"
# required, unless rpc_user and rpc_pass are set
cookie_path = "$HOME/.bitcoin/signet/.cookie"
# required, unless cookie_path is set
rpc_pass = ""
# required, unless cookie_path is set
rpc_user = ""
# required (has to be >= 1)
sync_start_height = 1
# the default for this is 1, but should be set to a higher value to increase performance,
# one should set this in accordance to how many cores one wants to use
max_parallel_tweak_computations = 4
# (depends on max-rpc-workers of the underlying full node)
max_parallel_requests = 4
# optional - will only generate tweaks (still both cut-through and full-index)
# default: 0
tweaks_only = 0
# The base index. Only includes the tweaks. No dust filtering or cut-through possible
# default: 1
tweaks_full_basic = 1
# if this is set a full non-cut-through index will be created.
# This index can be used to filter for dust (?dustLimit=). If this is active the base index will not be created.
# All full index queries will be served from this with or without (?dustLimit=) set in the query.
# default 0
tweaks_full_with_dust_filter = 0
# This index applies cut-through and dust filtering.
# Beware that it will be stored in addition to any full index (with or without dust) if activated.
# It has more storage requirements than the simple indices.
# Currently still requires tweaks_only=0.
# default: 0
tweaks_cut_through_with_dust_filter = 0

View File

@ -0,0 +1,50 @@
# 0.0.0.0:8000 to expose outside of localhost
# default: "127.0.0.1:8000"
host = "bitcoin.4nk.local:8000"
# Defines on which chain the wallet runs. Allowed values: main, testnet, signet, regtest.
# default: signet
chain = "signet"
# default: http://bitcoin.4nk.local:8332
rpc_endpoint = "http://bitcoin.4nk.local:38332"
# required, unless rpc_user and rpc_pass are set
cookie_path = "$HOME/.bitcoin/signet/.cookie"
# required, unless cookie_path is set
rpc_pass = ""
# required, unless cookie_path is set
rpc_user = ""
# required (has to be >= 1)
sync_start_height = 1
# the default for this is 1, but should be set to a higher value to increase performance,
# one should set this in accordance to how many cores one wants to use
max_parallel_tweak_computations = 4
# (depends on max-rpc-workers of the underlying full node)
max_parallel_requests = 4
# optional - will only generate tweaks (still both cut-through and full-index)
# default: 0
tweaks_only = 0
# The base index. Only includes the tweaks. No dust filtering or cut-through possible
# default: 1
tweaks_full_basic = 1
# if this is set a full non-cut-through index will be created.
# This index can be used to filter for dust (?dustLimit=). If this is active the base index will not be created.
# All full index queries will be served from this with or without (?dustLimit=) set in the query.
# default 0
tweaks_full_with_dust_filter = 0
# This index applies cut-through and dust filtering.
# Beware that it will be stored in addition to any full index (with or without dust) if activated.
# It has more storage requirements than the simple indices.
# Currently still requires tweaks_only=0.
# default: 0
tweaks_cut_through_with_dust_filter = 0

View File

@ -1,44 +0,0 @@
# Dockerfile: construction des artefacts (dist/) sans serveur — Nginx géré par 4NK_node
FROM node:20-alpine AS builder
WORKDIR /app
# Installation des dépendances système
RUN apk update && apk add --no-cache \
git \
build-base \
python3 \
make \
g++ \
curl \
ca-certificates
# Copie des fichiers de dépendances
COPY package*.json ./
# Installation des dépendances (inclut les devDependencies nécessaires au build)
RUN npm install
# Copie du code source
COPY . .
# Préparation des dépendances wasm (pkg/sdk_client)
ARG SDK_CLIENT_PKG_URL=""
ARG SDK_CLIENT_PKG_TARBALL=""
ARG SDK_CLIENT_PKG_BASE="https://git.4nkweb.com/4nk/ihm_client/raw/branch/docker-support/pkg"
ENV SDK_CLIENT_PKG_URL=${SDK_CLIENT_PKG_URL}
ENV SDK_CLIENT_PKG_TARBALL=${SDK_CLIENT_PKG_TARBALL}
ENV SDK_CLIENT_PKG_BASE=${SDK_CLIENT_PKG_BASE}
RUN chmod +x ./scripts/setup-remote-deps.sh && npm run build_wasm
# Build de l'application
RUN npm run build
# Stage artefacts uniquement (pas de serveur ici)
FROM alpine:3.19 AS dist
WORKDIR /opt/ihm_client
COPY --from=builder /app/dist ./dist
COPY --from=builder /app/package*.json ./
# Conteneur neutre (aucun port exposé, artefacts montables dans 4NK_node)
CMD ["sh", "-c", "echo 'dist prêt dans /opt/ihm_client/dist'; tail -f /dev/null"]

View File

@ -0,0 +1,16 @@
[PROD]
U32_MAX=4294967295
BASEURL="http://ihm-client.4nk.local"
BOOTSTRAPURL=["http://sdk-relay1.4nk.local:8090"]
STORAGEURL="http://sdk-storage.4nk.local/storage"
BLINDBITURL="http://blindbit.4nk.local:8000"
DEFAULTAMOUNT=1000
[DEV]
U32_MAX=4294967295
BASEURL="http://ihm-client.4nk.local"
BOOTSTRAPURL=["http://sdk-relay1.4nk.local:8090"]
STORAGEURL="http://sdk-storage.4nk.local/storage"
BLINDBITURL="http://blindbit.4nk.local:8000"
DEFAULTAMOUNT=1000

View File

@ -0,0 +1,7 @@
const U32_MAX = import.meta.env.U32_MAX;
const BASEURL = import.meta.env.DEV.BASEURL;
const BOOTSTRAPURL = import.meta.env.DEV.BOOTSTRAPURL;
const STORAGEURL = import.meta.env.DEV.STORAGEURL;
const BLINDBITURL = import.meta.env.DEV.BLINDBITURL;
const DEFAULTAMOUNT = import.meta.env.DEV.DEFAULTAMOUNT;
const EMPTY32BYTES = import.meta.env.DEV.EMPTY32BYTES;

View File

@ -1,46 +0,0 @@
FROM rust:1.75-alpine AS builder
# Install build dependencies
RUN apk add --no-cache musl-dev openssl-dev
# Set working directory
WORKDIR /app
# Copy source code
COPY . .
# Build the application
RUN cargo build --release
# Runtime stage
FROM alpine:latest
# Install runtime dependencies
RUN apk add --no-cache libgcc
# Create app user
RUN addgroup -g 1001 appuser && adduser -D -s /bin/sh -u 1001 -G appuser appuser
# Set working directory
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/target/release/sdk_relay /usr/local/bin/sdk_relay
# Configuration file will be mounted via docker-compose
# Set permissions
RUN chown -R appuser:appuser /app
# Switch to app user
USER appuser
# Expose ports
EXPOSE 8090 8091
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD wget --quiet --tries=1 --timeout=5 --spider http://localhost:8091 || exit 1
# Run the application
CMD ["/usr/local/bin/sdk_relay"]

View File

@ -0,0 +1,6 @@
core_url="http://bitcoin.4nk.local:38332"
ws_url="sdk-relay1.4nk.local:8090"
wallet_name="default"
network="signet"
blindbit_url="http://blindbit.4nk.local:8000"
zmq_url="tcp://bitcoin.4nk.local:29000"

View File

@ -1,46 +0,0 @@
FROM rust:1.75-alpine AS builder
# Install build dependencies
RUN apk add --no-cache musl-dev openssl-dev
# Set working directory
WORKDIR /app
# Copy source code
COPY . .
# Build the application
RUN cargo build --release
# Runtime stage
FROM alpine:latest
# Install runtime dependencies
RUN apk add --no-cache libgcc
# Create app user
RUN addgroup -g 1001 appuser && adduser -D -s /bin/sh -u 1001 -G appuser appuser
# Set working directory
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/target/release/sdk_relay /usr/local/bin/sdk_relay
# Configuration file will be mounted via docker-compose
# Set permissions
RUN chown -R appuser:appuser /app
# Switch to app user
USER appuser
# Expose ports
EXPOSE 8090 8091
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD wget --quiet --tries=1 --timeout=5 --spider http://localhost:8091 || exit 1
# Run the application
CMD ["/usr/local/bin/sdk_relay"]

View File

@ -0,0 +1,6 @@
core_url="http://bitcoin.4nk.local:38332"
ws_url="sdk-relay1.4nk.local:8090"
wallet_name="default"
network="signet"
blindbit_url="http://blindbit.4nk.local:8000"
zmq_url="tcp://bitcoin.4nk.local:29000"

View File

@ -1,46 +0,0 @@
FROM rust:1.75-alpine AS builder
# Install build dependencies
RUN apk add --no-cache musl-dev openssl-dev
# Set working directory
WORKDIR /app
# Copy source code
COPY . .
# Build the application
RUN cargo build --release
# Runtime stage
FROM alpine:latest
# Install runtime dependencies
RUN apk add --no-cache libgcc
# Create app user
RUN addgroup -g 1001 appuser && adduser -D -s /bin/sh -u 1001 -G appuser appuser
# Set working directory
WORKDIR /app
# Copy binary from builder
COPY --from=builder /app/target/release/sdk_relay /usr/local/bin/sdk_relay
# Configuration file will be mounted via docker-compose
# Set permissions
RUN chown -R appuser:appuser /app
# Switch to app user
USER appuser
# Expose ports
EXPOSE 8090 8091
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD wget --quiet --tries=1 --timeout=5 --spider http://localhost:8091 || exit 1
# Run the application
CMD ["/usr/local/bin/sdk_relay"]

View File

@ -0,0 +1,6 @@
core_url="http://bitcoin.4nk.local:38332"
ws_url="sdk-relay1.4nk.local:8090"
wallet_name="default"
network="signet"
blindbit_url="http://blindbit.4nk.local:8000"
zmq_url="tcp://bitcoin.4nk.local:29000"

View File

@ -1,17 +0,0 @@
FROM node:18-slim AS builder
WORKDIR /usr/src/app
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json ./
COPY src ./src
COPY pkg ./pkg
RUN npm run build
FROM node:18-slim
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/package.json ./package.json
COPY --from=builder /usr/src/app/node_modules ./node_modules
EXPOSE 9090
ENV PORT=9090
CMD ["node","dist/index.js"]

View File

@ -11,8 +11,8 @@ blindbit_url = "http://4nk-blindbit:8000"
bitcoin_rpc_url = "http://4nk-bitcoin:38332"
# Authentification Bitcoin
bitcoin_rpc_user = "EXEMPLE"
bitcoin_rpc_password = "EXEMPLE"
bitcoin_rpc_user = "bitcoin"
bitcoin_rpc_password = "bitcoin"
# Mode développement
dev_mode = true
@ -24,7 +24,7 @@ timeout = 30
# Logging
log_level = "info"
log_file = "/home/bitcoin/logs/sdk_signer.log"
log_file = "$HOME/bitcoin/logs/sdk_signer.log"
# Sécurité
enable_tls = false

View File

@ -1,19 +0,0 @@
# syntax=docker/dockerfile:1
FROM rust:1 as builder
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY src ./src
RUN cargo build --release
FROM debian:stable-slim
RUN useradd -m -u 10001 appuser && \
apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/target/release/sdk_storage /usr/local/bin/sdk_storage
RUN mkdir -p /app/storage && chown -R appuser:appuser /app
USER appuser
EXPOSE 8081
ENV RUST_LOG=info
ENTRYPOINT ["/usr/local/bin/sdk_storage"]
CMD ["--permanent"]

View File

@ -1,9 +0,0 @@
FROM alpine:latest
RUN apk add --no-cache tor curl
RUN addgroup -g 1001 toruser && adduser -D -s /bin/sh -u 1001 -G toruser toruser
RUN mkdir -p /var/lib/tor && chown -R toruser:toruser /var/lib/tor
USER toruser
EXPOSE 9050 9051
CMD ["tor", "-f", "/etc/tor/torrc"]

19
modules/tor/entrypoint.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/sh
set -e
TORRC_PATH=/etc/tor/torrc
if [ ! -f "$TORRC_PATH" ]; then
mkdir -p /etc/tor
cat > "$TORRC_PATH" << 'EOF'
Log notice file /var/log/tor/notices.log
DataDirectory /var/lib/tor
SocksPort 0.0.0.0:9050
ControlPort 9051
EOF
fi
# Ensure permissions for Tor data directories when running as root
chown -R 0:0 /var/lib/tor /var/log/tor /etc/tor 2>/dev/null || true
chmod -R a+rwX /var/lib/tor /var/log/tor /etc/tor 2>/dev/null || true
tor -f "$TORRC_PATH"

View File

@ -1,6 +0,0 @@
# Dockerfile minimal pour lecoffre-back-mini (local project)
FROM alpine:3.19
RUN apk add --no-cache bash
WORKDIR /app
COPY . /app
CMD ["bash", "-lc", "echo 'lecoffre-back-mini backend ready' && tail -f /dev/null"]

View File

@ -1,6 +0,0 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --silent
COPY . .
CMD ["node", "server.js"]

4
tests/RELEASE_NOTES.md Normal file
View File

@ -0,0 +1,4 @@
# Release tests 1.1.3 - 2025-09-07
- Ajout des notes de tests pour la release 1.1.3.
- Synchronisation des notes de release avec docs/RELEASE_NOTES.md.