diff --git a/sdk-client/README.md b/sdk-client/README.md index 3389614..b062298 100644 --- a/sdk-client/README.md +++ b/sdk-client/README.md @@ -31,8 +31,19 @@ Le SDK peut être configuré automatiquement via un fichier `.env` : VAULT_USER=demo_user_001 VAULT_KEY=JYyybYFXe9hghRI9d1mpoQ1uYYxpt/6lzYPOWrxruG0= VAULT_ENV=dev +VAULT_CONFS_DIR=../confs # Dossier de destination pour les fichiers synchronisés ``` +#### Variables d'environnement disponibles + +| Variable | Description | Requis | Défaut | +|----------|-------------|--------|--------| +| `VAULT_USER` | Identifiant utilisateur pour l'authentification | ✅ | - | +| `VAULT_KEY` | Clé de déchiffrement (gérée automatiquement) | ✅ | - | +| `VAULT_ENV` | Environnement par défaut | ✅ | - | +| `VAULT_CONFS_DIR` | Dossier de destination pour les fichiers synchronisés | ❌ | `../confs` | +| `VAULT_URL` | URL de l'API Vault | ❌ | `https://vault.4nkweb.com:6666` | + ### Configuration manuelle ```typescript @@ -125,9 +136,10 @@ const routes = await client.getRoutes(); console.log(`Routes disponibles: ${routes.total_routes}`); // Synchronisation des fichiers déchiffrés localement avec variables résolues +// Le dossier de destination peut être configuré via VAULT_CONFS_DIR dans .env const syncResult = await client.syncLocalFiles({ environment: 'dev', - localDir: '../confs', + localDir: '../confs', // Optionnel: utilise VAULT_CONFS_DIR par défaut verbose: true }); diff --git a/sdk-client/src/index.ts b/sdk-client/src/index.ts index 79c24f8..7ca523a 100644 --- a/sdk-client/src/index.ts +++ b/sdk-client/src/index.ts @@ -369,9 +369,12 @@ export class SecureVaultClient { * Les fichiers existants dans confs/ sont toujours écrasés pour avoir le contenu le plus récent */ async syncLocalFiles(options: SyncOptions): Promise { + // Récupérer le dossier de destination depuis les variables d'environnement + const defaultConfsDir = process.env['VAULT_CONFS_DIR'] || '../confs'; + const { environment, - localDir = '../confs', + localDir = defaultConfsDir, verbose = false } = options; diff --git a/storage/dev/4NK_certificator/.gitkeep b/storage/dev/4NK_certificator/.gitkeep new file mode 100644 index 0000000..6a04314 --- /dev/null +++ b/storage/dev/4NK_certificator/.gitkeep @@ -0,0 +1 @@ +./ \ No newline at end of file diff --git a/storage/dev/nginx/route_blindbit.conf b/storage/dev/nginx/route_blindbit.conf index 0def95c..d2940ca 100644 --- a/storage/dev/nginx/route_blindbit.conf +++ b/storage/dev/nginx/route_blindbit.conf @@ -1,5 +1,5 @@ location $URL_ROUTE_BLINDBIT/ { - proxy_pass http://localhost:$BLINDBIT_PORT/; + 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; diff --git a/storage/dev/nginx/route_grafana.conf b/storage/dev/nginx/route_grafana.conf index 6e23f38..7883393 100644 --- a/storage/dev/nginx/route_grafana.conf +++ b/storage/dev/nginx/route_grafana.conf @@ -1,5 +1,5 @@ location $URL_ROUTE_GRAFAN/ { - proxy_pass http://localhost:$GRAFANA_PORT/; + proxy_pass http://127.0.0.1:$GRAFANA_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; diff --git a/storage/dev/nginx/route_ihm_client.conf b/storage/dev/nginx/route_ihm_client.conf index 6f54631..a2d8d9e 100644 --- a/storage/dev/nginx/route_ihm_client.conf +++ b/storage/dev/nginx/route_ihm_client.conf @@ -1,5 +1,5 @@ location $URL_ROUTE_IHM_CLIENT { - proxy_pass http://localhost:$IHM_CLIENT_PORT; + proxy_pass http://127.0.0.1:$IHM_CLIENT_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; diff --git a/storage/dev/nginx/route_lecoffre.conf b/storage/dev/nginx/route_lecoffre.conf index b9025d2..6a6140f 100644 --- a/storage/dev/nginx/route_lecoffre.conf +++ b/storage/dev/nginx/route_lecoffre.conf @@ -6,7 +6,7 @@ proxy_hide_header ETag; proxy_hide_header Last-Modified; rewrite ^$URL_ROUTE_LECOFFRE_FRONT/(.*)$ /$1 break; - proxy_pass http://localhost:$LECOFFRE_FRONT_PORT; + proxy_pass http://127.0.0.1:$LECOFFRE_FRONT_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; @@ -14,7 +14,7 @@ proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; - proxy_set_header X-Request-ID $x_request_id; + 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; diff --git a/storage/dev/nginx/route_lecoffre_hmr.conf b/storage/dev/nginx/route_lecoffre_hmr.conf index b1d5c94..9d2e4d9 100644 --- a/storage/dev/nginx/route_lecoffre_hmr.conf +++ b/storage/dev/nginx/route_lecoffre_hmr.conf @@ -7,5 +7,5 @@ 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://localhost:$LECOFFRE_FRONT_PORT; + proxy_pass http://127.0.0.1:$LECOFFRE_FRONT_PORT; } diff --git a/storage/dev/nginx/route_loki.conf b/storage/dev/nginx/route_loki.conf index f834c43..fd8883b 100644 --- a/storage/dev/nginx/route_loki.conf +++ b/storage/dev/nginx/route_loki.conf @@ -1,5 +1,5 @@ location /loki/ { - proxy_pass http://localhost:$LOKI_PORT/; + proxy_pass http://127.0.0.1:$LOKI_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; diff --git a/storage/dev/nginx/route_next_assets.conf b/storage/dev/nginx/route_next_assets.conf index 38e91da..bf4e66a 100644 --- a/storage/dev/nginx/route_next_assets.conf +++ b/storage/dev/nginx/route_next_assets.conf @@ -1,5 +1,5 @@ location ^~ $URL_ROUTE_NEXT/ { - proxy_pass http://localhost:$LECOFFRE_FRONT_PORT$URL_ROUTE_NEXT/; + proxy_pass http://127.0.0.1:$LECOFFRE_FRONT_PORT$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; diff --git a/storage/dev/nginx/route_status.conf b/storage/dev/nginx/route_status.conf index 30773ad..890fbe3 100644 --- a/storage/dev/nginx/route_status.conf +++ b/storage/dev/nginx/route_status.conf @@ -1,5 +1,5 @@ location $URL_ROUTE_STATUS_API/ { - proxy_pass http://localhost:$STATUS_API_PORT; + 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; diff --git a/storage/dev/nginx/route_status_api.conf b/storage/dev/nginx/route_status_api.conf index 1e41b34..48ff5d1 100644 --- a/storage/dev/nginx/route_status_api.conf +++ b/storage/dev/nginx/route_status_api.conf @@ -1,5 +1,5 @@ location $URL_ROUTE_STATUS { - proxy_pass http://localhost:3006/api; + 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; diff --git a/storage/dev/nginx/route_ws.conf b/storage/dev/nginx/route_ws.conf index 9b0e6ec..c34b02f 100644 --- a/storage/dev/nginx/route_ws.conf +++ b/storage/dev/nginx/route_ws.conf @@ -1,5 +1,5 @@ location /ws/ { - proxy_pass http://localhost:$SIGNER_PORT/; + 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; diff --git a/storage/dev/redis/.gitkeep b/storage/dev/redis/.gitkeep new file mode 100644 index 0000000..6a04314 --- /dev/null +++ b/storage/dev/redis/.gitkeep @@ -0,0 +1 @@ +./ \ No newline at end of file