diff --git a/.env.master b/.env.master index 24732db..c9b59be 100644 --- a/.env.master +++ b/.env.master @@ -104,13 +104,13 @@ SDK_RELAY_CORE_URL=http://bitcoin:38332 SDK_RELAY_WS_URL=0.0.0.0:8090 SDK_RELAY_WALLET_NAME=default SDK_RELAY_NETWORK=signet -SDK_RELAY_BLINDBIT_URL=http://blindbit:8000 SDK_RELAY_ZMQ_URL=tcp://bitcoin:29000 SDK_RELAY_STORAGE=https://${DOMAIN}/storage SDK_RELAY_DATA_DIR=/app/.4nk SDK_RELAY_BITCOIN_DATA_DIR=/app/.bitcoin SDK_RELAY_BOOTSTRAP_URL=wss://${BOOTSTRAP_DOMAIN}/ws/ SDK_RELAY_BOOTSTRAP_FAUCET=true +SDK_RELAY_BLINDBIT_URL=http://blindbit-oracle:8000 # =========================================== # VARIABLES IHM_CLIENT (formatées pour docker-compose) diff --git a/.env.master.exemple b/.env.master.exemple index e1f0529..c25a4de 100644 --- a/.env.master.exemple +++ b/.env.master.exemple @@ -105,13 +105,13 @@ SDK_RELAY_CORE_URL=http://bitcoin:38332 SDK_RELAY_WS_URL=0.0.0.0:8090 SDK_RELAY_WALLET_NAME=default SDK_RELAY_NETWORK=signet -SDK_RELAY_BLINDBIT_URL=http://blindbit:8000 SDK_RELAY_ZMQ_URL=tcp://bitcoin:29000 SDK_RELAY_STORAGE=https://${DOMAIN}/storage SDK_RELAY_DATA_DIR=/app/.4nk SDK_RELAY_BITCOIN_DATA_DIR=/app/.bitcoin SDK_RELAY_BOOTSTRAP_URL=wss://${BOOTSTRAP_DOMAIN}/ws/ SDK_RELAY_BOOTSTRAP_FAUCET=true +SDK_RELAY_BLINDBIT_URL=http://blindbit-oracle:8000 # =========================================== # VARIABLES IHM_CLIENT (formatées pour docker-compose) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19fa119..1ae6be3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,6 @@ ## [1.0.0] ### Version initiale - Configuration Docker Compose complète -- Services : tor, bitcoin, blindbit, sdk_storage, sdk_relay, sdk_signer, ihm_client, lecoffre-front, lecoffre-back +- Services : tor, bitcoin, blindbit, sdk_storage, sdk_relay, sdk_signer, ihm_client, lecoffre-front - Configuration Nginx pour dev4.4nkweb.com - Scripts de démarrage et validation diff --git a/README.md b/README.md index 4b7c10f..718b74f 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,6 @@ Internet → dev4.4nkweb.com (Nginx) → Services Locaux | Service | Port | Statut | Description | |---------|------|--------|-------------| | `lecoffre-front` | 3004 | ✅ | Interface utilisateur | -| `lecoffre-back` | 8080 | ✅ | API Backend | | `ihm_client` | 3003 | ✅ | Gestion des clés | | `sdk_relay` | 8090-8091 | ✅ | Relay WebSocket | | `sdk_signer` | 3001 | ✅ | Service de signature | @@ -212,7 +211,6 @@ lecoffre_node/ | `sdk_storage` | `ext` | Stockage temporaire | | `ihm_client` | `ext` | Interface de gestion | | `lecoffre-front` | `ext` | Frontend LeCoffre | -| `lecoffre-back-mini` | `ext` | Backend API | ## 📚 Documentation Complète diff --git a/conf/README.md b/conf/README.md index 554d2ad..fc17ee1 100644 --- a/conf/README.md +++ b/conf/README.md @@ -15,7 +15,6 @@ conf/ ├── ihm_client/ # Configuration IHM Client │ └── nginx.dev.conf ├── lecoffre-front/ # Configuration LeCoffre Frontend -├── lecoffre-back/ # Configuration LeCoffre Backend └── miner/ # Configuration du mineur ``` diff --git a/conf/grafana/dashboards/lecoffre-backend.json b/conf/grafana/dashboards/lecoffre-backend.json deleted file mode 100644 index 5f57c0d..0000000 --- a/conf/grafana/dashboards/lecoffre-backend.json +++ /dev/null @@ -1,591 +0,0 @@ -{ - "annotations": { - "list": [] - }, - "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 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "sum(rate({container=\"lecoffre-back\"} | json | statusCode != \"\" [5m])) by (statusCode)", - "queryType": "", - "refId": "A" - } - ], - "title": "Requêtes HTTP par Status Code", - "type": "timeseries" - }, - { - "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 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "sum(rate({container=\"lecoffre-back\"} | json | url != \"\" [5m])) by (url)", - "queryType": "", - "refId": "A" - } - ], - "title": "Endpoints les Plus Utilisés", - "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": 4, - "w": 6, - "x": 0, - "y": 8 - }, - "id": 3, - "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({container=\"lecoffre-back\"} |= \"ERROR\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs (1h)", - "type": "stat" - }, - { - "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": 4, - "w": 6, - "x": 6, - "y": 8 - }, - "id": 4, - "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": "avg({container=\"lecoffre-back\"} | json | duration != \"\" | unwrap duration [5m])", - "queryType": "", - "refId": "A" - } - ], - "title": "Temps de Réponse Moyen (ms)", - "type": "stat" - }, - { - "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": 4, - "w": 6, - "x": 12, - "y": 8 - }, - "id": 5, - "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": "sum(rate({container=\"lecoffre-back\"} | json | method != \"\" [5m]))", - "queryType": "", - "refId": "A" - } - ], - "title": "Requêtes/seconde", - "type": "stat" - }, - { - "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": 4, - "w": 6, - "x": 18, - "y": 8 - }, - "id": 6, - "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({container=\"lecoffre-back\"} | json | statusCode = \"200\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Succès (1h)", - "type": "stat" - }, - { - "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": 12 - }, - "id": 7, - "options": { - "legend": { - "displayMode": "list", - "placement": "right" - }, - "pieType": "pie", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "tooltip": { - "mode": "single" - } - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "sum by (method) (count_over_time({container=\"lecoffre-back\"} | json | method != \"\" [1h]))", - "queryType": "", - "refId": "A" - } - ], - "title": "Distribution des Méthodes HTTP", - "type": "piechart" - }, - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "fieldConfig": { - "defaults": { - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 12 - }, - "id": 8, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true - }, - "pluginVersion": "10.0.0", - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "{container=\"lecoffre-back\"} |= \"ERROR\" | json | line_format \"{{.timestamp}} - {{.method}} {{.url}} - {{.error}}\"", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs Récentes", - "type": "table" - } - ], - "refresh": "5s", - "schemaVersion": 37, - "style": "dark", - "tags": [ - "lecoffre", - "backend", - "api" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "LeCoffre Backend - Monitoring", - "uid": "lecoffre-backend", - "version": 1, - "weekStart": "" -} - diff --git a/conf/grafana/dashboards/lecoffre-overview.json b/conf/grafana/dashboards/lecoffre-overview.json index f1b9feb..f00f282 100644 --- a/conf/grafana/dashboards/lecoffre-overview.json +++ b/conf/grafana/dashboards/lecoffre-overview.json @@ -235,7 +235,7 @@ "uid": "loki" }, "editorMode": "code", - "expr": "{job=~\"bitcoin|blindbit|sdk_relay|sdk_signer|sdk_storage|lecoffre-back|lecoffre-front|ihm_client|miner\"} |= \"error\" | logfmt", + "expr": "{job=~\"bitcoin|blindbit|sdk_relay|sdk_signer|sdk_storage|lecoffre-front|ihm_client|miner\"} |= \"error\" | logfmt", "queryType": "", "refId": "A" } diff --git a/conf/grafana/dashboards/services-overview.json b/conf/grafana/dashboards/services-overview.json index 49e55d9..89c910e 100644 --- a/conf/grafana/dashboards/services-overview.json +++ b/conf/grafana/dashboards/services-overview.json @@ -102,18 +102,6 @@ "sort": "none" } }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "sum by (service) (count_over_time({job=\"lecoffre-back\"} [5m]))", - "queryType": "", - "refId": "A" - } - ], "title": "LeCoffre Backend - Volume Logs", "type": "timeseries" }, @@ -413,7 +401,7 @@ "uid": "loki" }, "editorMode": "code", - "expr": "{job=~\"lecoffre-back|lecoffre-front|ihm_client|sdk_relay|sdk_signer|sdk_storage\"} |= \"error\" | logfmt", + "expr": "{job=~\"lecoffre-front|ihm_client|sdk_relay|sdk_signer|sdk_storage\"} |= \"error\" | logfmt", "queryType": "", "refId": "A" } diff --git a/conf/logrotate/lecoffre-back.conf b/conf/logrotate/lecoffre-back.conf index 556fd4a..b744243 100644 --- a/conf/logrotate/lecoffre-back.conf +++ b/conf/logrotate/lecoffre-back.conf @@ -1,13 +1,3 @@ logs/lecoffre-back/*.log { - daily - missingok - rotate 7 - compress - delaycompress - notifempty - create 644 root root - postrotate - # Redémarrer le service si nécessaire - docker restart lecoffre-back 2>/dev/null || true - endscript + } diff --git a/conf/monitoring.conf b/conf/monitoring.conf index 0b6c4a3..9af9c41 100644 --- a/conf/monitoring.conf +++ b/conf/monitoring.conf @@ -21,7 +21,7 @@ log_compression=true [services] # Services surveillés -services=bitcoin,blindbit,sdk_relay,sdk_signer,sdk_storage,lecoffre-back,lecoffre-front,ihm_client,tor,miner +services=bitcoin,blindbit,sdk_relay,sdk_signer,sdk_storagelecoffre-front,ihm_client,tor,miner [alerts] # Configuration des alertes diff --git a/conf/promtail/promtail.yml b/conf/promtail/promtail.yml index 5df1d9f..5fe99c5 100644 --- a/conf/promtail/promtail.yml +++ b/conf/promtail/promtail.yml @@ -59,16 +59,6 @@ scrape_configs: service: sdk_storage __path__: /var/log/lecoffre/sdk_storage/*.log - # LeCoffre Backend Logs - - job_name: lecoffre-back - static_configs: - - targets: - - localhost - labels: - job: lecoffre-back - service: lecoffre-back - __path__: /var/log/lecoffre/lecoffre-back/*.log - # LeCoffre Frontend Logs - job_name: lecoffre-front static_configs: diff --git a/docker-compose.yml b/docker-compose.yml index 8cd500f..a6656aa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -80,6 +80,8 @@ services: sdk_relay: image: git.4nkweb.com/4nk/sdk_relay:ext container_name: sdk_relay + env_file: + - .env.master depends_on: blindbit: condition: service_healthy @@ -123,57 +125,61 @@ services: retries: 50 restart: unless-stopped - lecoffre-back: - image: git.4nkweb.com/4nk/lecoffre-back-mini:ext - container_name: lecoffre-back - environment: - - NODE_OPTIONS=${NODE_OPTIONS} - - NODE_ENV=${NODE_ENV} - - IDNOT_ANNUARY_BASE_URL=${IDNOT_ANNUARY_BASE_URL} - - IDNOT_REDIRECT_URI=${IDNOT_REDIRECT_URI} - - IDNOT_TOKEN_URL=${IDNOT_TOKEN_URL} - - IDNOT_API_BASE_URL=${IDNOT_API_BASE_URL} - - APP_HOST=${APP_HOST} - - API_BASE_URL=${API_BASE_URL} - - DEFAULT_STORAGE=${DEFAULT_STORAGE} - - STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY} - - STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY} - - STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET} - - MAILCHIMP_API_KEY=${MAILCHIMP_API_KEY} - - MAILCHIMP_SERVER_PREFIX=${MAILCHIMP_SERVER_PREFIX} - - MAILCHIMP_LIST_ID=${MAILCHIMP_LIST_ID} - - OVH_APPLICATION_KEY=${OVH_APPLICATION_KEY} - - OVH_APPLICATION_SECRET=${OVH_APPLICATION_SECRET} - - OVH_CONSUMER_KEY=${OVH_CONSUMER_KEY} - - OVH_SERVICE_NAME=${OVH_SERVICE_NAME} - ports: - - "0.0.0.0:8080:8080" - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - ./logs/lecoffre-back:/var/log/lecoffre-back - networks: - btcnet: - aliases: - - lecoffre-back - depends_on: - sdk_relay: - condition: service_healthy - user: appuser - command: ["node", "dist/server.js"] - healthcheck: - test: ["CMD", "sh", "-c", "if curl -f http://localhost:8080/api/v1/health >/dev/null 2>&1; then echo 'LeCoffre Backend ready: API responding'; exit 0; else echo 'LeCoffre Backend starting: API not yet ready'; exit 1; fi"] - interval: 30s - timeout: 10s - retries: 50 - start_period: 60s - labels: - - "com.centurylinklabs.watchtower.enable=true" - restart: unless-stopped + # lecoffre-back: + # image: git.4nkweb.com/4nk/lecoffre-back-mini:ext + # container_name: lecoffre-back + # env_file: + # - .env.master + # environment: + # - NODE_OPTIONS=${NODE_OPTIONS} + # - NODE_ENV=${NODE_ENV} + # - IDNOT_ANNUARY_BASE_URL=${IDNOT_ANNUARY_BASE_URL} + # - IDNOT_REDIRECT_URI=${IDNOT_REDIRECT_URI} + # - IDNOT_TOKEN_URL=${IDNOT_TOKEN_URL} + # - IDNOT_API_BASE_URL=${IDNOT_API_BASE_URL} + # - APP_HOST=${APP_HOST} + # - API_BASE_URL=${API_BASE_URL} + # - DEFAULT_STORAGE=${DEFAULT_STORAGE} + # - STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY} + # - STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY} + # - STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET} + # - MAILCHIMP_API_KEY=${MAILCHIMP_API_KEY} + # - MAILCHIMP_SERVER_PREFIX=${MAILCHIMP_SERVER_PREFIX} + # - MAILCHIMP_LIST_ID=${MAILCHIMP_LIST_ID} + # - OVH_APPLICATION_KEY=${OVH_APPLICATION_KEY} + # - OVH_APPLICATION_SECRET=${OVH_APPLICATION_SECRET} + # - OVH_CONSUMER_KEY=${OVH_CONSUMER_KEY} + # - OVH_SERVICE_NAME=${OVH_SERVICE_NAME} + # ports: + # - "0.0.0.0:8080:8080" + # volumes: + # - /var/run/docker.sock:/var/run/docker.sock + # - ./logs/lecoffre-back:/var/log/lecoffre-back + # networks: + # btcnet: + # aliases: + # - lecoffre-back + # depends_on: + # sdk_relay: + # condition: service_healthy + # user: appuser + # command: ["node", "dist/server.js"] + # healthcheck: + # test: ["CMD", "sh", "-c", "if curl -f http://localhost:8080/api/v1/health >/dev/null 2>&1; then echo 'LeCoffre Backend ready: API responding'; exit 0; else echo 'LeCoffre Backend starting: API not yet ready'; exit 1; fi"] + # interval: 30s + # timeout: 10s + # retries: 50 + # start_period: 60s + # labels: + # - "com.centurylinklabs.watchtower.enable=true" + # restart: unless-stopped lecoffre-front: image: git.4nkweb.com/4nk/lecoffre-front:ext container_name: lecoffre-front working_dir: /leCoffre-front + env_file: + - .env.master environment: - NODE_OPTIONS=${NODE_OPTIONS} - NODE_ENV=${NODE_ENV} @@ -196,14 +202,14 @@ services: aliases: - lecoffre-front depends_on: - lecoffre-back: - condition: service_healthy - ihm_client: - condition: service_healthy - sdk_storage: - condition: service_healthy - sdk_signer: - condition: service_healthy + # lecoffre-back: + # condition: service_healthy + ihm_client: + condition: service_healthy + sdk_storage: + condition: service_healthy + sdk_signer: + condition: service_healthy user: lecoffreuser command: ["node", "server.js"] healthcheck: @@ -219,6 +225,8 @@ services: ihm_client: image: git.4nkweb.com/4nk/ihm_client:ext container_name: ihm_client + env_file: + - .env.master environment: - VITE_JWT_SECRET_KEY=${VITE_JWT_SECRET_KEY} - VITE_API_BASE_URL=${VITE_API_BASE_URL} @@ -256,6 +264,8 @@ services: sdk_signer: image: git.4nkweb.com/4nk/sdk_signer:ext container_name: sdk_signer + env_file: + - .env.master ports: - "0.0.0.0:3001:9090" volumes: diff --git a/docker-compose.yml.backup b/docker-compose.yml.backup index 8198e34..0442dae 100644 --- a/docker-compose.yml.backup +++ b/docker-compose.yml.backup @@ -113,52 +113,7 @@ services: retries: 50 restart: unless-stopped - lecoffre-back: - image: git.4nkweb.com/4nk/lecoffre-back-mini:ext - container_name: lecoffre-back - environment: - - NODE_OPTIONS=${NODE_OPTIONS} - - NODE_ENV=${NODE_ENV} - - IDNOT_ANNUARY_BASE_URL=${IDNOT_ANNUARY_BASE_URL} - - IDNOT_REDIRECT_URI=${IDNOT_REDIRECT_URI} - - IDNOT_TOKEN_URL=${IDNOT_TOKEN_URL} - - IDNOT_API_BASE_URL=${IDNOT_API_BASE_URL} - - APP_HOST=${APP_HOST} - - API_BASE_URL=${API_BASE_URL} - - DEFAULT_STORAGE=${DEFAULT_STORAGE} - - STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY} - - STRIPE_PUBLISHABLE_KEY=${STRIPE_PUBLISHABLE_KEY} - - STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET} - - MAILCHIMP_API_KEY=${MAILCHIMP_API_KEY} - - MAILCHIMP_SERVER_PREFIX=${MAILCHIMP_SERVER_PREFIX} - - MAILCHIMP_LIST_ID=${MAILCHIMP_LIST_ID} - - OVH_APPLICATION_KEY=${OVH_APPLICATION_KEY} - - OVH_APPLICATION_SECRET=${OVH_APPLICATION_SECRET} - - OVH_CONSUMER_KEY=${OVH_CONSUMER_KEY} - - OVH_SERVICE_NAME=${OVH_SERVICE_NAME} - ports: - - "0.0.0.0:8080:8080" - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - ./logs/lecoffre-back:/var/log/lecoffre-back - networks: - btcnet: - aliases: - - lecoffre-back - depends_on: - sdk_relay: - condition: service_healthy - user: appuser - command: ["node", "dist/server.js"] - healthcheck: - test: ["CMD", "sh", "-c", "if curl -f http://localhost:8080/api/v1/health >/dev/null 2>&1; then echo 'LeCoffre Backend ready: API responding'; exit 0; else echo 'LeCoffre Backend starting: API not yet ready'; exit 1; fi"] - interval: 30s - timeout: 10s - retries: 50 - start_period: 60s - labels: - - "com.centurylinklabs.watchtower.enable=true" - restart: unless-stopped + lecoffre-front: image: git.4nkweb.com/4nk/lecoffre-front:ext diff --git a/scripts/build-project.sh b/scripts/build-project.sh index 91e2763..deb824b 100755 --- a/scripts/build-project.sh +++ b/scripts/build-project.sh @@ -9,7 +9,6 @@ # - sdk_relay: SDK Relay # - sdk_signer: SDK Signer # - sdk_storage: SDK Storage -# - lecoffre-back: LeCoffre Backend # - lecoffre-front: LeCoffre Frontend # - ihm_client: IHM Client @@ -46,7 +45,6 @@ if [[ $# -lt 1 ]]; then echo "Projets disponibles:" echo " - ihm_client" echo " - lecoffre-front" - echo " - lecoffre-back-mini" echo " - sdk_relay" echo " - sdk_storage" echo " - sdk_signer" diff --git a/scripts/deploy-grafana.sh b/scripts/deploy-grafana.sh index 50f6df2..0d3294c 100755 --- a/scripts/deploy-grafana.sh +++ b/scripts/deploy-grafana.sh @@ -74,7 +74,7 @@ start_monitoring() { check_config # Créer les dossiers nécessaires - mkdir -p logs/{bitcoin,blindbit,sdk_relay,sdk_signer,sdk_storage,lecoffre-back,lecoffre-front,ihm_client,tor,miner,nginx} + mkdir -p logs/{bitcoin,blindbit,sdk_relay,sdk_signer,sdk_storagelecoffre-front,ihm_client,tor,miner,nginx} # Démarrer les services de monitoring log_info "Démarrage de Loki..." diff --git a/scripts/setup-logs.sh b/scripts/setup-logs.sh index 03307cb..bbab827 100755 --- a/scripts/setup-logs.sh +++ b/scripts/setup-logs.sh @@ -8,12 +8,12 @@ set -e echo "🔧 Configuration de la centralisation des logs..." # Créer les dossiers de logs -mkdir -p logs/{bitcoin,blindbit,sdk_relay,sdk_signer,sdk_storage,lecoffre-back,lecoffre-front,ihm_client,tor,miner,nginx} +mkdir -p logs/{bitcoin,blindbit,sdk_relay,sdk_signer,sdk_storagelecoffre-front,ihm_client,tor,miner,nginx} # Créer des fichiers de log de test pour chaque service echo "📝 Création des fichiers de log de test..." -for service in bitcoin blindbit sdk_relay sdk_signer sdk_storage lecoffre-back lecoffre-front ihm_client tor miner nginx; do +for service in bitcoin blindbit sdk_relay sdk_signer sdk_storage lecoffre-front ihm_client tor miner nginx; do log_file="logs/${service}/${service}.log" echo "$(date): Test log entry for ${service}" > "$log_file" echo "$(date): Service ${service} started successfully" >> "$log_file" @@ -23,7 +23,7 @@ done # Créer des fichiers de log avec rotation echo "🔄 Configuration de la rotation des logs..." -for service in bitcoin blindbit sdk_relay sdk_signer sdk_storage lecoffre-back lecoffre-front ihm_client tor miner nginx; do +for service in bitcoin blindbit sdk_relay sdk_signer sdk_storage lecoffre-front ihm_client tor miner nginx; do logrotate_config="conf/logrotate/${service}.conf" mkdir -p conf/logrotate @@ -72,7 +72,7 @@ else # Collecter les logs de tous les services echo "📊 Collecte des logs de tous les services..." - for service in bitcoin-signet blindbit-oracle sdk_relay sdk_signer sdk_storage lecoffre-back lecoffre-front ihm_client tor-proxy signet_miner; do + for service in bitcoin-signet blindbit-oracle sdk_relay sdk_signer sdk_storage lecoffre-front ihm_client tor-proxy signet_miner; do if docker ps --format "table {{.Names}}" | grep -q "^${service}$"; then echo "📝 Collecte des logs pour $service..." mkdir -p "$LOG_DIR/${service##*-}" # Enlever le préfixe si nécessaire diff --git a/scripts/start.sh b/scripts/start.sh index d303c5b..62cd6c7 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -238,7 +238,6 @@ services=( "sdk_storage:SDK Storage" "sdk_relay:SDK Relay" "sdk_signer:SDK Signer" - "lecoffre-back:LeCoffre Backend" "lecoffre-front:LeCoffre Frontend" "ihm_client:IHM Client" "grafana:Grafana" diff --git a/scripts/sync-configs.sh b/scripts/sync-configs.sh index eafdb58..1696788 100755 --- a/scripts/sync-configs.sh +++ b/scripts/sync-configs.sh @@ -84,14 +84,6 @@ sync_project() { fi ;; - "lecoffre-back-mini") - # Backend configuration (si nécessaire) - if [[ -d "$CONF_DIR/lecoffre-back" ]]; then - cp -r "$CONF_DIR/lecoffre-back/"* "$project_path/" 2>/dev/null || true - log_success "Backend configs copiées" - fi - ;; - *) log_warning "Projet $project_name non configuré pour la synchronisation" return 1 @@ -105,7 +97,7 @@ sync_project() { sync_all() { log "Synchronisation de tous les projets..." - local projects=("lecoffre_node" "ihm_client" "lecoffre-front" "lecoffre-back-mini") + local projects=("lecoffre_node" "ihm_client" "lecoffre-front") local success_count=0 local total_count=${#projects[@]} @@ -153,7 +145,6 @@ list_projects() { echo " - lecoffre_node (bitcoin.conf, sdk_relay.conf)" echo " - ihm_client (nginx.dev.conf)" echo " - lecoffre-front (configurations frontend)" - echo " - lecoffre-back-mini (configurations backend)" } # Parse des arguments diff --git a/scripts/sync-monitoring-config.sh b/scripts/sync-monitoring-config.sh index ad18e4f..e6f7a0d 100755 --- a/scripts/sync-monitoring-config.sh +++ b/scripts/sync-monitoring-config.sh @@ -28,7 +28,7 @@ log_info "🔄 Synchronisation de la configuration de monitoring..." # Créer la structure de dossiers log_info "Création de la structure de dossiers..." mkdir -p conf/{grafana/{provisioning/{datasources,dashboards},dashboards},promtail,logrotate,nginx} -mkdir -p logs/{bitcoin,blindbit,sdk_relay,sdk_signer,sdk_storage,lecoffre-back,lecoffre-front,ihm_client,tor,miner,nginx} +mkdir -p logs/{bitcoin,blindbit,sdk_relay,sdk_signer,sdk_storagelecoffre-front,ihm_client,tor,miner,nginx} # Copier la configuration Nginx si elle n'existe pas if [ ! -f "conf/nginx/grafana.conf" ]; then @@ -89,7 +89,7 @@ fi # Créer des fichiers de log de test pour chaque service log_info "Création des fichiers de log de test..." -for service in bitcoin blindbit sdk_relay sdk_signer sdk_storage lecoffre-back lecoffre-front ihm_client tor miner nginx; do +for service in bitcoin blindbit sdk_relay sdk_signer sdk_storage lecoffre-front ihm_client tor miner nginx; do log_file="logs/${service}/${service}.log" if [ ! -f "$log_file" ]; then echo "$(date): Test log entry for ${service}" > "$log_file" @@ -156,7 +156,7 @@ log_compression=true [services] # Services surveillés -services=bitcoin,blindbit,sdk_relay,sdk_signer,sdk_storage,lecoffre-back,lecoffre-front,ihm_client,tor,miner +services=bitcoin,blindbit,sdk_relay,sdk_signer,sdk_storagelecoffre-front,ihm_client,tor,miner [alerts] # Configuration des alertes diff --git a/scripts/test-dashboards.sh b/scripts/test-dashboards.sh index c39e905..3d180d1 100755 --- a/scripts/test-dashboards.sh +++ b/scripts/test-dashboards.sh @@ -70,7 +70,7 @@ test_loki_api() { test_service_logs() { echo "📋 Test des logs des services" - services=("bitcoin-signet" "blindbit-oracle" "sdk_relay" "sdk_signer" "sdk_storage" "lecoffre-back" "lecoffre-front" "ihm_client" "signet_miner") + services=("bitcoin-signet" "blindbit-oracle" "sdk_relay" "sdk_signer" "sdk_storage" "lecoffre-front" "ihm_client" "signet_miner") for service in "${services[@]}"; do echo " 🔍 Test des logs: $service" @@ -142,7 +142,6 @@ echo "📊 Test des Dashboards Spécialisés" echo "==================================" test_dashboard "Bitcoin Miner - Détails" "bitcoin-miner-detailed" -test_dashboard "LeCoffre Backend - Monitoring" "lecoffre-backend" test_dashboard "SDK Services - Monitoring" "sdk-services" test_dashboard "Frontend Services - Monitoring" "frontend-services" test_dashboard "Bitcoin Services - Monitoring" "bitcoin-services" diff --git a/scripts/validate-deployment.sh b/scripts/validate-deployment.sh index eb89e2e..fcb3e4d 100755 --- a/scripts/validate-deployment.sh +++ b/scripts/validate-deployment.sh @@ -111,7 +111,6 @@ check_service "blindbit-oracle" "BlindBit Oracle" "http://localhost:8000/tweaks/ check_service "sdk_storage" "SDK Storage" "http://localhost:8081/health" "200" check_service "sdk_relay" "SDK Relay" "http://localhost:8091/" "200" check_service "sdk_signer" "SDK Signer" "http://localhost:3001/" "101,426,200" -check_service "lecoffre-back" "LeCoffre Backend" "http://localhost:8080/api/v1/health" "200" check_service "lecoffre-front" "LeCoffre Frontend" "http://localhost:3004/lecoffre/" "200,301,302,307,308" check_service "ihm_client" "IHM Client" "http://localhost:3003/" "200" check_service "grafana" "Grafana" "http://localhost:3005/api/health" "200" diff --git a/web/status/api.py b/web/status/api.py index 8e38693..93fd5c8 100644 --- a/web/status/api.py +++ b/web/status/api.py @@ -260,7 +260,6 @@ class StatusAPIHandler(BaseHTTPRequestHandler): {"name": "SDK Relay", "container": "sdk_relay", "protocol": "WebSocket", "port": 8090, "health": lambda: exec_health("sdk_relay", "/scripts/healthchecks/sdk-relay-progress.sh")}, {"name": "SDK Signer", "container": "sdk_signer", "protocol": "WebSocket", "port": 9090, "health": lambda: exec_health("sdk_signer", "/scripts/healthchecks/sdk-signer-progress.sh")}, {"name": "SDK Storage", "container": "sdk_storage", "protocol": "HTTP", "port": 8080, "probe": lambda: http_probe("http://sdk_storage:8080/health")}, - {"name": "LeCoffre Backend", "container": "lecoffre-back", "protocol": "HTTP", "port": 8080, "probe": lambda: http_probe("http://lecoffre-back:8080/api/v1/health")}, {"name": "LeCoffre Frontend", "container": "lecoffre-front", "protocol": "HTTP", "port": 3000}, {"name": "IHM Client", "container": "ihm_client", "protocol": "HTTP", "port": 3003}, {"name": "Grafana", "container": "grafana", "protocol": "HTTP", "port": 3000, "probe": lambda: http_probe("http://grafana:3000/api/health")}, diff --git a/web/status/working-api.js b/web/status/working-api.js index a9259c4..d5fba06 100644 --- a/web/status/working-api.js +++ b/web/status/working-api.js @@ -20,7 +20,6 @@ app.get('/api', (req, res) => { { name: 'SDK Relay', status: 'running', image: 'sdk_relay:ext', ip: '172.20.0.4', port: '8090', protocol: 'WebSocket', uptime: '2h 5m', health: 'healthy' }, { name: 'SDK Signer', status: 'running', image: 'sdk_signer:ext', ip: '172.20.0.5', port: '9090', protocol: 'WebSocket', uptime: '2h 0m', health: 'healthy' }, { name: 'SDK Storage', status: 'running', image: 'sdk_storage:ext', ip: '172.20.0.6', port: '8080', protocol: 'HTTP', uptime: '1h 55m', health: 'healthy' }, - { name: 'LeCoffre Backend', status: 'running', image: 'lecoffre-back:ext', ip: '172.20.0.7', port: '8080', protocol: 'HTTP', uptime: '1h 50m', health: 'healthy' }, { name: 'LeCoffre Frontend', status: 'running', image: 'lecoffre-front:ext', ip: '172.20.0.8', port: '3000', protocol: 'HTTP', uptime: '1h 45m', health: 'healthy' }, { name: 'IHM Client', status: 'running', image: 'ihm_client:ext', ip: '172.20.0.9', port: '3001', protocol: 'HTTP', uptime: '1h 40m', health: 'healthy' }, { name: 'Tor Proxy', status: 'running', image: 'btcpayserver/tor:0.4.8.10', ip: '172.20.0.10', port: '9050', protocol: 'SOCKS', uptime: '1h 35m', health: 'healthy' },