From 4834c405034965fd4dd661e719c825fbaf98142c Mon Sep 17 00:00:00 2001 From: 4NK Dev Date: Fri, 3 Oct 2025 17:13:19 +0000 Subject: [PATCH] ci: docker_tag=dev-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Séparation des scripts de génération et amélioration de l'architecture - Séparé generate_grafana_dashboards.sh en 3 scripts distincts : * generate_grafana_dashboards.sh (dashboards uniquement) * generate_promtail_config.sh (configuration Promtail) * generate_logrotate_configs.sh (configurations Logrotate) - Supprimé generate_docker_compose.sh et generate_docker_variables.sh - Centralisé la génération des variables dans generate_variables.sh - Mis à jour generate.sh pour une architecture en 5 étapes - Corrigé les chemins de sortie et les références de variables - Ajouté la gestion d'erreurs pour les fichiers .env problématiques - Généré toutes les configurations Nginx, Grafana, Promtail et Logrotate - Amélioré la modularité et la maintenabilité du code --- 4NK_vault.code-workspace | 8 +- README.md | 213 ++++++ storage/dev/.env | 58 +- storage/dev/.env.auto | 301 ++++---- storage/dev/4NK_modules/4NK_certificator/.env | 20 - .../dev/4NK_modules/4NK_certificator/.gitkeep | 1 - .../4NK_certificator/certificator.toml | 33 - storage/dev/4NK_modules/4NK_miner/.env | 4 - storage/dev/4NK_modules/4NK_miner/.gitkeep | 1 - .../dev/4NK_modules/4NK_web_status/.gitkeep | 1 - storage/dev/4NK_modules/bitcoin/.gitkeep | 1 - storage/dev/4NK_modules/bitcoin/bitcoin.conf | 45 -- .../dev/4NK_modules/blindbit-oracle/.gitkeep | 1 - .../4NK_modules/blindbit-oracle/blindbit.toml | 18 - storage/dev/4NK_modules/grafana/.env | 6 - storage/dev/4NK_modules/grafana/.gitkeep | 1 - .../4NK_modules/grafana/dashboards/.gitkeep | 0 ...ertificator.json => 4NK-certificator.json} | 20 +- .../{4nk-web-status.json => 4NK-miner.json} | 20 +- .../grafana/dashboards/4NK-vault.json | 308 ++++++++ .../grafana/dashboards/4NK-web-status.json | 308 ++++++++ .../dashboards/bitcoin-miner-detailed.json | 399 ---------- .../grafana/dashboards/bitcoin-miner.json | 160 ---- .../grafana/dashboards/bitcoin-services.json | 532 ------------- .../grafana/dashboards/frontend-services.json | 532 ------------- .../grafana/dashboards/lecoffre-overview.json | 252 ------- .../dashboards/{4nk-vault.json => ngnix.json} | 20 +- .../grafana/dashboards/sdk-services.json | 594 --------------- storage/dev/4NK_modules/grafana/grafana.ini | 57 -- storage/dev/4NK_modules/ihm_client/.env | 7 - storage/dev/4NK_modules/ihm_client/.gitkeep | 1 - storage/dev/4NK_modules/loki/.env | 1 - storage/dev/4NK_modules/loki/.gitkeep | 1 - storage/dev/4NK_modules/loki/loki-config.yaml | 76 -- storage/dev/4NK_modules/promtail/.env | 1 - storage/dev/4NK_modules/promtail/.gitkeep | 1 - storage/dev/4NK_modules/promtail/promtail.yml | 50 +- storage/dev/4NK_modules/redis/.gitkeep | 1 - storage/dev/4NK_modules/sdk_relay/.conf | 16 - storage/dev/4NK_modules/sdk_relay/.env | 12 - storage/dev/4NK_modules/sdk_relay/.gitkeep | 1 - storage/dev/4NK_modules/sdk_signer/.gitkeep | 1 - storage/dev/4NK_modules/sdk_storage/.env | 10 - storage/dev/4NK_modules/sdk_storage/.gitkeep | 1 - storage/dev/4NK_modules/tor-proxy/.gitkeep | 1 - storage/dev/4NK_modules/tor-proxy/torrc | 18 - storage/dev/README.md | 233 ++++++ .../grafana/dashboards/_4NK-certificator.json | 308 ++++++++ .../grafana/dashboards/_4NK-miner.json | 308 ++++++++ .../grafana/dashboards/_4NK-vault.json | 308 ++++++++ .../grafana/dashboards/_4NK-web-status.json | 308 ++++++++ .../grafana/dashboards/bitcoin.json | 308 ++++++++ .../grafana/dashboards/blindbit-oracle.json | 308 ++++++++ .../grafana/dashboards/grafana.json | 308 ++++++++ .../grafana/dashboards/ihm-client.json | 308 ++++++++ .../grafana/dashboards/lecoffre-front.json} | 20 +- .../_4NK_modules/grafana/dashboards/loki.json | 308 ++++++++ .../grafana/dashboards/ngnix.json | 308 ++++++++ .../grafana/dashboards/postgresql.json | 308 ++++++++ .../grafana/dashboards/promtail.json | 308 ++++++++ .../grafana/dashboards/redis.json | 308 ++++++++ .../grafana/dashboards/sdk-relay.json} | 20 +- .../grafana/dashboards/sdk-storage.json | 308 ++++++++ .../grafana/dashboards/services-overview.json | 119 +++ .../_4NK_modules/grafana/dashboards/tor.json | 308 ++++++++ .../dev/_4NK_modules/promtail/promtail.yml | 334 ++++++++ storage/dev/docker-compose.yml.auto | 535 +++++++++++++ storage/dev/generate.sh | 319 ++++++++ storage/dev/generate_grafana_dashboards.sh | 130 +--- storage/dev/generate_logrotate_configs.sh | 102 +++ storage/dev/generate_nginx_configs.sh | 429 +++++++++++ storage/dev/generate_promtail_config.sh | 121 +++ storage/dev/generate_variables.sh | 39 +- storage/dev/git/.env | 2 +- storage/dev/logrotade/.gitkeep | 1 - ...rtificator.conf => _4nk_certificator.conf} | 4 +- .../{4nk_miner.conf => _4nk_miner.conf} | 4 +- .../{4nk_vault.conf => _4nk_vault.conf} | 4 +- ...k_web_status.conf => _4nk_web_status.conf} | 4 +- storage/dev/logrotade/lecoffre-front.conf | 13 - storage/dev/logrotade/miner.conf | 13 - storage/dev/logrotade/nginx.conf | 13 - .../logrotade/{blindbit.conf => ngnix.conf} | 4 +- storage/dev/nginx/.gitkeep | 1 - storage/dev/nginx/BITCOIN_https.conf | 43 ++ storage/dev/nginx/BLINDBIT_ORACLE_https.conf | 43 ++ storage/dev/nginx/GRAFANA_https.conf | 43 ++ storage/dev/nginx/IHM_CLIENT_https.conf | 43 ++ storage/dev/nginx/LECOFFRE_FRONT_https.conf | 43 ++ storage/dev/nginx/LOKI_https.conf | 43 ++ storage/dev/nginx/NGNIX_https.conf | 43 ++ storage/dev/nginx/POSTGRESQL_https.conf | 43 ++ storage/dev/nginx/PROMTAIL_https.conf | 43 ++ storage/dev/nginx/REDIS_https.conf | 43 ++ storage/dev/nginx/SDK_RELAY_https.conf | 43 ++ storage/dev/nginx/SDK_STORAGE_https.conf | 43 ++ storage/dev/nginx/TOR_https.conf | 43 ++ .../dev/nginx/_4NK_CERTIFICATOR_https.conf | 43 ++ storage/dev/nginx/_4NK_MINER_https.conf | 43 ++ storage/dev/nginx/_4NK_VAULT_https.conf | 43 ++ storage/dev/nginx/_4NK_WEB_STATUS_https.conf | 43 ++ storage/dev/nginx/app-internal-ports.conf | 360 +++++++++ .../nginx/nginx_dev4.4NKweb.com-https.conf | 711 ++++++++++++++++++ .../nginx/nginx_dev4.4nkweb.com-https.conf | 711 ++++++++++++++++++ .../nginx/nginx_dev4._4NKweb.com-https.conf | 711 ++++++++++++++++++ .../dev/nginx/ngnix_dev4.4nkweb.com-http.conf | 15 - .../nginx/ngnix_dev4.4nkweb.com-https.conf | 57 -- storage/dev/nginx/proxy_headers.conf | 29 + storage/dev/nginx/route_blindbit.conf | 8 - storage/dev/nginx/route_favicon.conf | 4 - storage/dev/nginx/route_grafana.conf | 24 - storage/dev/nginx/route_ihm_client.conf | 11 - storage/dev/nginx/route_lecoffre.conf | 24 - storage/dev/nginx/route_lecoffre_hmr.conf | 11 - .../dev/nginx/route_lecoffre_redirect.conf | 1 - storage/dev/nginx/route_loki.conf | 15 - storage/dev/nginx/route_next_assets.conf | 12 - storage/dev/nginx/route_status.conf | 21 - storage/dev/nginx/route_status_api.conf | 21 - storage/dev/nginx/route_status_redirect.conf | 4 - storage/dev/nginx/route_ws.conf | 15 - storage/dev/nginx/upstreams.conf | 102 +++ storage/dev/nginx/validate_templates.sh | 73 ++ .../projects/lecoffre/docker-compose.yml.auto | 141 ++-- .../dev/projects/lecoffre/lecoffre-front/.env | 6 +- .../dev/projects/lecoffre/lecoffre_node/.env | 8 +- .../lecoffre/lecoffre_node/docker-compose.yml | 20 +- .../lecoffre_node/docker-compose.yml.auto | 138 ++-- storage/dev/supervisor/supervisord.conf | 24 +- storage/dev/test_generate.sh | 207 +++++ 130 files changed, 11767 insertions(+), 3645 deletions(-) delete mode 100644 storage/dev/4NK_modules/4NK_certificator/.env delete mode 100644 storage/dev/4NK_modules/4NK_certificator/.gitkeep delete mode 100644 storage/dev/4NK_modules/4NK_certificator/certificator.toml delete mode 100644 storage/dev/4NK_modules/4NK_miner/.env delete mode 100644 storage/dev/4NK_modules/4NK_miner/.gitkeep delete mode 100644 storage/dev/4NK_modules/4NK_web_status/.gitkeep delete mode 100644 storage/dev/4NK_modules/bitcoin/.gitkeep delete mode 100644 storage/dev/4NK_modules/bitcoin/bitcoin.conf delete mode 100644 storage/dev/4NK_modules/blindbit-oracle/.gitkeep delete mode 100644 storage/dev/4NK_modules/blindbit-oracle/blindbit.toml delete mode 100644 storage/dev/4NK_modules/grafana/.env delete mode 100644 storage/dev/4NK_modules/grafana/.gitkeep delete mode 100644 storage/dev/4NK_modules/grafana/dashboards/.gitkeep rename storage/dev/4NK_modules/grafana/dashboards/{4nk-certificator.json => 4NK-certificator.json} (90%) rename storage/dev/4NK_modules/grafana/dashboards/{4nk-web-status.json => 4NK-miner.json} (90%) create mode 100644 storage/dev/4NK_modules/grafana/dashboards/4NK-vault.json create mode 100644 storage/dev/4NK_modules/grafana/dashboards/4NK-web-status.json delete mode 100644 storage/dev/4NK_modules/grafana/dashboards/bitcoin-miner-detailed.json delete mode 100644 storage/dev/4NK_modules/grafana/dashboards/bitcoin-miner.json delete mode 100644 storage/dev/4NK_modules/grafana/dashboards/bitcoin-services.json delete mode 100644 storage/dev/4NK_modules/grafana/dashboards/frontend-services.json delete mode 100644 storage/dev/4NK_modules/grafana/dashboards/lecoffre-overview.json rename storage/dev/4NK_modules/grafana/dashboards/{4nk-vault.json => ngnix.json} (91%) delete mode 100644 storage/dev/4NK_modules/grafana/dashboards/sdk-services.json delete mode 100644 storage/dev/4NK_modules/grafana/grafana.ini delete mode 100644 storage/dev/4NK_modules/ihm_client/.env delete mode 100644 storage/dev/4NK_modules/ihm_client/.gitkeep delete mode 100644 storage/dev/4NK_modules/loki/.env delete mode 100644 storage/dev/4NK_modules/loki/.gitkeep delete mode 100644 storage/dev/4NK_modules/loki/loki-config.yaml delete mode 100644 storage/dev/4NK_modules/promtail/.env delete mode 100644 storage/dev/4NK_modules/promtail/.gitkeep delete mode 100644 storage/dev/4NK_modules/redis/.gitkeep delete mode 100644 storage/dev/4NK_modules/sdk_relay/.conf delete mode 100644 storage/dev/4NK_modules/sdk_relay/.env delete mode 100644 storage/dev/4NK_modules/sdk_relay/.gitkeep delete mode 100644 storage/dev/4NK_modules/sdk_signer/.gitkeep delete mode 100644 storage/dev/4NK_modules/sdk_storage/.env delete mode 100644 storage/dev/4NK_modules/sdk_storage/.gitkeep delete mode 100644 storage/dev/4NK_modules/tor-proxy/.gitkeep delete mode 100644 storage/dev/4NK_modules/tor-proxy/torrc create mode 100644 storage/dev/README.md create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/_4NK-certificator.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/_4NK-miner.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/_4NK-vault.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/_4NK-web-status.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/bitcoin.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/blindbit-oracle.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/grafana.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/ihm-client.json rename storage/dev/{4NK_modules/grafana/dashboards/.json => _4NK_modules/grafana/dashboards/lecoffre-front.json} (93%) create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/loki.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/ngnix.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/postgresql.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/promtail.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/redis.json rename storage/dev/{4NK_modules/grafana/dashboards/4nk-miner.json => _4NK_modules/grafana/dashboards/sdk-relay.json} (93%) create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/sdk-storage.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/services-overview.json create mode 100644 storage/dev/_4NK_modules/grafana/dashboards/tor.json create mode 100644 storage/dev/_4NK_modules/promtail/promtail.yml create mode 100644 storage/dev/docker-compose.yml.auto create mode 100755 storage/dev/generate.sh create mode 100755 storage/dev/generate_logrotate_configs.sh create mode 100755 storage/dev/generate_nginx_configs.sh create mode 100755 storage/dev/generate_promtail_config.sh delete mode 100644 storage/dev/logrotade/.gitkeep rename storage/dev/logrotade/{4nk_certificator.conf => _4nk_certificator.conf} (62%) rename storage/dev/logrotade/{4nk_miner.conf => _4nk_miner.conf} (66%) rename storage/dev/logrotade/{4nk_vault.conf => _4nk_vault.conf} (66%) rename storage/dev/logrotade/{4nk_web_status.conf => _4nk_web_status.conf} (63%) delete mode 100644 storage/dev/logrotade/lecoffre-front.conf delete mode 100644 storage/dev/logrotade/miner.conf delete mode 100644 storage/dev/logrotade/nginx.conf rename storage/dev/logrotade/{blindbit.conf => ngnix.conf} (68%) delete mode 100644 storage/dev/nginx/.gitkeep create mode 100644 storage/dev/nginx/BITCOIN_https.conf create mode 100644 storage/dev/nginx/BLINDBIT_ORACLE_https.conf create mode 100644 storage/dev/nginx/GRAFANA_https.conf create mode 100644 storage/dev/nginx/IHM_CLIENT_https.conf create mode 100644 storage/dev/nginx/LECOFFRE_FRONT_https.conf create mode 100644 storage/dev/nginx/LOKI_https.conf create mode 100644 storage/dev/nginx/NGNIX_https.conf create mode 100644 storage/dev/nginx/POSTGRESQL_https.conf create mode 100644 storage/dev/nginx/PROMTAIL_https.conf create mode 100644 storage/dev/nginx/REDIS_https.conf create mode 100644 storage/dev/nginx/SDK_RELAY_https.conf create mode 100644 storage/dev/nginx/SDK_STORAGE_https.conf create mode 100644 storage/dev/nginx/TOR_https.conf create mode 100644 storage/dev/nginx/_4NK_CERTIFICATOR_https.conf create mode 100644 storage/dev/nginx/_4NK_MINER_https.conf create mode 100644 storage/dev/nginx/_4NK_VAULT_https.conf create mode 100644 storage/dev/nginx/_4NK_WEB_STATUS_https.conf create mode 100644 storage/dev/nginx/app-internal-ports.conf create mode 100644 storage/dev/nginx/nginx_dev4.4NKweb.com-https.conf create mode 100644 storage/dev/nginx/nginx_dev4.4nkweb.com-https.conf create mode 100644 storage/dev/nginx/nginx_dev4._4NKweb.com-https.conf delete mode 100644 storage/dev/nginx/ngnix_dev4.4nkweb.com-http.conf delete mode 100644 storage/dev/nginx/ngnix_dev4.4nkweb.com-https.conf create mode 100644 storage/dev/nginx/proxy_headers.conf delete mode 100644 storage/dev/nginx/route_blindbit.conf delete mode 100644 storage/dev/nginx/route_favicon.conf delete mode 100644 storage/dev/nginx/route_grafana.conf delete mode 100644 storage/dev/nginx/route_ihm_client.conf delete mode 100644 storage/dev/nginx/route_lecoffre.conf delete mode 100644 storage/dev/nginx/route_lecoffre_hmr.conf delete mode 100644 storage/dev/nginx/route_lecoffre_redirect.conf delete mode 100644 storage/dev/nginx/route_loki.conf delete mode 100644 storage/dev/nginx/route_next_assets.conf delete mode 100644 storage/dev/nginx/route_status.conf delete mode 100644 storage/dev/nginx/route_status_api.conf delete mode 100644 storage/dev/nginx/route_status_redirect.conf delete mode 100644 storage/dev/nginx/route_ws.conf create mode 100644 storage/dev/nginx/upstreams.conf create mode 100755 storage/dev/nginx/validate_templates.sh create mode 100755 storage/dev/test_generate.sh diff --git a/4NK_vault.code-workspace b/4NK_vault.code-workspace index f7d202f..362d7c2 100644 --- a/4NK_vault.code-workspace +++ b/4NK_vault.code-workspace @@ -1,11 +1,7 @@ { "folders": [ { - "path": "../../.." - }, - { - "path": "../../../../../../etc/nginx" + "path": "." } - ], - "settings": {} + ] } \ No newline at end of file diff --git a/README.md b/README.md index 11c3b40..6c9e153 100644 --- a/README.md +++ b/README.md @@ -190,4 +190,217 @@ Les fichiers suivants sont centralisés dans le dépôt principal `4NK_env` : - `CONTRIBUTING.md` - Guide de contribution - `LICENSE` - Licence du projet +## 🚀 Politique NGINX + +### Introduction + +La configuration retenue met en place un reverse-proxy Nginx conteneurisé qui sert de point d'entrée unique. Elle distingue clairement les flux externes (terminaison TLS en 443) et les flux internes intra-Docker (routés par ports Nginx 8081/8082, non publiés sur l'hôte). Les applications tournent dans des conteneurs dédiés app1 (8081) et app2 (8082). Les en-têtes de traçabilité sont normalisés et les redirections sont maîtrisées pour éviter toute boucle. + +### 🏗️ Architecture Générale + +#### Configuration Fonctionnelle +- **Nginx conteneurisé** : Partage le réseau Docker `app_net` avec app1 et app2 +- **Ports externes** : 80 et 443 publiés vers l'hôte pour l'accès externe +- **Ports internes** : 8081 et 8082 non publiés (accessibles uniquement depuis les conteneurs) + +#### Flux de Trafic + +**Flux Externes :** +- **Port 80** → Redirection 301 vers port 443 +- **Port 443** → Terminaison TLS + proxy vers upstream HTTP (app1:8081 ou app2:8082) + +**Flux Internes Intra-Docker :** +- `http://nginx:8081/` → Nginx (port 8081) → app1:8081 +- `http://nginx:8082/` → Nginx (port 8082) → app2:8082 + +### 🔧 Configuration Technique + +#### Docker Compose +```yaml +nginx: + ports: + - "80:80" + - "443:443" + volumes: + - ./nginx/conf.d:/etc/nginx/conf.d + - ./nginx/snippets:/etc/nginx/snippets + - ./certs:/etc/nginx/certs + - ./logs:/var/log/nginx + depends_on: + - app1 + - app2 + networks: + - app_net + +app1: + expose: + - "8081" + networks: + - app_net + +app2: + expose: + - "8082" + networks: + - app_net +``` + +#### Upstreams (`nginx/conf.d/upstreams.conf`) +```nginx +upstream app1_docker { + server app1:8081; + keepalive 32; +} + +upstream app2_docker { + server app2:8082; + keepalive 32; +} + +# Format de logs JSON pour l'observabilité +log_format app_json escape=json + '{ "time":"$time_iso8601",' + ' "client":"$remote_addr",' + ' "xff":"$http_x_forwarded_for",' + ' "method":"$request_method",' + ' "host":"$host",' + ' "uri":"$request_uri",' + ' "status":$status,' + ' "bytes":$body_bytes_sent,' + ' "ua":"$http_user_agent",' + ' "upstream":"$upstream_addr",' + ' "rt":$request_time,' + ' "urt":$upstream_response_time }'; +``` + +#### Headers Proxy (`nginx/snippets/proxy_headers.conf`) +```nginx +proxy_http_version 1.1; + +# Headers de base +proxy_set_header Host $host; +proxy_set_header X-Forwarded-Host $host; +proxy_set_header X-Forwarded-Port $server_port; +proxy_set_header X-Forwarded-Proto $scheme; +proxy_set_header X-Forwarded-For $remote_addr; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header Connection ""; + +# Directives anti-boucle et debug +proxy_redirect off; +add_header X-Debug-Scheme $scheme always; +add_header X-Debug-XFP $http_x_forwarded_proto always; + +# Timeouts et buffers +proxy_connect_timeout 5s; +proxy_send_timeout 60s; +proxy_read_timeout 60s; +proxy_buffering on; +proxy_buffers 32 16k; +client_max_body_size 50m; +``` + +### 🌐 Configuration des VHosts + +#### VHosts Externes (Ports 80/443) + +**Redirection HTTP → HTTPS :** +```nginx +server { + listen 80; + server_name app1.exemple.tld app2.exemple.tld; + return 301 https://$host$request_uri; +} +``` + +**Terminaison HTTPS :** +```nginx +server { + listen 443 ssl http2; + server_name app1.exemple.tld; + + ssl_certificate /etc/nginx/certs/fullchain.pem; + ssl_certificate_key /etc/nginx/certs/privkey.pem; + + location / { + include snippets/proxy_headers.conf; + proxy_pass http://app1_docker; + + # Support WebSocket + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 3600s; + } +} +``` + +#### VHosts Internes (Ports 8081/8082) + +```nginx +server { + listen 8081 default_server; + server_name _; + + location / { + include snippets/proxy_headers.conf; + proxy_pass http://app1_docker; + } +} + +server { + listen 8082 default_server; + server_name _; + + location / { + include snippets/proxy_headers.conf; + proxy_pass http://app2_docker; + } +} +``` + +### ⚠️ Points d'Attention Opérationnels + +#### Configuration des Applications +- **Confiance Proxy** : Activer l'interprétation des headers `X-Forwarded-Proto` et `X-Forwarded-Host` +- **Frameworks Supportés** : Django/Flask, Rails, Express, Spring, Go frameworks, etc. +- **Redirection Réflexe** : Condition nécessaire pour éviter les boucles de redirection + +#### Sécurité +- **HSTS** : Ne pas activer sur les ports internes 8081/8082 +- **HSTS Externe** : Réserver aux vhosts externes en 443 si tout le domaine est en HTTPS +- **CDN/Proxy Amont** : Compléter avec `real_ip_header`/`set_real_ip_from` pour fiabiliser `$remote_addr` + +### 🧪 Tests de Non-Régression + +#### Tests Externes +```bash +# Redirection HTTP → HTTPS +curl -I http://app1.exemple.tld/ +# Attendu: 301 Location: https://app1.exemple.tld/... + +# Accès HTTPS direct +curl -I https://app1.exemple.tld/ +# Attendu: 200 (pas de 3xx) +``` + +#### Tests Internes +```bash +# Depuis un conteneur sur app_net +curl -I http://nginx:8081/ +curl -I http://nginx:8082/ +# Attendu: 200 (pas de 3xx) +``` + +### 📋 Conclusion + +La **Variante A intra-Docker** fournit un schéma propre : +- **Externe** : HTTPS avec redirection unique depuis le port 80 +- **Interne** : Nginx sur ports 8081/8082 sans exposition vers l'hôte +- **En-têtes standardisés** : Traçabilité et robustesse garanties +- **Anti-boucles** : `proxy_redirect off` et headers de debug +- **WebSocket** : Support natif avec timeouts étendus + +Cette base est prête pour la production et extensible à d'autres services. + Voir : [`4NK_env/CODE_OF_CONDUCT.md`](../../CODE_OF_CONDUCT.md), [`4NK_env/CODEOWNERS`](../../CODEOWNERS), [`4NK_env/CONTRIBUTING.md`](../../CONTRIBUTING.md), [`4NK_env/LICENSE`](../../LICENSE) diff --git a/storage/dev/.env b/storage/dev/.env index 659e488..16b4e9e 100644 --- a/storage/dev/.env +++ b/storage/dev/.env @@ -1,14 +1,14 @@ # Modifiez ces valeurs selon votre environnement ENV_NAME=DEV -DOMAIN=4nkweb.com +DOMAIN=_4NKweb.com HOST=dev4.$DOMAIN BACK_API_HOST=dev3.$DOMAIN BOOSTRAP_NETWORK_HOST=dev3.$DOMAIN DOCKER_LOG_LEVEL=info COMPOSE_LOG_LEVEL=WARNING -NODE_OPTIONS=--max-old-space-size=4096 +NODE_OPTIONS="--max-old-space-size=4096" NODE_ENV=production -ROOT_DIR=/home/debian/4NK_env +ROOT_DIR=/home/debian/_4NK_env DOCKER_GLOBAL_NAME=projects/lecoffre/$DOCKER_GLOBAL_NAME DOCKER_GLOBAL=$ROOT_DIR/DOCKER_GLOBAL_NAME NGINX_LOGS_DIR=$DOCKER_GLOBAL/logs/nginx @@ -24,17 +24,18 @@ export SERVICES=( "LOKI" "PROMTAIL" "GRAFANA" - "4NK_VAULT" + "NGNIX" "TOR" + "_4NK_VAULT" "BITCOIN" "BLINDBIT_ORACLE" "SDK_RELAY" "SDK_STORAGE" "IHM_CLIENT" - "4NK_CERTIFICATOR" - "4NK_MINER" + "_4NK_CERTIFICATOR" + "_4NK_MINER" "LECOFFRE_FRONT" - "4NK_WEB_STATUS" + "_4NK_WEB_STATUS" ) REDIS=redis @@ -58,13 +59,18 @@ PROMTAIL=promtail PROMTAIL_IMAGE=grafana/promtail:latest PROMTAIL_PORT=8090:8090 -4NK_VAULT=4NK_vault -4NK_VAULT_IMAGE=git.4nkweb.com/4nk/4NK_vault:ext +NGINX=nginx +NGINX_IMAGE=nginx:stable +NGINX_PORT=443 +NGINX_PORT2=80 TOR=tor-proxy TOR_IMAGE=btcpayserver/tor:0.4.8.10 TOR_PORT=9050:9050 +_4NK_VAULT=_4NK_vault +_4NK_VAULT_IMAGE=git._4NKweb.com/_4NK/_4NK_vault:ext + BITCOIN=bitcoin BITCOIN_IMAGE=lscr.io/linuxserver/bitcoin-knots:latest BITCOIN_PORT=38332:38332 @@ -73,37 +79,37 @@ BITCOIN_PORT2=29001:29001 BITCOIN_PORT3=29000:29000 BLINDBIT_ORACLE=blindbit-oracle -BLINDBIT_ORACLE_IMAGE=git.4nkweb.com/4nk/blindbit-oracle:fixed-source +BLINDBIT_ORACLE_IMAGE=git._4NKweb.com/_4NK/blindbit-oracle:fixed-source BLINDBIT_ORACLE_PORT=8000:8000 SDK_RELAY=sdk_relay -SDK_RELAY_IMAGE=git.4nkweb.com/4nk/sdk_relay:ext +SDK_RELAY_IMAGE=git._4NKweb.com/_4NK/sdk_relay:ext SDK_RELAY_PORT=8080:8080 SDK_STORAGE=sdk_storage -SDK_STORAGE_IMAGE=git.4nkweb.com/4nk/sdk_storage:ext +SDK_STORAGE_IMAGE=git._4NKweb.com/_4NK/sdk_storage:ext SDK_STORAGE_PORT=8081:8081 IHM_CLIENT=ihm_client -IHM_CLIENT_IMAGE=git.4nkweb.com/4nk/ihm_client:ext +IHM_CLIENT_IMAGE=git._4NKweb.com/_4NK/ihm_client:ext IHM_CLIENT_PORT=3003:3003 -4NK_CERTIFICATOR=4NK_certificator -4NK_CERTIFICATOR_IMAGE=git.4nkweb.com/4nk/4NK_certificator:ext -4NK_CERTIFICATOR_PORT=8082:8082 +_4NK_CERTIFICATOR=_4NK_certificator +_4NK_CERTIFICATOR_IMAGE=git._4NKweb.com/_4NK/_4NK_certificator:ext +_4NK_CERTIFICATOR_PORT=8082:8082 -4NK_MINER=4NK_miner -4NK_MINER_IMAGE=git.4nkweb.com/4nk/4NK_miner:ext -4NK_MINER_PORT=8083:8083 +_4NK_MINER=_4NK_miner +_4NK_MINER_IMAGE=git._4NKweb.com/_4NK/_4NK_miner:ext +_4NK_MINER_PORT=8083:8083 LECOFFRE_FRONT=lecoffre-front -LECOFFRE_FRONT_IMAGE=git.4nkweb.com/4nk/lecoffre-front:ext +LECOFFRE_FRONT_IMAGE=git._4NKweb.com/_4NK/lecoffre-front:ext LECOFFRE_FRONT_PORT=3000:3000 -4NK_WEB_STATUS=4NK_web_status -4NK_STATUS_IMAGE=git.4nkweb.com/4nk/4NK_web_status:ext -4NK_WEB_STATUS_PORT=3006:3006 -4NK_WEB_STATUS_EXTERNAL_PORT=3006:3006 +_4NK_WEB_STATUS=_4NK_web_status +_4NK_STATUS_IMAGE=git._4NKweb.com/_4NK/_4NK_web_status:ext +_4NK_WEB_STATUS_PORT=3006:3006 +_4NK_WEB_STATUS_EXTERNAL_PORT=3006:3006 ## Externes @@ -114,13 +120,13 @@ SERVICES_EXTERNAL=( SDK_SIGNER=sdk_signer SDK_SIGNER_HOST=$BACK_API_HOST -SDK_SIGNER_IMAGE=git.4nkweb.com/4nk/sdk_signer:ext +SDK_SIGNER_IMAGE=git._4NKweb.com/_4NK/sdk_signer:ext SDK_SIGNER_PORT=9090:9090 SDK_SIGNER_EXTERNAL_PORT=9090 LECOFFRE_BACK_MINI=lecoffre-back-mini LECOFFRE_BACK_MINI_HOST=$BACK_API_HOST -LECOFFRE_BACK_MINI_IMAGE=git.4nkweb.com/4nk/lecoffre-back-mini:ext +LECOFFRE_BACK_MINI_IMAGE=git._4NKweb.com/_4NK/lecoffre-back-mini:ext LECOFFRE_BACK_MINI_PORT=3001:3001 LECOFFRE_BACK_MINI_EXTERNAL_PORT=3001 diff --git a/storage/dev/.env.auto b/storage/dev/.env.auto index 5a35ae5..d54edc4 100644 --- a/storage/dev/.env.auto +++ b/storage/dev/.env.auto @@ -19,10 +19,11 @@ REDIS_DOCKER_WORKING_DIR=/home/$REDIS REDIS_DOCKER_WORKING_DIR_CREATE="id -u $REDIS >/dev/null 2>&1 || adduser --disabled-password --gecos '' $REDIS; chown -R $REDIS:$REDIS /home/root/.$REDIS || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" REDIS_URL_ROUTE=/$REDIS -REDIS_URL=$ROOT_URL_INTERNAL\$REDIS_DOCKER_NAME:$REDIS_DOCKER_PORT -REDIS_URL_EXTERNAL=$ROOT_URL$REDIS_URL_ROUTE -REDIS_URL_WS=$ROOT_URL_WS_INTERNAL\$REDIS_DOCKER_PORT -REDIS_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +REDIS_URL=http://\$REDIS_DOCKER_NAME:$REDIS_DOCKER_PORT +REDIS_URL_EXTERNAL=https://$HOST$REDIS_URL_ROUTE +REDIS_URL_WS=ws://\$REDIS_DOCKER_PORT +REDIS_URL_WS_EXTERNAL=wss://$HOST\ws + # ====== INTERNAL POSTGRESQL ====== @@ -45,10 +46,10 @@ POSTGRESQL_DOCKER_WORKING_DIR=/home/$POSTGRESQL POSTGRESQL_DOCKER_WORKING_DIR_CREATE="id -u $POSTGRESQL >/dev/null 2>&1 || adduser --disabled-password --gecos '' $POSTGRESQL; chown -R $POSTGRESQL:$POSTGRESQL /home/root/.$POSTGRESQL || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" POSTGRESQL_URL_ROUTE=/$POSTGRESQL -POSTGRESQL_URL=$ROOT_URL_INTERNAL\$POSTGRESQL_DOCKER_NAME:$POSTGRESQL_DOCKER_PORT -POSTGRESQL_URL_EXTERNAL=$ROOT_URL$POSTGRESQL_URL_ROUTE -POSTGRESQL_URL_WS=$ROOT_URL_WS_INTERNAL\$POSTGRESQL_DOCKER_PORT -POSTGRESQL_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +POSTGRESQL_URL=http://\$POSTGRESQL_DOCKER_NAME:$POSTGRESQL_DOCKER_PORT +POSTGRESQL_URL_EXTERNAL=https://$HOST$POSTGRESQL_URL_ROUTE +POSTGRESQL_URL_WS=ws://\$POSTGRESQL_DOCKER_PORT +POSTGRESQL_URL_WS_EXTERNAL=wss://$HOST\ws # ====== INTERNAL LOKI ====== @@ -72,10 +73,10 @@ LOKI_DOCKER_WORKING_DIR=/home/$LOKI LOKI_DOCKER_WORKING_DIR_CREATE="id -u $LOKI >/dev/null 2>&1 || adduser --disabled-password --gecos '' $LOKI; chown -R $LOKI:$LOKI /home/root/.$LOKI || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" LOKI_URL_ROUTE=/$LOKI -LOKI_URL=$ROOT_URL_INTERNAL\$LOKI_DOCKER_NAME:$LOKI_DOCKER_PORT -LOKI_URL_EXTERNAL=$ROOT_URL$LOKI_URL_ROUTE -LOKI_URL_WS=$ROOT_URL_WS_INTERNAL\$LOKI_DOCKER_PORT -LOKI_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +LOKI_URL=http://\$LOKI_DOCKER_NAME:$LOKI_DOCKER_PORT +LOKI_URL_EXTERNAL=https://$HOST$LOKI_URL_ROUTE +LOKI_URL_WS=ws://\$LOKI_DOCKER_PORT +LOKI_URL_WS_EXTERNAL=wss://$HOST\ws # ====== INTERNAL PROMTAIL ====== @@ -99,10 +100,10 @@ PROMTAIL_DOCKER_WORKING_DIR=/home/$PROMTAIL PROMTAIL_DOCKER_WORKING_DIR_CREATE="id -u $PROMTAIL >/dev/null 2>&1 || adduser --disabled-password --gecos '' $PROMTAIL; chown -R $PROMTAIL:$PROMTAIL /home/root/.$PROMTAIL || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" PROMTAIL_URL_ROUTE=/$PROMTAIL -PROMTAIL_URL=$ROOT_URL_INTERNAL\$PROMTAIL_DOCKER_NAME:$PROMTAIL_DOCKER_PORT -PROMTAIL_URL_EXTERNAL=$ROOT_URL$PROMTAIL_URL_ROUTE -PROMTAIL_URL_WS=$ROOT_URL_WS_INTERNAL\$PROMTAIL_DOCKER_PORT -PROMTAIL_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +PROMTAIL_URL=http://\$PROMTAIL_DOCKER_NAME:$PROMTAIL_DOCKER_PORT +PROMTAIL_URL_EXTERNAL=https://$HOST$PROMTAIL_URL_ROUTE +PROMTAIL_URL_WS=ws://\$PROMTAIL_DOCKER_PORT +PROMTAIL_URL_WS_EXTERNAL=wss://$HOST\ws # ====== INTERNAL GRAFANA ====== @@ -126,37 +127,37 @@ GRAFANA_DOCKER_WORKING_DIR=/home/$GRAFANA GRAFANA_DOCKER_WORKING_DIR_CREATE="id -u $GRAFANA >/dev/null 2>&1 || adduser --disabled-password --gecos '' $GRAFANA; chown -R $GRAFANA:$GRAFANA /home/root/.$GRAFANA || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" GRAFANA_URL_ROUTE=/$GRAFANA -GRAFANA_URL=$ROOT_URL_INTERNAL\$GRAFANA_DOCKER_NAME:$GRAFANA_DOCKER_PORT -GRAFANA_URL_EXTERNAL=$ROOT_URL$GRAFANA_URL_ROUTE -GRAFANA_URL_WS=$ROOT_URL_WS_INTERNAL\$GRAFANA_DOCKER_PORT -GRAFANA_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +GRAFANA_URL=http://\$GRAFANA_DOCKER_NAME:$GRAFANA_DOCKER_PORT +GRAFANA_URL_EXTERNAL=https://$HOST$GRAFANA_URL_ROUTE +GRAFANA_URL_WS=ws://\$GRAFANA_DOCKER_PORT +GRAFANA_URL_WS_EXTERNAL=wss://$HOST\ws -# ====== INTERNAL 4NK_VAULT ====== +# ====== INTERNAL NGNIX ====== -4NK_VAULT_DOCKER_NAME=$4NK_VAULT -4NK_VAULT_CONFS_DIR=$DOCKER_GLOBAL/confs/$4NK_VAULT -4NK_VAULT_LOGS_DIR=$DOCKER_GLOBAL/logs/$4NK_VAULT -4NK_VAULT_RUNS_DIR=$DOCKER_GLOBAL/runs/$4NK_VAULT -4NK_VAULT_DATAS_DIR=$DOCKER_GLOBAL/datas/$4NK_VAULT -4NK_VAULT_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$4NK_VAULT -4NK_VAULT_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$4NK_VAULT -4NK_VAULT_DOCKER_WORKING_DIR=/home/$4NK_VAULT +NGNIX_DOCKER_NAME=$NGNIX +NGNIX_CONFS_DIR=$DOCKER_GLOBAL/confs/$NGNIX +NGNIX_LOGS_DIR=$DOCKER_GLOBAL/logs/$NGNIX +NGNIX_RUNS_DIR=$DOCKER_GLOBAL/runs/$NGNIX +NGNIX_DATAS_DIR=$DOCKER_GLOBAL/datas/$NGNIX +NGNIX_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$NGNIX +NGNIX_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$NGNIX +NGNIX_DOCKER_WORKING_DIR=/home/$NGNIX -4NK_VAULT_DOCKER_CONFS_DIR=$DOCKER_GLOBAL/confs/$4NK_VAULT -4NK_VAULT_DOCKER_LOGS_DIR=$DOCKER_GLOBAL/logs/$4NK_VAULT -4NK_VAULT_DOCKER_RUNS_DIR=$DOCKER_GLOBAL/runs/$4NK_VAULT -4NK_VAULT_DOCKER_DATAS_DIR=$DOCKER_GLOBAL/datas/$4NK_VAULT -4NK_VAULT_DOCKER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$4NK_VAULT -4NK_VAULT_DOCKER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$4NK_VAULT -4NK_VAULT_DOCKER_WORKING_DIR=/home/$4NK_VAULT +NGNIX_DOCKER_CONFS_DIR=$DOCKER_GLOBAL/confs/$NGNIX +NGNIX_DOCKER_LOGS_DIR=$DOCKER_GLOBAL/logs/$NGNIX +NGNIX_DOCKER_RUNS_DIR=$DOCKER_GLOBAL/runs/$NGNIX +NGNIX_DOCKER_DATAS_DIR=$DOCKER_GLOBAL/datas/$NGNIX +NGNIX_DOCKER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$NGNIX +NGNIX_DOCKER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$NGNIX +NGNIX_DOCKER_WORKING_DIR=/home/$NGNIX -4NK_VAULT_DOCKER_WORKING_DIR_CREATE="id -u $4NK_VAULT >/dev/null 2>&1 || adduser --disabled-password --gecos '' $4NK_VAULT; chown -R $4NK_VAULT:$4NK_VAULT /home/root/.$4NK_VAULT || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" -4NK_VAULT_URL_ROUTE=/$4NK_VAULT -4NK_VAULT_URL=$ROOT_URL_INTERNAL\$4NK_VAULT_DOCKER_NAME:$4NK_VAULT_DOCKER_PORT -4NK_VAULT_URL_EXTERNAL=$ROOT_URL$4NK_VAULT_URL_ROUTE -4NK_VAULT_URL_WS=$ROOT_URL_WS_INTERNAL\$4NK_VAULT_DOCKER_PORT -4NK_VAULT_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +NGNIX_DOCKER_WORKING_DIR_CREATE="id -u $NGNIX >/dev/null 2>&1 || adduser --disabled-password --gecos '' $NGNIX; chown -R $NGNIX:$NGNIX /home/root/.$NGNIX || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" +NGNIX_URL_ROUTE=/$NGNIX +NGNIX_URL=http://\$NGNIX_DOCKER_NAME:$NGNIX_DOCKER_PORT +NGNIX_URL_EXTERNAL=https://$HOST$NGNIX_URL_ROUTE +NGNIX_URL_WS=ws://\$NGNIX_DOCKER_PORT +NGNIX_URL_WS_EXTERNAL=wss://$HOST\ws # ====== INTERNAL TOR ====== @@ -180,10 +181,37 @@ TOR_DOCKER_WORKING_DIR=/home/$TOR TOR_DOCKER_WORKING_DIR_CREATE="id -u $TOR >/dev/null 2>&1 || adduser --disabled-password --gecos '' $TOR; chown -R $TOR:$TOR /home/root/.$TOR || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" TOR_URL_ROUTE=/$TOR -TOR_URL=$ROOT_URL_INTERNAL\$TOR_DOCKER_NAME:$TOR_DOCKER_PORT -TOR_URL_EXTERNAL=$ROOT_URL$TOR_URL_ROUTE -TOR_URL_WS=$ROOT_URL_WS_INTERNAL\$TOR_DOCKER_PORT -TOR_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +TOR_URL=http://\$TOR_DOCKER_NAME:$TOR_DOCKER_PORT +TOR_URL_EXTERNAL=https://$HOST$TOR_URL_ROUTE +TOR_URL_WS=ws://\$TOR_DOCKER_PORT +TOR_URL_WS_EXTERNAL=wss://$HOST\ws + + +# ====== INTERNAL _4NK_VAULT ====== + +_4NK_VAULT_DOCKER_NAME=$_4NK_VAULT +_4NK_VAULT_CONFS_DIR=$DOCKER_GLOBAL/confs/$_4NK_VAULT +_4NK_VAULT_LOGS_DIR=$DOCKER_GLOBAL/logs/$_4NK_VAULT +_4NK_VAULT_RUNS_DIR=$DOCKER_GLOBAL/runs/$_4NK_VAULT +_4NK_VAULT_DATAS_DIR=$DOCKER_GLOBAL/datas/$_4NK_VAULT +_4NK_VAULT_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$_4NK_VAULT +_4NK_VAULT_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$_4NK_VAULT +_4NK_VAULT_DOCKER_WORKING_DIR=/home/$_4NK_VAULT + +_4NK_VAULT_DOCKER_CONFS_DIR=$DOCKER_GLOBAL/confs/$_4NK_VAULT +_4NK_VAULT_DOCKER_LOGS_DIR=$DOCKER_GLOBAL/logs/$_4NK_VAULT +_4NK_VAULT_DOCKER_RUNS_DIR=$DOCKER_GLOBAL/runs/$_4NK_VAULT +_4NK_VAULT_DOCKER_DATAS_DIR=$DOCKER_GLOBAL/datas/$_4NK_VAULT +_4NK_VAULT_DOCKER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$_4NK_VAULT +_4NK_VAULT_DOCKER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$_4NK_VAULT +_4NK_VAULT_DOCKER_WORKING_DIR=/home/$_4NK_VAULT + +_4NK_VAULT_DOCKER_WORKING_DIR_CREATE="id -u $_4NK_VAULT >/dev/null 2>&1 || adduser --disabled-password --gecos '' $_4NK_VAULT; chown -R $_4NK_VAULT:$_4NK_VAULT /home/root/.$_4NK_VAULT || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" +_4NK_VAULT_URL_ROUTE=/$_4NK_VAULT +_4NK_VAULT_URL=http://\$_4NK_VAULT_DOCKER_NAME:$_4NK_VAULT_DOCKER_PORT +_4NK_VAULT_URL_EXTERNAL=https://$HOST$_4NK_VAULT_URL_ROUTE +_4NK_VAULT_URL_WS=ws://\$_4NK_VAULT_DOCKER_PORT +_4NK_VAULT_URL_WS_EXTERNAL=wss://$HOST\ws # ====== INTERNAL BITCOIN ====== @@ -207,10 +235,10 @@ BITCOIN_DOCKER_WORKING_DIR=/home/$BITCOIN BITCOIN_DOCKER_WORKING_DIR_CREATE="id -u $BITCOIN >/dev/null 2>&1 || adduser --disabled-password --gecos '' $BITCOIN; chown -R $BITCOIN:$BITCOIN /home/root/.$BITCOIN || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" BITCOIN_URL_ROUTE=/$BITCOIN -BITCOIN_URL=$ROOT_URL_INTERNAL\$BITCOIN_DOCKER_NAME:$BITCOIN_DOCKER_PORT -BITCOIN_URL_EXTERNAL=$ROOT_URL$BITCOIN_URL_ROUTE -BITCOIN_URL_WS=$ROOT_URL_WS_INTERNAL\$BITCOIN_DOCKER_PORT -BITCOIN_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +BITCOIN_URL=http://\$BITCOIN_DOCKER_NAME:$BITCOIN_DOCKER_PORT +BITCOIN_URL_EXTERNAL=https://$HOST$BITCOIN_URL_ROUTE +BITCOIN_URL_WS=ws://\$BITCOIN_DOCKER_PORT +BITCOIN_URL_WS_EXTERNAL=wss://$HOST\ws # ====== INTERNAL BLINDBIT_ORACLE ====== @@ -234,10 +262,10 @@ BLINDBIT_ORACLE_DOCKER_WORKING_DIR=/home/$BLINDBIT_ORACLE BLINDBIT_ORACLE_DOCKER_WORKING_DIR_CREATE="id -u $BLINDBIT_ORACLE >/dev/null 2>&1 || adduser --disabled-password --gecos '' $BLINDBIT_ORACLE; chown -R $BLINDBIT_ORACLE:$BLINDBIT_ORACLE /home/root/.$BLINDBIT_ORACLE || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" BLINDBIT_ORACLE_URL_ROUTE=/$BLINDBIT_ORACLE -BLINDBIT_ORACLE_URL=$ROOT_URL_INTERNAL\$BLINDBIT_ORACLE_DOCKER_NAME:$BLINDBIT_ORACLE_DOCKER_PORT -BLINDBIT_ORACLE_URL_EXTERNAL=$ROOT_URL$BLINDBIT_ORACLE_URL_ROUTE -BLINDBIT_ORACLE_URL_WS=$ROOT_URL_WS_INTERNAL\$BLINDBIT_ORACLE_DOCKER_PORT -BLINDBIT_ORACLE_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +BLINDBIT_ORACLE_URL=http://\$BLINDBIT_ORACLE_DOCKER_NAME:$BLINDBIT_ORACLE_DOCKER_PORT +BLINDBIT_ORACLE_URL_EXTERNAL=https://$HOST$BLINDBIT_ORACLE_URL_ROUTE +BLINDBIT_ORACLE_URL_WS=ws://\$BLINDBIT_ORACLE_DOCKER_PORT +BLINDBIT_ORACLE_URL_WS_EXTERNAL=wss://$HOST\ws # ====== INTERNAL SDK_RELAY ====== @@ -261,10 +289,10 @@ SDK_RELAY_DOCKER_WORKING_DIR=/home/$SDK_RELAY SDK_RELAY_DOCKER_WORKING_DIR_CREATE="id -u $SDK_RELAY >/dev/null 2>&1 || adduser --disabled-password --gecos '' $SDK_RELAY; chown -R $SDK_RELAY:$SDK_RELAY /home/root/.$SDK_RELAY || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" SDK_RELAY_URL_ROUTE=/$SDK_RELAY -SDK_RELAY_URL=$ROOT_URL_INTERNAL\$SDK_RELAY_DOCKER_NAME:$SDK_RELAY_DOCKER_PORT -SDK_RELAY_URL_EXTERNAL=$ROOT_URL$SDK_RELAY_URL_ROUTE -SDK_RELAY_URL_WS=$ROOT_URL_WS_INTERNAL\$SDK_RELAY_DOCKER_PORT -SDK_RELAY_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +SDK_RELAY_URL=http://\$SDK_RELAY_DOCKER_NAME:$SDK_RELAY_DOCKER_PORT +SDK_RELAY_URL_EXTERNAL=https://$HOST$SDK_RELAY_URL_ROUTE +SDK_RELAY_URL_WS=ws://\$SDK_RELAY_DOCKER_PORT +SDK_RELAY_URL_WS_EXTERNAL=wss://$HOST\ws # ====== INTERNAL SDK_STORAGE ====== @@ -288,10 +316,10 @@ SDK_STORAGE_DOCKER_WORKING_DIR=/home/$SDK_STORAGE SDK_STORAGE_DOCKER_WORKING_DIR_CREATE="id -u $SDK_STORAGE >/dev/null 2>&1 || adduser --disabled-password --gecos '' $SDK_STORAGE; chown -R $SDK_STORAGE:$SDK_STORAGE /home/root/.$SDK_STORAGE || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" SDK_STORAGE_URL_ROUTE=/$SDK_STORAGE -SDK_STORAGE_URL=$ROOT_URL_INTERNAL\$SDK_STORAGE_DOCKER_NAME:$SDK_STORAGE_DOCKER_PORT -SDK_STORAGE_URL_EXTERNAL=$ROOT_URL$SDK_STORAGE_URL_ROUTE -SDK_STORAGE_URL_WS=$ROOT_URL_WS_INTERNAL\$SDK_STORAGE_DOCKER_PORT -SDK_STORAGE_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +SDK_STORAGE_URL=http://\$SDK_STORAGE_DOCKER_NAME:$SDK_STORAGE_DOCKER_PORT +SDK_STORAGE_URL_EXTERNAL=https://$HOST$SDK_STORAGE_URL_ROUTE +SDK_STORAGE_URL_WS=ws://\$SDK_STORAGE_DOCKER_PORT +SDK_STORAGE_URL_WS_EXTERNAL=wss://$HOST\ws # ====== INTERNAL IHM_CLIENT ====== @@ -315,64 +343,64 @@ IHM_CLIENT_DOCKER_WORKING_DIR=/home/$IHM_CLIENT IHM_CLIENT_DOCKER_WORKING_DIR_CREATE="id -u $IHM_CLIENT >/dev/null 2>&1 || adduser --disabled-password --gecos '' $IHM_CLIENT; chown -R $IHM_CLIENT:$IHM_CLIENT /home/root/.$IHM_CLIENT || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" IHM_CLIENT_URL_ROUTE=/$IHM_CLIENT -IHM_CLIENT_URL=$ROOT_URL_INTERNAL\$IHM_CLIENT_DOCKER_NAME:$IHM_CLIENT_DOCKER_PORT -IHM_CLIENT_URL_EXTERNAL=$ROOT_URL$IHM_CLIENT_URL_ROUTE -IHM_CLIENT_URL_WS=$ROOT_URL_WS_INTERNAL\$IHM_CLIENT_DOCKER_PORT -IHM_CLIENT_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +IHM_CLIENT_URL=http://\$IHM_CLIENT_DOCKER_NAME:$IHM_CLIENT_DOCKER_PORT +IHM_CLIENT_URL_EXTERNAL=https://$HOST$IHM_CLIENT_URL_ROUTE +IHM_CLIENT_URL_WS=ws://\$IHM_CLIENT_DOCKER_PORT +IHM_CLIENT_URL_WS_EXTERNAL=wss://$HOST\ws -# ====== INTERNAL 4NK_CERTIFICATOR ====== +# ====== INTERNAL _4NK_CERTIFICATOR ====== -4NK_CERTIFICATOR_DOCKER_NAME=$4NK_CERTIFICATOR -4NK_CERTIFICATOR_CONFS_DIR=$DOCKER_GLOBAL/confs/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_LOGS_DIR=$DOCKER_GLOBAL/logs/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_RUNS_DIR=$DOCKER_GLOBAL/runs/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_DATAS_DIR=$DOCKER_GLOBAL/datas/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_DOCKER_WORKING_DIR=/home/$4NK_CERTIFICATOR +_4NK_CERTIFICATOR_DOCKER_NAME=$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_CONFS_DIR=$DOCKER_GLOBAL/confs/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_LOGS_DIR=$DOCKER_GLOBAL/logs/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_RUNS_DIR=$DOCKER_GLOBAL/runs/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_DATAS_DIR=$DOCKER_GLOBAL/datas/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_DOCKER_WORKING_DIR=/home/$_4NK_CERTIFICATOR -4NK_CERTIFICATOR_DOCKER_CONFS_DIR=$DOCKER_GLOBAL/confs/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_DOCKER_LOGS_DIR=$DOCKER_GLOBAL/logs/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_DOCKER_RUNS_DIR=$DOCKER_GLOBAL/runs/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_DOCKER_DATAS_DIR=$DOCKER_GLOBAL/datas/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_DOCKER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_DOCKER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_DOCKER_WORKING_DIR=/home/$4NK_CERTIFICATOR +_4NK_CERTIFICATOR_DOCKER_CONFS_DIR=$DOCKER_GLOBAL/confs/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_DOCKER_LOGS_DIR=$DOCKER_GLOBAL/logs/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_DOCKER_RUNS_DIR=$DOCKER_GLOBAL/runs/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_DOCKER_DATAS_DIR=$DOCKER_GLOBAL/datas/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_DOCKER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_DOCKER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_DOCKER_WORKING_DIR=/home/$_4NK_CERTIFICATOR -4NK_CERTIFICATOR_DOCKER_WORKING_DIR_CREATE="id -u $4NK_CERTIFICATOR >/dev/null 2>&1 || adduser --disabled-password --gecos '' $4NK_CERTIFICATOR; chown -R $4NK_CERTIFICATOR:$4NK_CERTIFICATOR /home/root/.$4NK_CERTIFICATOR || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" -4NK_CERTIFICATOR_URL_ROUTE=/$4NK_CERTIFICATOR -4NK_CERTIFICATOR_URL=$ROOT_URL_INTERNAL\$4NK_CERTIFICATOR_DOCKER_NAME:$4NK_CERTIFICATOR_DOCKER_PORT -4NK_CERTIFICATOR_URL_EXTERNAL=$ROOT_URL$4NK_CERTIFICATOR_URL_ROUTE -4NK_CERTIFICATOR_URL_WS=$ROOT_URL_WS_INTERNAL\$4NK_CERTIFICATOR_DOCKER_PORT -4NK_CERTIFICATOR_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +_4NK_CERTIFICATOR_DOCKER_WORKING_DIR_CREATE="id -u $_4NK_CERTIFICATOR >/dev/null 2>&1 || adduser --disabled-password --gecos '' $_4NK_CERTIFICATOR; chown -R $_4NK_CERTIFICATOR:$_4NK_CERTIFICATOR /home/root/.$_4NK_CERTIFICATOR || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" +_4NK_CERTIFICATOR_URL_ROUTE=/$_4NK_CERTIFICATOR +_4NK_CERTIFICATOR_URL=http://\$_4NK_CERTIFICATOR_DOCKER_NAME:$_4NK_CERTIFICATOR_DOCKER_PORT +_4NK_CERTIFICATOR_URL_EXTERNAL=https://$HOST$_4NK_CERTIFICATOR_URL_ROUTE +_4NK_CERTIFICATOR_URL_WS=ws://\$_4NK_CERTIFICATOR_DOCKER_PORT +_4NK_CERTIFICATOR_URL_WS_EXTERNAL=wss://$HOST\ws -# ====== INTERNAL 4NK_MINER ====== +# ====== INTERNAL _4NK_MINER ====== -4NK_MINER_DOCKER_NAME=$4NK_MINER -4NK_MINER_CONFS_DIR=$DOCKER_GLOBAL/confs/$4NK_MINER -4NK_MINER_LOGS_DIR=$DOCKER_GLOBAL/logs/$4NK_MINER -4NK_MINER_RUNS_DIR=$DOCKER_GLOBAL/runs/$4NK_MINER -4NK_MINER_DATAS_DIR=$DOCKER_GLOBAL/datas/$4NK_MINER -4NK_MINER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$4NK_MINER -4NK_MINER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$4NK_MINER -4NK_MINER_DOCKER_WORKING_DIR=/home/$4NK_MINER +_4NK_MINER_DOCKER_NAME=$_4NK_MINER +_4NK_MINER_CONFS_DIR=$DOCKER_GLOBAL/confs/$_4NK_MINER +_4NK_MINER_LOGS_DIR=$DOCKER_GLOBAL/logs/$_4NK_MINER +_4NK_MINER_RUNS_DIR=$DOCKER_GLOBAL/runs/$_4NK_MINER +_4NK_MINER_DATAS_DIR=$DOCKER_GLOBAL/datas/$_4NK_MINER +_4NK_MINER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$_4NK_MINER +_4NK_MINER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$_4NK_MINER +_4NK_MINER_DOCKER_WORKING_DIR=/home/$_4NK_MINER -4NK_MINER_DOCKER_CONFS_DIR=$DOCKER_GLOBAL/confs/$4NK_MINER -4NK_MINER_DOCKER_LOGS_DIR=$DOCKER_GLOBAL/logs/$4NK_MINER -4NK_MINER_DOCKER_RUNS_DIR=$DOCKER_GLOBAL/runs/$4NK_MINER -4NK_MINER_DOCKER_DATAS_DIR=$DOCKER_GLOBAL/datas/$4NK_MINER -4NK_MINER_DOCKER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$4NK_MINER -4NK_MINER_DOCKER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$4NK_MINER -4NK_MINER_DOCKER_WORKING_DIR=/home/$4NK_MINER +_4NK_MINER_DOCKER_CONFS_DIR=$DOCKER_GLOBAL/confs/$_4NK_MINER +_4NK_MINER_DOCKER_LOGS_DIR=$DOCKER_GLOBAL/logs/$_4NK_MINER +_4NK_MINER_DOCKER_RUNS_DIR=$DOCKER_GLOBAL/runs/$_4NK_MINER +_4NK_MINER_DOCKER_DATAS_DIR=$DOCKER_GLOBAL/datas/$_4NK_MINER +_4NK_MINER_DOCKER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$_4NK_MINER +_4NK_MINER_DOCKER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$_4NK_MINER +_4NK_MINER_DOCKER_WORKING_DIR=/home/$_4NK_MINER -4NK_MINER_DOCKER_WORKING_DIR_CREATE="id -u $4NK_MINER >/dev/null 2>&1 || adduser --disabled-password --gecos '' $4NK_MINER; chown -R $4NK_MINER:$4NK_MINER /home/root/.$4NK_MINER || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" -4NK_MINER_URL_ROUTE=/$4NK_MINER -4NK_MINER_URL=$ROOT_URL_INTERNAL\$4NK_MINER_DOCKER_NAME:$4NK_MINER_DOCKER_PORT -4NK_MINER_URL_EXTERNAL=$ROOT_URL$4NK_MINER_URL_ROUTE -4NK_MINER_URL_WS=$ROOT_URL_WS_INTERNAL\$4NK_MINER_DOCKER_PORT -4NK_MINER_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +_4NK_MINER_DOCKER_WORKING_DIR_CREATE="id -u $_4NK_MINER >/dev/null 2>&1 || adduser --disabled-password --gecos '' $_4NK_MINER; chown -R $_4NK_MINER:$_4NK_MINER /home/root/.$_4NK_MINER || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" +_4NK_MINER_URL_ROUTE=/$_4NK_MINER +_4NK_MINER_URL=http://\$_4NK_MINER_DOCKER_NAME:$_4NK_MINER_DOCKER_PORT +_4NK_MINER_URL_EXTERNAL=https://$HOST$_4NK_MINER_URL_ROUTE +_4NK_MINER_URL_WS=ws://\$_4NK_MINER_DOCKER_PORT +_4NK_MINER_URL_WS_EXTERNAL=wss://$HOST\ws # ====== INTERNAL LECOFFRE_FRONT ====== @@ -396,37 +424,37 @@ LECOFFRE_FRONT_DOCKER_WORKING_DIR=/home/$LECOFFRE_FRONT LECOFFRE_FRONT_DOCKER_WORKING_DIR_CREATE="id -u $LECOFFRE_FRONT >/dev/null 2>&1 || adduser --disabled-password --gecos '' $LECOFFRE_FRONT; chown -R $LECOFFRE_FRONT:$LECOFFRE_FRONT /home/root/.$LECOFFRE_FRONT || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" LECOFFRE_FRONT_URL_ROUTE=/$LECOFFRE_FRONT -LECOFFRE_FRONT_URL=$ROOT_URL_INTERNAL\$LECOFFRE_FRONT_DOCKER_NAME:$LECOFFRE_FRONT_DOCKER_PORT -LECOFFRE_FRONT_URL_EXTERNAL=$ROOT_URL$LECOFFRE_FRONT_URL_ROUTE -LECOFFRE_FRONT_URL_WS=$ROOT_URL_WS_INTERNAL\$LECOFFRE_FRONT_DOCKER_PORT -LECOFFRE_FRONT_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +LECOFFRE_FRONT_URL=http://\$LECOFFRE_FRONT_DOCKER_NAME:$LECOFFRE_FRONT_DOCKER_PORT +LECOFFRE_FRONT_URL_EXTERNAL=https://$HOST$LECOFFRE_FRONT_URL_ROUTE +LECOFFRE_FRONT_URL_WS=ws://\$LECOFFRE_FRONT_DOCKER_PORT +LECOFFRE_FRONT_URL_WS_EXTERNAL=wss://$HOST\ws -# ====== INTERNAL 4NK_WEB_STATUS ====== +# ====== INTERNAL _4NK_WEB_STATUS ====== -4NK_WEB_STATUS_DOCKER_NAME=$4NK_WEB_STATUS -4NK_WEB_STATUS_CONFS_DIR=$DOCKER_GLOBAL/confs/$4NK_WEB_STATUS -4NK_WEB_STATUS_LOGS_DIR=$DOCKER_GLOBAL/logs/$4NK_WEB_STATUS -4NK_WEB_STATUS_RUNS_DIR=$DOCKER_GLOBAL/runs/$4NK_WEB_STATUS -4NK_WEB_STATUS_DATAS_DIR=$DOCKER_GLOBAL/datas/$4NK_WEB_STATUS -4NK_WEB_STATUS_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$4NK_WEB_STATUS -4NK_WEB_STATUS_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$4NK_WEB_STATUS -4NK_WEB_STATUS_DOCKER_WORKING_DIR=/home/$4NK_WEB_STATUS +_4NK_WEB_STATUS_DOCKER_NAME=$_4NK_WEB_STATUS +_4NK_WEB_STATUS_CONFS_DIR=$DOCKER_GLOBAL/confs/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_LOGS_DIR=$DOCKER_GLOBAL/logs/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_RUNS_DIR=$DOCKER_GLOBAL/runs/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_DATAS_DIR=$DOCKER_GLOBAL/datas/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_DOCKER_WORKING_DIR=/home/$_4NK_WEB_STATUS -4NK_WEB_STATUS_DOCKER_CONFS_DIR=$DOCKER_GLOBAL/confs/$4NK_WEB_STATUS -4NK_WEB_STATUS_DOCKER_LOGS_DIR=$DOCKER_GLOBAL/logs/$4NK_WEB_STATUS -4NK_WEB_STATUS_DOCKER_RUNS_DIR=$DOCKER_GLOBAL/runs/$4NK_WEB_STATUS -4NK_WEB_STATUS_DOCKER_DATAS_DIR=$DOCKER_GLOBAL/datas/$4NK_WEB_STATUS -4NK_WEB_STATUS_DOCKER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$4NK_WEB_STATUS -4NK_WEB_STATUS_DOCKER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$4NK_WEB_STATUS -4NK_WEB_STATUS_DOCKER_WORKING_DIR=/home/$4NK_WEB_STATUS +_4NK_WEB_STATUS_DOCKER_CONFS_DIR=$DOCKER_GLOBAL/confs/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_DOCKER_LOGS_DIR=$DOCKER_GLOBAL/logs/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_DOCKER_RUNS_DIR=$DOCKER_GLOBAL/runs/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_DOCKER_DATAS_DIR=$DOCKER_GLOBAL/datas/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_DOCKER_BACKUPS_DIR=$DOCKER_GLOBAL/backups/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_DOCKER_SCRIPTS_DIR=$DOCKER_GLOBAL/scripts/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_DOCKER_WORKING_DIR=/home/$_4NK_WEB_STATUS -4NK_WEB_STATUS_DOCKER_WORKING_DIR_CREATE="id -u $4NK_WEB_STATUS >/dev/null 2>&1 || adduser --disabled-password --gecos '' $4NK_WEB_STATUS; chown -R $4NK_WEB_STATUS:$4NK_WEB_STATUS /home/root/.$4NK_WEB_STATUS || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" -4NK_WEB_STATUS_URL_ROUTE=/$4NK_WEB_STATUS -4NK_WEB_STATUS_URL=$ROOT_URL_INTERNAL\$4NK_WEB_STATUS_DOCKER_NAME:$4NK_WEB_STATUS_DOCKER_PORT -4NK_WEB_STATUS_URL_EXTERNAL=$ROOT_URL$4NK_WEB_STATUS_URL_ROUTE -4NK_WEB_STATUS_URL_WS=$ROOT_URL_WS_INTERNAL\$4NK_WEB_STATUS_DOCKER_PORT -4NK_WEB_STATUS_URL_WS_EXTERNAL=$ROOT_URL_WS\ws +_4NK_WEB_STATUS_DOCKER_WORKING_DIR_CREATE="id -u $_4NK_WEB_STATUS >/dev/null 2>&1 || adduser --disabled-password --gecos '' $_4NK_WEB_STATUS; chown -R $_4NK_WEB_STATUS:$_4NK_WEB_STATUS /home/root/.$_4NK_WEB_STATUS || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \"$@\"" +_4NK_WEB_STATUS_URL_ROUTE=/$_4NK_WEB_STATUS +_4NK_WEB_STATUS_URL=http://\$_4NK_WEB_STATUS_DOCKER_NAME:$_4NK_WEB_STATUS_DOCKER_PORT +_4NK_WEB_STATUS_URL_EXTERNAL=https://$HOST$_4NK_WEB_STATUS_URL_ROUTE +_4NK_WEB_STATUS_URL_WS=ws://\$_4NK_WEB_STATUS_DOCKER_PORT +_4NK_WEB_STATUS_URL_WS_EXTERNAL=wss://$HOST\ws # ====== EXTERNAL BOOSTRAP ====== @@ -438,3 +466,4 @@ BOOSTRAP_URL_WS_EXTERNAL=wss://${VARIABLE}_HOST:${VARIABLE}_EXTERNAL_PORT\ws LECOFFRE_BACK_MINI_URL_EXTERNAL=https://${VARIABLE}_HOST:${VARIABLE}_EXTERNAL_PORT${VARIABLE}_URL_ROUTE LECOFFRE_BACK_MINI_URL_WS_EXTERNAL=wss://${VARIABLE}_HOST:${VARIABLE}_EXTERNAL_PORT\ws + diff --git a/storage/dev/4NK_modules/4NK_certificator/.env b/storage/dev/4NK_modules/4NK_certificator/.env deleted file mode 100644 index 04b6243..0000000 --- a/storage/dev/4NK_modules/4NK_certificator/.env +++ /dev/null @@ -1,20 +0,0 @@ -# Server configuration -RUST_LOG=info - -# Bitcoin RPC -BITCOIN_RPC_URL=$BITCOIN_RPC_URL -BITCOIN_RPC_USER=$BITCOIN_RPC_USER -BITCOIN_RPC_PASSWORD=$BITCOIN_RPC_PASSWORD -BITCOIN_WALLET_NAME=$BITCOIN_CERTIFICATOR_NAME - -# Database -DATABASE_URL=$CERTIFICATOR_POSTGRESQL_CONNECT - -# Redis -REDIS_URL=$CERTIFICATOR_REDIS_CONNECT - -# Relay -RELAY_WEBSOCKET_URL=$SDK_RELAY_URL_WS - -# Certificator DB password for docker-compose -CERTIFICATOR_DB_PASSWORD=$BDD_PASSWORD diff --git a/storage/dev/4NK_modules/4NK_certificator/.gitkeep b/storage/dev/4NK_modules/4NK_certificator/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/4NK_certificator/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/4NK_certificator/certificator.toml b/storage/dev/4NK_modules/4NK_certificator/certificator.toml deleted file mode 100644 index 83314de..0000000 --- a/storage/dev/4NK_modules/4NK_certificator/certificator.toml +++ /dev/null @@ -1,33 +0,0 @@ -[server] -host = "0.0.0.0" -port = "$4NK_CERTIFICATOR_PORT" -log_level = "info" - -[bitcoin] -network = "mainnet" -rpc_url = "$BITCOIN_RPC_URL" -rpc_user = "$BITCOIN_RPC_USER" -rpc_password = "$BITCOIN_RPC_PASSWORD" -wallet_name = "$BITCOIN_CERTIFICATOR_NAME" -min_confirmations = 6 - -[relay] -websocket_url = "$SDK_RELAY_URL_WS" -monitor_interval_secs = 60 - -[anchoring] -interval_blocks = 4320 # ~30 days (144 blocks/day) -auto_anchor = true -tx_fee_sat_per_vbyte = 10 - -[database] -url = "$CERTIFICATOR_POSTGRESQL_CONNECT" -max_connections = 10 - -[redis] -url = "$CERTIFICATOR_REDIS_CONNECT" -cache_ttl_secs = 3600 - -[api] -jwt_secret = "$VITE_JWT_SECRET_KEY" -cors_allowed_origins = ["$DOMAIN"] diff --git a/storage/dev/4NK_modules/4NK_miner/.env b/storage/dev/4NK_modules/4NK_miner/.env deleted file mode 100644 index 46c2073..0000000 --- a/storage/dev/4NK_modules/4NK_miner/.env +++ /dev/null @@ -1,4 +0,0 @@ -# Configuration du miner signet -# COINBASE_ADDRESS= # Générer automatiquement -RELAY_ADDRESS=tsp1qqd8k3twmuq3awxjmfukhma36j4la8gzsa8t0dgfms3cfglt2gkz6wqsqpd3d2q4quq59agtyfsr7gj9t07qt0nlrlrzgmhvpn5enfm76fud6sm0y -REWARD_SPLIT_RATIO=0.5 diff --git a/storage/dev/4NK_modules/4NK_miner/.gitkeep b/storage/dev/4NK_modules/4NK_miner/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/4NK_miner/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/4NK_web_status/.gitkeep b/storage/dev/4NK_modules/4NK_web_status/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/4NK_web_status/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/bitcoin/.gitkeep b/storage/dev/4NK_modules/bitcoin/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/bitcoin/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/bitcoin/bitcoin.conf b/storage/dev/4NK_modules/bitcoin/bitcoin.conf deleted file mode 100644 index 1e140be..0000000 --- a/storage/dev/4NK_modules/bitcoin/bitcoin.conf +++ /dev/null @@ -1,45 +0,0 @@ -# Configuration globale -signet=1 -server=1 -datadir=$BITCOIN_DATAS_DIR - -[signet] -daemon=0 -txindex=1 -upnp=1 -#debug=1 -#loglevel=debug -logthreadnames=1 -onion=tor:9050:9050 -listenonion=1 -onlynet=onion - -# Paramètres RPC -rpcauth=$BITCOIN_RPC_AUTH -rpcallowip=0.0.0.0/0 -rpcworkqueue=32 -rpcthreads=4 -rpcdoccheck=1 - -# Paramètres ZMQ -zmqpubhashblock=tcp://:$BITCOIN_ZMQPBUBHASHBLOCK_PORT -zmqpubrawtx=tcp://:$BITCOIN_ZMQPUBRAWTX_PORT - -listen=1 -bind=0.0.0.0:$BITCOIN_SIGNET_P2P_PORT -rpcbind=0.0.0.0:$BITCOIN_SIGNET_RPC_PORT -rpcport=$BITCOIN_SIGNET_RPC_PORT -fallbackfee=0.0001 -blockfilterindex=1 -datacarriersize=205 -acceptnonstdtxn=1 -dustrelayfee=0.00000001 -minrelaytxfee=0.00000001 -prune=0 -signetchallenge=0020341c43803863c252df326e73574a27d7e19322992061017b0dc893e2eab90821 -wallet=$BITCOIN_MINING_NAME -wallet=watchonly -maxtxfee=1 -addnode=tlv2yqamflv22vfdzy2hha2nwmt6zrwrhjjzz4lx7qyq7lyc6wfhabyd.onion -addnode=6xi33lwwslsx3yi3f7c56wnqtdx4v73vj2up3prrwebpwbz6qisnqbyd.onion -addnode=id7e3r3d2epen2v65jebjhmx77aimu7oyhcg45zadafypr4crqsytfid.onion \ No newline at end of file diff --git a/storage/dev/4NK_modules/blindbit-oracle/.gitkeep b/storage/dev/4NK_modules/blindbit-oracle/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/blindbit-oracle/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/blindbit-oracle/blindbit.toml b/storage/dev/4NK_modules/blindbit-oracle/blindbit.toml deleted file mode 100644 index 1b01100..0000000 --- a/storage/dev/4NK_modules/blindbit-oracle/blindbit.toml +++ /dev/null @@ -1,18 +0,0 @@ -# Configuration Blindbit Oracle -host = "0.0.0.0:$BLINDBIT_ORACLE_PORT" -chain = "signet" -rpc_endpoint = "$BITCOIN_RPC_URL" -cookie_path = "$BITCOIN_DATAS_DIR/.cookie" -rpc_user = "" -rpc_pass = "" -sync_start_height = 1 - -# Performance -max_parallel_tweak_computations = 4 -max_parallel_requests = 4 - -# Index -tweaks_only = 0 -tweaks_full_basic = 1 -tweaks_full_with_dust_filter = 1 -tweaks_cut_through_with_dust_filter = 1 diff --git a/storage/dev/4NK_modules/grafana/.env b/storage/dev/4NK_modules/grafana/.env deleted file mode 100644 index 5a59ce4..0000000 --- a/storage/dev/4NK_modules/grafana/.env +++ /dev/null @@ -1,6 +0,0 @@ -GF_SECURITY_ADMIN_PASSWORD=$GRAFANA_ADMIN_PASSWORD -GF_USERS_ALLOW_SIGN_UP=false -GF_SERVER_ROOT_URL=$ROOT_URL$GRAFANA_URL_ROUTE -GF_PLUGINS_PREINSTALL_SYNC=grafana-clock-panel,grafana-simple-json-datasource -GRAFANA_ADMIN_USER=$GRAFANA_ADMIN_USER -GRAFANA_ADMIN_PASSWORD=$GRAFANA_ADMIN_PASSWORD \ No newline at end of file diff --git a/storage/dev/4NK_modules/grafana/.gitkeep b/storage/dev/4NK_modules/grafana/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/grafana/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/grafana/dashboards/.gitkeep b/storage/dev/4NK_modules/grafana/dashboards/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/storage/dev/4NK_modules/grafana/dashboards/4nk-certificator.json b/storage/dev/4NK_modules/grafana/dashboards/4NK-certificator.json similarity index 90% rename from storage/dev/4NK_modules/grafana/dashboards/4nk-certificator.json rename to storage/dev/4NK_modules/grafana/dashboards/4NK-certificator.json index 5e07a65..33194bd 100644 --- a/storage/dev/4NK_modules/grafana/dashboards/4nk-certificator.json +++ b/storage/dev/4NK_modules/grafana/dashboards/4NK-certificator.json @@ -88,12 +88,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(rate({container=\"$4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "expr": "sum(rate({container=\"$_4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", "queryType": "", "refId": "A" } ], - "title": "Logs INFO - 4nk-certificator", + "title": "Logs INFO - _4NK-certificator", "type": "timeseries" }, { @@ -175,12 +175,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(rate({container=\"$4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "expr": "sum(rate({container=\"$_4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", "queryType": "", "refId": "A" } ], - "title": "Erreurs - 4nk-certificator", + "title": "Erreurs - _4NK-certificator", "type": "timeseries" }, { @@ -239,7 +239,7 @@ "uid": "loki" }, "editorMode": "code", - "expr": "count_over_time({container=\"$4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "expr": "count_over_time({container=\"$_4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"ERROR\" [1h])", "queryType": "", "refId": "A" } @@ -276,12 +276,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "{container=\"$4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "expr": "{container=\"$_4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", "queryType": "", "refId": "A" } ], - "title": "Logs d'Erreur - 4nk-certificator", + "title": "Logs d'Erreur - _4NK-certificator", "type": "logs" } ], @@ -289,7 +289,7 @@ "schemaVersion": 37, "style": "dark", "tags": [ - "4nk-certificator", + "_4NK-certificator", "auto-generated" ], "templating": { @@ -301,8 +301,8 @@ }, "timepicker": {}, "timezone": "", - "title": "4nk-certificator - Monitoring", - "uid": "4nk-certificator", + "title": "_4NK-certificator - Monitoring", + "uid": "_4NK-certificator", "version": 1, "weekStart": "" } diff --git a/storage/dev/4NK_modules/grafana/dashboards/4nk-web-status.json b/storage/dev/4NK_modules/grafana/dashboards/4NK-miner.json similarity index 90% rename from storage/dev/4NK_modules/grafana/dashboards/4nk-web-status.json rename to storage/dev/4NK_modules/grafana/dashboards/4NK-miner.json index 7142bc4..2ebc0dd 100644 --- a/storage/dev/4NK_modules/grafana/dashboards/4nk-web-status.json +++ b/storage/dev/4NK_modules/grafana/dashboards/4NK-miner.json @@ -88,12 +88,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(rate({container=\"$4NK_WEB_STATUS_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "expr": "sum(rate({container=\"$_4NK_MINER_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", "queryType": "", "refId": "A" } ], - "title": "Logs INFO - 4nk-web-status", + "title": "Logs INFO - _4NK-miner", "type": "timeseries" }, { @@ -175,12 +175,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(rate({container=\"$4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "expr": "sum(rate({container=\"$_4NK_MINER_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", "queryType": "", "refId": "A" } ], - "title": "Erreurs - 4nk-web-status", + "title": "Erreurs - _4NK-miner", "type": "timeseries" }, { @@ -239,7 +239,7 @@ "uid": "loki" }, "editorMode": "code", - "expr": "count_over_time({container=\"$4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "expr": "count_over_time({container=\"$_4NK_MINER_DOCKER_NAME\"} |= \"ERROR\" [1h])", "queryType": "", "refId": "A" } @@ -276,12 +276,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "{container=\"$4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "expr": "{container=\"$_4NK_MINER_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", "queryType": "", "refId": "A" } ], - "title": "Logs d'Erreur - 4nk-web-status", + "title": "Logs d'Erreur - _4NK-miner", "type": "logs" } ], @@ -289,7 +289,7 @@ "schemaVersion": 37, "style": "dark", "tags": [ - "4nk-web-status", + "_4NK-miner", "auto-generated" ], "templating": { @@ -301,8 +301,8 @@ }, "timepicker": {}, "timezone": "", - "title": "4nk-web-status - Monitoring", - "uid": "4nk-web-status", + "title": "_4NK-miner - Monitoring", + "uid": "_4NK-miner", "version": 1, "weekStart": "" } diff --git a/storage/dev/4NK_modules/grafana/dashboards/4NK-vault.json b/storage/dev/4NK_modules/grafana/dashboards/4NK-vault.json new file mode 100644 index 0000000..0b6df6c --- /dev/null +++ b/storage/dev/4NK_modules/grafana/dashboards/4NK-vault.json @@ -0,0 +1,308 @@ +{ + "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=\"$_4NK_VAULT_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - _4NK-vault", + "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=\"$_4NK_VAULT_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - _4NK-vault", + "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=\"$_4NK_VAULT_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$_4NK_VAULT_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - _4NK-vault", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "_4NK-vault", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "_4NK-vault - Monitoring", + "uid": "_4NK-vault", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/4NK_modules/grafana/dashboards/4NK-web-status.json b/storage/dev/4NK_modules/grafana/dashboards/4NK-web-status.json new file mode 100644 index 0000000..9e9be78 --- /dev/null +++ b/storage/dev/4NK_modules/grafana/dashboards/4NK-web-status.json @@ -0,0 +1,308 @@ +{ + "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=\"$_4NK_WEB_STATUS_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - _4NK-web-status", + "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=\"$_4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - _4NK-web-status", + "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=\"$_4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$_4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - _4NK-web-status", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "_4NK-web-status", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "_4NK-web-status - Monitoring", + "uid": "_4NK-web-status", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/4NK_modules/grafana/dashboards/bitcoin-miner-detailed.json b/storage/dev/4NK_modules/grafana/dashboards/bitcoin-miner-detailed.json deleted file mode 100644 index c8469f9..0000000 --- a/storage/dev/4NK_modules/grafana/dashboards/bitcoin-miner-detailed.json +++ /dev/null @@ -1,399 +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=\"signet_miner\"} |= \"Block mined\" [5m])) by (container)", - "queryType": "", - "refId": "A" - } - ], - "title": "Blocs Minés par Minute", - "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=\"signet_miner\"} |= \"Hashrate\" [5m])) by (container)", - "queryType": "", - "refId": "A" - } - ], - "title": "Hashrate du Mineur", - "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": 8, - "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=\"signet_miner\"} |= \"ERROR\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs du Mineur (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": 16, - "x": 8, - "y": 8 - }, - "id": 4, - "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 (level) (count_over_time({container=\"signet_miner\"} | json | level != \"\" [1h]))", - "queryType": "", - "refId": "A" - } - ], - "title": "Distribution des Niveaux de Log", - "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": 24, - "x": 0, - "y": 16 - }, - "id": 5, - "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=\"signet_miner\"} |= \"Block mined\" | json | line_format \"{{.timestamp}} - Bloc {{.height}} miné - Hash: {{.hash}}\"", - "queryType": "", - "refId": "A" - } - ], - "title": "Historique des Blocs Minés", - "type": "table" - } - ], - "refresh": "5s", - "schemaVersion": 37, - "style": "dark", - "tags": [ - "bitcoin", - "miner", - "signet" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Bitcoin Miner - Détails", - "uid": "bitcoin-miner-detailed", - "version": 1, - "weekStart": "" -} - diff --git a/storage/dev/4NK_modules/grafana/dashboards/bitcoin-miner.json b/storage/dev/4NK_modules/grafana/dashboards/bitcoin-miner.json deleted file mode 100644 index ed0bd13..0000000 --- a/storage/dev/4NK_modules/grafana/dashboards/bitcoin-miner.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": null, - "links": [], - "liveNow": false, - "panels": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 1, - "options": { - "showTime": false, - "showLabels": false, - "showCommonLabels": false, - "wrapLogMessage": false, - "prettifyLogMessage": false, - "enableLogDetails": true, - "dedupStrategy": "none", - "sortOrder": "Descending" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "{job=\"bitcoin\"} |= \"block\" | logfmt", - "queryType": "", - "refId": "A" - } - ], - "title": "Bitcoin - Nouveaux Blocs", - "type": "logs" - }, - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 2, - "options": { - "showTime": false, - "showLabels": false, - "showCommonLabels": false, - "wrapLogMessage": false, - "prettifyLogMessage": false, - "enableLogDetails": true, - "dedupStrategy": "none", - "sortOrder": "Descending" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "{job=\"miner\"} |= \"mined\" | logfmt", - "queryType": "", - "refId": "A" - } - ], - "title": "Miner - Blocs Minés", - "type": "logs" - }, - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "gridPos": { - "h": 8, - "w": 24, - "x": 0, - "y": 8 - }, - "id": 3, - "options": { - "showTime": false, - "showLabels": false, - "showCommonLabels": false, - "wrapLogMessage": false, - "prettifyLogMessage": false, - "enableLogDetails": true, - "dedupStrategy": "none", - "sortOrder": "Descending" - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "{job=~\"bitcoin|miner|blindbit\"} |= \"error\" | logfmt", - "queryType": "", - "refId": "A" - } - ], - "title": "Bitcoin/Miner/Blindbit - Erreurs", - "type": "logs" - } - ], - "refresh": "30s", - "schemaVersion": 36, - "style": "dark", - "tags": ["bitcoin", "miner", "blockchain"], - "templating": { - "list": [] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Bitcoin & Miner Monitoring", - "uid": "bitcoin-miner", - "version": 1, - "weekStart": "" -} diff --git a/storage/dev/4NK_modules/grafana/dashboards/bitcoin-services.json b/storage/dev/4NK_modules/grafana/dashboards/bitcoin-services.json deleted file mode 100644 index 2abf2d2..0000000 --- a/storage/dev/4NK_modules/grafana/dashboards/bitcoin-services.json +++ /dev/null @@ -1,532 +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=\"bitcoin-signet\"} |= \"UpdateTip\" [5m])) by (container)", - "queryType": "", - "refId": "A" - } - ], - "title": "Mises à Jour de la Chaîne Bitcoin", - "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=\"blindbit-oracle\"} |= \"tweak\" [5m])) by (container)", - "queryType": "", - "refId": "A" - } - ], - "title": "Détection de Tweak (BlindBit)", - "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=\"bitcoin-signet\"} |= \"ERROR\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs Bitcoin (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": "count_over_time({container=\"blindbit-oracle\"} |= \"ERROR\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs BlindBit (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": 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": "count_over_time({container=\"bitcoin-signet\"} |= \"New block\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Nouveaux Blocs (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": 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=\"blindbit-oracle\"} |= \"Silent payment\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Silent Payments (1h)", - "type": "stat" - }, - { - "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": 24, - "x": 0, - "y": 12 - }, - "id": 7, - "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=~\"bitcoin-signet|blindbit-oracle\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.container}} - {{.message}}\"", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs Bitcoin Services", - "type": "table" - } - ], - "refresh": "5s", - "schemaVersion": 37, - "style": "dark", - "tags": [ - "bitcoin", - "signet", - "blindbit", - "oracle" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Bitcoin Services - Monitoring", - "uid": "bitcoin-services", - "version": 1, - "weekStart": "" -} - diff --git a/storage/dev/4NK_modules/grafana/dashboards/frontend-services.json b/storage/dev/4NK_modules/grafana/dashboards/frontend-services.json deleted file mode 100644 index 262feb0..0000000 --- a/storage/dev/4NK_modules/grafana/dashboards/frontend-services.json +++ /dev/null @@ -1,532 +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-front|ihm_client\"} |= \"GET\" [5m])) by (container)", - "queryType": "", - "refId": "A" - } - ], - "title": "Requêtes HTTP par Frontend", - "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=\"ihm_client\"} |= \"vite\" [5m])) by (container)", - "queryType": "", - "refId": "A" - } - ], - "title": "Activité Vite (IHM Client)", - "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-front\"} |= \"ERROR\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs LeCoffre Front (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": "count_over_time({container=\"ihm_client\"} |= \"ERROR\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs IHM Client (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": 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(count_over_time({container=~\"lecoffre-front|ihm_client\"} [1h]))", - "queryType": "", - "refId": "A" - } - ], - "title": "Total Logs Frontend (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": 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=\"ihm_client\"} |= \"Pre-transform error\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs Vite (1h)", - "type": "stat" - }, - { - "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": 24, - "x": 0, - "y": 12 - }, - "id": 7, - "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-front|ihm_client\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.container}} - {{.message}}\"", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs Récentes Frontend", - "type": "table" - } - ], - "refresh": "5s", - "schemaVersion": 37, - "style": "dark", - "tags": [ - "frontend", - "lecoffre", - "ihm", - "client" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "Frontend Services - Monitoring", - "uid": "frontend-services", - "version": 1, - "weekStart": "" -} - diff --git a/storage/dev/4NK_modules/grafana/dashboards/lecoffre-overview.json b/storage/dev/4NK_modules/grafana/dashboards/lecoffre-overview.json deleted file mode 100644 index 9ecf781..0000000 --- a/storage/dev/4NK_modules/grafana/dashboards/lecoffre-overview.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "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" - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "sum by (service) (count_over_time({job=~\".*\"} |= \"error\" [5m]))", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs par Service (5 dernières minutes)", - "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 - } - ] - }, - "unit": "short" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "editorMode": "code", - "expr": "sum by (service) (count_over_time({job=~\".*\"} [5m]))", - "queryType": "", - "refId": "A" - } - ], - "title": "Volume de Logs par Service (5 dernières minutes)", - "type": "timeseries" - }, - { - "datasource": { - "type": "loki", - "uid": "loki" - }, - "gridPos": { - "h": 12, - "w": 24, - "x": 0, - "y": 8 - }, - "id": 3, - "options": { - "showTime": false, - "showLabels": false, - "showCommonLabels": false, - "wrapLogMessage": false, - "prettifyLogMessage": false, - "enableLogDetails": true, - "dedupStrategy": "none", - "sortOrder": "Descending" - }, - "title": "Logs d'Erreur - Tous Services", - "type": "logs" - } - ], - "refresh": "30s", - "schemaVersion": 36, - "style": "dark", - "tags": ["lecoffre", "monitoring"], - "templating": { - "list": [] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "LeCoffre Node - Vue d'ensemble", - "uid": "lecoffre-overview", - "version": 1, - "weekStart": "" -} diff --git a/storage/dev/4NK_modules/grafana/dashboards/4nk-vault.json b/storage/dev/4NK_modules/grafana/dashboards/ngnix.json similarity index 91% rename from storage/dev/4NK_modules/grafana/dashboards/4nk-vault.json rename to storage/dev/4NK_modules/grafana/dashboards/ngnix.json index e068c9d..5e8b3ef 100644 --- a/storage/dev/4NK_modules/grafana/dashboards/4nk-vault.json +++ b/storage/dev/4NK_modules/grafana/dashboards/ngnix.json @@ -88,12 +88,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(rate({container=\"$4NK_VAULT_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "expr": "sum(rate({container=\"$NGNIX_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", "queryType": "", "refId": "A" } ], - "title": "Logs INFO - 4nk-vault", + "title": "Logs INFO - ngnix", "type": "timeseries" }, { @@ -175,12 +175,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(rate({container=\"$4NK_VAULT_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "expr": "sum(rate({container=\"$NGNIX_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", "queryType": "", "refId": "A" } ], - "title": "Erreurs - 4nk-vault", + "title": "Erreurs - ngnix", "type": "timeseries" }, { @@ -239,7 +239,7 @@ "uid": "loki" }, "editorMode": "code", - "expr": "count_over_time({container=\"$4NK_VAULT_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "expr": "count_over_time({container=\"$NGNIX_DOCKER_NAME\"} |= \"ERROR\" [1h])", "queryType": "", "refId": "A" } @@ -276,12 +276,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "{container=\"$4NK_VAULT_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "expr": "{container=\"$NGNIX_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", "queryType": "", "refId": "A" } ], - "title": "Logs d'Erreur - 4nk-vault", + "title": "Logs d'Erreur - ngnix", "type": "logs" } ], @@ -289,7 +289,7 @@ "schemaVersion": 37, "style": "dark", "tags": [ - "4nk-vault", + "ngnix", "auto-generated" ], "templating": { @@ -301,8 +301,8 @@ }, "timepicker": {}, "timezone": "", - "title": "4nk-vault - Monitoring", - "uid": "4nk-vault", + "title": "ngnix - Monitoring", + "uid": "ngnix", "version": 1, "weekStart": "" } diff --git a/storage/dev/4NK_modules/grafana/dashboards/sdk-services.json b/storage/dev/4NK_modules/grafana/dashboards/sdk-services.json deleted file mode 100644 index 112fa6a..0000000 --- a/storage/dev/4NK_modules/grafana/dashboards/sdk-services.json +++ /dev/null @@ -1,594 +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": 8, - "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=~\"sdk_.*\"} |= \"message\" [5m])) by (container)", - "queryType": "", - "refId": "A" - } - ], - "title": "Messages par Service SDK", - "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": 8, - "x": 8, - "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=\"sdk_relay\"} |= \"transaction\" [5m])) by (container)", - "queryType": "", - "refId": "A" - } - ], - "title": "Transactions Relay", - "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": 8, - "x": 16, - "y": 0 - }, - "id": 3, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom" - }, - "tooltip": { - "mode": "single" - } - }, - "title": "Signatures Signer", - "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": 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": "count_over_time({container=\"sdk_relay\"} |= \"ERROR\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs Relay (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": 5, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto" - }, - "pluginVersion": "10.0.0", - "title": "Erreurs Signer (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": 12, - "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=\"sdk_storage\"} |= \"ERROR\" [1h])", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs Storage (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": 18, - "y": 8 - }, - "id": 7, - "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(count_over_time({container=~\"sdk_.*\"} [1h]))", - "queryType": "", - "refId": "A" - } - ], - "title": "Total Logs SDK (1h)", - "type": "stat" - }, - { - "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": 24, - "x": 0, - "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=~\"sdk_.*\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.container}} - {{.message}}\"", - "queryType": "", - "refId": "A" - } - ], - "title": "Erreurs Récentes SDK", - "type": "table" - } - ], - "refresh": "5s", - "schemaVersion": 37, - "style": "dark", - "tags": [ - "sdk", - "relay", - "signer", - "storage" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-1h", - "to": "now" - }, - "timepicker": {}, - "timezone": "", - "title": "SDK Services - Monitoring", - "uid": "sdk-services", - "version": 1, - "weekStart": "" -} diff --git a/storage/dev/4NK_modules/grafana/grafana.ini b/storage/dev/4NK_modules/grafana/grafana.ini deleted file mode 100644 index 399630a..0000000 --- a/storage/dev/4NK_modules/grafana/grafana.ini +++ /dev/null @@ -1,57 +0,0 @@ -# Configuration Grafana avancée pour LeCoffre Node - -[server] -# URL publique de Grafana -root_url = $GRAFANA_URL - -# Configuration de sécurité -enable_gzip = true -cert_file = -cert_key = -enforce_domain = false - -[security] -# Configuration de sécurité -admin_user = $GRAFANA_ADMIN_USER -admin_password = $GRAFANA_ADMIN_PASSWORD -secret_key = $GRAFANA_SECRET_KEY - -# Configuration des sessions -cookie_secure = true -cookie_samesite = strict - -[users] -# Configuration des utilisateurs -allow_sign_up = false -allow_org_create = false -auto_assign_org = true -auto_assign_org_id = 1 -auto_assign_org_role = Viewer - -[auth.anonymous] -# Accès anonyme désactivé pour la sécurité -enabled = false - -[dashboards] -# Configuration des dashboards -default_home_dashboard_path = $GRAFANA_CONF_DIR/dashboards/lecoffre-overview.json - -[unified_alerting] -# Configuration des alertes unifiées -enabled = true - -[log] -# Configuration des logs Grafana -mode = console -level = info -format = json - -[metrics] -# Métriques Prometheus -enabled = true -basic_auth_username = -basic_auth_password = - -[feature_toggles] -# Fonctionnalités activées -enable = traceqlEditor diff --git a/storage/dev/4NK_modules/ihm_client/.env b/storage/dev/4NK_modules/ihm_client/.env deleted file mode 100644 index 788ed82..0000000 --- a/storage/dev/4NK_modules/ihm_client/.env +++ /dev/null @@ -1,7 +0,0 @@ -NEXT_PUBLIC_4NK_IFRAME_URL=$IHM_CLIENT_URL -VITE_JWT_SECRET_KEY=$VITE_JWT_SECRET_KEY -VITE_API_BASE_URL=$LECOFFRE_BACK_URL -VITE_WS_URL=$SDK_RELAY_URL -VITE_SIGNER_URL=$SIGNER_URL -VITE_BOOTSTRAPURL=$RELAY_BOOTSTRAP_URL -RELAY_URLS=$RELAY_URLS diff --git a/storage/dev/4NK_modules/ihm_client/.gitkeep b/storage/dev/4NK_modules/ihm_client/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/ihm_client/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/loki/.env b/storage/dev/4NK_modules/loki/.env deleted file mode 100644 index 53be051..0000000 --- a/storage/dev/4NK_modules/loki/.env +++ /dev/null @@ -1 +0,0 @@ -LOKI_URL=$LOKI_URL diff --git a/storage/dev/4NK_modules/loki/.gitkeep b/storage/dev/4NK_modules/loki/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/loki/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/loki/loki-config.yaml b/storage/dev/4NK_modules/loki/loki-config.yaml deleted file mode 100644 index 2dca52e..0000000 --- a/storage/dev/4NK_modules/loki/loki-config.yaml +++ /dev/null @@ -1,76 +0,0 @@ -auth_enabled: false - -server: - http_listen_port: $LOKI_PORT - grpc_listen_port: $LOKI_PORT2 - http_listen_address: 0.0.0.0 - grpc_listen_address: 0.0.0.0 - -common: - instance_addr: 0.0.0.0 - path_prefix: /loki - storage: - filesystem: - chunks_directory: /loki/chunks - rules_directory: /loki/rules - replication_factor: 1 - ring: - kvstore: - store: inmemory - -schema_config: - configs: - - from: 2020-10-24 - store: tsdb - object_store: filesystem - schema: v13 - index: - prefix: index_ - period: 24h - -ruler: - alertmanager_url: $LOKI_URL - -# Configuration de l'ingester - SEULEMENT le paramètre crucial -ingester: - lifecycler: - min_ready_duration: 5s # Réduit le délai de 15s à 5s - -# Configuration des limites -limits_config: - reject_old_samples: true - reject_old_samples_max_age: 168h - max_cache_freshness_per_query: 10m - split_queries_by_interval: 15m - max_query_parallelism: 32 - max_streams_per_user: 0 - max_line_size: 256000 - ingestion_rate_mb: 16 - ingestion_burst_size_mb: 32 - per_stream_rate_limit: 3MB - per_stream_rate_limit_burst: 15MB - max_entries_limit_per_query: 5000 - max_query_series: 500 - max_query_length: 721h - cardinality_limit: 100000 - max_streams_matchers_per_query: 1000 - max_concurrent_tail_requests: 10 - -# Configuration du storage -storage_config: - tsdb_shipper: - active_index_directory: /loki/tsdb-index - cache_location: /loki/tsdb-cache - filesystem: - directory: /loki/chunks - -# Configuration du compactor -compactor: - working_directory: /loki/compactor - compaction_interval: 10m - retention_enabled: false - delete_request_store: filesystem - -# Analytics désactivés -analytics: - reporting_enabled: false \ No newline at end of file diff --git a/storage/dev/4NK_modules/promtail/.env b/storage/dev/4NK_modules/promtail/.env deleted file mode 100644 index b6296f0..0000000 --- a/storage/dev/4NK_modules/promtail/.env +++ /dev/null @@ -1 +0,0 @@ -PROMTAIL_CONFIG_FILE=$PROMTAIL_CONFS_DIR/config.yml diff --git a/storage/dev/4NK_modules/promtail/.gitkeep b/storage/dev/4NK_modules/promtail/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/promtail/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/promtail/promtail.yml b/storage/dev/4NK_modules/promtail/promtail.yml index 8410e06..a186fab 100644 --- a/storage/dev/4NK_modules/promtail/promtail.yml +++ b/storage/dev/4NK_modules/promtail/promtail.yml @@ -60,15 +60,15 @@ scrape_configs: service: $GRAFANA_DOCKER_NAME __path__: $GRAFANA_LOGS_DIR/*.log - # 4NK_VAULT Logs - - job_name: $4NK_VAULT_DOCKER_NAME + # NGNIX Logs + - job_name: $NGNIX_DOCKER_NAME static_configs: - targets: - localhost labels: - job: $4NK_VAULT_DOCKER_NAME - service: $4NK_VAULT_DOCKER_NAME - __path__: $4NK_VAULT_LOGS_DIR/*.log + job: $NGNIX_DOCKER_NAME + service: $NGNIX_DOCKER_NAME + __path__: $NGNIX_LOGS_DIR/*.log # TOR Logs - job_name: $TOR_DOCKER_NAME @@ -80,6 +80,16 @@ scrape_configs: service: $TOR_DOCKER_NAME __path__: $TOR_LOGS_DIR/*.log + # _4NK_VAULT Logs + - job_name: $_4NK_VAULT_DOCKER_NAME + static_configs: + - targets: + - localhost + labels: + job: $_4NK_VAULT_DOCKER_NAME + service: $_4NK_VAULT_DOCKER_NAME + __path__: $_4NK_VAULT_LOGS_DIR/*.log + # BITCOIN Logs - job_name: $BITCOIN_DOCKER_NAME static_configs: @@ -130,25 +140,25 @@ scrape_configs: service: $IHM_CLIENT_DOCKER_NAME __path__: $IHM_CLIENT_LOGS_DIR/*.log - # 4NK_CERTIFICATOR Logs - - job_name: $4NK_CERTIFICATOR_DOCKER_NAME + # _4NK_CERTIFICATOR Logs + - job_name: $_4NK_CERTIFICATOR_DOCKER_NAME static_configs: - targets: - localhost labels: - job: $4NK_CERTIFICATOR_DOCKER_NAME - service: $4NK_CERTIFICATOR_DOCKER_NAME - __path__: $4NK_CERTIFICATOR_LOGS_DIR/*.log + job: $_4NK_CERTIFICATOR_DOCKER_NAME + service: $_4NK_CERTIFICATOR_DOCKER_NAME + __path__: $_4NK_CERTIFICATOR_LOGS_DIR/*.log - # 4NK_MINER Logs - - job_name: $4NK_MINER_DOCKER_NAME + # _4NK_MINER Logs + - job_name: $_4NK_MINER_DOCKER_NAME static_configs: - targets: - localhost labels: - job: $4NK_MINER_DOCKER_NAME - service: $4NK_MINER_DOCKER_NAME - __path__: $4NK_MINER_LOGS_DIR/*.log + job: $_4NK_MINER_DOCKER_NAME + service: $_4NK_MINER_DOCKER_NAME + __path__: $_4NK_MINER_LOGS_DIR/*.log # LECOFFRE_FRONT Logs - job_name: $LECOFFRE_FRONT_DOCKER_NAME @@ -160,15 +170,15 @@ scrape_configs: service: $LECOFFRE_FRONT_DOCKER_NAME __path__: $LECOFFRE_FRONT_LOGS_DIR/*.log - # 4NK_WEB_STATUS Logs - - job_name: $4NK_WEB_STATUS_DOCKER_NAME + # _4NK_WEB_STATUS Logs + - job_name: $_4NK_WEB_STATUS_DOCKER_NAME static_configs: - targets: - localhost labels: - job: $4NK_WEB_STATUS_DOCKER_NAME - service: $4NK_WEB_STATUS_DOCKER_NAME - __path__: $4NK_WEB_STATUS_LOGS_DIR/*.log + job: $_4NK_WEB_STATUS_DOCKER_NAME + service: $_4NK_WEB_STATUS_DOCKER_NAME + __path__: $_4NK_WEB_STATUS_LOGS_DIR/*.log # Docker Container Logs - job_name: docker diff --git a/storage/dev/4NK_modules/redis/.gitkeep b/storage/dev/4NK_modules/redis/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/redis/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/sdk_relay/.conf b/storage/dev/4NK_modules/sdk_relay/.conf deleted file mode 100644 index bb1a65e..0000000 --- a/storage/dev/4NK_modules/sdk_relay/.conf +++ /dev/null @@ -1,16 +0,0 @@ -core_url="$BITCOIN_RPC_URL" -ws_url="$SDK_RELAY_URL" -wallet_name="default" -network="signet" -blindbit_url="$BLINDBIT_ORACLE_URL" -zmq_url=$ZMQ_URL -storage=$SDK_STORAGE_URL -data_dir=$SDK_RELAY_DATAS_DIR -bitcoin_data_dir=$SDK_RELAY_DATAS_DIR -bootstrap_url=$RELAY_BOOTSTRAP_URL -bootstrap_faucet=true -RUST_LOG="DEBUG,reqwest=DEBUG,tokio_tungstenite=DEBUG" -NODE_OPTIONS="--max-old-space-size=2048" - -SIGNER_API_KEY="$SIGNER_API_KEY" -VITE_JWT_SECRET_KEY="$VITE_JWT_SECRET_KEY" diff --git a/storage/dev/4NK_modules/sdk_relay/.env b/storage/dev/4NK_modules/sdk_relay/.env deleted file mode 100644 index ac69a5e..0000000 --- a/storage/dev/4NK_modules/sdk_relay/.env +++ /dev/null @@ -1,12 +0,0 @@ -SDK_RELAY_WS_URL=$SDK_RELAY_URL -SDK_RELAY_WALLET_NAME=$BITCOIN_WALLET_NAME -SDK_RELAY_NETWORK=signet -SDK_RELAY_BLINDBIT_ORACLE_URL=$BLINDBIT_ORACLE_URL -SDK_RELAY_STORAGE=$SDK_STORAGE_URL -SDK_RELAY_DATAS_DIR=$SDK_RELAY_DATAS_DIR -SDK_RELAY_BOOTSTRAP_URL=$RELAY_BOOTSTRAP_URL -SDK_RELAY_BOOTSTRAP_FAUCET=https://$BOOTSTRAP_HOST/api/v1/faucet -SDK_RELAY_CORE_URL=$BITCOIN_RPC_URL -SDK_RELAY_ZMQ_URL=tcp://$BITCOIN_DOCKER_NAME:$BITCOIN_ZMQPBUBHASHBLOCK_PORT -SDK_RELAY_BITCOIN_DATAS_DIR=$BITCOIN_DATAS_DIR -HOME=/$SDK_RELAY_DOCKER_NAME \ No newline at end of file diff --git a/storage/dev/4NK_modules/sdk_relay/.gitkeep b/storage/dev/4NK_modules/sdk_relay/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/sdk_relay/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/sdk_signer/.gitkeep b/storage/dev/4NK_modules/sdk_signer/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/sdk_signer/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/sdk_storage/.env b/storage/dev/4NK_modules/sdk_storage/.env deleted file mode 100644 index 982188b..0000000 --- a/storage/dev/4NK_modules/sdk_storage/.env +++ /dev/null @@ -1,10 +0,0 @@ -# =========================================== -# Variables d'environnement pour sdk_storage -# =========================================== - -# Configuration SDK Storage -SDK_STORAGE_URL=$SDK_STORAGE_URL -SDK_STORAGE_PORT=$SDK_STORAGE_PORT -STORAGE_DATA_DIR=$SDK_STORAGE_DATAS_DIR -VITE_SDK_STORAGE_URL=$SDK_STORAGE_DATAS_DIR -DOMAIN=$DOMAIN diff --git a/storage/dev/4NK_modules/sdk_storage/.gitkeep b/storage/dev/4NK_modules/sdk_storage/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/sdk_storage/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/tor-proxy/.gitkeep b/storage/dev/4NK_modules/tor-proxy/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/4NK_modules/tor-proxy/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/4NK_modules/tor-proxy/torrc b/storage/dev/4NK_modules/tor-proxy/torrc deleted file mode 100644 index 7ee029a..0000000 --- a/storage/dev/4NK_modules/tor-proxy/torrc +++ /dev/null @@ -1,18 +0,0 @@ -# Configuration Tor pour LeCoffre Node -# Écoute sur 127.0.0.1 pour la sécurité - -# Port SOCKS pour les connexions sortantes -SOCKSPort 127.0.0.1:$TOR_PORT - -# Configuration de base -Log notice file $TOR_LOGS_DIR/tor.log -DataDirectory $SDK_TOR_DATA_DIR - -# Configuration réseau -ClientOnly 1 -SafeLogging 1 -WarnUnsafeSocks 1 - -# Désactiver les services cachés -# HiddenServiceDir $SDK_TOR_DATA_DIR/hidden_service/ -# HiddenServicePort 80 127.0.0.1:80 diff --git a/storage/dev/README.md b/storage/dev/README.md new file mode 100644 index 0000000..f03562d --- /dev/null +++ b/storage/dev/README.md @@ -0,0 +1,233 @@ +# _4NK Vault - Générateur de Configurations + +Ce répertoire contient les scripts de génération automatique des configurations pour l'écosystème _4NK Vault. + +## 🚀 Script Principal + +### `generate.sh` +Script principal qui orchestre la génération de toutes les configurations nécessaires. + +**Scripts exécutés dans l'ordre :** +1. `generate_docker_variables.sh` - Génère `.env.auto` avec les variables Docker +2. `generate_docker_compose.sh` - Génère `docker-compose.yml.auto` +3. `generate_grafana_dashboards.sh` - Génère les dashboards Grafana et config Promtail +4. `generate_nginx_configs.sh` - Génère les configurations Nginx + +## 📋 Scripts Individuels + +### 1. Génération des Variables Docker +**`generate_docker_variables.sh`** +- Génère le fichier `.env.auto` avec toutes les variables Docker calculées +- Variables globales : `DOCKER_GLOBAL_NAME`, `DOCKER_NETWORK_NAME`, `DOCKER_VOLUME_PREFIX` +- Variables par service : `{SERVICE}_DOCKER_NAME`, `{SERVICE}_DOCKER_IMAGE`, etc. + +### 2. Génération du Docker Compose +**`generate_docker_compose.sh`** +- Génère le fichier `docker-compose.yml.auto` basé sur les services définis +- Configuration complète : services, réseaux, volumes +- Ports et variables d'environnement par service + +### 3. Génération des Dashboards Grafana +**`generate_grafana_dashboards.sh`** +- Génère les dashboards Grafana pour tous les services +- Configuration Promtail pour la collecte de logs +- Configurations logrotate pour la gestion des logs +- Dashboard overview avec vue d'ensemble + +### 4. Génération des Configurations Nginx +**`generate_nginx_configs.sh`** +- Génère `nginx/upstreams.conf` avec les upstreams et format de log JSON +- Génère `nginx/app-internal-ports.conf` pour le proxy interne +- Génère `nginx/proxy_headers.conf` avec les headers de proxy +- Génère `nginx/{SERVICE}_https.conf` avec les vhosts HTTPS individuels +- Génère `nginx/nginx_{HOST}-https.conf` avec la configuration HTTPS consolidée +- Génère `nginx/validate_templates.sh` pour la validation + +## 🔧 Utilisation + +### Prérequis +```bash +# Variables d'environnement requises dans .env +export HOST="dev4._4NKweb.com" +export SERVICES=(REDIS POSTGRESQL LOKI PROMTAIL GRAFANA NGNIX TOR _4NK_VAULT BITCOIN BLINDBIT_ORACLE SDK_RELAY SDK_STORAGE IHM_CLIENT _4NK_CERTIFICATOR _4NK_MINER LECOFFRE_FRONT _4NK_WEB_STATUS) +``` + +### Exécution +```bash +# Charger les variables d'environnement +source .env + +# Exécuter la génération complète +./generate.sh + +# Ou exécuter un script individuel +./generate_docker_variables.sh +./generate_docker_compose.sh +./generate_grafana_dashboards.sh +./generate_nginx_configs.sh +``` + +## 📁 Structure des Fichiers Générés + +``` +storage/dev/ +├── .env.auto # Variables Docker calculées +├── docker-compose.yml.auto # Configuration Docker Compose +├── _4NK_modules/ +│ ├── grafana/dashboards/ # Dashboards Grafana (.json) +│ └── promtail/promtail.yml # Configuration Promtail +├── nginx/ +│ ├── upstreams.conf # Upstreams et format de log +│ ├── app-internal-ports.conf # Proxy interne +│ ├── proxy_headers.conf # Headers de proxy +│ ├── {SERVICE}_https.conf # Configurations HTTPS individuelles +│ ├── nginx_{HOST}-https.conf # Configuration HTTPS consolidée +│ └── validate_templates.sh # Validation des templates +└── logrotade/ # Configurations logrotate (.conf) +``` + +## 🛡️ Politique de Déploiement + +### Principes de Sécurité +1. **Chiffrement des Flux** : Toutes les communications utilisent HTTPS avec TLS 1.2+ +2. **Authentification** : Authentification par clé utilisateur (`X-User-ID`) +3. **Rotation des Clés** : Rotation automatique des clés de chiffrement +4. **Isolation des Services** : Chaque service dans son propre réseau Docker +5. **Logs Sécurisés** : Collecte centralisée avec format JSON structuré + +### 🚀 Politique NGINX + +#### Configuration des Templates +- **Proxy Redirect Off** : Les applications gèrent leurs propres URLs +- **Headers de Debug** : `X-Debug-Scheme` et `X-Debug-XFP` pour le débogage +- **HSTS** : Strict-Transport-Security activé pour forcer HTTPS +- **WebSocket Support** : Support natif des WebSockets avec upgrade HTTP/1.1 +- **Logs JSON** : Format structuré pour l'analyse des logs + +#### Architecture des Templates +``` +nginx/ +├── upstreams.conf # Upstreams et format de log JSON +├── app-internal-ports.conf # Proxy interne (ports dédiés) +├── proxy_headers.conf # Headers de proxy communs +├── {SERVICE}_https.conf # Configurations HTTPS individuelles +├── nginx_{HOST}-https.conf # Configuration HTTPS consolidée +└── validate_templates.sh # Validation des templates générés +``` + +#### Directives Proxy Standardisées +```nginx +# Dans proxy_headers.conf +proxy_redirect off; # Les apps gèrent leurs URLs +add_header X-Debug-Scheme $scheme always; +add_header X-Debug-XFP $http_x_forwarded_proto always; + +# Headers de base +proxy_set_header Host $host; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +proxy_set_header X-Forwarded-Proto $scheme; +``` + +#### Gestion des Upstreams +- **Keepalive** : 64 connexions persistantes par upstream +- **Load Balancing** : Répartition automatique des requêtes +- **Health Checks** : Vérification automatique de la disponibilité + +#### Configuration HTTPS +- **TLS 1.2+** : Protocoles sécurisés uniquement +- **Certificats Dynamiques** : Chemins configurables via variables +- **Redirection HTTP→HTTPS** : Redirection automatique du port 80 vers 443 +- **HSTS** : Headers de sécurité stricts pour forcer HTTPS + +#### Support WebSocket +```nginx +location /ws/ { + proxy_pass http://$upstream; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_read_timeout 3600s; +} +``` + +#### Format de Logs JSON +```nginx +log_format app_json escape=json + '{ "time":"$time_iso8601",' + ' "client":"$remote_addr",' + ' "xff":"$http_x_forwarded_for",' + ' "method":"$request_method",' + ' "host":"$host",' + ' "uri":"$request_uri",' + ' "status":$status,' + ' "bytes":$body_bytes_sent,' + ' "ua":"$http_user_agent",' + ' "upstream":"$upstream_addr",' + ' "rt":$request_time,' + ' "urt":$upstream_response_time }'; +``` + +### Gestion des Variables +1. **Ordre de Chargement** : `.env.secrets` → `.env` → `.env.auto` → `.env.post` +2. **Résolution Récursive** : Support des variables imbriquées (`$VAR`, `${VAR}`) +3. **Protection** : Les fichiers `.env` et `.env.secrets` ne sont jamais modifiés +4. **Remplacement** : Les fichiers de sortie sont toujours remplacés complètement + +### Monitoring et Observabilité +- **Dashboards Grafana** : Vue d'ensemble et métriques par service +- **Collecte de Logs** : Promtail + Loki pour l'agrégation des logs +- **Rotation des Logs** : Configuration logrotate automatique +- **Métriques Docker** : Monitoring des containers et ressources + +### Génération de Templates +- **Templates Automatiques** : Génération automatique de tous les templates +- **Docker Compose** : Template d'orchestration des services avec volumes persistants +- **Réseaux Isolés** : Configuration de réseaux Docker par environnement +- **Volumes Nommés** : Configuration de persistance des données avec volumes nommés +- **Validation** : Script de validation des templates générés + +## 🔍 Dépannage + +### Erreurs Communes +1. **Variable SERVICES non définie** : Vérifiez que `SERVICES` est défini dans `.env` +2. **Variable HOST non définie** : Utilise la valeur par défaut `dev4._4NKweb.com` +3. **Fichiers manquants** : Vérifiez que tous les scripts sont présents et exécutables + +### Logs et Debug +- Les scripts affichent des messages détaillés en mode verbeux +- Les configurations Nginx incluent des headers de debug +- Les logs sont collectés au format JSON pour l'analyse + +## 📚 Documentation des Scripts + +Chaque script inclut : +- Documentation complète en en-tête +- Messages d'erreur explicites +- Validation des prérequis +- Gestion des erreurs robuste +- Support des options d'aide (`--help`) + +## 🔄 Maintenance + +### Mise à Jour des Configurations +Les scripts sont conçus pour être **idempotents** : +- Les fichiers de sortie sont toujours remplacés complètement +- Aucune modification des fichiers sources (`.env`, `.env.secrets`) +- Régénération possible à tout moment sans conflit + +### Ajout de Nouveaux Services +1. Ajouter le service à la variable `SERVICES` dans `.env` +2. Définir les variables spécifiques au service (ports, base de données, etc.) +3. Relancer `./generate.sh` pour régénérer toutes les configurations + +### Utilisation des Templates +Les templates générés sont prêts à être utilisés dans votre infrastructure : + +1. **Validation** : Utilisez `nginx/validate_templates.sh` pour vérifier la cohérence +2. **Adaptation** : Modifiez les chemins et configurations selon vos besoins spécifiques +3. **Déploiement** : Intégrez les templates dans votre processus de déploiement +4. **Rotation des Certificats** : Les templates utilisent des variables pour les chemins : + - `$CERT_PATH/certs/fullchain.pem` + - `$CERT_PATH/private/privkey.pem` + - Mise à jour automatique lors de la régénération des templates diff --git a/storage/dev/_4NK_modules/grafana/dashboards/_4NK-certificator.json b/storage/dev/_4NK_modules/grafana/dashboards/_4NK-certificator.json new file mode 100644 index 0000000..d8e4806 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/_4NK-certificator.json @@ -0,0 +1,308 @@ +{ + "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=\"$_4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - _4NK-certificator", + "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=\"$_4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - _4NK-certificator", + "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=\"$_4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$_4NK_CERTIFICATOR_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - _4NK-certificator", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "_4NK-certificator", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "_4NK-certificator - Monitoring", + "uid": "-4nk-certificator", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/_4NK-miner.json b/storage/dev/_4NK_modules/grafana/dashboards/_4NK-miner.json new file mode 100644 index 0000000..54cc4f6 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/_4NK-miner.json @@ -0,0 +1,308 @@ +{ + "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=\"$_4NK_MINER_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - _4NK-miner", + "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=\"$_4NK_MINER_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - _4NK-miner", + "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=\"$_4NK_MINER_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$_4NK_MINER_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - _4NK-miner", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "_4NK-miner", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "_4NK-miner - Monitoring", + "uid": "-4nk-miner", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/_4NK-vault.json b/storage/dev/_4NK_modules/grafana/dashboards/_4NK-vault.json new file mode 100644 index 0000000..a541dac --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/_4NK-vault.json @@ -0,0 +1,308 @@ +{ + "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=\"$_4NK_VAULT_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - _4NK-vault", + "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=\"$_4NK_VAULT_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - _4NK-vault", + "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=\"$_4NK_VAULT_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$_4NK_VAULT_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - _4NK-vault", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "_4NK-vault", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "_4NK-vault - Monitoring", + "uid": "-4nk-vault", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/_4NK-web-status.json b/storage/dev/_4NK_modules/grafana/dashboards/_4NK-web-status.json new file mode 100644 index 0000000..d1fff44 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/_4NK-web-status.json @@ -0,0 +1,308 @@ +{ + "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=\"$_4NK_WEB_STATUS_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - _4NK-web-status", + "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=\"$_4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - _4NK-web-status", + "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=\"$_4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$_4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - _4NK-web-status", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "_4NK-web-status", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "_4NK-web-status - Monitoring", + "uid": "-4nk-web-status", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/bitcoin.json b/storage/dev/_4NK_modules/grafana/dashboards/bitcoin.json new file mode 100644 index 0000000..76ee3a5 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/bitcoin.json @@ -0,0 +1,308 @@ +{ + "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=\"$BITCOIN_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - bitcoin", + "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=\"$BITCOIN_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - bitcoin", + "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=\"$BITCOIN_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$BITCOIN_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - bitcoin", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "bitcoin", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "bitcoin - Monitoring", + "uid": "bitcoin", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/blindbit-oracle.json b/storage/dev/_4NK_modules/grafana/dashboards/blindbit-oracle.json new file mode 100644 index 0000000..45766ab --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/blindbit-oracle.json @@ -0,0 +1,308 @@ +{ + "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=\"$BLINDBIT_ORACLE_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - blindbit-oracle", + "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=\"$BLINDBIT_ORACLE_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - blindbit-oracle", + "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=\"$BLINDBIT_ORACLE_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$BLINDBIT_ORACLE_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - blindbit-oracle", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "blindbit-oracle", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "blindbit-oracle - Monitoring", + "uid": "blindbit-oracle", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/grafana.json b/storage/dev/_4NK_modules/grafana/dashboards/grafana.json new file mode 100644 index 0000000..ce220cd --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/grafana.json @@ -0,0 +1,308 @@ +{ + "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=\"$GRAFANA_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - grafana", + "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=\"$GRAFANA_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - grafana", + "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=\"$GRAFANA_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$GRAFANA_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - grafana", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "grafana", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "grafana - Monitoring", + "uid": "grafana", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/ihm-client.json b/storage/dev/_4NK_modules/grafana/dashboards/ihm-client.json new file mode 100644 index 0000000..5e4be65 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/ihm-client.json @@ -0,0 +1,308 @@ +{ + "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=\"$IHM_CLIENT_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - ihm-client", + "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=\"$IHM_CLIENT_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - ihm-client", + "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=\"$IHM_CLIENT_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$IHM_CLIENT_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - ihm-client", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "ihm-client", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "ihm-client - Monitoring", + "uid": "ihm-client", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/4NK_modules/grafana/dashboards/.json b/storage/dev/_4NK_modules/grafana/dashboards/lecoffre-front.json similarity index 93% rename from storage/dev/4NK_modules/grafana/dashboards/.json rename to storage/dev/_4NK_modules/grafana/dashboards/lecoffre-front.json index 0c37038..a82acdd 100644 --- a/storage/dev/4NK_modules/grafana/dashboards/.json +++ b/storage/dev/_4NK_modules/grafana/dashboards/lecoffre-front.json @@ -88,12 +88,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(rate({container=\"$4NK_WEB_STATUS_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "expr": "sum(rate({container=\"$LECOFFRE_FRONT_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", "queryType": "", "refId": "A" } ], - "title": "Logs INFO - ", + "title": "Logs INFO - lecoffre-front", "type": "timeseries" }, { @@ -175,12 +175,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(rate({container=\"$4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "expr": "sum(rate({container=\"$LECOFFRE_FRONT_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", "queryType": "", "refId": "A" } ], - "title": "Erreurs - ", + "title": "Erreurs - lecoffre-front", "type": "timeseries" }, { @@ -239,7 +239,7 @@ "uid": "loki" }, "editorMode": "code", - "expr": "count_over_time({container=\"$4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "expr": "count_over_time({container=\"$LECOFFRE_FRONT_DOCKER_NAME\"} |= \"ERROR\" [1h])", "queryType": "", "refId": "A" } @@ -276,12 +276,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "{container=\"$4NK_WEB_STATUS_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "expr": "{container=\"$LECOFFRE_FRONT_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", "queryType": "", "refId": "A" } ], - "title": "Logs d'Erreur - ", + "title": "Logs d'Erreur - lecoffre-front", "type": "logs" } ], @@ -289,7 +289,7 @@ "schemaVersion": 37, "style": "dark", "tags": [ - "", + "lecoffre-front", "auto-generated" ], "templating": { @@ -301,8 +301,8 @@ }, "timepicker": {}, "timezone": "", - "title": " - Monitoring", - "uid": "", + "title": "lecoffre-front - Monitoring", + "uid": "lecoffre-front", "version": 1, "weekStart": "" } diff --git a/storage/dev/_4NK_modules/grafana/dashboards/loki.json b/storage/dev/_4NK_modules/grafana/dashboards/loki.json new file mode 100644 index 0000000..61cf966 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/loki.json @@ -0,0 +1,308 @@ +{ + "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=\"$LOKI_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - loki", + "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=\"$LOKI_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - loki", + "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=\"$LOKI_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$LOKI_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - loki", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "loki", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "loki - Monitoring", + "uid": "loki", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/ngnix.json b/storage/dev/_4NK_modules/grafana/dashboards/ngnix.json new file mode 100644 index 0000000..5e8b3ef --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/ngnix.json @@ -0,0 +1,308 @@ +{ + "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=\"$NGNIX_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - ngnix", + "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=\"$NGNIX_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - ngnix", + "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=\"$NGNIX_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$NGNIX_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - ngnix", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "ngnix", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "ngnix - Monitoring", + "uid": "ngnix", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/postgresql.json b/storage/dev/_4NK_modules/grafana/dashboards/postgresql.json new file mode 100644 index 0000000..5ae1014 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/postgresql.json @@ -0,0 +1,308 @@ +{ + "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=\"$POSTGRESQL_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - postgresql", + "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=\"$POSTGRESQL_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - postgresql", + "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=\"$POSTGRESQL_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$POSTGRESQL_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - postgresql", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "postgresql", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "postgresql - Monitoring", + "uid": "postgresql", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/promtail.json b/storage/dev/_4NK_modules/grafana/dashboards/promtail.json new file mode 100644 index 0000000..f2cef80 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/promtail.json @@ -0,0 +1,308 @@ +{ + "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=\"$PROMTAIL_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - promtail", + "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=\"$PROMTAIL_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - promtail", + "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=\"$PROMTAIL_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$PROMTAIL_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - promtail", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "promtail", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "promtail - Monitoring", + "uid": "promtail", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/redis.json b/storage/dev/_4NK_modules/grafana/dashboards/redis.json new file mode 100644 index 0000000..e6ef3ee --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/redis.json @@ -0,0 +1,308 @@ +{ + "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=\"$REDIS_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - redis", + "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=\"$REDIS_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - redis", + "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=\"$REDIS_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$REDIS_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - redis", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "redis", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "redis - Monitoring", + "uid": "redis", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/4NK_modules/grafana/dashboards/4nk-miner.json b/storage/dev/_4NK_modules/grafana/dashboards/sdk-relay.json similarity index 93% rename from storage/dev/4NK_modules/grafana/dashboards/4nk-miner.json rename to storage/dev/_4NK_modules/grafana/dashboards/sdk-relay.json index 63cafb8..27e2083 100644 --- a/storage/dev/4NK_modules/grafana/dashboards/4nk-miner.json +++ b/storage/dev/_4NK_modules/grafana/dashboards/sdk-relay.json @@ -88,12 +88,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(rate({container=\"$4NK_MINER_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "expr": "sum(rate({container=\"$SDK_RELAY_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", "queryType": "", "refId": "A" } ], - "title": "Logs INFO - 4nk-miner", + "title": "Logs INFO - sdk-relay", "type": "timeseries" }, { @@ -175,12 +175,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "sum(rate({container=\"$4NK_MINER_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "expr": "sum(rate({container=\"$SDK_RELAY_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", "queryType": "", "refId": "A" } ], - "title": "Erreurs - 4nk-miner", + "title": "Erreurs - sdk-relay", "type": "timeseries" }, { @@ -239,7 +239,7 @@ "uid": "loki" }, "editorMode": "code", - "expr": "count_over_time({container=\"$4NK_MINER_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "expr": "count_over_time({container=\"$SDK_RELAY_DOCKER_NAME\"} |= \"ERROR\" [1h])", "queryType": "", "refId": "A" } @@ -276,12 +276,12 @@ "uid": "loki" }, "editorMode": "code", - "expr": "{container=\"$4NK_MINER_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "expr": "{container=\"$SDK_RELAY_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", "queryType": "", "refId": "A" } ], - "title": "Logs d'Erreur - 4nk-miner", + "title": "Logs d'Erreur - sdk-relay", "type": "logs" } ], @@ -289,7 +289,7 @@ "schemaVersion": 37, "style": "dark", "tags": [ - "4nk-miner", + "sdk-relay", "auto-generated" ], "templating": { @@ -301,8 +301,8 @@ }, "timepicker": {}, "timezone": "", - "title": "4nk-miner - Monitoring", - "uid": "4nk-miner", + "title": "sdk-relay - Monitoring", + "uid": "sdk-relay", "version": 1, "weekStart": "" } diff --git a/storage/dev/_4NK_modules/grafana/dashboards/sdk-storage.json b/storage/dev/_4NK_modules/grafana/dashboards/sdk-storage.json new file mode 100644 index 0000000..38bffe1 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/sdk-storage.json @@ -0,0 +1,308 @@ +{ + "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=\"$SDK_STORAGE_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - sdk-storage", + "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=\"$SDK_STORAGE_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - sdk-storage", + "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=\"$SDK_STORAGE_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$SDK_STORAGE_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - sdk-storage", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "sdk-storage", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "sdk-storage - Monitoring", + "uid": "sdk-storage", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/services-overview.json b/storage/dev/_4NK_modules/grafana/dashboards/services-overview.json new file mode 100644 index 0000000..a4bb478 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/services-overview.json @@ -0,0 +1,119 @@ +{ + "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 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "sum by (container) (count_over_time({container=~\"$bitcoin_DOCKER_NAME|$blindbit-oracle_DOCKER_NAME|$sdk_relay_DOCKER_NAME|$sdk_storage_DOCKER_NAME|$ihm_client_DOCKER_NAME|$lecoffre-front_DOCKER_NAME\"} |= \"ERROR\" [5m]))", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs par Service (5 dernières minutes)", + "type": "timeseries" + } + ], + "refresh": "30s", + "schemaVersion": 36, + "style": "dark", + "tags": ["overview", "auto-generated"], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Services Overview - Auto Generated", + "uid": "services-overview-auto", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/grafana/dashboards/tor.json b/storage/dev/_4NK_modules/grafana/dashboards/tor.json new file mode 100644 index 0000000..a461b10 --- /dev/null +++ b/storage/dev/_4NK_modules/grafana/dashboards/tor.json @@ -0,0 +1,308 @@ +{ + "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=\"$TOR_DOCKER_NAME\"} |= \"INFO\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs INFO - tor", + "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=\"$TOR_DOCKER_NAME\"} |= \"ERROR\" [5m])) by (container)", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs - tor", + "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=\"$TOR_DOCKER_NAME\"} |= \"ERROR\" [1h])", + "queryType": "", + "refId": "A" + } + ], + "title": "Erreurs (1h)", + "type": "stat" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 12 + }, + "id": 4, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "targets": [ + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "editorMode": "code", + "expr": "{container=\"$TOR_DOCKER_NAME\"} |= \"ERROR\" | line_format \"{{.timestamp}} - {{.message}}\"", + "queryType": "", + "refId": "A" + } + ], + "title": "Logs d'Erreur - tor", + "type": "logs" + } + ], + "refresh": "5s", + "schemaVersion": 37, + "style": "dark", + "tags": [ + "tor", + "auto-generated" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "tor - Monitoring", + "uid": "tor", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/_4NK_modules/promtail/promtail.yml b/storage/dev/_4NK_modules/promtail/promtail.yml new file mode 100644 index 0000000..5377b26 --- /dev/null +++ b/storage/dev/_4NK_modules/promtail/promtail.yml @@ -0,0 +1,334 @@ +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: 'REDIS' + static_configs: + - targets: + - localhost + labels: + job: REDIS + __path__: $REDIS_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="REDIS"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'POSTGRESQL' + static_configs: + - targets: + - localhost + labels: + job: POSTGRESQL + __path__: $POSTGRESQL_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="POSTGRESQL"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'LOKI' + static_configs: + - targets: + - localhost + labels: + job: LOKI + __path__: $LOKI_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="LOKI"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'PROMTAIL' + static_configs: + - targets: + - localhost + labels: + job: PROMTAIL + __path__: $PROMTAIL_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="PROMTAIL"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'GRAFANA' + static_configs: + - targets: + - localhost + labels: + job: GRAFANA + __path__: $GRAFANA_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="GRAFANA"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'NGNIX' + static_configs: + - targets: + - localhost + labels: + job: NGNIX + __path__: $NGNIX_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="NGNIX"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'TOR' + static_configs: + - targets: + - localhost + labels: + job: TOR + __path__: $TOR_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="TOR"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: '_4NK_VAULT' + static_configs: + - targets: + - localhost + labels: + job: _4NK_VAULT + __path__: $_4NK_VAULT_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="_4NK_VAULT"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'BITCOIN' + static_configs: + - targets: + - localhost + labels: + job: BITCOIN + __path__: $BITCOIN_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="BITCOIN"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'BLINDBIT_ORACLE' + static_configs: + - targets: + - localhost + labels: + job: BLINDBIT_ORACLE + __path__: $BLINDBIT_ORACLE_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="BLINDBIT_ORACLE"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'SDK_RELAY' + static_configs: + - targets: + - localhost + labels: + job: SDK_RELAY + __path__: $SDK_RELAY_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="SDK_RELAY"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'SDK_STORAGE' + static_configs: + - targets: + - localhost + labels: + job: SDK_STORAGE + __path__: $SDK_STORAGE_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="SDK_STORAGE"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'IHM_CLIENT' + static_configs: + - targets: + - localhost + labels: + job: IHM_CLIENT + __path__: $IHM_CLIENT_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="IHM_CLIENT"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: '_4NK_CERTIFICATOR' + static_configs: + - targets: + - localhost + labels: + job: _4NK_CERTIFICATOR + __path__: $_4NK_CERTIFICATOR_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="_4NK_CERTIFICATOR"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: '_4NK_MINER' + static_configs: + - targets: + - localhost + labels: + job: _4NK_MINER + __path__: $_4NK_MINER_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="_4NK_MINER"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: 'LECOFFRE_FRONT' + static_configs: + - targets: + - localhost + labels: + job: LECOFFRE_FRONT + __path__: $LECOFFRE_FRONT_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="LECOFFRE_FRONT"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' + + - job_name: '_4NK_WEB_STATUS' + static_configs: + - targets: + - localhost + labels: + job: _4NK_WEB_STATUS + __path__: $_4NK_WEB_STATUS_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="_4NK_WEB_STATUS"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' diff --git a/storage/dev/docker-compose.yml.auto b/storage/dev/docker-compose.yml.auto new file mode 100644 index 0000000..2b220e6 --- /dev/null +++ b/storage/dev/docker-compose.yml.auto @@ -0,0 +1,535 @@ + +services: + + + $REDIS_DOCKER_NAME: + image: $REDIS_DOCKER_IMAGE + container_name: $REDIS_DOCKER_NAME + working_dir: /$REDIS_DOCKER_NAME + ports: + - "0.0.0.0:$REDIS_EXTERNAL_PORT" + - "0.0.0.0:$REDIS_PORT" + - "0.0.0.0:$REDIS_PORT2" + - "0.0.0.0:$REDIS_PORT3" + volumes: + - $REDIS_CONFS_DIR:$REDIS_DOCKER_CONFS_DIR + - $REDIS_LOGS_DIR:$REDIS_DOCKER_LOGS_DIR + - $REDIS_RUNS_DIR:$REDIS_DOCKER_RUNS_DIR + - $REDIS_DATAS_DIR:$REDIS_DOCKER_DATAS_DIR + - $REDIS_BACKUPS_DIR:$REDIS_DOCKER_BACKUPS_DIR + - $REDIS_SCRIPTS_DIR:$REDIS_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $REDIS_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$REDIS_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$REDIS.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $POSTGRESQL_DOCKER_NAME: + image: $POSTGRESQL_DOCKER_IMAGE + container_name: $POSTGRESQL_DOCKER_NAME + working_dir: /$POSTGRESQL_DOCKER_NAME + ports: + - "0.0.0.0:$POSTGRESQL_EXTERNAL_PORT" + - "0.0.0.0:$POSTGRESQL_PORT" + - "0.0.0.0:$POSTGRESQL_PORT2" + - "0.0.0.0:$POSTGRESQL_PORT3" + volumes: + - $POSTGRESQL_CONFS_DIR:$POSTGRESQL_DOCKER_CONFS_DIR + - $POSTGRESQL_LOGS_DIR:$POSTGRESQL_DOCKER_LOGS_DIR + - $POSTGRESQL_RUNS_DIR:$POSTGRESQL_DOCKER_RUNS_DIR + - $POSTGRESQL_DATAS_DIR:$POSTGRESQL_DOCKER_DATAS_DIR + - $POSTGRESQL_BACKUPS_DIR:$POSTGRESQL_DOCKER_BACKUPS_DIR + - $POSTGRESQL_SCRIPTS_DIR:$POSTGRESQL_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $POSTGRESQL_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$POSTGRESQL_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$POSTGRESQL.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $LOKI_DOCKER_NAME: + image: $LOKI_DOCKER_IMAGE + container_name: $LOKI_DOCKER_NAME + working_dir: /$LOKI_DOCKER_NAME + ports: + - "0.0.0.0:$LOKI_EXTERNAL_PORT" + - "0.0.0.0:$LOKI_PORT" + - "0.0.0.0:$LOKI_PORT2" + - "0.0.0.0:$LOKI_PORT3" + volumes: + - $LOKI_CONFS_DIR:$LOKI_DOCKER_CONFS_DIR + - $LOKI_LOGS_DIR:$LOKI_DOCKER_LOGS_DIR + - $LOKI_RUNS_DIR:$LOKI_DOCKER_RUNS_DIR + - $LOKI_DATAS_DIR:$LOKI_DOCKER_DATAS_DIR + - $LOKI_BACKUPS_DIR:$LOKI_DOCKER_BACKUPS_DIR + - $LOKI_SCRIPTS_DIR:$LOKI_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $LOKI_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$LOKI_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$LOKI.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $PROMTAIL_DOCKER_NAME: + image: $PROMTAIL_DOCKER_IMAGE + container_name: $PROMTAIL_DOCKER_NAME + working_dir: /$PROMTAIL_DOCKER_NAME + ports: + - "0.0.0.0:$PROMTAIL_EXTERNAL_PORT" + - "0.0.0.0:$PROMTAIL_PORT" + - "0.0.0.0:$PROMTAIL_PORT2" + - "0.0.0.0:$PROMTAIL_PORT3" + volumes: + - $PROMTAIL_CONFS_DIR:$PROMTAIL_DOCKER_CONFS_DIR + - $PROMTAIL_LOGS_DIR:$PROMTAIL_DOCKER_LOGS_DIR + - $PROMTAIL_RUNS_DIR:$PROMTAIL_DOCKER_RUNS_DIR + - $PROMTAIL_DATAS_DIR:$PROMTAIL_DOCKER_DATAS_DIR + - $PROMTAIL_BACKUPS_DIR:$PROMTAIL_DOCKER_BACKUPS_DIR + - $PROMTAIL_SCRIPTS_DIR:$PROMTAIL_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $PROMTAIL_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$PROMTAIL_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$PROMTAIL.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $GRAFANA_DOCKER_NAME: + image: $GRAFANA_DOCKER_IMAGE + container_name: $GRAFANA_DOCKER_NAME + working_dir: /$GRAFANA_DOCKER_NAME + ports: + - "0.0.0.0:$GRAFANA_EXTERNAL_PORT" + - "0.0.0.0:$GRAFANA_PORT" + - "0.0.0.0:$GRAFANA_PORT2" + - "0.0.0.0:$GRAFANA_PORT3" + volumes: + - $GRAFANA_CONFS_DIR:$GRAFANA_DOCKER_CONFS_DIR + - $GRAFANA_LOGS_DIR:$GRAFANA_DOCKER_LOGS_DIR + - $GRAFANA_RUNS_DIR:$GRAFANA_DOCKER_RUNS_DIR + - $GRAFANA_DATAS_DIR:$GRAFANA_DOCKER_DATAS_DIR + - $GRAFANA_BACKUPS_DIR:$GRAFANA_DOCKER_BACKUPS_DIR + - $GRAFANA_SCRIPTS_DIR:$GRAFANA_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $GRAFANA_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$GRAFANA_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$GRAFANA.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $NGNIX_DOCKER_NAME: + image: $NGNIX_DOCKER_IMAGE + container_name: $NGNIX_DOCKER_NAME + working_dir: /$NGNIX_DOCKER_NAME + ports: + - "0.0.0.0:$NGNIX_EXTERNAL_PORT" + - "0.0.0.0:$NGNIX_PORT" + - "0.0.0.0:$NGNIX_PORT2" + - "0.0.0.0:$NGNIX_PORT3" + volumes: + - $NGNIX_CONFS_DIR:$NGNIX_DOCKER_CONFS_DIR + - $NGNIX_LOGS_DIR:$NGNIX_DOCKER_LOGS_DIR + - $NGNIX_RUNS_DIR:$NGNIX_DOCKER_RUNS_DIR + - $NGNIX_DATAS_DIR:$NGNIX_DOCKER_DATAS_DIR + - $NGNIX_BACKUPS_DIR:$NGNIX_DOCKER_BACKUPS_DIR + - $NGNIX_SCRIPTS_DIR:$NGNIX_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $NGNIX_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$NGNIX_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$NGNIX.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $TOR_DOCKER_NAME: + image: $TOR_DOCKER_IMAGE + container_name: $TOR_DOCKER_NAME + working_dir: /$TOR_DOCKER_NAME + ports: + - "0.0.0.0:$TOR_EXTERNAL_PORT" + - "0.0.0.0:$TOR_PORT" + - "0.0.0.0:$TOR_PORT2" + - "0.0.0.0:$TOR_PORT3" + volumes: + - $TOR_CONFS_DIR:$TOR_DOCKER_CONFS_DIR + - $TOR_LOGS_DIR:$TOR_DOCKER_LOGS_DIR + - $TOR_RUNS_DIR:$TOR_DOCKER_RUNS_DIR + - $TOR_DATAS_DIR:$TOR_DOCKER_DATAS_DIR + - $TOR_BACKUPS_DIR:$TOR_DOCKER_BACKUPS_DIR + - $TOR_SCRIPTS_DIR:$TOR_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $TOR_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$TOR_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$TOR.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $_4NK_VAULT_DOCKER_NAME: + image: $_4NK_VAULT_DOCKER_IMAGE + container_name: $_4NK_VAULT_DOCKER_NAME + working_dir: /$_4NK_VAULT_DOCKER_NAME + ports: + - "0.0.0.0:$_4NK_VAULT_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_VAULT_PORT" + - "0.0.0.0:$_4NK_VAULT_PORT2" + - "0.0.0.0:$_4NK_VAULT_PORT3" + volumes: + - $_4NK_VAULT_CONFS_DIR:$_4NK_VAULT_DOCKER_CONFS_DIR + - $_4NK_VAULT_LOGS_DIR:$_4NK_VAULT_DOCKER_LOGS_DIR + - $_4NK_VAULT_RUNS_DIR:$_4NK_VAULT_DOCKER_RUNS_DIR + - $_4NK_VAULT_DATAS_DIR:$_4NK_VAULT_DOCKER_DATAS_DIR + - $_4NK_VAULT_BACKUPS_DIR:$_4NK_VAULT_DOCKER_BACKUPS_DIR + - $_4NK_VAULT_SCRIPTS_DIR:$_4NK_VAULT_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $_4NK_VAULT_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$_4NK_VAULT_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_VAULT.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $BITCOIN_DOCKER_NAME: + image: $BITCOIN_DOCKER_IMAGE + container_name: $BITCOIN_DOCKER_NAME + working_dir: /$BITCOIN_DOCKER_NAME + ports: + - "0.0.0.0:$BITCOIN_EXTERNAL_PORT" + - "0.0.0.0:$BITCOIN_PORT" + - "0.0.0.0:$BITCOIN_PORT2" + - "0.0.0.0:$BITCOIN_PORT3" + volumes: + - $BITCOIN_CONFS_DIR:$BITCOIN_DOCKER_CONFS_DIR + - $BITCOIN_LOGS_DIR:$BITCOIN_DOCKER_LOGS_DIR + - $BITCOIN_RUNS_DIR:$BITCOIN_DOCKER_RUNS_DIR + - $BITCOIN_DATAS_DIR:$BITCOIN_DOCKER_DATAS_DIR + - $BITCOIN_BACKUPS_DIR:$BITCOIN_DOCKER_BACKUPS_DIR + - $BITCOIN_SCRIPTS_DIR:$BITCOIN_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $BITCOIN_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$BITCOIN_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$BITCOIN.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $BLINDBIT_ORACLE_DOCKER_NAME: + image: $BLINDBIT_ORACLE_DOCKER_IMAGE + container_name: $BLINDBIT_ORACLE_DOCKER_NAME + working_dir: /$BLINDBIT_ORACLE_DOCKER_NAME + ports: + - "0.0.0.0:$BLINDBIT_ORACLE_EXTERNAL_PORT" + - "0.0.0.0:$BLINDBIT_ORACLE_PORT" + - "0.0.0.0:$BLINDBIT_ORACLE_PORT2" + - "0.0.0.0:$BLINDBIT_ORACLE_PORT3" + volumes: + - $BLINDBIT_ORACLE_CONFS_DIR:$BLINDBIT_ORACLE_DOCKER_CONFS_DIR + - $BLINDBIT_ORACLE_LOGS_DIR:$BLINDBIT_ORACLE_DOCKER_LOGS_DIR + - $BLINDBIT_ORACLE_RUNS_DIR:$BLINDBIT_ORACLE_DOCKER_RUNS_DIR + - $BLINDBIT_ORACLE_DATAS_DIR:$BLINDBIT_ORACLE_DOCKER_DATAS_DIR + - $BLINDBIT_ORACLE_BACKUPS_DIR:$BLINDBIT_ORACLE_DOCKER_BACKUPS_DIR + - $BLINDBIT_ORACLE_SCRIPTS_DIR:$BLINDBIT_ORACLE_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $BLINDBIT_ORACLE_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$BLINDBIT_ORACLE_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$BLINDBIT_ORACLE.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $SDK_RELAY_DOCKER_NAME: + image: $SDK_RELAY_DOCKER_IMAGE + container_name: $SDK_RELAY_DOCKER_NAME + working_dir: /$SDK_RELAY_DOCKER_NAME + ports: + - "0.0.0.0:$SDK_RELAY_EXTERNAL_PORT" + - "0.0.0.0:$SDK_RELAY_PORT" + - "0.0.0.0:$SDK_RELAY_PORT2" + - "0.0.0.0:$SDK_RELAY_PORT3" + volumes: + - $SDK_RELAY_CONFS_DIR:$SDK_RELAY_DOCKER_CONFS_DIR + - $SDK_RELAY_LOGS_DIR:$SDK_RELAY_DOCKER_LOGS_DIR + - $SDK_RELAY_RUNS_DIR:$SDK_RELAY_DOCKER_RUNS_DIR + - $SDK_RELAY_DATAS_DIR:$SDK_RELAY_DOCKER_DATAS_DIR + - $SDK_RELAY_BACKUPS_DIR:$SDK_RELAY_DOCKER_BACKUPS_DIR + - $SDK_RELAY_SCRIPTS_DIR:$SDK_RELAY_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $SDK_RELAY_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$SDK_RELAY_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$SDK_RELAY.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $SDK_STORAGE_DOCKER_NAME: + image: $SDK_STORAGE_DOCKER_IMAGE + container_name: $SDK_STORAGE_DOCKER_NAME + working_dir: /$SDK_STORAGE_DOCKER_NAME + ports: + - "0.0.0.0:$SDK_STORAGE_EXTERNAL_PORT" + - "0.0.0.0:$SDK_STORAGE_PORT" + - "0.0.0.0:$SDK_STORAGE_PORT2" + - "0.0.0.0:$SDK_STORAGE_PORT3" + volumes: + - $SDK_STORAGE_CONFS_DIR:$SDK_STORAGE_DOCKER_CONFS_DIR + - $SDK_STORAGE_LOGS_DIR:$SDK_STORAGE_DOCKER_LOGS_DIR + - $SDK_STORAGE_RUNS_DIR:$SDK_STORAGE_DOCKER_RUNS_DIR + - $SDK_STORAGE_DATAS_DIR:$SDK_STORAGE_DOCKER_DATAS_DIR + - $SDK_STORAGE_BACKUPS_DIR:$SDK_STORAGE_DOCKER_BACKUPS_DIR + - $SDK_STORAGE_SCRIPTS_DIR:$SDK_STORAGE_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $SDK_STORAGE_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$SDK_STORAGE_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$SDK_STORAGE.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $IHM_CLIENT_DOCKER_NAME: + image: $IHM_CLIENT_DOCKER_IMAGE + container_name: $IHM_CLIENT_DOCKER_NAME + working_dir: /$IHM_CLIENT_DOCKER_NAME + ports: + - "0.0.0.0:$IHM_CLIENT_EXTERNAL_PORT" + - "0.0.0.0:$IHM_CLIENT_PORT" + - "0.0.0.0:$IHM_CLIENT_PORT2" + - "0.0.0.0:$IHM_CLIENT_PORT3" + volumes: + - $IHM_CLIENT_CONFS_DIR:$IHM_CLIENT_DOCKER_CONFS_DIR + - $IHM_CLIENT_LOGS_DIR:$IHM_CLIENT_DOCKER_LOGS_DIR + - $IHM_CLIENT_RUNS_DIR:$IHM_CLIENT_DOCKER_RUNS_DIR + - $IHM_CLIENT_DATAS_DIR:$IHM_CLIENT_DOCKER_DATAS_DIR + - $IHM_CLIENT_BACKUPS_DIR:$IHM_CLIENT_DOCKER_BACKUPS_DIR + - $IHM_CLIENT_SCRIPTS_DIR:$IHM_CLIENT_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $IHM_CLIENT_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$IHM_CLIENT_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$IHM_CLIENT.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $_4NK_CERTIFICATOR_DOCKER_NAME: + image: $_4NK_CERTIFICATOR_DOCKER_IMAGE + container_name: $_4NK_CERTIFICATOR_DOCKER_NAME + working_dir: /$_4NK_CERTIFICATOR_DOCKER_NAME + ports: + - "0.0.0.0:$_4NK_CERTIFICATOR_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_CERTIFICATOR_PORT" + - "0.0.0.0:$_4NK_CERTIFICATOR_PORT2" + - "0.0.0.0:$_4NK_CERTIFICATOR_PORT3" + volumes: + - $_4NK_CERTIFICATOR_CONFS_DIR:$_4NK_CERTIFICATOR_DOCKER_CONFS_DIR + - $_4NK_CERTIFICATOR_LOGS_DIR:$_4NK_CERTIFICATOR_DOCKER_LOGS_DIR + - $_4NK_CERTIFICATOR_RUNS_DIR:$_4NK_CERTIFICATOR_DOCKER_RUNS_DIR + - $_4NK_CERTIFICATOR_DATAS_DIR:$_4NK_CERTIFICATOR_DOCKER_DATAS_DIR + - $_4NK_CERTIFICATOR_BACKUPS_DIR:$_4NK_CERTIFICATOR_DOCKER_BACKUPS_DIR + - $_4NK_CERTIFICATOR_SCRIPTS_DIR:$_4NK_CERTIFICATOR_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $_4NK_CERTIFICATOR_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$_4NK_CERTIFICATOR_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_CERTIFICATOR.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $_4NK_MINER_DOCKER_NAME: + image: $_4NK_MINER_DOCKER_IMAGE + container_name: $_4NK_MINER_DOCKER_NAME + working_dir: /$_4NK_MINER_DOCKER_NAME + ports: + - "0.0.0.0:$_4NK_MINER_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_MINER_PORT" + - "0.0.0.0:$_4NK_MINER_PORT2" + - "0.0.0.0:$_4NK_MINER_PORT3" + volumes: + - $_4NK_MINER_CONFS_DIR:$_4NK_MINER_DOCKER_CONFS_DIR + - $_4NK_MINER_LOGS_DIR:$_4NK_MINER_DOCKER_LOGS_DIR + - $_4NK_MINER_RUNS_DIR:$_4NK_MINER_DOCKER_RUNS_DIR + - $_4NK_MINER_DATAS_DIR:$_4NK_MINER_DOCKER_DATAS_DIR + - $_4NK_MINER_BACKUPS_DIR:$_4NK_MINER_DOCKER_BACKUPS_DIR + - $_4NK_MINER_SCRIPTS_DIR:$_4NK_MINER_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $_4NK_MINER_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$_4NK_MINER_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_MINER.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $LECOFFRE_FRONT_DOCKER_NAME: + image: $LECOFFRE_FRONT_DOCKER_IMAGE + container_name: $LECOFFRE_FRONT_DOCKER_NAME + working_dir: /$LECOFFRE_FRONT_DOCKER_NAME + ports: + - "0.0.0.0:$LECOFFRE_FRONT_EXTERNAL_PORT" + - "0.0.0.0:$LECOFFRE_FRONT_PORT" + - "0.0.0.0:$LECOFFRE_FRONT_PORT2" + - "0.0.0.0:$LECOFFRE_FRONT_PORT3" + volumes: + - $LECOFFRE_FRONT_CONFS_DIR:$LECOFFRE_FRONT_DOCKER_CONFS_DIR + - $LECOFFRE_FRONT_LOGS_DIR:$LECOFFRE_FRONT_DOCKER_LOGS_DIR + - $LECOFFRE_FRONT_RUNS_DIR:$LECOFFRE_FRONT_DOCKER_RUNS_DIR + - $LECOFFRE_FRONT_DATAS_DIR:$LECOFFRE_FRONT_DOCKER_DATAS_DIR + - $LECOFFRE_FRONT_BACKUPS_DIR:$LECOFFRE_FRONT_DOCKER_BACKUPS_DIR + - $LECOFFRE_FRONT_SCRIPTS_DIR:$LECOFFRE_FRONT_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $LECOFFRE_FRONT_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$LECOFFRE_FRONT_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$LECOFFRE_FRONT.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + $_4NK_WEB_STATUS_DOCKER_NAME: + image: $_4NK_WEB_STATUS_DOCKER_IMAGE + container_name: $_4NK_WEB_STATUS_DOCKER_NAME + working_dir: /$_4NK_WEB_STATUS_DOCKER_NAME + ports: + - "0.0.0.0:$_4NK_WEB_STATUS_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_WEB_STATUS_PORT" + - "0.0.0.0:$_4NK_WEB_STATUS_PORT2" + - "0.0.0.0:$_4NK_WEB_STATUS_PORT3" + volumes: + - $_4NK_WEB_STATUS_CONFS_DIR:$_4NK_WEB_STATUS_DOCKER_CONFS_DIR + - $_4NK_WEB_STATUS_LOGS_DIR:$_4NK_WEB_STATUS_DOCKER_LOGS_DIR + - $_4NK_WEB_STATUS_RUNS_DIR:$_4NK_WEB_STATUS_DOCKER_RUNS_DIR + - $_4NK_WEB_STATUS_DATAS_DIR:$_4NK_WEB_STATUS_DOCKER_DATAS_DIR + - $_4NK_WEB_STATUS_BACKUPS_DIR:$_4NK_WEB_STATUS_DOCKER_BACKUPS_DIR + - $_4NK_WEB_STATUS_SCRIPTS_DIR:$_4NK_WEB_STATUS_DOCKER_SCRIPTS_DIR + networks: + btcnet: + aliases: + - $_4NK_WEB_STATUS_DOCKER_NAME + user: root + entrypoint: \> + /bin/sh -c "$_4NK_WEB_STATUS_DOCKER_WORKING_DIR_CREATE" + healthcheck: + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_WEB_STATUS.sh"] + interval: 30s + timeout: 10s + retries: 50 + restart: unless-stopped" + + + watchtower: + image: containrrr/watchtower + container_name: watchtower + volumes: + - /var/run/docker.sock:/var/run/docker.sock + command: --interval 30 --label-enable + networks: + - btcnet + restart: unless-stopped + +networks: + btcnet: + name: _4NK_node_btcnet + driver: bridge + ipam: + config: + - subnet: 172.20.0.0/16 + + + diff --git a/storage/dev/generate.sh b/storage/dev/generate.sh new file mode 100755 index 0000000..4a61c4a --- /dev/null +++ b/storage/dev/generate.sh @@ -0,0 +1,319 @@ +#!/bin/bash + +# Script principal de génération pour l'écosystème _4NK Vault +# Orchestre l'exécution des scripts de génération dans l'ordre approprié + +# Couleurs pour les messages +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +PURPLE='\033[0;35m' +CYAN='\033[0;36m' +NC='\033[0m' # No Color + +# Compteurs +SCRIPTS_EXECUTED=0 +SCRIPTS_FAILED=0 +TOTAL_SCRIPTS=3 + +# Fonction pour afficher les messages avec couleurs +print_header() { + local message="$1" + echo -e "${BLUE}================================${NC}" + echo -e "${BLUE}$message${NC}" + echo -e "${BLUE}================================${NC}" +} + +print_step() { + local step="$1" + local description="$2" + echo -e "\n${CYAN}📋 ÉTAPE $step${NC}: $description" + echo -e "${CYAN}$(printf '=%.0s' {1..50})${NC}" +} + +print_success() { + local message="$1" + echo -e "${GREEN}✅ SUCCÈS${NC}: $message" +} + +print_error() { + local message="$1" + echo -e "${RED}❌ ERREUR${NC}: $message" +} + +print_warning() { + local message="$1" + echo -e "${YELLOW}⚠️ ATTENTION${NC}: $message" +} + +print_info() { + local message="$1" + echo -e "${PURPLE}ℹ️ INFO${NC}: $message" +} + +# Fonction pour exécuter un script avec gestion d'erreur +execute_script() { + local script_name="$1" + local script_path="$2" + local description="$3" + + echo -e "\n${YELLOW}🚀 Exécution de $script_name...${NC}" + echo -e "${YELLOW}Description: $description${NC}" + echo "" + + # Vérifier que le script existe + if [ ! -f "$script_path" ]; then + print_error "Script $script_name non trouvé: $script_path" + SCRIPTS_FAILED=$((SCRIPTS_FAILED + 1)) + return 1 + fi + + # Vérifier que le script est exécutable + if [ ! -x "$script_path" ]; then + print_warning "Script $script_name n'est pas exécutable, tentative de correction..." + chmod +x "$script_path" + fi + + # Exécuter le script + echo -e "${BLUE}Commande: $script_path${NC}" + echo "" + + if "$script_path"; then + print_success "$script_name exécuté avec succès" + SCRIPTS_EXECUTED=$((SCRIPTS_EXECUTED + 1)) + return 0 + else + print_error "$script_name a échoué (code de sortie: $?)" + SCRIPTS_FAILED=$((SCRIPTS_FAILED + 1)) + return 1 + fi +} + +# Fonction pour vérifier les prérequis +check_prerequisites() { + echo -e "${BLUE}🔍 Vérification des prérequis...${NC}" + + # Vérifier que nous sommes dans le bon répertoire + if [ ! -f "generate_variables.sh" ]; then + print_error "Script generate_variables.sh non trouvé. Assurez-vous d'être dans le répertoire storage/dev" + exit 1 + fi + + if [ ! -f "generate_grafana_dashboards.sh" ]; then + print_error "Script generate_grafana_dashboards.sh non trouvé" + exit 1 + fi + + if [ ! -f "generate_promtail_config.sh" ]; then + print_error "Script generate_promtail_config.sh non trouvé" + exit 1 + fi + + if [ ! -f "generate_logrotate_configs.sh" ]; then + print_error "Script generate_logrotate_configs.sh non trouvé" + exit 1 + fi + + if [ ! -f "generate_nginx_configs.sh" ]; then + print_error "Script generate_nginx_configs.sh non trouvé" + exit 1 + fi + + # Vérifier la variable HOST + if [ -z "${HOST:-}" ]; then + print_warning "Variable HOST non définie, utilisation de la valeur par défaut" + export HOST="dev4._4NKweb.com" + print_info "HOST défini à: $HOST" + else + print_info "HOST détecté: $HOST" + fi + + # Vérifier la variable SERVICES + if [ -z "${SERVICES:-}" ] || [ ${#SERVICES[@]} -eq 0 ]; then + print_warning "Variable SERVICES non définie" + print_info "Les scripts peuvent échouer si SERVICES n'est pas défini dans .env" + else + print_info "SERVICES détecté: ${#SERVICES[@]} services (${SERVICES[*]})" + fi + + print_success "Prérequis vérifiés" +} + +# Fonction pour afficher le résumé final +show_summary() { + echo -e "\n${PURPLE}📊 RÉSUMÉ DE LA GÉNÉRATION${NC}" + echo -e "${PURPLE}=============================${NC}" + echo -e "Scripts exécutés avec succès: ${GREEN}$SCRIPTS_EXECUTED/$TOTAL_SCRIPTS${NC}" + echo -e "Scripts échoués: ${RED}$SCRIPTS_FAILED/$TOTAL_SCRIPTS${NC}" + + if [ $SCRIPTS_FAILED -eq 0 ]; then + echo -e "\n${GREEN}🎉 TOUS LES SCRIPTS ONT ÉTÉ EXÉCUTÉS AVEC SUCCÈS !${NC}" + echo -e "\n${CYAN}📁 Fichiers générés:${NC}" + echo -e " • ${GREEN}docker-compose.yml.auto${NC} - Configuration Docker" + echo -e " • ${GREEN}.env.auto${NC} - Variables d'environnement" + echo -e " • ${GREEN}_4NK_modules/grafana/dashboards/${NC} - Dashboards Grafana" + echo -e " • ${GREEN}_4NK_modules/promtail/promtail.yml${NC} - Configuration Promtail" + echo -e " • ${GREEN}logrotade/${NC} - Configurations Logrotate" + echo -e " • ${GREEN}nginx/${NC} - Configurations Nginx" + + echo -e "\n${CYAN}🚀 Prochaines étapes recommandées:${NC}" + echo -e " 1. Vérifiez les fichiers générés" + echo -e " 2. Déployez avec Docker Compose si nécessaire" + echo -e " 3. Testez les configurations Nginx" + echo -e " 4. Déployez les configurations Nginx si validées" + + else + echo -e "\n${RED}⚠️ CERTAINS SCRIPTS ONT ÉCHOUÉ${NC}" + echo -e "\n${YELLOW}🔧 Actions recommandées:${NC}" + echo -e " 1. Vérifiez les variables d'environnement dans .env" + echo -e " 2. Vérifiez les erreurs ci-dessus" + echo -e " 3. Relancez le script après correction" + echo -e " 4. Consultez la documentation des scripts individuels" + fi + + echo -e "\n${BLUE}📚 Documentation disponible:${NC}" + echo -e " • generate_variables.sh - Génération des variables et docker-compose" + echo -e " • generate_grafana_dashboards.sh - Génération des dashboards" + echo -e " • generate_promtail_config.sh - Génération de la config Promtail" + echo -e " • generate_logrotate_configs.sh - Génération des configs Logrotate" + echo -e " • generate_nginx_configs.sh - Génération des configs Nginx" + echo -e " • README.md - Documentation générale du projet" +} + +# Fonction pour afficher l'aide +show_help() { + echo -e "${BLUE}🚀 GÉNÉRATEUR PRINCIPAL _4NK VAULT${NC}" + echo -e "${BLUE}===================================${NC}" + echo "" + echo -e "${CYAN}Description:${NC}" + echo " Script principal qui orchestre la génération de toutes les configurations" + echo " nécessaires pour l'écosystème _4NK Vault." + echo "" + echo -e "${CYAN}Scripts exécutés dans l'ordre:${NC}" + echo " 1. generate_variables.sh - Génère .env.auto et docker-compose.yml.auto" + echo " 2. generate_grafana_dashboards.sh - Génère les dashboards Grafana" + echo " 3. generate_promtail_config.sh - Génère la configuration Promtail" + echo " 4. generate_logrotate_configs.sh - Génère les configurations Logrotate" + echo " 5. generate_nginx_configs.sh - Génère les configurations Nginx" + echo "" + echo -e "${CYAN}Utilisation:${NC}" + echo " ./generate.sh [options]" + echo "" + echo -e "${CYAN}Options:${NC}" + echo " -h, --help Affiche cette aide" + echo "" + echo -e "${CYAN}Variables d'environnement:${NC}" + echo " HOST Domaine principal (ex: dev4._4NKweb.com)" + echo " SERVICES Tableau des services à configurer" + echo "" + echo -e "${CYAN}Exemple:${NC}" + echo " # Charger les variables d'environnement" + echo " source .env" + echo " # Exécuter la génération" + echo " ./generate.sh" + echo "" + echo -e "${CYAN}Fichiers requis:${NC}" + echo " • .env - Variables d'environnement" + echo " • generate_variables.sh - Script de génération des variables et docker-compose" + echo " • generate_grafana_dashboards.sh - Script de génération Grafana" + echo " • generate_promtail_config.sh - Script de génération Promtail" + echo " • generate_logrotate_configs.sh - Script de génération Logrotate" + echo " • generate_nginx_configs.sh - Script de génération Nginx" +} + +# Fonction principale +main() { + # Gestion des arguments + + while [[ $# -gt 0 ]]; do + case $1 in + -h|--help) + show_help + exit 0 + ;; + *) + print_error "Option inconnue: $1" + echo "Utilisez -h ou --help pour voir l'aide" + exit 1 + ;; + esac + done + + # Affichage de l'en-tête + print_header "🚀 GÉNÉRATEUR PRINCIPAL _4NK VAULT" + echo -e "${BLUE}Orchestration des scripts de génération${NC}" + echo -e "${BLUE}Hôte: ${HOST:-"non défini"}${NC}" + echo -e "${BLUE}Timestamp: $(date)${NC}" + + # Vérification des prérequis + check_prerequisites + + # ÉTAPE 1: Génération des variables et docker-compose + print_step "1/3" "Génération des variables et docker-compose" + if execute_script "generate_variables.sh" "./generate_variables.sh" "Génère .env.auto et docker-compose.yml.auto"; then + print_success "Variables et docker-compose générés avec succès" + print_info "Fichiers créés:" + [ -f ".env.auto" ] && echo " • .env.auto" + [ -f "docker-compose.yml.auto" ] && echo " • docker-compose.yml.auto" + else + print_error "Échec de la génération des variables et docker-compose" + fi + + # ÉTAPE 2: Génération des dashboards Grafana + print_step "2/5" "Génération des dashboards Grafana" + if execute_script "generate_grafana_dashboards.sh" "./generate_grafana_dashboards.sh" "Génère les dashboards Grafana"; then + print_success "Dashboards Grafana générés avec succès" + print_info "Fichiers créés:" + [ -d "_4NK_modules/grafana/dashboards" ] && echo " • _4NK_modules/grafana/dashboards/ (dashboards)" + else + print_error "Échec de la génération des dashboards Grafana" + fi + + # ÉTAPE 3: Génération de la configuration Promtail + print_step "3/5" "Génération de la configuration Promtail" + if execute_script "generate_promtail_config.sh" "./generate_promtail_config.sh" "Génère la configuration Promtail"; then + print_success "Configuration Promtail générée avec succès" + print_info "Fichiers créés:" + [ -f "_4NK_modules/promtail/promtail.yml" ] && echo " • _4NK_modules/promtail/promtail.yml" + else + print_error "Échec de la génération de la configuration Promtail" + fi + + # ÉTAPE 4: Génération des configurations Logrotate + print_step "4/5" "Génération des configurations Logrotate" + if execute_script "generate_logrotate_configs.sh" "./generate_logrotate_configs.sh" "Génère les configurations Logrotate"; then + print_success "Configurations Logrotate générées avec succès" + print_info "Fichiers créés:" + [ -d "logrotade" ] && echo " • logrotade/ (configurations logrotate)" + else + print_error "Échec de la génération des configurations Logrotate" + fi + + # ÉTAPE 5: Génération des configurations Nginx + print_step "5/5" "Génération des configurations Nginx" + if execute_script "generate_nginx_configs.sh" "./generate_nginx_configs.sh" "Génère toutes les configurations Nginx (upstreams, internes, HTTPS)"; then + print_success "Configurations Nginx générées avec succès" + print_info "Fichiers créés:" + [ -f "nginx/upstreams.conf" ] && echo " • nginx/upstreams.conf" + [ -f "nginx/app-internal-ports.conf" ] && echo " • nginx/app-internal-ports.conf" + [ -d "nginx/https-configs" ] && echo " • nginx/https-configs/ (configurations HTTPS)" + [ -f "nginx/nginx_${HOST:-dev4._4NKweb.com}-https.conf" ] && echo " • nginx/nginx_${HOST:-dev4._4NKweb.com}-https.conf" + [ -f "nginx/proxy_headers.conf" ] && echo " • nginx/proxy_headers.conf" + else + print_error "Échec de la génération des configurations Nginx" + fi + + # Affichage du résumé final + show_summary + + # Code de sortie basé sur le succès + if [ $SCRIPTS_FAILED -eq 0 ]; then + exit 0 + else + exit 1 + fi +} + +# Exécution du script principal +main "$@" diff --git a/storage/dev/generate_grafana_dashboards.sh b/storage/dev/generate_grafana_dashboards.sh index 135fc66..1c03e8d 100755 --- a/storage/dev/generate_grafana_dashboards.sh +++ b/storage/dev/generate_grafana_dashboards.sh @@ -26,10 +26,10 @@ generate_service_dashboard() { echo "🔧 Génération du dashboard pour $SERVICE ($SERVICE_NAME)" # Créer le répertoire si nécessaire - mkdir -p "4NK_modules/grafana/dashboards" + mkdir -p "_4NK_modules/grafana/dashboards" # Générer le nom du fichier - local DASHBOARD_FILE="4NK_modules/grafana/dashboards/${SERVICE_NAME}.json" + local DASHBOARD_FILE="_4NK_modules/grafana/dashboards/${SERVICE_NAME}.json" # Générer le contenu JSON du dashboard cat > "$DASHBOARD_FILE" << EOF @@ -350,9 +350,9 @@ EOF generate_overview_dashboard() { echo "🔧 Génération du dashboard overview" - mkdir -p "4NK_modules/grafana/dashboards" + mkdir -p "_4NK_modules/grafana/dashboards" - cat > "4NK_modules/grafana/dashboards/services-overview.json" << EOF + cat > "_4NK_modules/grafana/dashboards/services-overview.json" << EOF { "annotations": { "list": [] @@ -477,101 +477,6 @@ EOF echo "✅ Dashboard overview généré" } -# Fonction pour générer le fichier promtail.yml -generate_promtail_config() { - echo "🔧 Génération du fichier promtail.yml" - - # Créer le répertoire si nécessaire - mkdir -p "4NK_modules/promtail" - - # Générer le fichier promtail.yml - cat > "4NK_modules/promtail/promtail.yml" << 'EOF' -server: - http_listen_port: $PROMTAIL_PORT - grpc_listen_port: 0 - -positions: - filename: /tmp/positions.yaml - -clients: - - url: $LOKI_URL/loki/api/v1/push - -scrape_configs: -EOF - - # Générer les configurations pour chaque service - for SERVICE_VAR in "${SERVICES[@]}"; do - # Ajouter la configuration pour ce service - cat >> "4NK_modules/promtail/promtail.yml" << EOF - - # ${SERVICE_VAR} Logs - - job_name: \$${SERVICE_VAR}_DOCKER_NAME - static_configs: - - targets: - - localhost - labels: - job: \$${SERVICE_VAR}_DOCKER_NAME - service: \$${SERVICE_VAR}_DOCKER_NAME - __path__: \$${SERVICE_VAR}_LOGS_DIR/*.log -EOF - done - - # Ajouter la configuration Docker - cat >> "4NK_modules/promtail/promtail.yml" << 'EOF' - - # Docker Container Logs - - job_name: docker - docker_sd_configs: - - host: unix:///var/run/docker.sock - refresh_interval: 5s - filters: - - name: label - values: ["com.centurylinklabs.watchtower.enable=true"] - relabel_configs: - - source_labels: ['__meta_docker_container_name'] - regex: '/?(.*)' - target_label: 'container_name' - - source_labels: ['__meta_docker_container_log_stream'] - target_label: 'logstream' - - source_labels: ['__meta_docker_container_label_logging_job_name'] - target_label: 'job' -EOF - - echo "✅ Configuration promtail.yml générée" -} - -# Fonction pour générer les fichiers de configuration logrotate -generate_logrotate_configs() { - echo "🔧 Génération des configurations logrotate" - - # Créer le répertoire si nécessaire - mkdir -p "logrotade" - - # Générer les configurations pour chaque service - for SERVICE_VAR in "${SERVICES[@]}"; do - local CONFIG_FILE="logrotade/${SERVICE_VAR,,}.conf" - - echo "📄 Génération de $CONFIG_FILE" - - cat > "$CONFIG_FILE" << EOF -\$${SERVICE_VAR}_LOGS_DIR/*.log { - daily - missingok - rotate 7 - compress - delaycompress - notifempty - create 644 root root - postrotate - # Redémarrer le service si nécessaire - docker restart \$${SERVICE_VAR}_DOCKER_NAME 2>/dev/null || true - endscript -} -EOF - done - - echo "✅ Configurations logrotate générées pour ${#SERVICES[@]} services" -} # Fonction pour déterminer le type de service get_service_type() { @@ -580,7 +485,7 @@ get_service_type() { "BITCOIN"|"BLINDBIT_ORACLE") echo "blockchain" ;; "SDK_RELAY"|"SDK_STORAGE") echo "sdk" ;; "IHM_CLIENT"|"LECOFFRE_FRONT") echo "frontend" ;; - "4NK_MINER") echo "mining" ;; + "_4NK_MINER") echo "mining" ;; "REDIS"|"POSTGRESQL"|"LOKI"|"PROMTAIL"|"GRAFANA") echo "infrastructure" ;; *) echo "service" ;; esac @@ -596,10 +501,10 @@ get_dashboard_name() { "SDK_STORAGE") echo "sdk-storage" ;; "IHM_CLIENT") echo "ihm-client" ;; "LECOFFRE_FRONT") echo "lecoffre-front" ;; - "4NK_MINER") echo "4nk-miner" ;; - "4NK_CERTIFICATOR") echo "4nk-certificator" ;; - "4NK_WEB_STATUS") echo "4nk-web-status" ;; - "4NK_VAULT") echo "4nk-vault" ;; + "_4NK_MINER") echo "_4NK-miner" ;; + "_4NK_CERTIFICATOR") echo "_4NK-certificator" ;; + "_4NK_WEB_STATUS") echo "_4NK-web-status" ;; + "_4NK_VAULT") echo "_4NK-vault" ;; *) echo "${service,,}" ;; # Convertir en minuscules esac } @@ -612,8 +517,11 @@ main() { # Charger les variables d'environnement load_env_files + # Supprimer les fichiers de sortie existants (remplacer complètement) + rm -f "_4NK_modules/grafana/dashboards"/*.json 2>/dev/null || true + # Créer le répertoire des dashboards - mkdir -p "4NK_modules/grafana/dashboards" + mkdir -p "_4NK_modules/grafana/dashboards" echo "📋 Génération des dashboards pour ${#SERVICES[@]} services..." @@ -633,19 +541,9 @@ main() { echo "🔄 Génération du dashboard overview..." generate_overview_dashboard - # Générer la configuration Promtail - echo "🔄 Génération de la configuration Promtail..." - generate_promtail_config - - # Générer les configurations logrotate - echo "🔄 Génération des configurations logrotate..." - generate_logrotate_configs - echo "" echo "✅ GÉNÉRATION TERMINÉE !" - echo "📁 Dashboards générés dans: 4NK_modules/grafana/dashboards/" - echo "📁 Configuration Promtail: 4NK_modules/promtail/promtail.yml" - echo "📁 Configurations logrotate: logrotade/*.conf" + echo "📁 Dashboards générés dans: _4NK_modules/grafana/dashboards/" echo "🔧 Les dashboards utilisent les variables d'environnement pour les noms de containers" echo "📊 Services traités: ${#SERVICES[@]}" } diff --git a/storage/dev/generate_logrotate_configs.sh b/storage/dev/generate_logrotate_configs.sh new file mode 100755 index 0000000..bb049bb --- /dev/null +++ b/storage/dev/generate_logrotate_configs.sh @@ -0,0 +1,102 @@ +#!/bin/bash + +# Script de génération des configurations Logrotate +# Génère les configurations logrotate pour tous les services + +set -euo pipefail + +# Couleurs pour les messages +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Fonctions d'affichage +print_error() { echo -e "${RED}❌ ERREUR${NC}: $1"; } +print_success() { echo -e "${GREEN}✅ SUCCÈS${NC}: $1"; } +print_info() { echo -e "${BLUE}ℹ️ INFO${NC}: $1"; } +print_warning() { echo -e "${YELLOW}⚠️ ATTENTION${NC}: $1"; } + +# Charger les variables d'environnement +load_env_files() { + local env_files=(".env.secrets" ".env") + + for env_file in "${env_files[@]}"; do + if [ -f "$env_file" ]; then + echo "📄 Chargement de $env_file..." + # shellcheck source=/dev/null + source "$env_file" + else + print_warning "Fichier $env_file non trouvé" + fi + done +} + +# Fonction pour générer les fichiers de configuration logrotate +generate_logrotate_configs() { + echo "🔧 Génération des configurations logrotate" + + # Créer le répertoire si nécessaire + mkdir -p "logrotade" + + # Générer les configurations pour chaque service + for SERVICE_VAR in "${SERVICES[@]}"; do + local CONFIG_FILE="logrotade/${SERVICE_VAR,,}.conf" + + echo "📄 Génération de $CONFIG_FILE" + + cat > "$CONFIG_FILE" << EOF +\$${SERVICE_VAR}_LOGS_DIR/*.log { + daily + missingok + rotate 7 + compress + delaycompress + notifempty + create 644 root root + postrotate + # Redémarrer le service si nécessaire + docker restart \$${SERVICE_VAR}_DOCKER_NAME 2>/dev/null || true + endscript +} +EOF + done + + echo "✅ Configurations logrotate générées pour ${#SERVICES[@]} services" +} + +# Fonction principale +main() { + echo "🚀 GÉNÉRATION DES CONFIGURATIONS LOGROTATE" + echo "==========================================" + + # Charger les variables d'environnement + load_env_files + + # Supprimer les fichiers de sortie existants (remplacer complètement) + rm -f "logrotade"/*.conf 2>/dev/null || true + + # Créer le répertoire si nécessaire + mkdir -p "logrotade" + + # Vérifier que SERVICES est défini + if [ -z "${SERVICES[*]:-}" ]; then + print_error "Variable SERVICES non définie dans .env" + exit 1 + fi + + echo "📋 Génération des configurations logrotate pour ${#SERVICES[@]} services..." + + # Générer les configurations logrotate + generate_logrotate_configs + + echo "" + echo "✅ GÉNÉRATION TERMINÉE !" + echo "📁 Configurations générées dans: logrotade/" + echo "🔧 Configurations logrotate pour ${#SERVICES[@]} services" + echo "📊 Services traités: ${#SERVICES[@]}" +} + +# Exécuter le script principal +main "$@" diff --git a/storage/dev/generate_nginx_configs.sh b/storage/dev/generate_nginx_configs.sh new file mode 100755 index 0000000..7923564 --- /dev/null +++ b/storage/dev/generate_nginx_configs.sh @@ -0,0 +1,429 @@ +#!/bin/bash + +# Script pour générer automatiquement les configurations Nginx +# basées sur les modules définis dans les variables d'environnement + +# Fonction pour charger les variables d'environnement +load_env_files() { + local env_files=(".env.secrets" ".env" ".env.auto" ".env.post") + + for env_file in "${env_files[@]}"; do + if [ -f "$env_file" ]; then + echo "📄 Chargement de $env_file..." + source "$env_file" 2>/dev/null || true + else + echo "⚠️ Fichier $env_file non trouvé, ignoré." + fi + done +} + +# Fonction pour générer les upstreams +generate_upstreams() { + echo "🔧 Génération du fichier upstreams.conf" + + # Créer le répertoire si nécessaire + mkdir -p "nginx" + + # Générer le fichier upstreams.conf + cat > "nginx/upstreams.conf" << 'EOF' +# Upstreams générés automatiquement +# Généré le $(date) + +EOF + + # Ajouter le format de log JSON + cat >> "nginx/upstreams.conf" << 'EOF' +log_format app_json escape=json + '{ "time":"$time_iso8601",' + ' "client":"$remote_addr",' + ' "xff":"$http_x_forwarded_for",' + ' "method":"$request_method",' + ' "host":"$host",' + ' "uri":"$request_uri",' + ' "status":$status,' + ' "bytes":$body_bytes_sent,' + ' "ua":"$http_user_agent",' + ' "upstream":"$upstream_addr",' + ' "rt":$request_time,' + ' "urt":$upstream_response_time }'; + +EOF + + # Générer les upstreams pour chaque service + for SERVICE_VAR in "${SERVICES[@]}"; do + echo " 🔄 Génération upstream pour $SERVICE_VAR" + + cat >> "nginx/upstreams.conf" << EOF + +upstream \$${SERVICE_VAR} { + server \$${SERVICE_VAR}_DOCKER_NAME:\$${SERVICE_VAR}_PORT; + keepalive 64; +} +EOF + done + + echo "✅ Fichier upstreams.conf généré" +} + +# Fonction pour générer les configurations internes +generate_internal_configs() { + echo "🔧 Génération du fichier app-internal-ports.conf" + + # Créer le répertoire si nécessaire + mkdir -p "nginx" + + # Générer le fichier app-internal-ports.conf + cat > "nginx/app-internal-ports.conf" << 'EOF' +# Configurations internes générées automatiquement +# Généré le $(date) + +EOF + + # Générer les configurations internes pour chaque service + for SERVICE_VAR in "${SERVICES[@]}"; do + echo " 🔄 Génération config interne pour $SERVICE_VAR" + + cat >> "nginx/app-internal-ports.conf" << EOF + +server { + listen \$${SERVICE_VAR}_PORT default_server; + server_name _; # pas d'host requis + access_log \$$NGINX_LOGS_DIR/\$${SERVICE_VAR}_int.log app_json; + + location / { + proxy_pass http://\$${SERVICE_VAR}_DOCKER_NAME; + include \$$NGINX_CONFS_DIR/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://\$${SERVICE_VAR}_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade \$http_upgrade; + proxy_set_header Connection "upgrade"; + include \$$NGINX_CONFS_DIR/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} +EOF + done + + echo "✅ Fichier app-internal-ports.conf généré" +} + +# Fonction pour générer les configurations HTTPS individuelles +generate_https_configs() { + echo "🔧 Génération des configurations HTTPS individuelles" + + # Générer une configuration HTTPS pour chaque service + for SERVICE_VAR in "${SERVICES[@]}"; do + echo " 🔄 Génération config HTTPS pour $SERVICE_VAR" + + local CONFIG_FILE="nginx/${SERVICE_VAR}_https.conf" + + cat > "$CONFIG_FILE" << EOF +# Configuration HTTPS pour $SERVICE_VAR +# Généré automatiquement le $(date) + +server { + listen 80; + server_name \$${SERVICE_VAR}.\$$DOMAIN; + # redirection HTTP→HTTPS pour l'externe + return 301 https://\$host\$request_uri; +} + +server { + listen 443 ssl http2; + server_name \$${SERVICE_VAR}_DOCKER_NAME.\$$DOMAIN; + +ssl_certificate /etc/letsencrypt/live/$HOST/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/$HOST/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log \$$NGINX_LOGS_DIR/\$${SERVICE_VAR}_https.log app_json; + + location / { + proxy_pass http://\$${SERVICE_VAR}_DOCKER_NAME; + include \$$NGINX_CONFS_DIR/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://\$${SERVICE_VAR}_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade \$http_upgrade; + proxy_set_header Connection "upgrade"; + include \$$NGINX_CONFS_DIR/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} +EOF + + echo " ✅ Config HTTPS générée: $CONFIG_FILE" + done + + echo "✅ Configurations HTTPS individuelles générées" +} + +# Fonction pour générer un fichier de configuration consolidé +generate_consolidated_https_config() { + echo "🔧 Génération du fichier nginx_$HOST-https.conf consolidé" + + # Créer le répertoire si nécessaire + mkdir -p "nginx" + + # Générer le fichier consolidé + cat > "nginx/nginx_$HOST-https.conf" << 'EOF' +# Configuration Nginx consolidée pour $HOST +# Générée automatiquement le $(date) + +# Inclusion du format de log JSON et des upstreams +include upstreams.conf; + +EOF + + # Ajouter la redirection HTTP→HTTPS globale + cat >> "nginx/nginx_$HOST-https.conf" << 'EOF' + +# Redirection globale HTTP→HTTPS +server { + listen 80; + server_name $HOST *.$HOST; + return 301 https://$host$request_uri; +} + +EOF + + # Ajouter les configurations HTTPS pour chaque service + for SERVICE_VAR in "${SERVICES[@]}"; do + echo " 🔄 Ajout de la config HTTPS pour $SERVICE_VAR dans le fichier consolidé" + + cat >> "nginx/nginx_$HOST-https.conf" << EOF + +# Configuration HTTPS pour $SERVICE_VAR +server { + listen 80; + server_name \$${SERVICE_VAR}.\$$DOMAIN; + # redirection HTTP→HTTPS pour l'externe + return 301 https://\$host\$request_uri; +} + +server { + listen 443 ssl http2; + server_name \$${SERVICE_VAR}_DOCKER_NAME.\$$DOMAIN; + + ssl_certificate \$$CERT_PATH/certs/fullchain.pem; + ssl_certificate_key \$$CERT_PATH/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log \$$NGINX_LOGS_DIR/\$${SERVICE_VAR}_https.log app_json; + + location / { + proxy_pass http://\$${SERVICE_VAR}_DOCKER_NAME; + include \$$NGINX_CONFS_DIR/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://\$${SERVICE_VAR}_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade \$http_upgrade; + proxy_set_header Connection "upgrade"; + include \$$NGINX_CONFS_DIR/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} +EOF + done + + echo "✅ Fichier nginx_$HOST-https.conf consolidé généré" +} + +# Fonction pour créer les fichiers de configuration proxy_headers.conf +generate_proxy_headers() { + echo "🔧 Génération du fichier proxy_headers.conf" + + # Créer le répertoire si nécessaire + mkdir -p "nginx" + + # Générer le fichier proxy_headers.conf + cat > "nginx/proxy_headers.conf" << 'EOF' +# Headers de proxy générés automatiquement +# Généré le $(date) + +proxy_set_header Host $host; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +proxy_set_header X-Forwarded-Proto $scheme; +proxy_set_header X-Forwarded-Host $host; +proxy_set_header X-Forwarded-Port $server_port; + +# Directives de proxy +proxy_redirect off; # si l'app sait générer ses URLs +add_header X-Debug-Scheme $scheme always; +add_header X-Debug-XFP $http_x_forwarded_proto always; + +# Timeouts +proxy_connect_timeout 60s; +proxy_send_timeout 60s; +proxy_read_timeout 60s; + +# Buffer settings +proxy_buffering on; +proxy_buffer_size 4k; +proxy_buffers 8 4k; +proxy_busy_buffers_size 8k; + +# Cache settings +proxy_cache_bypass $http_upgrade; +proxy_no_cache $http_upgrade; +EOF + + echo "✅ Fichier proxy_headers.conf généré" +} + +# Générer le script de validation des templates +generate_deploy_script() { + echo "🔧 Génération du script de validation des templates" + + cat > "nginx/validate_templates.sh" << 'EOF' +#!/bin/bash + +# Script de validation des templates Nginx générés +# Généré automatiquement le $(date) + +set -euo pipefail + +# Couleurs pour les messages +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +# Fonctions d'affichage +print_error() { echo -e "${RED}❌ ERREUR${NC}: $1"; } +print_success() { echo -e "${GREEN}✅ SUCCÈS${NC}: $1"; } +print_info() { echo -e "${BLUE}ℹ️ INFO${NC}: $1"; } +print_warning() { echo -e "${YELLOW}⚠️ ATTENTION${NC}: $1"; } + +# Charger les variables d'environnement +if [ -f ".env" ]; then + # Charger .env en mode silencieux pour éviter les erreurs de syntaxe + source .env 2>/dev/null || true +fi + +# Vérifier que HOST est défini +if [ -z "${HOST:-}" ]; then + print_warning "Variable HOST non définie, utilisation de la valeur par défaut" + export HOST="dev4._4NKweb.com" +fi + +print_info "Validation des templates Nginx pour $HOST" + +# Vérifier que les fichiers existent +missing_files=0 + +if [ ! -f "nginx/upstreams.conf" ]; then + print_error "Template nginx/upstreams.conf non trouvé" + missing_files=$((missing_files + 1)) +fi + +if [ ! -f "nginx/app-internal-ports.conf" ]; then + print_error "Template nginx/app-internal-ports.conf non trouvé" + missing_files=$((missing_files + 1)) +fi + +if [ ! -f "nginx/proxy_headers.conf" ]; then + print_error "Template nginx/proxy_headers.conf non trouvé" + missing_files=$((missing_files + 1)) +fi + +if [ ! -f "nginx/nginx_$HOST-https.conf" ]; then + print_error "Template nginx/nginx_$HOST-https.conf non trouvé" + missing_files=$((missing_files + 1)) +fi + +if [ $missing_files -eq 0 ]; then + print_success "Tous les templates de configuration sont présents" + print_info "Templates générés:" + echo " • nginx/upstreams.conf" + echo " • nginx/app-internal-ports.conf" + echo " • nginx/proxy_headers.conf" + echo " • nginx/*_https.conf (configurations HTTPS individuelles)" + echo " • nginx/nginx_$HOST-https.conf" + + print_info "Ces templates sont prêts à être utilisés dans votre infrastructure" + print_warning "Adaptez les chemins et configurations selon vos besoins spécifiques" +else + print_error "$missing_files template(s) manquant(s)" + exit 1 +fi + +EOF + + chmod +x "nginx/validate_templates.sh" + echo "✅ Script de validation des templates généré" +} + +# Fonction principale +main() { + echo "🚀 GÉNÉRATION AUTOMATIQUE DES CONFIGURATIONS NGINX" + echo "==================================================" + + # Charger les variables d'environnement + load_env_files + + # Vérifier que SERVICES est défini + if [ -z "${SERVICES[*]}" ]; then + print_error "Variable SERVICES non définie" + echo " Assurez-vous que SERVICES=(service1 service2 ...) est défini dans .env" + exit 1 + fi + + echo "📋 Génération des configurations pour ${#SERVICES[@]} services..." + echo " Services: ${SERVICES[*]}" + + # Supprimer les fichiers de sortie existants (remplacer complètement) + rm -f "nginx/upstreams.conf" 2>/dev/null || true + rm -f "nginx/app-internal-ports.conf" 2>/dev/null || true + rm -f "nginx/proxy_headers.conf" 2>/dev/null || true + rm -f "nginx/nginx_${HOST:-dev4._4NKweb.com}-https.conf" 2>/dev/null || true + rm -f "nginx/deploy_configs.sh" 2>/dev/null || true + rm -f "nginx/"*_https.conf 2>/dev/null || true + + # Créer le répertoire de sortie + mkdir -p "nginx" + + # Générer tous les fichiers de configuration + generate_upstreams + generate_internal_configs + generate_proxy_headers + generate_https_configs + generate_consolidated_https_config + generate_deploy_script + + echo "" + echo "✅ GÉNÉRATION TERMINÉE !" + echo "📁 Configurations générées dans: nginx/" + echo "🔧 Les configurations utilisent les variables d'environnement" + echo "📊 Services traités: ${#SERVICES[@]}" +} + +# Exécuter le script principal +main "$@" diff --git a/storage/dev/generate_promtail_config.sh b/storage/dev/generate_promtail_config.sh new file mode 100755 index 0000000..4c54877 --- /dev/null +++ b/storage/dev/generate_promtail_config.sh @@ -0,0 +1,121 @@ +#!/bin/bash + +# Script de génération de la configuration Promtail +# Génère promtail.yml pour la collecte de logs + +set -euo pipefail + +# Couleurs pour les messages +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +# Fonctions d'affichage +print_error() { echo -e "${RED}❌ ERREUR${NC}: $1"; } +print_success() { echo -e "${GREEN}✅ SUCCÈS${NC}: $1"; } +print_info() { echo -e "${BLUE}ℹ️ INFO${NC}: $1"; } +print_warning() { echo -e "${YELLOW}⚠️ ATTENTION${NC}: $1"; } + +# Charger les variables d'environnement +load_env_files() { + local env_files=(".env.secrets" ".env") + + for env_file in "${env_files[@]}"; do + if [ -f "$env_file" ]; then + echo "📄 Chargement de $env_file..." + # shellcheck source=/dev/null + source "$env_file" + else + print_warning "Fichier $env_file non trouvé" + fi + done +} + +# Fonction pour générer la configuration Promtail +generate_promtail_config() { + echo "🔧 Génération de la configuration Promtail" + + # Créer le répertoire si nécessaire + mkdir -p "_4NK_modules/promtail" + + # Générer le fichier promtail.yml + cat > "_4NK_modules/promtail/promtail.yml" << EOF +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: +EOF + + # Ajouter une configuration de scraping pour chaque service + for SERVICE_VAR in "${SERVICES[@]}"; do + echo " 🔄 Ajout config Promtail pour $SERVICE_VAR" + + cat >> "_4NK_modules/promtail/promtail.yml" << EOF + + - job_name: '$SERVICE_VAR' + static_configs: + - targets: + - localhost + labels: + job: $SERVICE_VAR + __path__: \$${SERVICE_VAR}_LOGS_DIR/*.log + pipeline_stages: + - match: + selector: '{job="$SERVICE_VAR"}' + stages: + - regex: + expression: '^(?P\S+\s\S+)\s+(?P\S+)\s+(?P.*)' + - labels: + level: + - timestamp: + source: timestamp + format: '2006-01-02 15:04:05' +EOF + done + + echo "✅ Configuration promtail.yml générée" +} + +# Fonction principale +main() { + echo "🚀 GÉNÉRATION DE LA CONFIGURATION PROMTAIL" + echo "===========================================" + + # Charger les variables d'environnement + load_env_files + + # Supprimer le fichier de sortie existant (remplacer complètement) + rm -f "_4NK_modules/promtail/promtail.yml" 2>/dev/null || true + + # Créer le répertoire si nécessaire + mkdir -p "_4NK_modules/promtail" + + # Vérifier que SERVICES est défini + if [ -z "${SERVICES[*]:-}" ]; then + print_error "Variable SERVICES non définie dans .env" + exit 1 + fi + + echo "📋 Génération de la configuration Promtail pour ${#SERVICES[@]} services..." + + # Générer la configuration Promtail + generate_promtail_config + + echo "" + echo "✅ GÉNÉRATION TERMINÉE !" + echo "📁 Configuration générée: _4NK_modules/promtail/promtail.yml" + echo "🔧 Configuration Promtail pour ${#SERVICES[@]} services" + echo "📊 Services traités: ${#SERVICES[@]}" +} + +# Exécuter le script principal +main "$@" diff --git a/storage/dev/generate_variables.sh b/storage/dev/generate_variables.sh index 52d3e5f..0d4b0e4 100755 --- a/storage/dev/generate_variables.sh +++ b/storage/dev/generate_variables.sh @@ -22,7 +22,8 @@ load_env_files() { # Charger les variables d'environnement dans l'ordre load_env_files -rm -rf .env.auto docker-compose.yml.auto +# Supprimer les fichiers de sortie existants (remplacer complètement) +rm -f .env.auto docker-compose.yml.auto echo " services: @@ -39,30 +40,30 @@ generate_variables() { echo "" echo "${VARIABLE}_DOCKER_NAME=\$${VARIABLE}" - echo "${VARIABLE}_CONFS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/confs/\$${VARIABLE}" - echo "${VARIABLE}_LOGS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/logs/\$${VARIABLE}" - echo "${VARIABLE}_RUNS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/runs/\$${VARIABLE}" - echo "${VARIABLE}_DATAS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/datas/\$${VARIABLE}" - echo "${VARIABLE}_BACKUPS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/backups/\$${VARIABLE}" - echo "${VARIABLE}_SCRIPTS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/scripts/\$${VARIABLE}" + echo "${VARIABLE}_CONFS_DIR=\$DOCKER_GLOBAL/confs/\$${VARIABLE}" + echo "${VARIABLE}_LOGS_DIR=\$DOCKER_GLOBAL/logs/\$${VARIABLE}" + echo "${VARIABLE}_RUNS_DIR=\$DOCKER_GLOBAL/runs/\$${VARIABLE}" + echo "${VARIABLE}_DATAS_DIR=\$DOCKER_GLOBAL/datas/\$${VARIABLE}" + echo "${VARIABLE}_BACKUPS_DIR=\$DOCKER_GLOBAL/backups/\$${VARIABLE}" + echo "${VARIABLE}_SCRIPTS_DIR=\$DOCKER_GLOBAL/scripts/\$${VARIABLE}" echo "${VARIABLE}_DOCKER_WORKING_DIR=/home/\$${VARIABLE}" echo "" - echo "${VARIABLE}_DOCKER_CONFS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/confs/\$${VARIABLE}" - echo "${VARIABLE}_DOCKER_LOGS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/logs/\$${VARIABLE}" - echo "${VARIABLE}_DOCKER_RUNS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/runs/\$${VARIABLE}" - echo "${VARIABLE}_DOCKER_DATAS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/datas/\$${VARIABLE}" - echo "${VARIABLE}_DOCKER_BACKUPS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/backups/\$${VARIABLE}" - echo "${VARIABLE}_DOCKER_SCRIPTS_DIR=\/home/debian/4NK_env/DOCKER_GLOBAL_NAME/scripts/\$${VARIABLE}" + echo "${VARIABLE}_DOCKER_CONFS_DIR=\$DOCKER_GLOBAL/confs/\$${VARIABLE}" + echo "${VARIABLE}_DOCKER_LOGS_DIR=\$DOCKER_GLOBAL/logs/\$${VARIABLE}" + echo "${VARIABLE}_DOCKER_RUNS_DIR=\$DOCKER_GLOBAL/runs/\$${VARIABLE}" + echo "${VARIABLE}_DOCKER_DATAS_DIR=\$DOCKER_GLOBAL/datas/\$${VARIABLE}" + echo "${VARIABLE}_DOCKER_BACKUPS_DIR=\$DOCKER_GLOBAL/backups/\$${VARIABLE}" + echo "${VARIABLE}_DOCKER_SCRIPTS_DIR=\$DOCKER_GLOBAL/scripts/\$${VARIABLE}" echo "${VARIABLE}_DOCKER_WORKING_DIR=/home/\$${VARIABLE}" echo "" echo "${VARIABLE}_DOCKER_WORKING_DIR_CREATE=\"id -u \$${VARIABLE} >/dev/null 2>&1 || adduser --disabled-password --gecos '' \$${VARIABLE}; chown -R \$${VARIABLE}:\$${VARIABLE} /home/root/.\$${VARIABLE} || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec \\\"\$@\\\"\"" echo "${VARIABLE}_URL_ROUTE=/\$${VARIABLE}" - echo "${VARIABLE}_URL=\http://\\\$${VARIABLE}_DOCKER_NAME:\$${VARIABLE}_DOCKER_PORT" - echo "${VARIABLE}_URL_EXTERNAL=\https://dev4.4nkweb.com\$${VARIABLE}_URL_ROUTE" - echo "${VARIABLE}_URL_WS=\ws://\\\$${VARIABLE}_DOCKER_PORT" - echo "${VARIABLE}_URL_WS_EXTERNAL=\wss://dev4.4nkweb.com\ws" + echo "${VARIABLE}_URL=http://\\\$${VARIABLE}_DOCKER_NAME:\$${VARIABLE}_DOCKER_PORT" + echo "${VARIABLE}_URL_EXTERNAL=https://\$HOST\$${VARIABLE}_URL_ROUTE" + echo "${VARIABLE}_URL_WS=ws://\\\$${VARIABLE}_DOCKER_PORT" + echo "${VARIABLE}_URL_WS_EXTERNAL=wss://\$HOST\ws" echo "" echo " \$${VARIABLE}_DOCKER_NAME: @@ -135,7 +136,7 @@ echo " networks: btcnet: - name: 4nk_node_btcnet + name: _4NK_node_btcnet driver: bridge ipam: config: @@ -144,4 +145,4 @@ networks: " >> docker-compose.yml.auto -mv docker-compose.yml.auto projects/lecoffre/projects/lecoffre/projects/lecoffre/projects/lecoffre/projects/lecoffre/projects/lecoffre/projects/lecoffre/projects/lecoffre/projects/lecoffre/projects/lecoffre/projects/lecoffre/projects/lecoffre//home/debian/4NK_env/DOCKER_GLOBAL_NAME_NAME/docker-compose.yml.auto -f \ No newline at end of file +# docker-compose.yml.auto reste dans le répertoire courant \ No newline at end of file diff --git a/storage/dev/git/.env b/storage/dev/git/.env index cb2dbb1..c276fe4 100644 --- a/storage/dev/git/.env +++ b/storage/dev/git/.env @@ -1,4 +1,4 @@ -GITEA_BASE_URL=git.4nkweb.com +GITEA_BASE_URL=git._4NKweb.com GIT_TOKEN=$GIT_TOKEN GITEA_OWNER="nicolas.cantu,Omar" GITEA_RUNNER_NAME=debian-runner \ No newline at end of file diff --git a/storage/dev/logrotade/.gitkeep b/storage/dev/logrotade/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/logrotade/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/logrotade/4nk_certificator.conf b/storage/dev/logrotade/_4nk_certificator.conf similarity index 62% rename from storage/dev/logrotade/4nk_certificator.conf rename to storage/dev/logrotade/_4nk_certificator.conf index 77d5fde..64a66e8 100644 --- a/storage/dev/logrotade/4nk_certificator.conf +++ b/storage/dev/logrotade/_4nk_certificator.conf @@ -1,4 +1,4 @@ -$4NK_CERTIFICATOR_LOGS_DIR/*.log { +$_4NK_CERTIFICATOR_LOGS_DIR/*.log { daily missingok rotate 7 @@ -8,6 +8,6 @@ $4NK_CERTIFICATOR_LOGS_DIR/*.log { create 644 root root postrotate # Redémarrer le service si nécessaire - docker restart $4NK_CERTIFICATOR_DOCKER_NAME 2>/dev/null || true + docker restart $_4NK_CERTIFICATOR_DOCKER_NAME 2>/dev/null || true endscript } diff --git a/storage/dev/logrotade/4nk_miner.conf b/storage/dev/logrotade/_4nk_miner.conf similarity index 66% rename from storage/dev/logrotade/4nk_miner.conf rename to storage/dev/logrotade/_4nk_miner.conf index e234a3f..f33033a 100644 --- a/storage/dev/logrotade/4nk_miner.conf +++ b/storage/dev/logrotade/_4nk_miner.conf @@ -1,4 +1,4 @@ -$4NK_MINER_LOGS_DIR/*.log { +$_4NK_MINER_LOGS_DIR/*.log { daily missingok rotate 7 @@ -8,6 +8,6 @@ $4NK_MINER_LOGS_DIR/*.log { create 644 root root postrotate # Redémarrer le service si nécessaire - docker restart $4NK_MINER_DOCKER_NAME 2>/dev/null || true + docker restart $_4NK_MINER_DOCKER_NAME 2>/dev/null || true endscript } diff --git a/storage/dev/logrotade/4nk_vault.conf b/storage/dev/logrotade/_4nk_vault.conf similarity index 66% rename from storage/dev/logrotade/4nk_vault.conf rename to storage/dev/logrotade/_4nk_vault.conf index 63590d5..4b62c19 100644 --- a/storage/dev/logrotade/4nk_vault.conf +++ b/storage/dev/logrotade/_4nk_vault.conf @@ -1,4 +1,4 @@ -$4NK_VAULT_LOGS_DIR/*.log { +$_4NK_VAULT_LOGS_DIR/*.log { daily missingok rotate 7 @@ -8,6 +8,6 @@ $4NK_VAULT_LOGS_DIR/*.log { create 644 root root postrotate # Redémarrer le service si nécessaire - docker restart $4NK_VAULT_DOCKER_NAME 2>/dev/null || true + docker restart $_4NK_VAULT_DOCKER_NAME 2>/dev/null || true endscript } diff --git a/storage/dev/logrotade/4nk_web_status.conf b/storage/dev/logrotade/_4nk_web_status.conf similarity index 63% rename from storage/dev/logrotade/4nk_web_status.conf rename to storage/dev/logrotade/_4nk_web_status.conf index 53653fd..fc7906b 100644 --- a/storage/dev/logrotade/4nk_web_status.conf +++ b/storage/dev/logrotade/_4nk_web_status.conf @@ -1,4 +1,4 @@ -$4NK_WEB_STATUS_LOGS_DIR/*.log { +$_4NK_WEB_STATUS_LOGS_DIR/*.log { daily missingok rotate 7 @@ -8,6 +8,6 @@ $4NK_WEB_STATUS_LOGS_DIR/*.log { create 644 root root postrotate # Redémarrer le service si nécessaire - docker restart $4NK_WEB_STATUS_DOCKER_NAME 2>/dev/null || true + docker restart $_4NK_WEB_STATUS_DOCKER_NAME 2>/dev/null || true endscript } diff --git a/storage/dev/logrotade/lecoffre-front.conf b/storage/dev/logrotade/lecoffre-front.conf deleted file mode 100644 index be7a5ac..0000000 --- a/storage/dev/logrotade/lecoffre-front.conf +++ /dev/null @@ -1,13 +0,0 @@ -$4NK_MINER_LOGS_DIR/*.log { - daily - missingok - rotate 7 - compress - delaycompress - notifempty - create 644 root root - postrotate - # Redémarrer le service si nécessaire - docker restart lecoffre-front 2>/dev/null || true - endscript -} diff --git a/storage/dev/logrotade/miner.conf b/storage/dev/logrotade/miner.conf deleted file mode 100644 index 00ebd4b..0000000 --- a/storage/dev/logrotade/miner.conf +++ /dev/null @@ -1,13 +0,0 @@ -/home/debian/4NK_env_LOGS_MINER/*.log { - daily - missingok - rotate 7 - compress - delaycompress - notifempty - create 644 root root - postrotate - # Redémarrer le service si nécessaire - docker restart miner 2>/dev/null || true - endscript -} diff --git a/storage/dev/logrotade/nginx.conf b/storage/dev/logrotade/nginx.conf deleted file mode 100644 index dd74805..0000000 --- a/storage/dev/logrotade/nginx.conf +++ /dev/null @@ -1,13 +0,0 @@ -/home/debian/4NK_env_LOGS/nginx/*.log { - daily - missingok - rotate 7 - compress - delaycompress - notifempty - create 644 root root - postrotate - # Redémarrer le service si nécessaire - docker restart nginx 2>/dev/null || true - endscript -} diff --git a/storage/dev/logrotade/blindbit.conf b/storage/dev/logrotade/ngnix.conf similarity index 68% rename from storage/dev/logrotade/blindbit.conf rename to storage/dev/logrotade/ngnix.conf index 3ec91f8..6c99fa9 100644 --- a/storage/dev/logrotade/blindbit.conf +++ b/storage/dev/logrotade/ngnix.conf @@ -1,4 +1,4 @@ -$BLINDBIT_ORACLE_LOGS_DIR/*.log { +$NGNIX_LOGS_DIR/*.log { daily missingok rotate 7 @@ -8,6 +8,6 @@ $BLINDBIT_ORACLE_LOGS_DIR/*.log { create 644 root root postrotate # Redémarrer le service si nécessaire - docker restart blindbit 2>/dev/null || true + docker restart $NGNIX_DOCKER_NAME 2>/dev/null || true endscript } diff --git a/storage/dev/nginx/.gitkeep b/storage/dev/nginx/.gitkeep deleted file mode 100644 index 6a04314..0000000 --- a/storage/dev/nginx/.gitkeep +++ /dev/null @@ -1 +0,0 @@ -./ \ No newline at end of file diff --git a/storage/dev/nginx/BITCOIN_https.conf b/storage/dev/nginx/BITCOIN_https.conf new file mode 100644 index 0000000..1fb93c0 --- /dev/null +++ b/storage/dev/nginx/BITCOIN_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour BITCOIN +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $BITCOIN.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $BITCOIN_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$BITCOIN_https.log app_json; + + location / { + proxy_pass http://$BITCOIN_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$BITCOIN_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/BLINDBIT_ORACLE_https.conf b/storage/dev/nginx/BLINDBIT_ORACLE_https.conf new file mode 100644 index 0000000..45cf9ae --- /dev/null +++ b/storage/dev/nginx/BLINDBIT_ORACLE_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour BLINDBIT_ORACLE +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $BLINDBIT_ORACLE.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $BLINDBIT_ORACLE_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$BLINDBIT_ORACLE_https.log app_json; + + location / { + proxy_pass http://$BLINDBIT_ORACLE_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$BLINDBIT_ORACLE_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/GRAFANA_https.conf b/storage/dev/nginx/GRAFANA_https.conf new file mode 100644 index 0000000..1e9c145 --- /dev/null +++ b/storage/dev/nginx/GRAFANA_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour GRAFANA +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $GRAFANA.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $GRAFANA_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$GRAFANA_https.log app_json; + + location / { + proxy_pass http://$GRAFANA_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$GRAFANA_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/IHM_CLIENT_https.conf b/storage/dev/nginx/IHM_CLIENT_https.conf new file mode 100644 index 0000000..25d844e --- /dev/null +++ b/storage/dev/nginx/IHM_CLIENT_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour IHM_CLIENT +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $IHM_CLIENT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $IHM_CLIENT_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$IHM_CLIENT_https.log app_json; + + location / { + proxy_pass http://$IHM_CLIENT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$IHM_CLIENT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/LECOFFRE_FRONT_https.conf b/storage/dev/nginx/LECOFFRE_FRONT_https.conf new file mode 100644 index 0000000..1e0b693 --- /dev/null +++ b/storage/dev/nginx/LECOFFRE_FRONT_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour LECOFFRE_FRONT +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $LECOFFRE_FRONT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $LECOFFRE_FRONT_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$LECOFFRE_FRONT_https.log app_json; + + location / { + proxy_pass http://$LECOFFRE_FRONT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$LECOFFRE_FRONT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/LOKI_https.conf b/storage/dev/nginx/LOKI_https.conf new file mode 100644 index 0000000..c3cede5 --- /dev/null +++ b/storage/dev/nginx/LOKI_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour LOKI +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $LOKI.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $LOKI_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$LOKI_https.log app_json; + + location / { + proxy_pass http://$LOKI_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$LOKI_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/NGNIX_https.conf b/storage/dev/nginx/NGNIX_https.conf new file mode 100644 index 0000000..56cf9c4 --- /dev/null +++ b/storage/dev/nginx/NGNIX_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour NGNIX +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $NGNIX.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $NGNIX_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$NGNIX_https.log app_json; + + location / { + proxy_pass http://$NGNIX_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$NGNIX_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/POSTGRESQL_https.conf b/storage/dev/nginx/POSTGRESQL_https.conf new file mode 100644 index 0000000..aedf7dc --- /dev/null +++ b/storage/dev/nginx/POSTGRESQL_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour POSTGRESQL +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $POSTGRESQL.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $POSTGRESQL_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$POSTGRESQL_https.log app_json; + + location / { + proxy_pass http://$POSTGRESQL_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$POSTGRESQL_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/PROMTAIL_https.conf b/storage/dev/nginx/PROMTAIL_https.conf new file mode 100644 index 0000000..7c7a59f --- /dev/null +++ b/storage/dev/nginx/PROMTAIL_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour PROMTAIL +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $PROMTAIL.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $PROMTAIL_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$PROMTAIL_https.log app_json; + + location / { + proxy_pass http://$PROMTAIL_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$PROMTAIL_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/REDIS_https.conf b/storage/dev/nginx/REDIS_https.conf new file mode 100644 index 0000000..ddf1881 --- /dev/null +++ b/storage/dev/nginx/REDIS_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour REDIS +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $REDIS.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $REDIS_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$REDIS_https.log app_json; + + location / { + proxy_pass http://$REDIS_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$REDIS_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/SDK_RELAY_https.conf b/storage/dev/nginx/SDK_RELAY_https.conf new file mode 100644 index 0000000..4e8e43d --- /dev/null +++ b/storage/dev/nginx/SDK_RELAY_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour SDK_RELAY +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $SDK_RELAY.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $SDK_RELAY_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$SDK_RELAY_https.log app_json; + + location / { + proxy_pass http://$SDK_RELAY_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$SDK_RELAY_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/SDK_STORAGE_https.conf b/storage/dev/nginx/SDK_STORAGE_https.conf new file mode 100644 index 0000000..9737b79 --- /dev/null +++ b/storage/dev/nginx/SDK_STORAGE_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour SDK_STORAGE +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $SDK_STORAGE.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $SDK_STORAGE_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$SDK_STORAGE_https.log app_json; + + location / { + proxy_pass http://$SDK_STORAGE_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$SDK_STORAGE_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/TOR_https.conf b/storage/dev/nginx/TOR_https.conf new file mode 100644 index 0000000..bbd77c3 --- /dev/null +++ b/storage/dev/nginx/TOR_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour TOR +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $TOR.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $TOR_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$TOR_https.log app_json; + + location / { + proxy_pass http://$TOR_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$TOR_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/_4NK_CERTIFICATOR_https.conf b/storage/dev/nginx/_4NK_CERTIFICATOR_https.conf new file mode 100644 index 0000000..1afcacb --- /dev/null +++ b/storage/dev/nginx/_4NK_CERTIFICATOR_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour _4NK_CERTIFICATOR +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $_4NK_CERTIFICATOR.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_CERTIFICATOR_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_CERTIFICATOR_https.log app_json; + + location / { + proxy_pass http://$_4NK_CERTIFICATOR_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_CERTIFICATOR_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/_4NK_MINER_https.conf b/storage/dev/nginx/_4NK_MINER_https.conf new file mode 100644 index 0000000..bf44c51 --- /dev/null +++ b/storage/dev/nginx/_4NK_MINER_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour _4NK_MINER +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $_4NK_MINER.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_MINER_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_MINER_https.log app_json; + + location / { + proxy_pass http://$_4NK_MINER_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_MINER_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/_4NK_VAULT_https.conf b/storage/dev/nginx/_4NK_VAULT_https.conf new file mode 100644 index 0000000..8eaba15 --- /dev/null +++ b/storage/dev/nginx/_4NK_VAULT_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour _4NK_VAULT +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $_4NK_VAULT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_VAULT_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_VAULT_https.log app_json; + + location / { + proxy_pass http://$_4NK_VAULT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_VAULT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/_4NK_WEB_STATUS_https.conf b/storage/dev/nginx/_4NK_WEB_STATUS_https.conf new file mode 100644 index 0000000..fe778a4 --- /dev/null +++ b/storage/dev/nginx/_4NK_WEB_STATUS_https.conf @@ -0,0 +1,43 @@ +# Configuration HTTPS pour _4NK_WEB_STATUS +# Généré automatiquement le Fri Oct 3 17:10:13 UTC 2025 + +server { + listen 80; + server_name $_4NK_WEB_STATUS.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_WEB_STATUS_DOCKER_NAME.$_4NKweb.com; + +ssl_certificate /etc/letsencrypt/live/dev4._4NKweb.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/dev4._4NKweb.com/privkey.pem; + + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_WEB_STATUS_https.log app_json; + + location / { + proxy_pass http://$_4NK_WEB_STATUS_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_WEB_STATUS_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/app-internal-ports.conf b/storage/dev/nginx/app-internal-ports.conf new file mode 100644 index 0000000..68bd9ed --- /dev/null +++ b/storage/dev/nginx/app-internal-ports.conf @@ -0,0 +1,360 @@ +# Configurations internes générées automatiquement +# Généré le $(date) + + +server { + listen $REDIS_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$REDIS_int.log app_json; + + location / { + proxy_pass http://$REDIS_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$REDIS_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $POSTGRESQL_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$POSTGRESQL_int.log app_json; + + location / { + proxy_pass http://$POSTGRESQL_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$POSTGRESQL_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $LOKI_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$LOKI_int.log app_json; + + location / { + proxy_pass http://$LOKI_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$LOKI_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $PROMTAIL_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$PROMTAIL_int.log app_json; + + location / { + proxy_pass http://$PROMTAIL_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$PROMTAIL_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $GRAFANA_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$GRAFANA_int.log app_json; + + location / { + proxy_pass http://$GRAFANA_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$GRAFANA_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $NGNIX_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$NGNIX_int.log app_json; + + location / { + proxy_pass http://$NGNIX_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$NGNIX_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $TOR_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$TOR_int.log app_json; + + location / { + proxy_pass http://$TOR_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$TOR_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $_4NK_VAULT_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_VAULT_int.log app_json; + + location / { + proxy_pass http://$_4NK_VAULT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$_4NK_VAULT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $BITCOIN_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$BITCOIN_int.log app_json; + + location / { + proxy_pass http://$BITCOIN_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$BITCOIN_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $BLINDBIT_ORACLE_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$BLINDBIT_ORACLE_int.log app_json; + + location / { + proxy_pass http://$BLINDBIT_ORACLE_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$BLINDBIT_ORACLE_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $SDK_RELAY_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$SDK_RELAY_int.log app_json; + + location / { + proxy_pass http://$SDK_RELAY_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$SDK_RELAY_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $SDK_STORAGE_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$SDK_STORAGE_int.log app_json; + + location / { + proxy_pass http://$SDK_STORAGE_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$SDK_STORAGE_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $IHM_CLIENT_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$IHM_CLIENT_int.log app_json; + + location / { + proxy_pass http://$IHM_CLIENT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$IHM_CLIENT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $_4NK_CERTIFICATOR_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_CERTIFICATOR_int.log app_json; + + location / { + proxy_pass http://$_4NK_CERTIFICATOR_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$_4NK_CERTIFICATOR_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $_4NK_MINER_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_MINER_int.log app_json; + + location / { + proxy_pass http://$_4NK_MINER_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$_4NK_MINER_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $LECOFFRE_FRONT_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$LECOFFRE_FRONT_int.log app_json; + + location / { + proxy_pass http://$LECOFFRE_FRONT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$LECOFFRE_FRONT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +server { + listen $_4NK_WEB_STATUS_PORT default_server; + server_name _; # pas d'host requis + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_WEB_STATUS_int.log app_json; + + location / { + proxy_pass http://$_4NK_WEB_STATUS_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + # websocket (si nécessaire) + location /ws/ { + proxy_pass http://$_4NK_WEB_STATUS_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/nginx_dev4.4NKweb.com-https.conf b/storage/dev/nginx/nginx_dev4.4NKweb.com-https.conf new file mode 100644 index 0000000..52cbf72 --- /dev/null +++ b/storage/dev/nginx/nginx_dev4.4NKweb.com-https.conf @@ -0,0 +1,711 @@ +# Configuration Nginx consolidée pour $HOST +# Générée automatiquement le $(date) + +# Inclusion du format de log JSON et des upstreams +include upstreams.conf; + + +# Redirection globale HTTP→HTTPS +server { + listen 80; + server_name $HOST *.$HOST; + return 301 https://$host$request_uri; +} + + +# Configuration HTTPS pour REDIS +server { + listen 80; + server_name $REDIS.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $REDIS_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$REDIS_https.log app_json; + + location / { + proxy_pass http://$REDIS_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$REDIS_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour POSTGRESQL +server { + listen 80; + server_name $POSTGRESQL.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $POSTGRESQL_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$POSTGRESQL_https.log app_json; + + location / { + proxy_pass http://$POSTGRESQL_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$POSTGRESQL_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour LOKI +server { + listen 80; + server_name $LOKI.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $LOKI_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$LOKI_https.log app_json; + + location / { + proxy_pass http://$LOKI_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$LOKI_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour PROMTAIL +server { + listen 80; + server_name $PROMTAIL.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $PROMTAIL_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$PROMTAIL_https.log app_json; + + location / { + proxy_pass http://$PROMTAIL_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$PROMTAIL_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour GRAFANA +server { + listen 80; + server_name $GRAFANA.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $GRAFANA_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$GRAFANA_https.log app_json; + + location / { + proxy_pass http://$GRAFANA_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$GRAFANA_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour NGNIX +server { + listen 80; + server_name $NGNIX.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $NGNIX_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$NGNIX_https.log app_json; + + location / { + proxy_pass http://$NGNIX_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$NGNIX_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour TOR +server { + listen 80; + server_name $TOR.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $TOR_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$TOR_https.log app_json; + + location / { + proxy_pass http://$TOR_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$TOR_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_VAULT +server { + listen 80; + server_name $_4NK_VAULT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_VAULT_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_VAULT_https.log app_json; + + location / { + proxy_pass http://$_4NK_VAULT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_VAULT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour BITCOIN +server { + listen 80; + server_name $BITCOIN.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $BITCOIN_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$BITCOIN_https.log app_json; + + location / { + proxy_pass http://$BITCOIN_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$BITCOIN_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour BLINDBIT_ORACLE +server { + listen 80; + server_name $BLINDBIT_ORACLE.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $BLINDBIT_ORACLE_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$BLINDBIT_ORACLE_https.log app_json; + + location / { + proxy_pass http://$BLINDBIT_ORACLE_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$BLINDBIT_ORACLE_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour SDK_RELAY +server { + listen 80; + server_name $SDK_RELAY.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $SDK_RELAY_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$SDK_RELAY_https.log app_json; + + location / { + proxy_pass http://$SDK_RELAY_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$SDK_RELAY_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour SDK_STORAGE +server { + listen 80; + server_name $SDK_STORAGE.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $SDK_STORAGE_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$SDK_STORAGE_https.log app_json; + + location / { + proxy_pass http://$SDK_STORAGE_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$SDK_STORAGE_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour IHM_CLIENT +server { + listen 80; + server_name $IHM_CLIENT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $IHM_CLIENT_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$IHM_CLIENT_https.log app_json; + + location / { + proxy_pass http://$IHM_CLIENT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$IHM_CLIENT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_CERTIFICATOR +server { + listen 80; + server_name $_4NK_CERTIFICATOR.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_CERTIFICATOR_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_CERTIFICATOR_https.log app_json; + + location / { + proxy_pass http://$_4NK_CERTIFICATOR_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_CERTIFICATOR_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_MINER +server { + listen 80; + server_name $_4NK_MINER.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_MINER_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_MINER_https.log app_json; + + location / { + proxy_pass http://$_4NK_MINER_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_MINER_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour LECOFFRE_FRONT +server { + listen 80; + server_name $LECOFFRE_FRONT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $LECOFFRE_FRONT_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$LECOFFRE_FRONT_https.log app_json; + + location / { + proxy_pass http://$LECOFFRE_FRONT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$LECOFFRE_FRONT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_WEB_STATUS +server { + listen 80; + server_name $_4NK_WEB_STATUS.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_WEB_STATUS_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_WEB_STATUS_https.log app_json; + + location / { + proxy_pass http://$_4NK_WEB_STATUS_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_WEB_STATUS_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/nginx_dev4.4nkweb.com-https.conf b/storage/dev/nginx/nginx_dev4.4nkweb.com-https.conf new file mode 100644 index 0000000..52cbf72 --- /dev/null +++ b/storage/dev/nginx/nginx_dev4.4nkweb.com-https.conf @@ -0,0 +1,711 @@ +# Configuration Nginx consolidée pour $HOST +# Générée automatiquement le $(date) + +# Inclusion du format de log JSON et des upstreams +include upstreams.conf; + + +# Redirection globale HTTP→HTTPS +server { + listen 80; + server_name $HOST *.$HOST; + return 301 https://$host$request_uri; +} + + +# Configuration HTTPS pour REDIS +server { + listen 80; + server_name $REDIS.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $REDIS_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$REDIS_https.log app_json; + + location / { + proxy_pass http://$REDIS_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$REDIS_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour POSTGRESQL +server { + listen 80; + server_name $POSTGRESQL.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $POSTGRESQL_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$POSTGRESQL_https.log app_json; + + location / { + proxy_pass http://$POSTGRESQL_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$POSTGRESQL_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour LOKI +server { + listen 80; + server_name $LOKI.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $LOKI_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$LOKI_https.log app_json; + + location / { + proxy_pass http://$LOKI_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$LOKI_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour PROMTAIL +server { + listen 80; + server_name $PROMTAIL.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $PROMTAIL_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$PROMTAIL_https.log app_json; + + location / { + proxy_pass http://$PROMTAIL_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$PROMTAIL_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour GRAFANA +server { + listen 80; + server_name $GRAFANA.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $GRAFANA_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$GRAFANA_https.log app_json; + + location / { + proxy_pass http://$GRAFANA_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$GRAFANA_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour NGNIX +server { + listen 80; + server_name $NGNIX.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $NGNIX_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$NGNIX_https.log app_json; + + location / { + proxy_pass http://$NGNIX_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$NGNIX_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour TOR +server { + listen 80; + server_name $TOR.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $TOR_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$TOR_https.log app_json; + + location / { + proxy_pass http://$TOR_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$TOR_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_VAULT +server { + listen 80; + server_name $_4NK_VAULT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_VAULT_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_VAULT_https.log app_json; + + location / { + proxy_pass http://$_4NK_VAULT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_VAULT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour BITCOIN +server { + listen 80; + server_name $BITCOIN.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $BITCOIN_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$BITCOIN_https.log app_json; + + location / { + proxy_pass http://$BITCOIN_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$BITCOIN_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour BLINDBIT_ORACLE +server { + listen 80; + server_name $BLINDBIT_ORACLE.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $BLINDBIT_ORACLE_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$BLINDBIT_ORACLE_https.log app_json; + + location / { + proxy_pass http://$BLINDBIT_ORACLE_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$BLINDBIT_ORACLE_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour SDK_RELAY +server { + listen 80; + server_name $SDK_RELAY.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $SDK_RELAY_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$SDK_RELAY_https.log app_json; + + location / { + proxy_pass http://$SDK_RELAY_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$SDK_RELAY_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour SDK_STORAGE +server { + listen 80; + server_name $SDK_STORAGE.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $SDK_STORAGE_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$SDK_STORAGE_https.log app_json; + + location / { + proxy_pass http://$SDK_STORAGE_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$SDK_STORAGE_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour IHM_CLIENT +server { + listen 80; + server_name $IHM_CLIENT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $IHM_CLIENT_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$IHM_CLIENT_https.log app_json; + + location / { + proxy_pass http://$IHM_CLIENT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$IHM_CLIENT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_CERTIFICATOR +server { + listen 80; + server_name $_4NK_CERTIFICATOR.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_CERTIFICATOR_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_CERTIFICATOR_https.log app_json; + + location / { + proxy_pass http://$_4NK_CERTIFICATOR_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_CERTIFICATOR_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_MINER +server { + listen 80; + server_name $_4NK_MINER.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_MINER_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_MINER_https.log app_json; + + location / { + proxy_pass http://$_4NK_MINER_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_MINER_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour LECOFFRE_FRONT +server { + listen 80; + server_name $LECOFFRE_FRONT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $LECOFFRE_FRONT_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$LECOFFRE_FRONT_https.log app_json; + + location / { + proxy_pass http://$LECOFFRE_FRONT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$LECOFFRE_FRONT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_WEB_STATUS +server { + listen 80; + server_name $_4NK_WEB_STATUS.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_WEB_STATUS_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_WEB_STATUS_https.log app_json; + + location / { + proxy_pass http://$_4NK_WEB_STATUS_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_WEB_STATUS_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/nginx_dev4._4NKweb.com-https.conf b/storage/dev/nginx/nginx_dev4._4NKweb.com-https.conf new file mode 100644 index 0000000..52cbf72 --- /dev/null +++ b/storage/dev/nginx/nginx_dev4._4NKweb.com-https.conf @@ -0,0 +1,711 @@ +# Configuration Nginx consolidée pour $HOST +# Générée automatiquement le $(date) + +# Inclusion du format de log JSON et des upstreams +include upstreams.conf; + + +# Redirection globale HTTP→HTTPS +server { + listen 80; + server_name $HOST *.$HOST; + return 301 https://$host$request_uri; +} + + +# Configuration HTTPS pour REDIS +server { + listen 80; + server_name $REDIS.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $REDIS_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$REDIS_https.log app_json; + + location / { + proxy_pass http://$REDIS_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$REDIS_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour POSTGRESQL +server { + listen 80; + server_name $POSTGRESQL.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $POSTGRESQL_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$POSTGRESQL_https.log app_json; + + location / { + proxy_pass http://$POSTGRESQL_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$POSTGRESQL_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour LOKI +server { + listen 80; + server_name $LOKI.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $LOKI_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$LOKI_https.log app_json; + + location / { + proxy_pass http://$LOKI_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$LOKI_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour PROMTAIL +server { + listen 80; + server_name $PROMTAIL.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $PROMTAIL_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$PROMTAIL_https.log app_json; + + location / { + proxy_pass http://$PROMTAIL_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$PROMTAIL_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour GRAFANA +server { + listen 80; + server_name $GRAFANA.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $GRAFANA_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$GRAFANA_https.log app_json; + + location / { + proxy_pass http://$GRAFANA_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$GRAFANA_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour NGNIX +server { + listen 80; + server_name $NGNIX.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $NGNIX_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$NGNIX_https.log app_json; + + location / { + proxy_pass http://$NGNIX_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$NGNIX_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour TOR +server { + listen 80; + server_name $TOR.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $TOR_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$TOR_https.log app_json; + + location / { + proxy_pass http://$TOR_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$TOR_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_VAULT +server { + listen 80; + server_name $_4NK_VAULT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_VAULT_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_VAULT_https.log app_json; + + location / { + proxy_pass http://$_4NK_VAULT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_VAULT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour BITCOIN +server { + listen 80; + server_name $BITCOIN.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $BITCOIN_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$BITCOIN_https.log app_json; + + location / { + proxy_pass http://$BITCOIN_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$BITCOIN_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour BLINDBIT_ORACLE +server { + listen 80; + server_name $BLINDBIT_ORACLE.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $BLINDBIT_ORACLE_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$BLINDBIT_ORACLE_https.log app_json; + + location / { + proxy_pass http://$BLINDBIT_ORACLE_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$BLINDBIT_ORACLE_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour SDK_RELAY +server { + listen 80; + server_name $SDK_RELAY.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $SDK_RELAY_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$SDK_RELAY_https.log app_json; + + location / { + proxy_pass http://$SDK_RELAY_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$SDK_RELAY_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour SDK_STORAGE +server { + listen 80; + server_name $SDK_STORAGE.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $SDK_STORAGE_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$SDK_STORAGE_https.log app_json; + + location / { + proxy_pass http://$SDK_STORAGE_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$SDK_STORAGE_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour IHM_CLIENT +server { + listen 80; + server_name $IHM_CLIENT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $IHM_CLIENT_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$IHM_CLIENT_https.log app_json; + + location / { + proxy_pass http://$IHM_CLIENT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$IHM_CLIENT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_CERTIFICATOR +server { + listen 80; + server_name $_4NK_CERTIFICATOR.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_CERTIFICATOR_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_CERTIFICATOR_https.log app_json; + + location / { + proxy_pass http://$_4NK_CERTIFICATOR_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_CERTIFICATOR_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_MINER +server { + listen 80; + server_name $_4NK_MINER.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_MINER_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_MINER_https.log app_json; + + location / { + proxy_pass http://$_4NK_MINER_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_MINER_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour LECOFFRE_FRONT +server { + listen 80; + server_name $LECOFFRE_FRONT.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $LECOFFRE_FRONT_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$LECOFFRE_FRONT_https.log app_json; + + location / { + proxy_pass http://$LECOFFRE_FRONT_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$LECOFFRE_FRONT_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} + +# Configuration HTTPS pour _4NK_WEB_STATUS +server { + listen 80; + server_name $_4NK_WEB_STATUS.$_4NKweb.com; + # redirection HTTP→HTTPS pour l'externe + return 301 https://$host$request_uri; +} + +server { + listen 443 ssl http2; + server_name $_4NK_WEB_STATUS_DOCKER_NAME.$_4NKweb.com; + + ssl_certificate $/etc/letsencrypt/live/dev4._4NKweb.com/certs/fullchain.pem; + ssl_certificate_key $/etc/letsencrypt/live/dev4._4NKweb.com/private/privkey.pem; + + # réglages TLS minimaux (adapter selon politique) + ssl_session_timeout 1d; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_ciphers HIGH:!aNULL:!MD5; + ssl_prefer_server_ciphers on; + + # HSTS (activer seulement si tout le domaine est en HTTPS) + add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; + + access_log $/home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/nginx/$_4NK_WEB_STATUS_https.log app_json; + + location / { + proxy_pass http://$_4NK_WEB_STATUS_DOCKER_NAME; + include $/etc/nginx/conf.d/proxy_headers.conf; + } + + location /ws/ { + proxy_pass http://$_4NK_WEB_STATUS_DOCKER_NAME; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + include $/etc/nginx/conf.d/proxy_headers.conf; + proxy_read_timeout 3600s; + } +} diff --git a/storage/dev/nginx/ngnix_dev4.4nkweb.com-http.conf b/storage/dev/nginx/ngnix_dev4.4nkweb.com-http.conf deleted file mode 100644 index 6a7d847..0000000 --- a/storage/dev/nginx/ngnix_dev4.4nkweb.com-http.conf +++ /dev/null @@ -1,15 +0,0 @@ -# HTTP server for ACME and redirect to HTTPS -server { - listen 80 default_server; - server_name _; - - # ACME HTTP-01 challenges - location /.well-known/acme-challenge/ { - root /var/www/letsencrypt; - } - - # Redirection vers HTTPS pour toutes les autres requêtes - location / { - return 301 https://$server_name$request_uri; - } -} diff --git a/storage/dev/nginx/ngnix_dev4.4nkweb.com-https.conf b/storage/dev/nginx/ngnix_dev4.4nkweb.com-https.conf deleted file mode 100644 index f3866ad..0000000 --- a/storage/dev/nginx/ngnix_dev4.4nkweb.com-https.conf +++ /dev/null @@ -1,57 +0,0 @@ -# Configuration HTTPS pour dev4.4nkweb.com -server { - listen 443 ssl; - http2 on; - server_name dev4.4nkweb.com; - - # Certificats SSL - ssl_certificate /etc/letsencrypt/live/dev4.4nkweb.com/fullchain.pem; - ssl_certificate_key /etc/letsencrypt/live/dev4.4nkweb.com/privkey.pem; - - # Configuration SSL - ssl_protocols TLSv1.2 TLSv1.3; - ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384; - ssl_prefer_server_ciphers off; - ssl_session_cache shared:SSL:10m; - ssl_session_timeout 10m; - - # Headers de sécurité - add_header Strict-Transport-Security "max-age=63072000" always; - add_header X-Frame-Options DENY always; - add_header X-Content-Type-Options nosniff always; - add_header X-XSS-Protection "1; mode=block" always; - - # Grafana - Interface de monitoring (DOIT être avant location /) - include $NGINX_CONF_DIR/route_grafana.conf; - - # Loki API - API de logs (DOIT être avant location /) - include $NGINX_CONF_DIR/route_loki.conf; - - # Page de statut des services (DOIT être avant location /) - include $NGINX_CONF_DIR/route_status.conf; - include $NGINX_CONF_DIR/route_status_redirect.conf; - include $NGINX_CONF_DIR/route_status_api.conf; - - # API backend - route /back/ vers /api/ du backend - include $NGINX_CONF_DIR/route_back_proxy.conf; - - # WebSocket relay (sdk_relay) - include $NGINX_CONF_DIR/route_ws.conf; - - # favicon - include $NGINX_CONF_DIR/route_favicon.conf; - - # blindbit - include $NGINX_CONF_DIR/route_blindbit.conf; - - # lecoffre-front - Application LeCoffre - include $NGINX_CONF_DIR/route_lecoffre_redirect.conf; - include $NGINX_CONF_DIR/route_lecoffre.conf; - include $NGINX_CONF_DIR/route_lecoffre_hmr.conf; - include $NGINX_CONF_DIR/route_next_assets.conf; - - - # ihm_client (root) - DOIT être en dernier - - include $NGINX_CONF_DIR/route_ihm_client.conf; -} diff --git a/storage/dev/nginx/proxy_headers.conf b/storage/dev/nginx/proxy_headers.conf new file mode 100644 index 0000000..6349894 --- /dev/null +++ b/storage/dev/nginx/proxy_headers.conf @@ -0,0 +1,29 @@ +# Headers de proxy générés automatiquement +# Généré le $(date) + +proxy_set_header Host $host; +proxy_set_header X-Real-IP $remote_addr; +proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; +proxy_set_header X-Forwarded-Proto $scheme; +proxy_set_header X-Forwarded-Host $host; +proxy_set_header X-Forwarded-Port $server_port; + +# Directives de proxy +proxy_redirect off; # si l'app sait générer ses URLs +add_header X-Debug-Scheme $scheme always; +add_header X-Debug-XFP $http_x_forwarded_proto always; + +# Timeouts +proxy_connect_timeout 60s; +proxy_send_timeout 60s; +proxy_read_timeout 60s; + +# Buffer settings +proxy_buffering on; +proxy_buffer_size 4k; +proxy_buffers 8 4k; +proxy_busy_buffers_size 8k; + +# Cache settings +proxy_cache_bypass $http_upgrade; +proxy_no_cache $http_upgrade; diff --git a/storage/dev/nginx/route_blindbit.conf b/storage/dev/nginx/route_blindbit.conf deleted file mode 100644 index d2940ca..0000000 --- a/storage/dev/nginx/route_blindbit.conf +++ /dev/null @@ -1,8 +0,0 @@ - location $URL_ROUTE_BLINDBIT/ { - proxy_pass http://127.0.0.1:$BLINDBIT_PORT/; - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - } diff --git a/storage/dev/nginx/route_favicon.conf b/storage/dev/nginx/route_favicon.conf deleted file mode 100644 index 2a7538b..0000000 --- a/storage/dev/nginx/route_favicon.conf +++ /dev/null @@ -1,4 +0,0 @@ - location = /favicon.ico { - root $NGINX_CONF_DIR/assets; - try_files /favicon.ico =404; - } diff --git a/storage/dev/nginx/route_grafana.conf b/storage/dev/nginx/route_grafana.conf deleted file mode 100644 index c112b03..0000000 --- a/storage/dev/nginx/route_grafana.conf +++ /dev/null @@ -1,24 +0,0 @@ - location $URL_ROUTE_GRAFAN/ { - proxy_pass http://127.0.0.1:3001:3001/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - # Configuration spécifique pour Grafana - proxy_set_header X-Grafana-Org-Id 1; - - # Support des WebSockets pour les live updates - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - - # Timeouts - proxy_connect_timeout 60s; - proxy_send_timeout 60s; - proxy_read_timeout 60s; - - # Buffer settings - proxy_buffering off; - proxy_request_buffering off; - } diff --git a/storage/dev/nginx/route_ihm_client.conf b/storage/dev/nginx/route_ihm_client.conf deleted file mode 100644 index 0e6c45a..0000000 --- a/storage/dev/nginx/route_ihm_client.conf +++ /dev/null @@ -1,11 +0,0 @@ - location $URL_ROUTE_IHM_CLIENT { - proxy_pass http://127.0.0.1:3003:3003; - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_read_timeout 300; - } diff --git a/storage/dev/nginx/route_lecoffre.conf b/storage/dev/nginx/route_lecoffre.conf deleted file mode 100644 index 6555c83..0000000 --- a/storage/dev/nginx/route_lecoffre.conf +++ /dev/null @@ -1,24 +0,0 @@ - location ^~ $URL_ROUTE_LECOFFRE_FRONT/ { - # ensure no redirect here; only proxy to Next - add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0" always; - add_header Pragma "no-cache" always; - add_header Expires "-1" always; - proxy_hide_header ETag; - proxy_hide_header Last-Modified; - rewrite ^$URL_ROUTE_LECOFFRE_FRONT/(.*)$ /$1 break; - proxy_pass http://127.0.0.1:3000:3000; - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_set_header X-Session-ID $http_x_session_id; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-Host $host; - proxy_read_timeout 300; - proxy_send_timeout 300; - proxy_connect_timeout 300; - } diff --git a/storage/dev/nginx/route_lecoffre_hmr.conf b/storage/dev/nginx/route_lecoffre_hmr.conf deleted file mode 100644 index 651538e..0000000 --- a/storage/dev/nginx/route_lecoffre_hmr.conf +++ /dev/null @@ -1,11 +0,0 @@ - location ^~ $URL_ROUTE_LECOFFRE_FRONT_HMR/ { - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - rewrite ^$URL_ROUTE_LECOFFRE_FRONT_HMR/(.*)$ $URL_ROUTE_LECOFFRE_FRONT/$1 break; - proxy_pass http://127.0.0.1:3000:3000; - } diff --git a/storage/dev/nginx/route_lecoffre_redirect.conf b/storage/dev/nginx/route_lecoffre_redirect.conf deleted file mode 100644 index 7f71c51..0000000 --- a/storage/dev/nginx/route_lecoffre_redirect.conf +++ /dev/null @@ -1 +0,0 @@ - location = $URL_ROUTE_LECOFFRE_FRONT { return 301 $URL_ROUTE_LECOFFRE_FRONT/; } diff --git a/storage/dev/nginx/route_loki.conf b/storage/dev/nginx/route_loki.conf deleted file mode 100644 index f5fdf82..0000000 --- a/storage/dev/nginx/route_loki.conf +++ /dev/null @@ -1,15 +0,0 @@ - location /loki/ { - proxy_pass http://127.0.0.1:3100:3100/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - # CORS pour les requêtes depuis Grafana - add_header Access-Control-Allow-Origin *; - add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; - add_header Access-Control-Allow-Headers "Content-Type, Authorization"; - - if ($request_method = 'OPTIONS') { - return 204; - } diff --git a/storage/dev/nginx/route_next_assets.conf b/storage/dev/nginx/route_next_assets.conf deleted file mode 100644 index 3075896..0000000 --- a/storage/dev/nginx/route_next_assets.conf +++ /dev/null @@ -1,12 +0,0 @@ - location ^~ $URL_ROUTE_NEXT/ { - proxy_pass http://127.0.0.1:3000:3000$URL_ROUTE_NEXT/; - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_read_timeout 300; - add_header Cache-Control "public, max-age=31536000, immutable"; - } diff --git a/storage/dev/nginx/route_status.conf b/storage/dev/nginx/route_status.conf deleted file mode 100644 index 890fbe3..0000000 --- a/storage/dev/nginx/route_status.conf +++ /dev/null @@ -1,21 +0,0 @@ - location $URL_ROUTE_STATUS_API/ { - proxy_pass http://127.0.0.1:$STATUS_API_PORT; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - # CORS pour les requêtes AJAX - add_header Access-Control-Allow-Origin *; - add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; - add_header Access-Control-Allow-Headers "Content-Type, Authorization"; - - # Timeouts - proxy_connect_timeout 10s; - proxy_send_timeout 10s; - proxy_read_timeout 10s; - - if ($request_method = 'OPTIONS') { - return 204; - } - } \ No newline at end of file diff --git a/storage/dev/nginx/route_status_api.conf b/storage/dev/nginx/route_status_api.conf deleted file mode 100644 index 48ff5d1..0000000 --- a/storage/dev/nginx/route_status_api.conf +++ /dev/null @@ -1,21 +0,0 @@ - location $URL_ROUTE_STATUS { - proxy_pass http://127.0.0.1:3006/api; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - - # CORS pour les requêtes AJAX - add_header Access-Control-Allow-Origin *; - add_header Access-Control-Allow-Methods "GET, POST, OPTIONS"; - add_header Access-Control-Allow-Headers "Content-Type, Authorization"; - - # Timeouts - proxy_connect_timeout 10s; - proxy_send_timeout 10s; - proxy_read_timeout 10s; - - if ($request_method = 'OPTIONS') { - return 204; - } - } diff --git a/storage/dev/nginx/route_status_redirect.conf b/storage/dev/nginx/route_status_redirect.conf deleted file mode 100644 index ba449d8..0000000 --- a/storage/dev/nginx/route_status_redirect.conf +++ /dev/null @@ -1,4 +0,0 @@ - location $URL_ROUTE_STATUS { - # Redirection vers $URL_ROUTE_STATUS/ - return 301 $URL_ROUTE_STATUS/; - } diff --git a/storage/dev/nginx/route_ws.conf b/storage/dev/nginx/route_ws.conf deleted file mode 100644 index c34b02f..0000000 --- a/storage/dev/nginx/route_ws.conf +++ /dev/null @@ -1,15 +0,0 @@ - location /ws/ { - proxy_pass http://127.0.0.1:$SIGNER_PORT/; - proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key; - proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version; - proxy_set_header Sec-WebSocket-Protocol $http_sec_websocket_protocol; - proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_read_timeout 86400; - } diff --git a/storage/dev/nginx/upstreams.conf b/storage/dev/nginx/upstreams.conf new file mode 100644 index 0000000..70ea138 --- /dev/null +++ b/storage/dev/nginx/upstreams.conf @@ -0,0 +1,102 @@ +# Upstreams générés automatiquement +# Généré le $(date) + +log_format app_json escape=json + '{ "time":"$time_iso8601",' + ' "client":"$remote_addr",' + ' "xff":"$http_x_forwarded_for",' + ' "method":"$request_method",' + ' "host":"$host",' + ' "uri":"$request_uri",' + ' "status":$status,' + ' "bytes":$body_bytes_sent,' + ' "ua":"$http_user_agent",' + ' "upstream":"$upstream_addr",' + ' "rt":$request_time,' + ' "urt":$upstream_response_time }'; + + +upstream $REDIS { + server $REDIS_DOCKER_NAME:$REDIS_PORT; + keepalive 64; +} + +upstream $POSTGRESQL { + server $POSTGRESQL_DOCKER_NAME:$POSTGRESQL_PORT; + keepalive 64; +} + +upstream $LOKI { + server $LOKI_DOCKER_NAME:$LOKI_PORT; + keepalive 64; +} + +upstream $PROMTAIL { + server $PROMTAIL_DOCKER_NAME:$PROMTAIL_PORT; + keepalive 64; +} + +upstream $GRAFANA { + server $GRAFANA_DOCKER_NAME:$GRAFANA_PORT; + keepalive 64; +} + +upstream $NGNIX { + server $NGNIX_DOCKER_NAME:$NGNIX_PORT; + keepalive 64; +} + +upstream $TOR { + server $TOR_DOCKER_NAME:$TOR_PORT; + keepalive 64; +} + +upstream $_4NK_VAULT { + server $_4NK_VAULT_DOCKER_NAME:$_4NK_VAULT_PORT; + keepalive 64; +} + +upstream $BITCOIN { + server $BITCOIN_DOCKER_NAME:$BITCOIN_PORT; + keepalive 64; +} + +upstream $BLINDBIT_ORACLE { + server $BLINDBIT_ORACLE_DOCKER_NAME:$BLINDBIT_ORACLE_PORT; + keepalive 64; +} + +upstream $SDK_RELAY { + server $SDK_RELAY_DOCKER_NAME:$SDK_RELAY_PORT; + keepalive 64; +} + +upstream $SDK_STORAGE { + server $SDK_STORAGE_DOCKER_NAME:$SDK_STORAGE_PORT; + keepalive 64; +} + +upstream $IHM_CLIENT { + server $IHM_CLIENT_DOCKER_NAME:$IHM_CLIENT_PORT; + keepalive 64; +} + +upstream $_4NK_CERTIFICATOR { + server $_4NK_CERTIFICATOR_DOCKER_NAME:$_4NK_CERTIFICATOR_PORT; + keepalive 64; +} + +upstream $_4NK_MINER { + server $_4NK_MINER_DOCKER_NAME:$_4NK_MINER_PORT; + keepalive 64; +} + +upstream $LECOFFRE_FRONT { + server $LECOFFRE_FRONT_DOCKER_NAME:$LECOFFRE_FRONT_PORT; + keepalive 64; +} + +upstream $_4NK_WEB_STATUS { + server $_4NK_WEB_STATUS_DOCKER_NAME:$_4NK_WEB_STATUS_PORT; + keepalive 64; +} diff --git a/storage/dev/nginx/validate_templates.sh b/storage/dev/nginx/validate_templates.sh new file mode 100755 index 0000000..2e1d6a5 --- /dev/null +++ b/storage/dev/nginx/validate_templates.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +# Script de validation des templates Nginx générés +# Généré automatiquement le $(date) + +set -euo pipefail + +# Couleurs pour les messages +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +# Fonctions d'affichage +print_error() { echo -e "${RED}❌ ERREUR${NC}: $1"; } +print_success() { echo -e "${GREEN}✅ SUCCÈS${NC}: $1"; } +print_info() { echo -e "${BLUE}ℹ️ INFO${NC}: $1"; } +print_warning() { echo -e "${YELLOW}⚠️ ATTENTION${NC}: $1"; } + +# Charger les variables d'environnement +if [ -f ".env" ]; then + # Charger .env en mode silencieux pour éviter les erreurs de syntaxe + source .env 2>/dev/null || true +fi + +# Vérifier que HOST est défini +if [ -z "${HOST:-}" ]; then + print_warning "Variable HOST non définie, utilisation de la valeur par défaut" + export HOST="dev4._4NKweb.com" +fi + +print_info "Validation des templates Nginx pour $HOST" + +# Vérifier que les fichiers existent +missing_files=0 + +if [ ! -f "nginx/upstreams.conf" ]; then + print_error "Template nginx/upstreams.conf non trouvé" + missing_files=$((missing_files + 1)) +fi + +if [ ! -f "nginx/app-internal-ports.conf" ]; then + print_error "Template nginx/app-internal-ports.conf non trouvé" + missing_files=$((missing_files + 1)) +fi + +if [ ! -f "nginx/proxy_headers.conf" ]; then + print_error "Template nginx/proxy_headers.conf non trouvé" + missing_files=$((missing_files + 1)) +fi + +if [ ! -f "nginx/nginx_$HOST-https.conf" ]; then + print_error "Template nginx/nginx_$HOST-https.conf non trouvé" + missing_files=$((missing_files + 1)) +fi + +if [ $missing_files -eq 0 ]; then + print_success "Tous les templates de configuration sont présents" + print_info "Templates générés:" + echo " • nginx/upstreams.conf" + echo " • nginx/app-internal-ports.conf" + echo " • nginx/proxy_headers.conf" + echo " • nginx/*_https.conf (configurations HTTPS individuelles)" + echo " • nginx/nginx_$HOST-https.conf" + + print_info "Ces templates sont prêts à être utilisés dans votre infrastructure" + print_warning "Adaptez les chemins et configurations selon vos besoins spécifiques" +else + print_error "$missing_files template(s) manquant(s)" + exit 1 +fi + diff --git a/storage/dev/projects/lecoffre/docker-compose.yml.auto b/storage/dev/projects/lecoffre/docker-compose.yml.auto index 76cf459..0ffbc69 100644 --- a/storage/dev/projects/lecoffre/docker-compose.yml.auto +++ b/storage/dev/projects/lecoffre/docker-compose.yml.auto @@ -152,31 +152,31 @@ services: retries: 50 restart: unless-stopped" - $4NK_VAULT_DOCKER_NAME: - image: $4NK_VAULT_DOCKER_IMAGE - container_name: $4NK_VAULT_DOCKER_NAME - working_dir: /$4NK_VAULT_DOCKER_NAME + $_4NK_VAULT_DOCKER_NAME: + image: $_4NK_VAULT_DOCKER_IMAGE + container_name: $_4NK_VAULT_DOCKER_NAME + working_dir: /$_4NK_VAULT_DOCKER_NAME ports: - - "0.0.0.0:$4NK_VAULT_EXTERNAL_PORT" - - "0.0.0.0:$4NK_VAULT_PORT" - - "0.0.0.0:$4NK_VAULT_PORT2" - - "0.0.0.0:$4NK_VAULT_PORT3" + - "0.0.0.0:$_4NK_VAULT_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_VAULT_PORT" + - "0.0.0.0:$_4NK_VAULT_PORT2" + - "0.0.0.0:$_4NK_VAULT_PORT3" volumes: - - $4NK_VAULT_CONFS_DIR:$4NK_VAULT_DOCKER_CONFS_DIR - - $4NK_VAULT_LOGS_DIR:$4NK_VAULT_DOCKER_LOGS_DIR - - $4NK_VAULT_RUNS_DIR:$4NK_VAULT_DOCKER_RUNS_DIR - - $4NK_VAULT_DATAS_DIR:$4NK_VAULT_DOCKER_DATAS_DIR - - $4NK_VAULT_BACKUPS_DIR:$4NK_VAULT_DOCKER_BACKUPS_DIR - - $4NK_VAULT_SCRIPTS_DIR:$4NK_VAULT_DOCKER_SCRIPTS_DIR + - $_4NK_VAULT_CONFS_DIR:$_4NK_VAULT_DOCKER_CONFS_DIR + - $_4NK_VAULT_LOGS_DIR:$_4NK_VAULT_DOCKER_LOGS_DIR + - $_4NK_VAULT_RUNS_DIR:$_4NK_VAULT_DOCKER_RUNS_DIR + - $_4NK_VAULT_DATAS_DIR:$_4NK_VAULT_DOCKER_DATAS_DIR + - $_4NK_VAULT_BACKUPS_DIR:$_4NK_VAULT_DOCKER_BACKUPS_DIR + - $_4NK_VAULT_SCRIPTS_DIR:$_4NK_VAULT_DOCKER_SCRIPTS_DIR networks: btcnet: aliases: - - $4NK_VAULT_DOCKER_NAME + - $_4NK_VAULT_DOCKER_NAME user: root entrypoint: \> - /bin/sh -c "$4NK_VAULT_DOCKER_WORKING_DIR_CREATE" + /bin/sh -c "$_4NK_VAULT_DOCKER_WORKING_DIR_CREATE" healthcheck: - test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$4NK_VAULT.sh"] + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_VAULT.sh"] interval: 30s timeout: 10s retries: 50 @@ -362,61 +362,61 @@ services: retries: 50 restart: unless-stopped" - $4NK_CERTIFICATOR_DOCKER_NAME: - image: $4NK_CERTIFICATOR_DOCKER_IMAGE - container_name: $4NK_CERTIFICATOR_DOCKER_NAME - working_dir: /$4NK_CERTIFICATOR_DOCKER_NAME + $_4NK_CERTIFICATOR_DOCKER_NAME: + image: $_4NK_CERTIFICATOR_DOCKER_IMAGE + container_name: $_4NK_CERTIFICATOR_DOCKER_NAME + working_dir: /$_4NK_CERTIFICATOR_DOCKER_NAME ports: - - "0.0.0.0:$4NK_CERTIFICATOR_EXTERNAL_PORT" - - "0.0.0.0:$4NK_CERTIFICATOR_PORT" - - "0.0.0.0:$4NK_CERTIFICATOR_PORT2" - - "0.0.0.0:$4NK_CERTIFICATOR_PORT3" + - "0.0.0.0:$_4NK_CERTIFICATOR_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_CERTIFICATOR_PORT" + - "0.0.0.0:$_4NK_CERTIFICATOR_PORT2" + - "0.0.0.0:$_4NK_CERTIFICATOR_PORT3" volumes: - - $4NK_CERTIFICATOR_CONFS_DIR:$4NK_CERTIFICATOR_DOCKER_CONFS_DIR - - $4NK_CERTIFICATOR_LOGS_DIR:$4NK_CERTIFICATOR_DOCKER_LOGS_DIR - - $4NK_CERTIFICATOR_RUNS_DIR:$4NK_CERTIFICATOR_DOCKER_RUNS_DIR - - $4NK_CERTIFICATOR_DATAS_DIR:$4NK_CERTIFICATOR_DOCKER_DATAS_DIR - - $4NK_CERTIFICATOR_BACKUPS_DIR:$4NK_CERTIFICATOR_DOCKER_BACKUPS_DIR - - $4NK_CERTIFICATOR_SCRIPTS_DIR:$4NK_CERTIFICATOR_DOCKER_SCRIPTS_DIR + - $_4NK_CERTIFICATOR_CONFS_DIR:$_4NK_CERTIFICATOR_DOCKER_CONFS_DIR + - $_4NK_CERTIFICATOR_LOGS_DIR:$_4NK_CERTIFICATOR_DOCKER_LOGS_DIR + - $_4NK_CERTIFICATOR_RUNS_DIR:$_4NK_CERTIFICATOR_DOCKER_RUNS_DIR + - $_4NK_CERTIFICATOR_DATAS_DIR:$_4NK_CERTIFICATOR_DOCKER_DATAS_DIR + - $_4NK_CERTIFICATOR_BACKUPS_DIR:$_4NK_CERTIFICATOR_DOCKER_BACKUPS_DIR + - $_4NK_CERTIFICATOR_SCRIPTS_DIR:$_4NK_CERTIFICATOR_DOCKER_SCRIPTS_DIR networks: btcnet: aliases: - - $4NK_CERTIFICATOR_DOCKER_NAME + - $_4NK_CERTIFICATOR_DOCKER_NAME user: root entrypoint: \> - /bin/sh -c "$4NK_CERTIFICATOR_DOCKER_WORKING_DIR_CREATE" + /bin/sh -c "$_4NK_CERTIFICATOR_DOCKER_WORKING_DIR_CREATE" healthcheck: - test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$4NK_CERTIFICATOR.sh"] + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_CERTIFICATOR.sh"] interval: 30s timeout: 10s retries: 50 restart: unless-stopped" - $4NK_MINER_DOCKER_NAME: - image: $4NK_MINER_DOCKER_IMAGE - container_name: $4NK_MINER_DOCKER_NAME - working_dir: /$4NK_MINER_DOCKER_NAME + $_4NK_MINER_DOCKER_NAME: + image: $_4NK_MINER_DOCKER_IMAGE + container_name: $_4NK_MINER_DOCKER_NAME + working_dir: /$_4NK_MINER_DOCKER_NAME ports: - - "0.0.0.0:$4NK_MINER_EXTERNAL_PORT" - - "0.0.0.0:$4NK_MINER_PORT" - - "0.0.0.0:$4NK_MINER_PORT2" - - "0.0.0.0:$4NK_MINER_PORT3" + - "0.0.0.0:$_4NK_MINER_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_MINER_PORT" + - "0.0.0.0:$_4NK_MINER_PORT2" + - "0.0.0.0:$_4NK_MINER_PORT3" volumes: - - $4NK_MINER_CONFS_DIR:$4NK_MINER_DOCKER_CONFS_DIR - - $4NK_MINER_LOGS_DIR:$4NK_MINER_DOCKER_LOGS_DIR - - $4NK_MINER_RUNS_DIR:$4NK_MINER_DOCKER_RUNS_DIR - - $4NK_MINER_DATAS_DIR:$4NK_MINER_DOCKER_DATAS_DIR - - $4NK_MINER_BACKUPS_DIR:$4NK_MINER_DOCKER_BACKUPS_DIR - - $4NK_MINER_SCRIPTS_DIR:$4NK_MINER_DOCKER_SCRIPTS_DIR + - $_4NK_MINER_CONFS_DIR:$_4NK_MINER_DOCKER_CONFS_DIR + - $_4NK_MINER_LOGS_DIR:$_4NK_MINER_DOCKER_LOGS_DIR + - $_4NK_MINER_RUNS_DIR:$_4NK_MINER_DOCKER_RUNS_DIR + - $_4NK_MINER_DATAS_DIR:$_4NK_MINER_DOCKER_DATAS_DIR + - $_4NK_MINER_BACKUPS_DIR:$_4NK_MINER_DOCKER_BACKUPS_DIR + - $_4NK_MINER_SCRIPTS_DIR:$_4NK_MINER_DOCKER_SCRIPTS_DIR networks: btcnet: aliases: - - $4NK_MINER_DOCKER_NAME + - $_4NK_MINER_DOCKER_NAME user: root entrypoint: \> - /bin/sh -c "$4NK_MINER_DOCKER_WORKING_DIR_CREATE" + /bin/sh -c "$_4NK_MINER_DOCKER_WORKING_DIR_CREATE" healthcheck: - test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$4NK_MINER.sh"] + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_MINER.sh"] interval: 30s timeout: 10s retries: 50 @@ -452,31 +452,31 @@ services: retries: 50 restart: unless-stopped" - $4NK_WEB_STATUS_DOCKER_NAME: - image: $4NK_WEB_STATUS_DOCKER_IMAGE - container_name: $4NK_WEB_STATUS_DOCKER_NAME - working_dir: /$4NK_WEB_STATUS_DOCKER_NAME + $_4NK_WEB_STATUS_DOCKER_NAME: + image: $_4NK_WEB_STATUS_DOCKER_IMAGE + container_name: $_4NK_WEB_STATUS_DOCKER_NAME + working_dir: /$_4NK_WEB_STATUS_DOCKER_NAME ports: - - "0.0.0.0:$4NK_WEB_STATUS_EXTERNAL_PORT" - - "0.0.0.0:$4NK_WEB_STATUS_PORT" - - "0.0.0.0:$4NK_WEB_STATUS_PORT2" - - "0.0.0.0:$4NK_WEB_STATUS_PORT3" + - "0.0.0.0:$_4NK_WEB_STATUS_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_WEB_STATUS_PORT" + - "0.0.0.0:$_4NK_WEB_STATUS_PORT2" + - "0.0.0.0:$_4NK_WEB_STATUS_PORT3" volumes: - - $4NK_WEB_STATUS_CONFS_DIR:$4NK_WEB_STATUS_DOCKER_CONFS_DIR - - $4NK_WEB_STATUS_LOGS_DIR:$4NK_WEB_STATUS_DOCKER_LOGS_DIR - - $4NK_WEB_STATUS_RUNS_DIR:$4NK_WEB_STATUS_DOCKER_RUNS_DIR - - $4NK_WEB_STATUS_DATAS_DIR:$4NK_WEB_STATUS_DOCKER_DATAS_DIR - - $4NK_WEB_STATUS_BACKUPS_DIR:$4NK_WEB_STATUS_DOCKER_BACKUPS_DIR - - $4NK_WEB_STATUS_SCRIPTS_DIR:$4NK_WEB_STATUS_DOCKER_SCRIPTS_DIR + - $_4NK_WEB_STATUS_CONFS_DIR:$_4NK_WEB_STATUS_DOCKER_CONFS_DIR + - $_4NK_WEB_STATUS_LOGS_DIR:$_4NK_WEB_STATUS_DOCKER_LOGS_DIR + - $_4NK_WEB_STATUS_RUNS_DIR:$_4NK_WEB_STATUS_DOCKER_RUNS_DIR + - $_4NK_WEB_STATUS_DATAS_DIR:$_4NK_WEB_STATUS_DOCKER_DATAS_DIR + - $_4NK_WEB_STATUS_BACKUPS_DIR:$_4NK_WEB_STATUS_DOCKER_BACKUPS_DIR + - $_4NK_WEB_STATUS_SCRIPTS_DIR:$_4NK_WEB_STATUS_DOCKER_SCRIPTS_DIR networks: btcnet: aliases: - - $4NK_WEB_STATUS_DOCKER_NAME + - $_4NK_WEB_STATUS_DOCKER_NAME user: root entrypoint: \> - /bin/sh -c "$4NK_WEB_STATUS_DOCKER_WORKING_DIR_CREATE" + /bin/sh -c "$_4NK_WEB_STATUS_DOCKER_WORKING_DIR_CREATE" healthcheck: - test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$4NK_WEB_STATUS.sh"] + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_WEB_STATUS.sh"] interval: 30s timeout: 10s retries: 50 @@ -495,11 +495,8 @@ services: networks: btcnet: - name: 4nk_node_btcnet + name: _4NK_node_btcnet driver: bridge ipam: config: - subnet: 172.20.0.0/16 - - - diff --git a/storage/dev/projects/lecoffre/lecoffre-front/.env b/storage/dev/projects/lecoffre/lecoffre-front/.env index fa46357..1c33f18 100644 --- a/storage/dev/projects/lecoffre/lecoffre-front/.env +++ b/storage/dev/projects/lecoffre/lecoffre-front/.env @@ -2,7 +2,7 @@ IDNOT_API_KEY=$IDNOT_API_KEY IDNOT_CLIENT_ID=$IDNOT_CLIENT_ID IDNOT_CLIENT_SECRET=$IDNOT_CLIENT_SECRET IDNOT_ANNUARY_BASE_URL=https://qual-api.notaires.fr/annuaire -IDNOT_REDIRECT_URI=https://lecoffreio.4nkweb.com/authorized-client +IDNOT_REDIRECT_URI=https://lecoffreio._4NKweb.com/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 @@ -19,10 +19,10 @@ NEXT_PUBLIC_BACK_API_HOST=$LECOFFRE_BACK_HOST NEXT_PUBLIC_BACK_API_PORT=443 NEXT_PUBLIC_BACK_API_ROOT_URL=$URL_ROUTE_LECOFFRE_BACK NEXT_PUBLIC_BACK_API_VERSION=v1 -NEXT_PUBLIC_ANK_BASE_REDIRECT_URI=https://lecoffreio.4nkweb.com/authorized-client +NEXT_PUBLIC_ANK_BASE_REDIRECT_URI=https://lecoffreio._4NKweb.com/authorized-client NEXT_PUBLIC_TARGET_ORIGIN=https://$LECOFFRE_BACK_HOST NEXT_PUBLIC_4NK_IFRAME_URL=$IHM_CLIENT_URL -NEXT_PUBLIC_IDNOT_REDIRECT_URI=https://lecoffreio.4nkweb.com/authorized-client +NEXT_PUBLIC_IDNOT_REDIRECT_URI=https://lecoffreio._4NKweb.com/authorized-client NEXT_PUBLIC_DOCAPOSTE_API_URL= NEXT_PUBLIC_API_URL=$LECOFFRE_BACK_URL NEXT_PUBLIC_DEFAULT_VALIDATOR_ID=$NEXT_PUBLIC_DEFAULT_VALIDATOR_ID diff --git a/storage/dev/projects/lecoffre/lecoffre_node/.env b/storage/dev/projects/lecoffre/lecoffre_node/.env index 130941f..314ea33 100644 --- a/storage/dev/projects/lecoffre/lecoffre_node/.env +++ b/storage/dev/projects/lecoffre/lecoffre_node/.env @@ -1,7 +1,7 @@ # Modifiez ces valeurs selon votre environnement API_PASS=testpass ENV_NAME=DEV -DOMAIN=4nkweb.com +DOMAIN=_4NKweb.com HOST=dev4.$DOMAIN DOCKER_LOG_LEVEL=info COMPOSE_LOG_LEVEL=WARNING @@ -10,7 +10,7 @@ NODE_ENV=production DOCKER_GLOBAL=project/lecoffre/lecoffre_node # Répertoires -ROOT_DIR=/home/debian/4NK_env +ROOT_DIR=/home/debian/_4NK_env $DOCKER_GLOBAL/datas=$ROOT_DIR/$DOCKER_GLOBAL/data BITCOIN_DATA_DIR=$$DOCKER_GLOBAL/datas/bitcoin BITCOIN_COOKIE_PATH=$BITCOIN_DATA_DIR/signet/.cookie @@ -138,8 +138,8 @@ STATUS_API_EXTERNAL_PORT=3006 GRAFANA_ADMIN_PASSWORD=Fuy8ZfxQI2xdSdoB8wsGxNjyU # Chemins de configuration -LECOFFRE_NODE_CONFS_DIR=/home/debian/4NK_env/confs -LECOFFRE_NODE_LOGS_DIR=/home/debian/4NK_env/logs +LECOFFRE_NODE_CONFS_DIR=/home/debian/_4NK_env/confs +LECOFFRE_NODE_LOGS_DIR=/home/debian/_4NK_env/logs # Ports supplémentaires BLINDBIT_EXTERNAL_PORT=8000 diff --git a/storage/dev/projects/lecoffre/lecoffre_node/docker-compose.yml b/storage/dev/projects/lecoffre/lecoffre_node/docker-compose.yml index b66ffa2..df1f1b8 100644 --- a/storage/dev/projects/lecoffre/lecoffre_node/docker-compose.yml +++ b/storage/dev/projects/lecoffre/lecoffre_node/docker-compose.yml @@ -4,7 +4,7 @@ services: container_name: tor-proxy working_dir: /tor-proxy volumes: - - /home/debian/4NK_env/DOCKER_GLOBAL_NAME/logs/tor-proxy:/var/log/tor + - /home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/tor-proxy:/var/log/tor - $LECOFFRE_NODE_SCRIPTS_DIR:/scripts:ro networks: btcnet: @@ -27,7 +27,7 @@ services: volumes: - bitcoin_DATA_DIR:/home/bitcoin/.bitcoin - bitcoin_CONF_DIR/bitcoin.conf:/etc/bitcoin/bitcoin.conf - - /home/debian/4NK_env/DOCKER_GLOBAL_NAME/logs/bitcoin:/var/log/bitcoin + - /home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/bitcoin:/var/log/bitcoin - $LECOFFRE_NODE_SCRIPTS_DIR:/scripts:ro networks: btcnet: @@ -46,7 +46,7 @@ services: restart: unless-stopped $BLINDBIT_DOCKER_NAME: - image: git.4nkweb.com/4nk/blindbit-oracle:fixed-source + image: git._4NKweb.com/_4NK/blindbit-oracle:fixed-source container_name: $BLINDBIT_DOCKER_NAME working_dir: /$BLINDBIT_DOCKER_NAME depends_on: @@ -79,7 +79,7 @@ services: restart: unless-stopped sdk_relay: - image: git.4nkweb.com/4nk/sdk_relay:ext + image: git._4NKweb.com/_4NK/sdk_relay:ext container_name: sdk_relay working_dir: /sdk_relay env_file: @@ -89,9 +89,9 @@ services: condition: service_healthy volumes: - sdk_relay_CONF_DIR/.conf:/SDK_RELAY_DOCKER_NAME/.conf:ro - - sdk_relay_DATA_DIR:/SDK_RELAY_DOCKER_NAME/.4nk + - sdk_relay_DATA_DIR:/SDK_RELAY_DOCKER_NAME/._4NK - bitcoin_DATA_DIR:/SDK_RELAY_DOCKER_NAME/.bitcoin - - /home/debian/4NK_env/DOCKER_GLOBAL_NAME/logs/sdk_relay:/var/log/sdk_relay + - /home/debian/_4NK_env/DOCKER_GLOBAL_NAME/logs/sdk_relay:/var/log/sdk_relay ports: - "0.0.0.0:8080:8080" networks: @@ -111,7 +111,7 @@ services: restart: unless-stopped lecoffre-front: - image: git.4nkweb.com/4nk/lecoffre-front:ext + image: git._4NKweb.com/_4NK/lecoffre-front:ext container_name: lecoffre-front working_dir: /lecoffre-front env_file: @@ -142,7 +142,7 @@ services: restart: unless-stopped ihm_client: - image: git.4nkweb.com/4nk/ihm_client:ext + image: git._4NKweb.com/_4NK/ihm_client:ext container_name: ihm_client env_file: - $LECOFFRE_NODE_CONFS_DIR/ihm_client/.env @@ -172,7 +172,7 @@ services: restart: unless-stopped sdk_storage: - image: git.4nkweb.com/4nk/sdk_storage:ext + image: git._4NKweb.com/_4NK/sdk_storage:ext container_name: sdk_storage ports: - "0.0.0.0:sdk_storage_EXTERNAL_PORT:8080" @@ -332,7 +332,7 @@ services: networks: btcnet: - name: 4nk_node_btcnet + name: _4NK_node_btcnet driver: bridge ipam: config: diff --git a/storage/dev/projects/lecoffre/lecoffre_node/docker-compose.yml.auto b/storage/dev/projects/lecoffre/lecoffre_node/docker-compose.yml.auto index a4f02f0..0ffbc69 100644 --- a/storage/dev/projects/lecoffre/lecoffre_node/docker-compose.yml.auto +++ b/storage/dev/projects/lecoffre/lecoffre_node/docker-compose.yml.auto @@ -152,31 +152,31 @@ services: retries: 50 restart: unless-stopped" - $4NK_VAULT_DOCKER_NAME: - image: $4NK_VAULT_DOCKER_IMAGE - container_name: $4NK_VAULT_DOCKER_NAME - working_dir: /$4NK_VAULT_DOCKER_NAME + $_4NK_VAULT_DOCKER_NAME: + image: $_4NK_VAULT_DOCKER_IMAGE + container_name: $_4NK_VAULT_DOCKER_NAME + working_dir: /$_4NK_VAULT_DOCKER_NAME ports: - - "0.0.0.0:$4NK_VAULT_EXTERNAL_PORT" - - "0.0.0.0:$4NK_VAULT_PORT" - - "0.0.0.0:$4NK_VAULT_PORT2" - - "0.0.0.0:$4NK_VAULT_PORT3" + - "0.0.0.0:$_4NK_VAULT_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_VAULT_PORT" + - "0.0.0.0:$_4NK_VAULT_PORT2" + - "0.0.0.0:$_4NK_VAULT_PORT3" volumes: - - $4NK_VAULT_CONFS_DIR:$4NK_VAULT_DOCKER_CONFS_DIR - - $4NK_VAULT_LOGS_DIR:$4NK_VAULT_DOCKER_LOGS_DIR - - $4NK_VAULT_RUNS_DIR:$4NK_VAULT_DOCKER_RUNS_DIR - - $4NK_VAULT_DATAS_DIR:$4NK_VAULT_DOCKER_DATAS_DIR - - $4NK_VAULT_BACKUPS_DIR:$4NK_VAULT_DOCKER_BACKUPS_DIR - - $4NK_VAULT_SCRIPTS_DIR:$4NK_VAULT_DOCKER_SCRIPTS_DIR + - $_4NK_VAULT_CONFS_DIR:$_4NK_VAULT_DOCKER_CONFS_DIR + - $_4NK_VAULT_LOGS_DIR:$_4NK_VAULT_DOCKER_LOGS_DIR + - $_4NK_VAULT_RUNS_DIR:$_4NK_VAULT_DOCKER_RUNS_DIR + - $_4NK_VAULT_DATAS_DIR:$_4NK_VAULT_DOCKER_DATAS_DIR + - $_4NK_VAULT_BACKUPS_DIR:$_4NK_VAULT_DOCKER_BACKUPS_DIR + - $_4NK_VAULT_SCRIPTS_DIR:$_4NK_VAULT_DOCKER_SCRIPTS_DIR networks: btcnet: aliases: - - $4NK_VAULT_DOCKER_NAME + - $_4NK_VAULT_DOCKER_NAME user: root entrypoint: \> - /bin/sh -c "$4NK_VAULT_DOCKER_WORKING_DIR_CREATE" + /bin/sh -c "$_4NK_VAULT_DOCKER_WORKING_DIR_CREATE" healthcheck: - test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$4NK_VAULT.sh"] + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_VAULT.sh"] interval: 30s timeout: 10s retries: 50 @@ -362,61 +362,61 @@ services: retries: 50 restart: unless-stopped" - $4NK_CERTIFICATOR_DOCKER_NAME: - image: $4NK_CERTIFICATOR_DOCKER_IMAGE - container_name: $4NK_CERTIFICATOR_DOCKER_NAME - working_dir: /$4NK_CERTIFICATOR_DOCKER_NAME + $_4NK_CERTIFICATOR_DOCKER_NAME: + image: $_4NK_CERTIFICATOR_DOCKER_IMAGE + container_name: $_4NK_CERTIFICATOR_DOCKER_NAME + working_dir: /$_4NK_CERTIFICATOR_DOCKER_NAME ports: - - "0.0.0.0:$4NK_CERTIFICATOR_EXTERNAL_PORT" - - "0.0.0.0:$4NK_CERTIFICATOR_PORT" - - "0.0.0.0:$4NK_CERTIFICATOR_PORT2" - - "0.0.0.0:$4NK_CERTIFICATOR_PORT3" + - "0.0.0.0:$_4NK_CERTIFICATOR_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_CERTIFICATOR_PORT" + - "0.0.0.0:$_4NK_CERTIFICATOR_PORT2" + - "0.0.0.0:$_4NK_CERTIFICATOR_PORT3" volumes: - - $4NK_CERTIFICATOR_CONFS_DIR:$4NK_CERTIFICATOR_DOCKER_CONFS_DIR - - $4NK_CERTIFICATOR_LOGS_DIR:$4NK_CERTIFICATOR_DOCKER_LOGS_DIR - - $4NK_CERTIFICATOR_RUNS_DIR:$4NK_CERTIFICATOR_DOCKER_RUNS_DIR - - $4NK_CERTIFICATOR_DATAS_DIR:$4NK_CERTIFICATOR_DOCKER_DATAS_DIR - - $4NK_CERTIFICATOR_BACKUPS_DIR:$4NK_CERTIFICATOR_DOCKER_BACKUPS_DIR - - $4NK_CERTIFICATOR_SCRIPTS_DIR:$4NK_CERTIFICATOR_DOCKER_SCRIPTS_DIR + - $_4NK_CERTIFICATOR_CONFS_DIR:$_4NK_CERTIFICATOR_DOCKER_CONFS_DIR + - $_4NK_CERTIFICATOR_LOGS_DIR:$_4NK_CERTIFICATOR_DOCKER_LOGS_DIR + - $_4NK_CERTIFICATOR_RUNS_DIR:$_4NK_CERTIFICATOR_DOCKER_RUNS_DIR + - $_4NK_CERTIFICATOR_DATAS_DIR:$_4NK_CERTIFICATOR_DOCKER_DATAS_DIR + - $_4NK_CERTIFICATOR_BACKUPS_DIR:$_4NK_CERTIFICATOR_DOCKER_BACKUPS_DIR + - $_4NK_CERTIFICATOR_SCRIPTS_DIR:$_4NK_CERTIFICATOR_DOCKER_SCRIPTS_DIR networks: btcnet: aliases: - - $4NK_CERTIFICATOR_DOCKER_NAME + - $_4NK_CERTIFICATOR_DOCKER_NAME user: root entrypoint: \> - /bin/sh -c "$4NK_CERTIFICATOR_DOCKER_WORKING_DIR_CREATE" + /bin/sh -c "$_4NK_CERTIFICATOR_DOCKER_WORKING_DIR_CREATE" healthcheck: - test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$4NK_CERTIFICATOR.sh"] + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_CERTIFICATOR.sh"] interval: 30s timeout: 10s retries: 50 restart: unless-stopped" - $4NK_MINER_DOCKER_NAME: - image: $4NK_MINER_DOCKER_IMAGE - container_name: $4NK_MINER_DOCKER_NAME - working_dir: /$4NK_MINER_DOCKER_NAME + $_4NK_MINER_DOCKER_NAME: + image: $_4NK_MINER_DOCKER_IMAGE + container_name: $_4NK_MINER_DOCKER_NAME + working_dir: /$_4NK_MINER_DOCKER_NAME ports: - - "0.0.0.0:$4NK_MINER_EXTERNAL_PORT" - - "0.0.0.0:$4NK_MINER_PORT" - - "0.0.0.0:$4NK_MINER_PORT2" - - "0.0.0.0:$4NK_MINER_PORT3" + - "0.0.0.0:$_4NK_MINER_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_MINER_PORT" + - "0.0.0.0:$_4NK_MINER_PORT2" + - "0.0.0.0:$_4NK_MINER_PORT3" volumes: - - $4NK_MINER_CONFS_DIR:$4NK_MINER_DOCKER_CONFS_DIR - - $4NK_MINER_LOGS_DIR:$4NK_MINER_DOCKER_LOGS_DIR - - $4NK_MINER_RUNS_DIR:$4NK_MINER_DOCKER_RUNS_DIR - - $4NK_MINER_DATAS_DIR:$4NK_MINER_DOCKER_DATAS_DIR - - $4NK_MINER_BACKUPS_DIR:$4NK_MINER_DOCKER_BACKUPS_DIR - - $4NK_MINER_SCRIPTS_DIR:$4NK_MINER_DOCKER_SCRIPTS_DIR + - $_4NK_MINER_CONFS_DIR:$_4NK_MINER_DOCKER_CONFS_DIR + - $_4NK_MINER_LOGS_DIR:$_4NK_MINER_DOCKER_LOGS_DIR + - $_4NK_MINER_RUNS_DIR:$_4NK_MINER_DOCKER_RUNS_DIR + - $_4NK_MINER_DATAS_DIR:$_4NK_MINER_DOCKER_DATAS_DIR + - $_4NK_MINER_BACKUPS_DIR:$_4NK_MINER_DOCKER_BACKUPS_DIR + - $_4NK_MINER_SCRIPTS_DIR:$_4NK_MINER_DOCKER_SCRIPTS_DIR networks: btcnet: aliases: - - $4NK_MINER_DOCKER_NAME + - $_4NK_MINER_DOCKER_NAME user: root entrypoint: \> - /bin/sh -c "$4NK_MINER_DOCKER_WORKING_DIR_CREATE" + /bin/sh -c "$_4NK_MINER_DOCKER_WORKING_DIR_CREATE" healthcheck: - test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$4NK_MINER.sh"] + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_MINER.sh"] interval: 30s timeout: 10s retries: 50 @@ -452,31 +452,31 @@ services: retries: 50 restart: unless-stopped" - $4NK_WEB_STATUS_DOCKER_NAME: - image: $4NK_WEB_STATUS_DOCKER_IMAGE - container_name: $4NK_WEB_STATUS_DOCKER_NAME - working_dir: /$4NK_WEB_STATUS_DOCKER_NAME + $_4NK_WEB_STATUS_DOCKER_NAME: + image: $_4NK_WEB_STATUS_DOCKER_IMAGE + container_name: $_4NK_WEB_STATUS_DOCKER_NAME + working_dir: /$_4NK_WEB_STATUS_DOCKER_NAME ports: - - "0.0.0.0:$4NK_WEB_STATUS_EXTERNAL_PORT" - - "0.0.0.0:$4NK_WEB_STATUS_PORT" - - "0.0.0.0:$4NK_WEB_STATUS_PORT2" - - "0.0.0.0:$4NK_WEB_STATUS_PORT3" + - "0.0.0.0:$_4NK_WEB_STATUS_EXTERNAL_PORT" + - "0.0.0.0:$_4NK_WEB_STATUS_PORT" + - "0.0.0.0:$_4NK_WEB_STATUS_PORT2" + - "0.0.0.0:$_4NK_WEB_STATUS_PORT3" volumes: - - $4NK_WEB_STATUS_CONFS_DIR:$4NK_WEB_STATUS_DOCKER_CONFS_DIR - - $4NK_WEB_STATUS_LOGS_DIR:$4NK_WEB_STATUS_DOCKER_LOGS_DIR - - $4NK_WEB_STATUS_RUNS_DIR:$4NK_WEB_STATUS_DOCKER_RUNS_DIR - - $4NK_WEB_STATUS_DATAS_DIR:$4NK_WEB_STATUS_DOCKER_DATAS_DIR - - $4NK_WEB_STATUS_BACKUPS_DIR:$4NK_WEB_STATUS_DOCKER_BACKUPS_DIR - - $4NK_WEB_STATUS_SCRIPTS_DIR:$4NK_WEB_STATUS_DOCKER_SCRIPTS_DIR + - $_4NK_WEB_STATUS_CONFS_DIR:$_4NK_WEB_STATUS_DOCKER_CONFS_DIR + - $_4NK_WEB_STATUS_LOGS_DIR:$_4NK_WEB_STATUS_DOCKER_LOGS_DIR + - $_4NK_WEB_STATUS_RUNS_DIR:$_4NK_WEB_STATUS_DOCKER_RUNS_DIR + - $_4NK_WEB_STATUS_DATAS_DIR:$_4NK_WEB_STATUS_DOCKER_DATAS_DIR + - $_4NK_WEB_STATUS_BACKUPS_DIR:$_4NK_WEB_STATUS_DOCKER_BACKUPS_DIR + - $_4NK_WEB_STATUS_SCRIPTS_DIR:$_4NK_WEB_STATUS_DOCKER_SCRIPTS_DIR networks: btcnet: aliases: - - $4NK_WEB_STATUS_DOCKER_NAME + - $_4NK_WEB_STATUS_DOCKER_NAME user: root entrypoint: \> - /bin/sh -c "$4NK_WEB_STATUS_DOCKER_WORKING_DIR_CREATE" + /bin/sh -c "$_4NK_WEB_STATUS_DOCKER_WORKING_DIR_CREATE" healthcheck: - test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$4NK_WEB_STATUS.sh"] + test: ["CMD", "sh", "$LECONFFRE-FRONT_CONFS_DIR/healthcheck_$_4NK_WEB_STATUS.sh"] interval: 30s timeout: 10s retries: 50 @@ -495,7 +495,7 @@ services: networks: btcnet: - name: 4nk_node_btcnet + name: _4NK_node_btcnet driver: bridge ipam: config: diff --git a/storage/dev/supervisor/supervisord.conf b/storage/dev/supervisor/supervisord.conf index fda46a5..08fdd4d 100644 --- a/storage/dev/supervisor/supervisord.conf +++ b/storage/dev/supervisor/supervisord.conf @@ -1,16 +1,16 @@ [supervisord] nodaemon=true user=root -logfile=/home/debian/4NK_env_LOGS/supervisor/supervisord.log -pidfile=/home/debian/4NK_env_RUN/supervisord.pid -childlogdir=/home/debian/4NK_env_LOGS/supervisor +logfile=/home/debian/_4NK_env_LOGS/supervisor/supervisord.log +pidfile=/home/debian/_4NK_env_RUN/supervisord.pid +childlogdir=/home/debian/_4NK_env_LOGS/supervisor [unix_http_server] -file=/home/debian/4NK_env_RUN/supervisor.sock +file=/home/debian/_4NK_env_RUN/supervisor.sock chmod=0700 [supervisorctl] -serverurl=unix:///home/debian/4NK_env_RUN/supervisor.sock +serverurl=unix:///home/debian/_4NK_env_RUN/supervisor.sock [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface @@ -19,8 +19,8 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface command=/usr/sbin/nginx -g "daemon off;" autostart=true autorestart=true -stderr_logfile=/home/debian/4NK_env_LOGS/supervisor/nginx.err.log -stdout_logfile=/home/debian/4NK_env_LOGS/supervisor/nginx.out.log +stderr_logfile=/home/debian/_4NK_env_LOGS/supervisor/nginx.err.log +stdout_logfile=/home/debian/_4NK_env_LOGS/supervisor/nginx.out.log user=root [program:docker-compose] @@ -28,8 +28,8 @@ command=/app/scripts/startup.sh directory=/app autostart=true autorestart=true -stderr_logfile=/home/debian/4NK_env_LOGS/supervisor/docker-compose.err.log -stdout_logfile=/home/debian/4NK_env_LOGS/supervisor/docker-compose.out.log +stderr_logfile=/home/debian/_4NK_env_LOGS/supervisor/docker-compose.err.log +stdout_logfile=/home/debian/_4NK_env_LOGS/supervisor/docker-compose.out.log user=appuser environment=HOME="/app" @@ -37,12 +37,12 @@ environment=HOME="/app" command=/usr/sbin/cron -f autostart=true autorestart=true -stderr_logfile=/home/debian/4NK_env_LOGS/supervisor/cron.err.log -stdout_logfile=/home/debian/4NK_env_LOGS/supervisor/cron.out.log +stderr_logfile=/home/debian/_4NK_env_LOGS/supervisor/cron.err.log +stdout_logfile=/home/debian/_4NK_env_LOGS/supervisor/cron.out.log user=root [program:logrotate] -command=/usr/sbin/logrotate /home/debian/4NK_env_CONFS/logrotate/lecoffre +command=/usr/sbin/logrotate /home/debian/_4NK_env_CONFS/logrotate/lecoffre autostart=true autorestart=false startsecs=0 diff --git a/storage/dev/test_generate.sh b/storage/dev/test_generate.sh new file mode 100755 index 0000000..b009769 --- /dev/null +++ b/storage/dev/test_generate.sh @@ -0,0 +1,207 @@ +#!/bin/bash + +# Script de test pour valider le fonctionnement du script generate.sh +# Teste les différentes options et fonctionnalités + +# Couleurs +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +NC='\033[0m' + +# Compteurs +TESTS_PASSED=0 +TESTS_FAILED=0 +TOTAL_TESTS=0 + +# Fonction pour afficher les résultats +print_result() { + local test_name="$1" + local status="$2" + local message="$3" + + TOTAL_TESTS=$((TOTAL_TESTS + 1)) + + if [ "$status" = "PASS" ]; then + echo -e "${GREEN}✅ PASS${NC}: $test_name - $message" + TESTS_PASSED=$((TESTS_PASSED + 1)) + else + echo -e "${RED}❌ FAIL${NC}: $test_name - $message" + TESTS_FAILED=$((TESTS_FAILED + 1)) + fi +} + +echo -e "${BLUE}🧪 TEST DU SCRIPT GÉNÉRATEUR PRINCIPAL${NC}" +echo -e "${BLUE}======================================${NC}" + +# Test 1: Vérifier l'existence du script +if [ -f "generate.sh" ]; then + print_result "Script existe" "PASS" "generate.sh présent" +else + print_result "Script existe" "FAIL" "generate.sh manquant" + exit 1 +fi + +# Test 2: Vérifier que le script est exécutable +if [ -x "generate.sh" ]; then + print_result "Script exécutable" "PASS" "generate.sh exécutable" +else + print_result "Script exécutable" "FAIL" "generate.sh non exécutable" +fi + +# Test 3: Test de l'aide +echo -e "\n${YELLOW}🔍 Test de l'aide...${NC}" +if ./generate.sh --help >/dev/null 2>&1; then + print_result "Aide fonctionne" "PASS" "Option --help fonctionne" +else + print_result "Aide fonctionne" "FAIL" "Option --help échoue" +fi + +# Test 4: Vérifier les scripts requis +REQUIRED_SCRIPTS=( + "generate_variables.sh" + "generate_grafana_dashboards.sh" + "generate_nginx_configs.sh" +) + +for script in "${REQUIRED_SCRIPTS[@]}"; do + if [ -f "$script" ]; then + print_result "Script requis" "PASS" "$script présent" + else + print_result "Script requis" "FAIL" "$script manquant" + fi +done + +# Test 5: Test avec variables d'environnement minimales +echo -e "\n${YELLOW}🔍 Test avec variables minimales...${NC}" + +# Exporter des variables minimales +export HOST="test.example.com" +export SERVICES=(TEST_SERVICE) +export DOMAIN="test.example.com" +export CERT_PATH="/tmp/certs" +export NGINX_LOGS_DIR="/tmp/logs" +export NGINX_CONFS_DIR="/tmp/conf" +export DOCKER_GLOBAL_NAME="test" + +# Test d'exécution (sans --verbose pour éviter trop de sortie) +echo -e "${YELLOW}Exécution du script generate.sh...${NC}" +if timeout 30 ./generate.sh >/dev/null 2>&1; then + print_result "Exécution script" "PASS" "Script s'exécute sans erreur fatale" +else + exit_code=$? + if [ $exit_code -eq 124 ]; then + print_result "Exécution script" "PASS" "Script s'exécute (timeout après 30s)" + else + print_result "Exécution script" "FAIL" "Script échoue avec code $exit_code" + fi +fi + +# Test 6: Vérifier les fichiers générés +echo -e "\n${YELLOW}🔍 Vérification des fichiers générés...${NC}" + +# Vérifier si des fichiers ont été générés +GENERATED_FILES=( + "_4NK_modules/grafana/dashboards" + "_4NK_modules/promtail/promtail.yml" + "nginx/upstreams.conf" + "nginx/app-internal-ports.conf" + "nginx/proxy_headers.conf" +) + +for file in "${GENERATED_FILES[@]}"; do + if [ -e "$file" ]; then + print_result "Fichier généré" "PASS" "$file créé" + else + print_result "Fichier généré" "FAIL" "$file non créé" + fi +done + +# Test 7: Test des options +echo -e "\n${YELLOW}🔍 Test des options...${NC}" + +# Test exécution normale (mode verbeux par défaut) +if timeout 10 ./generate.sh >/dev/null 2>&1; then + print_result "Exécution normale" "PASS" "Script fonctionne en mode verbeux par défaut" +else + exit_code=$? + if [ $exit_code -eq 124 ]; then + print_result "Exécution normale" "PASS" "Script fonctionne (timeout)" + else + print_result "Exécution normale" "FAIL" "Script échoue" + fi +fi + +# Test option invalide +if ./generate.sh --invalid-option >/dev/null 2>&1; then + print_result "Option invalide" "FAIL" "Option invalide acceptée" +else + print_result "Option invalide" "PASS" "Option invalide rejetée" +fi + +# Test 8: Vérifier la structure des fichiers générés +echo -e "\n${YELLOW}🔍 Vérification du contenu des fichiers...${NC}" + +# Vérifier upstreams.conf +if [ -f "nginx/upstreams.conf" ]; then + if grep -q "upstream" nginx/upstreams.conf; then + print_result "Contenu upstreams" "PASS" "upstreams.conf contient des upstreams" + else + print_result "Contenu upstreams" "FAIL" "upstreams.conf vide ou invalide" + fi + + if grep -q "log_format app_json" nginx/upstreams.conf; then + print_result "Format log JSON" "PASS" "Format de log JSON présent" + else + print_result "Format log JSON" "FAIL" "Format de log JSON manquant" + fi +fi + +# Vérifier proxy_headers.conf +if [ -f "nginx/proxy_headers.conf" ]; then + if grep -q "proxy_set_header Host" nginx/proxy_headers.conf; then + print_result "Headers proxy" "PASS" "Headers de proxy configurés" + else + print_result "Headers proxy" "FAIL" "Headers de proxy manquants" + fi +fi + +# Vérifier les dashboards Grafana +if [ -d "_4NK_modules/grafana/dashboards" ]; then + dashboard_count=$(find _4NK_modules/grafana/dashboards -name "*.json" | wc -l) + if [ $dashboard_count -gt 0 ]; then + print_result "Dashboards Grafana" "PASS" "$dashboard_count dashboards générés" + else + print_result "Dashboards Grafana" "FAIL" "Aucun dashboard généré" + fi +fi + +# Test 9: Nettoyage des fichiers de test +echo -e "\n${YELLOW}🧹 Nettoyage des fichiers de test...${NC}" + +# Supprimer les fichiers générés par les tests +rm -rf nginx/ 2>/dev/null +rm -rf _4NK_modules/ 2>/dev/null +rm -rf logrotade/ 2>/dev/null +rm -f docker-compose.yml.auto 2>/dev/null +rm -f .env.auto 2>/dev/null + +print_result "Nettoyage" "PASS" "Fichiers de test nettoyés" + +# Résumé final +echo -e "\n${BLUE}📊 RÉSUMÉ DES TESTS${NC}" +echo -e "${BLUE}==================${NC}" +echo -e "Total des tests: ${BLUE}$TOTAL_TESTS${NC}" +echo -e "Tests réussis: ${GREEN}$TESTS_PASSED${NC}" +echo -e "Tests échoués: ${RED}$TESTS_FAILED${NC}" + +if [ $TESTS_FAILED -eq 0 ]; then + echo -e "\n${GREEN}🎉 TOUS LES TESTS SONT PASSÉS !${NC}" + echo "Le script generate.sh fonctionne correctement." + exit 0 +else + echo -e "\n${RED}⚠️ CERTAINS TESTS ONT ÉCHOUÉ${NC}" + echo "Vérifiez les erreurs ci-dessus." + exit 1 +fi