ci: docker_tag=ext - Fix sdk_relay healthcheck with curl installation

This commit is contained in:
Nicolas Cantu 2025-09-19 17:03:51 +00:00
parent a5b8f1a2db
commit 77cb87b518
9 changed files with 256 additions and 2 deletions

102
.env.bak Normal file
View File

@ -0,0 +1,102 @@
# Variables d'environnement pour l'application back-end
NODE_OPTIONS=--max-old-space-size=2048
NODE_ENV=production
# Configuration IDNOT
IDNOT_ANNUARY_BASE_URL=https://qual-api.notaires.fr/annuaire
# IDNOT_REDIRECT_URI=http://local.4nkweb.com:3004/authorized-client
IDNOT_REDIRECT_URI=http://local.4nkweb.com:3000/authorized-client
IDNOT_TOKEN_URL=https://qual-connexion.idnot.fr/user/IdPOAuth2/token/idnot_idp_v1
IDNOT_API_BASE_URL=https://qual-api.notaires.fr
# Configuration serveur
APP_HOST=dev4.4nkweb.com
# API_BASE_URL=https://demo.4nkweb.com/back
API_BASE_URL=https://dev4.4nkweb.com/back
# DEFAULT_STORAGE=https://demo.4nkweb.com/storage
DEFAULT_STORAGE=https://dev4.4nkweb.com/storage
# Variables d'environnement pour l'application front-end
# NEXT_PUBLIC_4NK_URL=http://demo.4nkweb.com/
NEXT_PUBLIC_4NK_URL=https://dev4.4nkweb.com
# NEXT_PUBLIC_FRONT_APP_HOST=https://demo.4nkweb.com
NEXT_PUBLIC_FRONT_APP_HOST=https://dev4.4nkweb.com/lecoffre
NEXT_PUBLIC_IDNOT_BASE_URL=https://qual-connexion.idnot.fr
NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT=/IdPOAuth2/authorize/idnot_idp_v1
NEXT_PUBLIC_BACK_API_PROTOCOL=https
NEXT_PUBLIC_BACK_API_HOST=dev4.4nkweb.com
NEXT_PUBLIC_BACK_API_PORT=443
NEXT_PUBLIC_BACK_API_ROOT_URL=/api
NEXT_PUBLIC_BACK_API_VERSION=v1
# NEXT_PUBLIC_ANK_BASE_REDIRECT_URI='http://local.4nkweb.com:3004/authorized-client'
NEXT_PUBLIC_ANK_BASE_REDIRECT_URI=https://dev4.4nkweb.com/lecoffre/authorized-client
NEXT_PUBLIC_TARGET_ORIGIN=https://dev4.4nkweb.com/lecoffre
NEXT_PUBLIC_4NK_IFRAME_URL=https://dev4.4nkweb.com
NEXT_PUBLIC_IDNOT_REDIRECT_URI=https://dev4.4nkweb.com/lecoffre/authorized-client
NEXT_PUBLIC_DOCAPOSTE_API_URL=
NEXT_PUBLIC_API_URL=https://dev4.4nkweb.com/api
NEXT_PUBLIC_DEFAULT_VALIDATOR_ID=28c9a3a8151bef545ebf700ca5222c63d0031ad593097e95c1de202464304a99
NEXT_PUBLIC_DEFAULT_STORAGE_URLS=https://dev4.4nkweb.com/storage
# WS
# RELAY_URLS=wss://demo.4nkweb.com/ws
RELAY_URLS=wss://dev4.4nkweb.com/ws
# SIGNER_WS_URL=ws://dev4.4nkweb.com/signer/
SIGNER_WS_URL=ws://dev3.4nkweb.com
SIGNER_BASE_URL=https://dev3.4nkweb.com
# IHM URLS
# VITE_BOOTSTRAPURL=http://sdk_relay:8090/
VITE_BOOTSTRAPURL=https://dev4.4nkweb.com/ws/
# Cartes de test Stripe
SUCCES='4242 4242 4242 4242'
DECLINED='4000 0025 0000 3155'
ENABLE_SUBSCRIPTION_STUB=true
CORS_ALLOWED_ORIGINS=http://local.4nkweb.com:3000,https://dev4.4nkweb.com
core_url="http://bitcoin:38332"
ws_url="0.0.0.0:8090"
wallet_name="default"
network="signet"
blindbit_url="http://blindbit:8000"
zmq_url="tcp://bitcoin:29000"
storage="https://dev4.4nkweb.com/storage"
data_dir="/home/bitcoin/.4nk"
bitcoin_data_dir="/home/bitcoin/.bitcoin"
# ================== /!\ sensible =========================
# Configuration IDNOT
IDNOT_API_KEY=ba557f84-0bf6-4dbf-844f-df2767555e3e
IDNOT_CLIENT_ID=B3CE56353EDB15A9
IDNOT_CLIENT_SECRET=3F733549E879878344B6C949B366BB5CDBB2DB5B7F7AB7EBBEBB0F0DD0776D1C
NEXT_PUBLIC_IDNOT_CLIENT_ID=B3CE56353EDB15A9
# Configuration OVH
OVH_APP_KEY=5ab0709bbb65ef26
OVH_APP_SECRET=de1fac1779d707d263a611a557cd5766
OVH_CONSUMER_KEY=5fe817829b8a9c780cfa2354f8312ece
OVH_SMS_SERVICE_NAME=sms-tt802880-1
# Configuration SMS Factor
SMS_FACTOR_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI4NzgzNiIsImlhdCI6MTcwMTMzOTY1Mi45NDUzOH0.GNoqLb5MDBWuniNlQjbr1PKolwxGqBZe_tf4IMObvHw
# Configuration Mailchimp
MAILCHIMP_API_KEY=md-VVfaml-ApIV4nsGgaJKl0A
MAILCHIMP_KEY=3fa54304bc766dfd0b8043a827b28a3a-us17
MAILCHIMP_LIST_ID=a48d9ad852
# Configuration Stripe
STRIPE_SECRET_KEY=sk_test_51OwKmMP5xh1u9BqSeFpqw0Yr15hHtFsh0pvRGaE0VERhlYtvw33ND1qiGA6Dy1DPmmV61B6BqIimlhuv7bwElhjF00PLQwD60n
STRIPE_WEBHOOK_SECRET=
STRIPE_STANDARD_SUBSCRIPTION_PRICE_ID=price_1P66fuP5xh1u9BqSHj0O6Uy3
STRIPE_STANDARD_ANNUAL_SUBSCRIPTION_PRICE_ID=price_1P9NsRP5xh1u9BqSFgkUDbQY
STRIPE_UNLIMITED_SUBSCRIPTION_PRICE_ID=price_1P66RqP5xh1u9BqSuUzkQNac
STRIPE_UNLIMITED_ANNUAL_SUBSCRIPTION_PRICE_ID=price_1P9NpKP5xh1u9BqSApFogvUB
SIGNER_API_KEY=your-api-key-change-this
VITE_JWT_SECRET_KEY=52b3d77617bb00982dfee15b08effd52cfe5b2e69b2f61cc4848cfe1e98c0bc9

