From 775fd78b3625dc690c05f24d33ea2b9085168936 Mon Sep 17 00:00:00 2001 From: 4NK Dev Date: Wed, 1 Oct 2025 22:22:17 +0000 Subject: [PATCH] docs+ops: vault sync workflow; deploy-all with live progress and URL checks; prompt updates --- .gitignore | 87 +-- sdk-client/.env | 5 + storage/dev/.env secrets.example | 20 + storage/dev/4NK_certificator/.env | 20 + .../dev/4NK_certificator/certificator.toml | 33 + storage/dev/4NK_miner/.env | 5 + storage/dev/bitcoin/bitcoin.conf | 45 ++ storage/dev/blindbit-oracle/blindbit.toml | 18 + storage/dev/git/.env | 4 + storage/dev/grafana/.env | 6 + .../dashboards/bitcoin-miner-detailed.json | 399 ++++++++++++ .../dev/grafana/dashboards/bitcoin-miner.json | 160 +++++ .../grafana/dashboards/bitcoin-services.json | 532 ++++++++++++++++ .../grafana/dashboards/blindbit-oracle.json | 192 ++++++ .../grafana/dashboards/frontend-services.json | 532 ++++++++++++++++ .../grafana/dashboards/lecoffre-overview.json | 252 ++++++++ .../dev/grafana/dashboards/sdk-services.json | 594 ++++++++++++++++++ .../grafana/dashboards/services-overview.json | 418 ++++++++++++ storage/dev/grafana/grafana.ini | 57 ++ storage/dev/ihm_client/.env | 7 + storage/dev/lecoffre-front/.env | 29 + storage/dev/logrotade/bitcoin.conf | 13 + storage/dev/logrotade/blindbit.conf | 13 + storage/dev/logrotade/ihm_client.conf | 13 + storage/dev/logrotade/lecoffre-front.conf | 13 + storage/dev/logrotade/miner.conf | 13 + storage/dev/logrotade/nginx.conf | 13 + storage/dev/logrotade/sdk_relay.conf | 13 + storage/dev/logrotade/sdk_storage.conf | 13 + storage/dev/logrotade/tor.conf | 13 + storage/dev/loki/.env | 1 + storage/dev/loki/loki-config.yaml | 76 +++ storage/dev/monitoring/.env | 4 + storage/dev/monitoring/monitoring.conf | 30 + storage/dev/promtail/.env | 1 + storage/dev/promtail/promtail.yml | 107 ++++ storage/dev/sdk_relay/.conf | 16 + storage/dev/sdk_relay/.env | 13 + storage/dev/sdk_storage/.env | 10 + storage/dev/supervisor/supervisord.conf | 50 ++ 40 files changed, 3764 insertions(+), 76 deletions(-) create mode 100644 sdk-client/.env create mode 100644 storage/dev/.env secrets.example create mode 100644 storage/dev/4NK_certificator/.env create mode 100644 storage/dev/4NK_certificator/certificator.toml create mode 100644 storage/dev/4NK_miner/.env create mode 100644 storage/dev/bitcoin/bitcoin.conf create mode 100644 storage/dev/blindbit-oracle/blindbit.toml create mode 100644 storage/dev/git/.env create mode 100644 storage/dev/grafana/.env create mode 100644 storage/dev/grafana/dashboards/bitcoin-miner-detailed.json create mode 100644 storage/dev/grafana/dashboards/bitcoin-miner.json create mode 100644 storage/dev/grafana/dashboards/bitcoin-services.json create mode 100644 storage/dev/grafana/dashboards/blindbit-oracle.json create mode 100644 storage/dev/grafana/dashboards/frontend-services.json create mode 100644 storage/dev/grafana/dashboards/lecoffre-overview.json create mode 100644 storage/dev/grafana/dashboards/sdk-services.json create mode 100644 storage/dev/grafana/dashboards/services-overview.json create mode 100644 storage/dev/grafana/grafana.ini create mode 100644 storage/dev/ihm_client/.env create mode 100644 storage/dev/lecoffre-front/.env create mode 100644 storage/dev/logrotade/bitcoin.conf create mode 100644 storage/dev/logrotade/blindbit.conf create mode 100644 storage/dev/logrotade/ihm_client.conf create mode 100644 storage/dev/logrotade/lecoffre-front.conf create mode 100644 storage/dev/logrotade/miner.conf create mode 100644 storage/dev/logrotade/nginx.conf create mode 100644 storage/dev/logrotade/sdk_relay.conf create mode 100644 storage/dev/logrotade/sdk_storage.conf create mode 100644 storage/dev/logrotade/tor.conf create mode 100644 storage/dev/loki/.env create mode 100644 storage/dev/loki/loki-config.yaml create mode 100644 storage/dev/monitoring/.env create mode 100644 storage/dev/monitoring/monitoring.conf create mode 100644 storage/dev/promtail/.env create mode 100644 storage/dev/promtail/promtail.yml create mode 100644 storage/dev/sdk_relay/.conf create mode 100644 storage/dev/sdk_relay/.env create mode 100644 storage/dev/sdk_storage/.env create mode 100644 storage/dev/supervisor/supervisord.conf diff --git a/.gitignore b/.gitignore index a14ac3d..0a61bfd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,82 +1,17 @@ -# 4NK Environment - Git Ignore -# ============================ -confs/ -# Dossiers de sauvegarde des scripts -**/backup/ -**/*backup* +# PROTECTION COMPLÈTE - Empêcher l'accès Docker à storage/ +**/__pycache__/ +**/dist/ +**/node_modules/ +**/package-lock.json* +**/yarn.lock* -**/.cargo/ +# Variables d'environnement (protection renforcée) -# Fichiers temporaires -**/*.tmp* -**/*.temp* -**/*.log* -**/*.pid* - -# Fichiers de configuration locale -**/*.env* -**/*.conf* -**/*.yaml* -**/*.yml* -**/*.ini* -**/*.json* -**/*.toml* -**/*.lock* - -# Données et logs -**/*.logs* -**/*.data -*.db -*.sqlite - -# Certificats et clés -**/*.key -**/*.pem -**/*.crt -**/*.p12 -**/*.pfx -ssl/ -certs/ - -# Docker -**/*.docker* - -# Cache et build -**/*.node_modules/ -**/*.dist/ -**/*build/ -**/*target/ -**/*.*.o -**/*.so -**/*.dylib - -# IDE et éditeurs -**/*.vscode/ -**/*.idea/ -**/*.swp -**/*.swo -**/*~ - -# OS -**/*.DS_Store -**/*Thumbs.db -**/*tmp* - -# Git -**/*.git/ -**/*.orig* - -# Backup des projets existants -**/*backup* +**/.crt* +**/.key* +**/.pem* # Clés utilisateur et données sensibles **/_keys/ **/keys.json* - -**/*wallet* -**/*keys* - -**/*node_modules* -**/*cursor* -**/*pid* -**/*next* +storage/dev/.env.secrets diff --git a/sdk-client/.env b/sdk-client/.env new file mode 100644 index 0000000..6c9ef86 --- /dev/null +++ b/sdk-client/.env @@ -0,0 +1,5 @@ +VAULT_USER=demo_user_001 +VAULT_KEY="JYyybYFXe9hghRI9d1mpoQ1uYYxpt/6lzYPOWrxruG0=" +VAULT_ENV=dev +VAULT_CONFS_DIR=../confs2 +VAULT_URL=https://vault.4nkweb.com:6666 \ No newline at end of file diff --git a/storage/dev/.env secrets.example b/storage/dev/.env secrets.example new file mode 100644 index 0000000..594c1d0 --- /dev/null +++ b/storage/dev/.env secrets.example @@ -0,0 +1,20 @@ +BDD_USER=*** +BDD_PASSWORD=bdd_password +POSTGRESQL_USER=$BDD_USER +POSTGRESQL_PASSWORD=$BDD_PASSWORD +REDIS_USER=$BDD_USER +REDIS_PASSWORD=$BDD_PASSWORD +SIGNER_API_KEY=*** +BITCOIN_RPC_AUTH=***:*** +VITE_JWT_SECRET_KEY=*** +GRAFANA_ADMIN_USER=*** +GRAFANA_ADMIN_PASSWORD=*** +BITCOIN_RPC_USER=*** +BITCOIN_RPC_PASSWORD=*** +GIT_TOKEN=*** +IDNOT_API_KEY=*** +IDNOT_CLIENT_ID=*** +IDNOT_CLIENT_SECRET=*** +NEXT_PUBLIC_IDNOT_CLIENT_ID=*** +NEXT_PUBLIC_DEFAULT_VALIDATOR_ID=*** +GF_SECURITY_ADMIN_PASSWORD=*** \ No newline at end of file diff --git a/storage/dev/4NK_certificator/.env b/storage/dev/4NK_certificator/.env new file mode 100644 index 0000000..47bd154 --- /dev/null +++ b/storage/dev/4NK_certificator/.env @@ -0,0 +1,20 @@ +# 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=$RELAY_WEBSOCKET_URL + +# Certificator DB password for docker-compose +CERTIFICATOR_DB_PASSWORD=$BDD_PASSWORD diff --git a/storage/dev/4NK_certificator/certificator.toml b/storage/dev/4NK_certificator/certificator.toml new file mode 100644 index 0000000..b0d9962 --- /dev/null +++ b/storage/dev/4NK_certificator/certificator.toml @@ -0,0 +1,33 @@ +[server] +host = "0.0.0.0" +port = $CERTIFICATOR_PORT +log_level = "info" + +[bitcoin] +network = "mainnet" +rpc_url = "$BITCOIN_RPC_URL" +rpc_user = "" +rpc_password = "" +wallet_name = "$BITCOIN_CERTIFICATOR_NAME" +min_confirmations = 6 + +[relay] +websocket_url = "$RELAY_WEBSOCKET_URL" +monitor_interval_secs = 60 + +[anchoring] +interval_blocks = 4320 # ~30 days (144 blocks/day) +auto_anchor = true +tx_fee_sat_per_vbyte = 10 + +[database] +url = "postgresql://certificator:password@localhost/certificator_db" +max_connections = 10 + +[redis] +url = "redis://localhost:6379" +cache_ttl_secs = 3600 + +[api] +jwt_secret = "$VITE_JWT_SECRET_KEY" +cors_allowed_origins = ["$DOMAIN"] diff --git a/storage/dev/4NK_miner/.env b/storage/dev/4NK_miner/.env new file mode 100644 index 0000000..d834550 --- /dev/null +++ b/storage/dev/4NK_miner/.env @@ -0,0 +1,5 @@ +# Configuration du miner signet +# COINBASE_ADDRESS= # Générer automatiquement +RELAY_ADDRESS=tsp1qqd8k3twmuq3awxjmfukhma36j4la8gzsa8t0dgfms3cfglt2gkz6wqsqpd3d2q4quq59agtyfsr7gj9t07qt0nlrlrzgmhvpn5enfm76fud6sm0y +REWARD_SPLIT_RATIO=0.5 + diff --git a/storage/dev/bitcoin/bitcoin.conf b/storage/dev/bitcoin/bitcoin.conf new file mode 100644 index 0000000..4a2fa6e --- /dev/null +++ b/storage/dev/bitcoin/bitcoin.conf @@ -0,0 +1,45 @@ +# Configuration globale +signet=1 +server=1 +datadir=$BITCOIN_DATA_DIR + +[signet] +daemon=0 +txindex=1 +upnp=1 +#debug=1 +#loglevel=debug +logthreadnames=1 +onion=tor:$TOR_PORT +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_WALLET_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/blindbit-oracle/blindbit.toml b/storage/dev/blindbit-oracle/blindbit.toml new file mode 100644 index 0000000..d119478 --- /dev/null +++ b/storage/dev/blindbit-oracle/blindbit.toml @@ -0,0 +1,18 @@ +# Configuration Blindbit Oracle +host = "0.0.0.0:$BLINDBIT_PORT" +chain = "signet" +rpc_endpoint = "$BITCOIN_RPC_URL" +cookie_path = "$BITCOIN_COOKIE_PATH" +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/git/.env b/storage/dev/git/.env new file mode 100644 index 0000000..cb2dbb1 --- /dev/null +++ b/storage/dev/git/.env @@ -0,0 +1,4 @@ +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/grafana/.env b/storage/dev/grafana/.env new file mode 100644 index 0000000..e62242c --- /dev/null +++ b/storage/dev/grafana/.env @@ -0,0 +1,6 @@ +GF_SECURITY_ADMIN_PASSWORD=Fuy8ZfxQI2xdSdoB8wsGxNjyU +GF_USERS_ALLOW_SIGN_UP=false +GF_SERVER_ROOT_URL=$ROOT_URL$URL_ROUTE_GRAFAN +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/grafana/dashboards/bitcoin-miner-detailed.json b/storage/dev/grafana/dashboards/bitcoin-miner-detailed.json new file mode 100644 index 0000000..c8469f9 --- /dev/null +++ b/storage/dev/grafana/dashboards/bitcoin-miner-detailed.json @@ -0,0 +1,399 @@ +{ + "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/grafana/dashboards/bitcoin-miner.json b/storage/dev/grafana/dashboards/bitcoin-miner.json new file mode 100644 index 0000000..ed0bd13 --- /dev/null +++ b/storage/dev/grafana/dashboards/bitcoin-miner.json @@ -0,0 +1,160 @@ +{ + "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/grafana/dashboards/bitcoin-services.json b/storage/dev/grafana/dashboards/bitcoin-services.json new file mode 100644 index 0000000..2abf2d2 --- /dev/null +++ b/storage/dev/grafana/dashboards/bitcoin-services.json @@ -0,0 +1,532 @@ +{ + "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/grafana/dashboards/blindbit-oracle.json b/storage/dev/grafana/dashboards/blindbit-oracle.json new file mode 100644 index 0000000..9d0a0fa --- /dev/null +++ b/storage/dev/grafana/dashboards/blindbit-oracle.json @@ -0,0 +1,192 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": "-- Grafana --", + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "gnetId": null, + "graphTooltip": 0, + "id": null, + "links": [], + "panels": [ + { + "datasource": "Loki", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "showLabels": false, + "showTime": false, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "targets": [ + { + "expr": "{job=\"blindbit\"} |= \"Host configuration loaded\"", + "refId": "A" + } + ], + "title": "BlindBit Oracle - Configuration Loaded", + "type": "logs" + }, + { + "datasource": "Loki", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 2, + "options": { + "showLabels": false, + "showTime": false, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "targets": [ + { + "expr": "{job=\"blindbit\"} |= \"Sync took\"", + "refId": "A" + } + ], + "title": "BlindBit Oracle - Synchronization", + "type": "logs" + }, + { + "datasource": "Loki", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "showLabels": false, + "showTime": false, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "targets": [ + { + "expr": "{job=\"blindbit\"} |= \"successfully processed block\"", + "refId": "A" + } + ], + "title": "BlindBit Oracle - Block Processing", + "type": "logs" + }, + { + "datasource": "Loki", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 16 + }, + "id": 4, + "options": { + "showLabels": false, + "showTime": false, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "targets": [ + { + "expr": "{job=\"blindbit\"} |= \"GET\" |~ \"/tweaks/\"", + "refId": "A" + } + ], + "title": "BlindBit Oracle - API Requests", + "type": "logs" + }, + { + "datasource": "Loki", + "fieldConfig": { + "defaults": { + "custom": {} + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 16 + }, + "id": 5, + "options": { + "showLabels": false, + "showTime": false, + "sortOrder": "Descending", + "wrapLogMessage": false + }, + "targets": [ + { + "expr": "{job=\"blindbit\"} |~ \"ERROR|error|Error\"", + "refId": "A" + } + ], + "title": "BlindBit Oracle - Errors", + "type": "logs" + } + ], + "schemaVersion": 27, + "style": "dark", + "tags": [ + "blindbit", + "oracle", + "blockchain" + ], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "BlindBit Oracle Dashboard", + "uid": "blindbit-oracle", + "version": 1 +} + diff --git a/storage/dev/grafana/dashboards/frontend-services.json b/storage/dev/grafana/dashboards/frontend-services.json new file mode 100644 index 0000000..262feb0 --- /dev/null +++ b/storage/dev/grafana/dashboards/frontend-services.json @@ -0,0 +1,532 @@ +{ + "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/grafana/dashboards/lecoffre-overview.json b/storage/dev/grafana/dashboards/lecoffre-overview.json new file mode 100644 index 0000000..9ecf781 --- /dev/null +++ b/storage/dev/grafana/dashboards/lecoffre-overview.json @@ -0,0 +1,252 @@ +{ + "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/grafana/dashboards/sdk-services.json b/storage/dev/grafana/dashboards/sdk-services.json new file mode 100644 index 0000000..112fa6a --- /dev/null +++ b/storage/dev/grafana/dashboards/sdk-services.json @@ -0,0 +1,594 @@ +{ + "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/grafana/dashboards/services-overview.json b/storage/dev/grafana/dashboards/services-overview.json new file mode 100644 index 0000000..b27238f --- /dev/null +++ b/storage/dev/grafana/dashboards/services-overview.json @@ -0,0 +1,418 @@ +{ + "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": 6, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom" + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "title": "LeCoffre Backend - Volume Logs", + "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": 6, + "x": 6, + "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=\"lecoffre-front\"} [5m]))", + "queryType": "", + "refId": "A" + } + ], + "title": "LeCoffre Frontend - Volume Logs", + "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": 6, + "x": 12, + "y": 0 + }, + "id": 3, + "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=\"ihm_client\"} [5m]))", + "queryType": "", + "refId": "A" + } + ], + "title": "IHM Client - Volume Logs", + "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": 6, + "x": 18, + "y": 0 + }, + "id": 4, + "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=\"sdk_relay\"} [5m]))", + "queryType": "", + "refId": "A" + } + ], + "title": "SDK Relay - Volume Logs", + "type": "timeseries" + }, + { + "datasource": { + "type": "loki", + "uid": "loki" + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 5, + "options": { + "showTime": false, + "showLabels": false, + "showCommonLabels": false, + "wrapLogMessage": false, + "prettifyLogMessage": false, + "enableLogDetails": true, + "dedupStrategy": "none", + "sortOrder": "Descending" + }, + "title": "Logs d'Erreur - Services Applications", + "type": "logs" + } + ], + "refresh": "30s", + "schemaVersion": 36, + "style": "dark", + "tags": ["services", "applications"], + "templating": { + "list": [] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Services Applications - Monitoring", + "uid": "services-overview", + "version": 1, + "weekStart": "" +} diff --git a/storage/dev/grafana/grafana.ini b/storage/dev/grafana/grafana.ini new file mode 100644 index 0000000..a3c3e02 --- /dev/null +++ b/storage/dev/grafana/grafana.ini @@ -0,0 +1,57 @@ +# 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 = lecoffre_grafana_secret_key_2025 + +# 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/ihm_client/.env b/storage/dev/ihm_client/.env new file mode 100644 index 0000000..7fe28d5 --- /dev/null +++ b/storage/dev/ihm_client/.env @@ -0,0 +1,7 @@ +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=$RELAY_URL +VITE_SIGNER_URL=$SIGNER_URL +VITE_BOOTSTRAPURL=$RELAY_BOOSTRAP_URL +RELAY_URLS=$RELAY_URLS diff --git a/storage/dev/lecoffre-front/.env b/storage/dev/lecoffre-front/.env new file mode 100644 index 0000000..2ee7763 --- /dev/null +++ b/storage/dev/lecoffre-front/.env @@ -0,0 +1,29 @@ +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_TOKEN_URL=https://qual-connexion.idnot.fr/user/IdPOAuth2/token/idnot_idp_v1 +IDNOT_API_BASE_URL=https://qual-api.notaires.fr + +SIGNER_API_KEY=$SIGNER_API_KEY +VITE_JWT_SECRET_KEY=$VITE_JWT_SECRET_KEY + +NEXT_PUBLIC_IDNOT_CLIENT_ID=$NEXT_PUBLIC_IDNOT_CLIENT_ID +NEXT_PUBLIC_4NK_URL=$IHM_CLIENT_URL +NEXT_PUBLIC_FRONT_APP_HOST=$LECOFFRE_FRONT_URL +NEXT_PUBLIC_IDNOT_BASE_URL=https://qual-connexion.idnot.fr +NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT=/IdPOAuth2/authorize/idnot_idp_v1 +NEXT_PUBLIC_BACK_API_PROTOCOL=https +NEXT_PUBLIC_BACK_API_HOST=$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_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_DOCAPOSTE_API_URL= +NEXT_PUBLIC_API_URL=$LECOFFRE_BACK_URL +NEXT_PUBLIC_DEFAULT_VALIDATOR_ID=$NEXT_PUBLIC_DEFAULT_VALIDATOR_ID +NEXT_PUBLIC_DEFAULT_STORAGE_URLS=$STORAGE_URL \ No newline at end of file diff --git a/storage/dev/logrotade/bitcoin.conf b/storage/dev/logrotade/bitcoin.conf new file mode 100644 index 0000000..cf09ecd --- /dev/null +++ b/storage/dev/logrotade/bitcoin.conf @@ -0,0 +1,13 @@ +$BITCOIN_LOGS_DIR/*.log { + daily + missingok + rotate 7 + compress + delaycompress + notifempty + create 644 root root + postrotate + # Redémarrer le service si nécessaire + docker restart bitcoin 2>/dev/null || true + endscript +} diff --git a/storage/dev/logrotade/blindbit.conf b/storage/dev/logrotade/blindbit.conf new file mode 100644 index 0000000..afd72c0 --- /dev/null +++ b/storage/dev/logrotade/blindbit.conf @@ -0,0 +1,13 @@ +$BLINDBIT_LOGS_DIR/*.log { + daily + missingok + rotate 7 + compress + delaycompress + notifempty + create 644 root root + postrotate + # Redémarrer le service si nécessaire + docker restart blindbit 2>/dev/null || true + endscript +} diff --git a/storage/dev/logrotade/ihm_client.conf b/storage/dev/logrotade/ihm_client.conf new file mode 100644 index 0000000..9b9d342 --- /dev/null +++ b/storage/dev/logrotade/ihm_client.conf @@ -0,0 +1,13 @@ +$IHM_CLIENT_LOGS_DIR/*.log { + daily + missingok + rotate 7 + compress + delaycompress + notifempty + create 644 root root + postrotate + # Redémarrer le service si nécessaire + docker restart ihm_client 2>/dev/null || true + endscript +} diff --git a/storage/dev/logrotade/lecoffre-front.conf b/storage/dev/logrotade/lecoffre-front.conf new file mode 100644 index 0000000..9ce4f8b --- /dev/null +++ b/storage/dev/logrotade/lecoffre-front.conf @@ -0,0 +1,13 @@ +$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 new file mode 100644 index 0000000..a9cbd4a --- /dev/null +++ b/storage/dev/logrotade/miner.conf @@ -0,0 +1,13 @@ +$ROOT_DIR_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 new file mode 100644 index 0000000..6eb9f3e --- /dev/null +++ b/storage/dev/logrotade/nginx.conf @@ -0,0 +1,13 @@ +$NGINX_LOGS_DIR/*.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/sdk_relay.conf b/storage/dev/logrotade/sdk_relay.conf new file mode 100644 index 0000000..cb70cec --- /dev/null +++ b/storage/dev/logrotade/sdk_relay.conf @@ -0,0 +1,13 @@ +$SDK_RELAY_LOGS_DIR/*.log { + daily + missingok + rotate 7 + compress + delaycompress + notifempty + create 644 root root + postrotate + # Redémarrer le service si nécessaire + docker restart sdk_relay 2>/dev/null || true + endscript +} diff --git a/storage/dev/logrotade/sdk_storage.conf b/storage/dev/logrotade/sdk_storage.conf new file mode 100644 index 0000000..b7682ad --- /dev/null +++ b/storage/dev/logrotade/sdk_storage.conf @@ -0,0 +1,13 @@ +$SDK_STORAGE_LOGS_DIR/*.log { + daily + missingok + rotate 7 + compress + delaycompress + notifempty + create 644 root root + postrotate + # Redémarrer le service si nécessaire + docker restart sdk_storage 2>/dev/null || true + endscript +} diff --git a/storage/dev/logrotade/tor.conf b/storage/dev/logrotade/tor.conf new file mode 100644 index 0000000..6c975dc --- /dev/null +++ b/storage/dev/logrotade/tor.conf @@ -0,0 +1,13 @@ +$TOR_LOGS_DIR/*.log { + daily + missingok + rotate 7 + compress + delaycompress + notifempty + create 644 root root + postrotate + # Redémarrer le service si nécessaire + docker restart tor 2>/dev/null || true + endscript +} diff --git a/storage/dev/loki/.env b/storage/dev/loki/.env new file mode 100644 index 0000000..53be051 --- /dev/null +++ b/storage/dev/loki/.env @@ -0,0 +1 @@ +LOKI_URL=$LOKI_URL diff --git a/storage/dev/loki/loki-config.yaml b/storage/dev/loki/loki-config.yaml new file mode 100644 index 0000000..d4eece1 --- /dev/null +++ b/storage/dev/loki/loki-config.yaml @@ -0,0 +1,76 @@ +auth_enabled: false + +server: + http_listen_port: $LOKI_PORT + grpc_listen_port: 9096 + 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: http://localhost:$LOKI_PORT + +# 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/monitoring/.env b/storage/dev/monitoring/.env new file mode 100644 index 0000000..cc7ac91 --- /dev/null +++ b/storage/dev/monitoring/.env @@ -0,0 +1,4 @@ +STATUS_API_PORT=$STATUS_API_PORT +GF_SECURITY_ADMIN_PASSWORD=$GF_SECURITY_ADMIN_PASSWORD +LOKI_URL=$LOKI_URL +DOMAIN=$HOST diff --git a/storage/dev/monitoring/monitoring.conf b/storage/dev/monitoring/monitoring.conf new file mode 100644 index 0000000..e1db69a --- /dev/null +++ b/storage/dev/monitoring/monitoring.conf @@ -0,0 +1,30 @@ +# Configuration centralisée du monitoring LeCoffre Node +# Généré automatiquement le $(date) + +[monitoring] +# Services de monitoring +grafana_port=$GRAFANA_PORT +loki_port=$LOKI_PORT +promtail_enabled=true + +[grafana] +admin_user=$GRAFANA_ADMIN_USER +admin_password=$GRAFANA_ADMIN_PASSWORD +root_url=$GRAFANA_URL +dashboard_home=lecoffre-overview + +[logs] +# Configuration des logs +log_retention_days=30 +log_rotation=daily +log_compression=true + +[services] +# Services surveillés +services=bitcoin,blindbit,sdk_relay,,sdk_storagelecoffre-front,ihm_client,tor,miner + +[alerts] +# Configuration des alertes +error_threshold=10 +warning_threshold=5 +alert_email= diff --git a/storage/dev/promtail/.env b/storage/dev/promtail/.env new file mode 100644 index 0000000..997aa2f --- /dev/null +++ b/storage/dev/promtail/.env @@ -0,0 +1 @@ +PROMTAIL_CONFIG_FILE=$PROMTAIL_CONF_DIR/config.yml diff --git a/storage/dev/promtail/promtail.yml b/storage/dev/promtail/promtail.yml new file mode 100644 index 0000000..40d27ea --- /dev/null +++ b/storage/dev/promtail/promtail.yml @@ -0,0 +1,107 @@ +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: + # Bitcoin Signet Logs + - job_name: bitcoin + static_configs: + - targets: + - localhost + labels: + job: bitcoin + service: bitcoin-signet + __path__: $BITCOIN_LOGS_DIR/*.log + + # Blindbit Oracle Logs + - job_name: blindbit + static_configs: + - targets: + - localhost + labels: + job: blindbit + service: blindbit-oracle + __path__: $BLINDBIT_LOGS_DIR/*.log + + # SDK Relay Logs + - job_name: sdk_relay + static_configs: + - targets: + - localhost + labels: + job: sdk_relay + service: sdk_relay + __path__: $SDK_RELAY_LOGS_DIR/*.log + + # SDK Storage Logs + - job_name: sdk_storage + static_configs: + - targets: + - localhost + labels: + job: sdk_storage + service: sdk_storage + __path__: $SDK_STORAGE_LOGS_DIR/*.log + + # LeCoffre Frontend Logs + - job_name: lecoffre-front + static_configs: + - targets: + - localhost + labels: + job: lecoffre-front + service: lecoffre-front + __path__: $LECOFFRE_FRONT_LOGS_DIR/*.log + + # IHM Client Logs + - job_name: ihm_client + static_configs: + - targets: + - localhost + labels: + job: ihm_client + service: ihm_client + __path__: $IHM_CLIENT_LOGS_DIR/*.log + + # Miner Logs + - job_name: miner + static_configs: + - targets: + - localhost + labels: + job: miner + service: signet_miner + __path__: $MINER_LOGS_DIR/*.log + + # Tor Logs + - job_name: tor + static_configs: + - targets: + - localhost + labels: + job: tor + service: tor-proxy + __path__: $TOR_LOGS_DIR/*.log + + # 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' diff --git a/storage/dev/sdk_relay/.conf b/storage/dev/sdk_relay/.conf new file mode 100644 index 0000000..99417d0 --- /dev/null +++ b/storage/dev/sdk_relay/.conf @@ -0,0 +1,16 @@ +core_url="$BITCOIN_RPC_URL" +ws_url="$RELAY_URL" +wallet_name="default" +network="signet" +blindbit_url="$BLINDBIT_URL" +zmq_url=$ZMQ_URL +storage=$STORAGE_URL +data_dir=$SDK_RELAY_DATA_DIR +bitcoin_data_dir=$SDK_RELAY_DATA_DIR +bootstrap_url=$RELAY_BOOSTRAP_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/sdk_relay/.env b/storage/dev/sdk_relay/.env new file mode 100644 index 0000000..6f88f73 --- /dev/null +++ b/storage/dev/sdk_relay/.env @@ -0,0 +1,13 @@ +SDK_RELAY_WS_URL=$RELAY_URL +SDK_RELAY_WALLET_NAME=$BITCOIN_WALLET_NAME +SDK_RELAY_NETWORK=signet +SDK_RELAY_BLINDBIT_URL=$BLINDBIT_URL +SDK_RELAY_STORAGE=$STORAGE_URL +SDK_RELAY_DATA_DIR=$SDK_RELAY_DATA_DIR +SDK_RELAY_BOOTSTRAP_URL=$RELAY_BOOSTRAP_URL +SDK_RELAY_BOOTSTRAP_FAUCET=https://$BOOTSTRAP_HOST/api/v1/faucet + +SDK_RELAY_CORE_URL=$BITCOIN_RPC_URL +SDK_RELAY_NETWORK=signet +SDK_RELAY_ZMQ_URL=tcp://$BITCOIN_DOCKER_HOST:$BITCOIN_ZMQPBUBHASHBLOCK_PORT +SDK_RELAY_BITCOIN_DATA_DIR=$BITCOIN_DATA_DIR diff --git a/storage/dev/sdk_storage/.env b/storage/dev/sdk_storage/.env new file mode 100644 index 0000000..2ed03c0 --- /dev/null +++ b/storage/dev/sdk_storage/.env @@ -0,0 +1,10 @@ +# =========================================== +# Variables d'environnement pour sdk_storage +# =========================================== + +# Configuration SDK Storage +STORAGE_URL=$STORAGE_URL +STORAGE_PORT=$STORAGE_PORT +STORAGE_DATA_DIR=$SDK_STORAGE_DATA_DIR +VITE_STORAGE_URL=$SDK_STORAGE_DATA_DIR +DOMAIN=$DOMAIN diff --git a/storage/dev/supervisor/supervisord.conf b/storage/dev/supervisor/supervisord.conf new file mode 100644 index 0000000..c67274b --- /dev/null +++ b/storage/dev/supervisor/supervisord.conf @@ -0,0 +1,50 @@ +[supervisord] +nodaemon=true +user=root +logfile=$SUPERVISOR_LOGS_DIR/supervisord.log +pidfile=$ROOT_DIR_RUN/supervisord.pid +childlogdir=$SUPERVISOR_LOGS_DIR + +[unix_http_server] +file=$ROOT_DIR_RUN/supervisor.sock +chmod=0700 + +[supervisorctl] +serverurl=unix://$ROOT_DIR_RUN/supervisor.sock + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[program:nginx] +command=/usr/sbin/nginx -g "daemon off;" +autostart=true +autorestart=true +stderr_logfile=$SUPERVISOR_LOGS_DIR/nginx.err.log +stdout_logfile=$SUPERVISOR_LOGS_DIR/nginx.out.log +user=root + +[program:docker-compose] +command=/app/scripts/startup.sh +directory=/app +autostart=true +autorestart=true +stderr_logfile=$SUPERVISOR_LOGS_DIR/docker-compose.err.log +stdout_logfile=$SUPERVISOR_LOGS_DIR/docker-compose.out.log +user=appuser +environment=HOME="/app" + +[program:cron] +command=/usr/sbin/cron -f +autostart=true +autorestart=true +stderr_logfile=$SUPERVISOR_LOGS_DIR/cron.err.log +stdout_logfile=$SUPERVISOR_LOGS_DIR/cron.out.log +user=root + +[program:logrotate] +command=/usr/sbin/logrotate $LOGROTATE_CONF_DIR/lecoffre +autostart=true +autorestart=false +startsecs=0 +exitcodes=0 +user=root