View File

@ -59,7 +59,7 @@ services:
restart: unless-stopped
sdk_relay:
image: git.4nkweb.com/4nk/sdk_relay:dev
image: git.4nkweb.com/4nk/sdk_relay:ext
container_name: sdk_relay
depends_on:
blindbit:
@ -70,6 +70,7 @@ services:
- bitcoin_data:/home/bitcoin/.bitcoin
ports:
- "127.0.0.1:8090:8090"
- "127.0.0.1:8091:8091"
networks:
btcnet:
aliases:
@ -89,7 +90,7 @@ services:
exec /usr/local/bin/sdk_relay --config /home/bitcoin/.conf 2>&1 | tee -a /home/bitcoin/.4nk/logs/sdk_relay.log
'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8090/health"]
test: ["CMD", "curl", "-f", "http://localhost:8091/health"]
interval: 30s
timeout: 10s
retries: 3

73
docs/ANALYSE.md Normal file
View File

@ -0,0 +1,73 @@
## Analyse détaillée
### Périmètre
Analyse du nœud dorchestration `lecoffre_node` et de son `docker-compose.yml` (services, images, ports, volumes, dépendances interservices).
### Stack et orchestration
- **Compose**: `version: "3.9"`
- **Services**: `tor`, `bitcoin`, `blindbit`, `sdk_relay`, `lecoffre-back` (ext), `lecoffre-front` (ext), `ihm_client` (ext), `sdk_signer`, `sdk_storage`, `watchtower`.
- **Réseau**: bridge `4nk_node_btcnet` (subnet 172.20.0.0/16).
- **Volumes**:
- `4nk_node_bitcoin_data``/home/bitcoin/.bitcoin`
- `blindbit_data``/root/.blindbit-oracle`
- `sdk_data``/home/bitcoin/.4nk`
### Ordre de démarrage et dépendances
- `tor``bitcoin` (healthcheck) → `blindbit` (healthcheck) → `sdk_relay` (healthcheck)
- Services applicatifs (`lecoffre-back`, `lecoffre-front`, `ihm_client`) démarrent ensuite.
- `sdk_signer` et `sdk_storage` sont indépendants du pipeline Bitcoin/Blindbit.
### Images et tags
- `tor`: `btcpayserver/tor:0.4.8.10`
- `bitcoin`: `git.4nkweb.com/4nk/bitcoin:latest`
- `blindbit`: `git.4nkweb.com/4nk/blindbit-oracle:dev`
- `sdk_relay`: `git.4nkweb.com/4nk/sdk_relay:dev`
- `lecoffre-back`: `git.4nkweb.com/4nk/lecoffre-back-mini:ext`
- `lecoffre-front`: `git.4nkweb.com/4nk/lecoffre-front:ext`
- `ihm_client`: `git.4nkweb.com/4nk/ihm_client:ext`
- `sdk_signer`: `git.4nkweb.com/4nk/sdk_signer:latest`
- `sdk_storage`: `git.4nkweb.com/4nk/sdk_storage:latest`
- `watchtower`: `containrrr/watchtower`
### Ports exposés (localhost)
- `blindbit`: 8000
- `sdk_relay`: 8090
- `lecoffre-back`: 8080
- `lecoffre-front`: 3004→3000 (127.0.0.2)
- `ihm_client`: 3003
- `sdk_signer`: 3001
- `sdk_storage`: 8081
### Configuration et logs
- `bitcoin`: monte `./bitcoin/bitcoin.conf` en lecture seule.
- `blindbit`: copie `./blindbit/blindbit.toml` vers `$HOME/.blindbit-oracle/blindbit.toml`.
- `sdk_relay`: `./relay/sdk_relay.conf` monté en lecture seule; sortie multiplexée vers `/home/bitcoin/.4nk/logs/sdk_relay.log`.
### Healthchecks
- `bitcoin`: `bitcoin-cli getblockchaininfo`
- `blindbit`: sondage HTTP `GET /tweaks/1`
- `sdk_relay`: `GET /health`
### Risques et incohérences relevés
- Tags dimages hétérogènes (`latest`, `dev`, `ext`). Préférer une convention unique et traçable.
- Contrainte interne: usage recommandé du tag `docker-support-v2` au lieu de `latest`. Harmonisation à planifier.
- `sdk_signer` listé alors quil nest pas utilisé sur la machine. Éviter son démarrage par défaut pour réduire lempreinte.
- Exposition multiIP (`127.0.0.2` pour `lecoffre-front`). Vérifier la résolution locale et la compatibilité outillage.
### Actions proposées
- Normaliser les tags dimages (`dev-test` pour branches de test; `docker-support-v2` pour releases) et documenter la politique.
- Paramétrer le démarrage conditionnel de `sdk_signer` (profil/override compose).
- Centraliser les variables denvironnement communes dans `.env` et documenter leurs valeurs attendues.
- Aligner la rotation des logs et vérifier la capacité des volumes (`sdk_data`, `bitcoin_data`).

42
docs/ENV-RESUME.md Normal file
View File

@ -0,0 +1,42 @@
## Résumé des environnements (plateforme)
### Contexte fonctionnel
- **Site principal**: `https://dev4.4nkweb.com/lecoffre`
- **Intégration Iframe**: hôte `https://dev4.4nkweb.com`
- **Service Signer**: utilisé depuis `https://dev3.4nkweb.com`
### Cartographie (compose et apps)
- `lecoffre-front` (Next.js): basePath `/lecoffre`; variables `NEXT_PUBLIC_*` orientées vers `dev4.4nkweb.com` et services backend.
- `lecoffre-back-mini` (Express): exposé en interne sur 8080; consommé par le front via `NEXT_PUBLIC_API_URL`.
- `sdk_relay`: exposé sur 8090; consommé par les clients qui en ont besoin.
- `ihm_client`: exposé sur 3003; intégré/embarqué si nécessaire.
- `sdk_signer`: non utilisé localement sur la machine, signer consommé depuis `dev3.4nkweb.com`.
### Valeurs attendues (synthèse)
- Front (Next.js):
- `NEXT_PUBLIC_FRONT_APP_HOST=dev4.4nkweb.com`
- `NEXT_PUBLIC_FRONT_APP_PORT` (selon déploiement; non nécessaire en prod si 443)
- `NEXT_PUBLIC_4NK_URL=https://dev4.4nkweb.com`
- `NEXT_PUBLIC_4NK_IFRAME_URL=https://dev4.4nkweb.com`
- `NEXT_PUBLIC_API_URL` pointant vers lAPI (`lecoffre-back-mini`) accessible depuis le navigateur
- `NEXT_PUBLIC_BACK_API_*` si utilisés pour construire lURL back (protocol/host/port/root/version)
- `NEXT_PUBLIC_IDNOT_*`, `NEXT_PUBLIC_DOCAPOSTE_API_URL` selon intégrations
- `NEXT_PUBLIC_DEFAULT_*` (validator, storages) selon besoins
- Back (`lecoffre-back-mini`):
- Variables DB, clés Stripe/Mail, endpoints externes (non détaillés ici; `.env` validés)
- Signer (externe):
- Ciblage de `dev3.4nkweb.com` côté front/back pour les opérations de signature.
### Remarques
- Les fichiers `.env` existants sont validés OK.
- Sassurer de la cohérence entre `basePath` `/lecoffre` et les URLs publiques (liens, redirections, assets).
- Documenter un `.env.example` à jour dans chaque projet pour reproduire la configuration.

8
log/ihm_client.log Normal file
View File

@ -0,0 +1,8 @@
2025-09-19T13:07:01
2025-09-19T13:07:01 WARN Files in the public directory are served at the root path.
2025-09-19T13:07:01 Instead of /public/style/4nk.css, use /style/4nk.css.
2025-09-19T13:07:01
2025-09-19T13:23:38
2025-09-19T13:23:38 WARN Files in the public directory are served at the root path.
2025-09-19T13:23:38 Instead of /public/style/4nk.css, use /style/4nk.css.
2025-09-19T13:23:38

0
log/lecoffre-back.log Normal file
View File

24
log/lecoffre-front.log Normal file
View File

@ -0,0 +1,24 @@
2025-09-19T13:06:59 targetOrigin is already set
2025-09-19T13:06:59 iframeUrl is already set
2025-09-19T13:06:59 targetOrigin is already set
2025-09-19T13:06:59 iframeUrl is already set
2025-09-19T13:06:59 targetOrigin is already set
2025-09-19T13:06:59 iframeUrl is already set
2025-09-19T13:06:59 targetOrigin is already set
2025-09-19T13:06:59 iframeUrl is already set
2025-09-19T13:06:59 targetOrigin is already set
2025-09-19T13:06:59 iframeUrl is already set
2025-09-19T13:06:59 targetOrigin is already set
2025-09-19T13:06:59 iframeUrl is already set
2025-09-19T13:23:05 targetOrigin is already set
2025-09-19T13:23:05 iframeUrl is already set
2025-09-19T13:23:11 targetOrigin is already set
2025-09-19T13:23:12 iframeUrl is already set
2025-09-19T13:23:25 targetOrigin is already set
2025-09-19T13:23:25 iframeUrl is already set
2025-09-19T13:23:27 targetOrigin is already set
2025-09-19T13:23:27 iframeUrl is already set
2025-09-19T13:23:36 targetOrigin is already set
2025-09-19T13:23:36 iframeUrl is already set
2025-09-19T13:23:37 targetOrigin is already set
2025-09-19T13:23:37 iframeUrl is already set

0
log/sdk_relay.log Normal file
View File

View File

@ -26,3 +26,7 @@
- Journaux Nginx (`error.log`) sans erreurs après reload
- Logs `sdk_relay` présents dans `/home/bitcoin/.4nk/logs/sdk_relay.log`