diff --git a/.gitignore b/.gitignore index 432069ee..313378d0 100644 --- a/.gitignore +++ b/.gitignore @@ -31,8 +31,23 @@ tests/reports/ # Sauvegardes locales *.backup +*.conf +*.toml +*.yml +*.yaml +*.json +*.csv +*.txt +*.log +*.log.* +*.log.*.* +*.log.*.*.* +*.log.*.*.*.* +*.log.*.*.*.*.* +*.log.*.*.*.*.*.* +*.log.*.*.*.*.*.*.* +*.log.*.*.*.*.*.*.*.* certs/ *.log # Ignore real configuration files, but keep example configs -*.conf diff --git a/conf/nginx/nginx.conf.exemple b/conf/nginx/nginx.conf.exemple new file mode 100644 index 00000000..5a2731e0 --- /dev/null +++ b/conf/nginx/nginx.conf.exemple @@ -0,0 +1,18 @@ +worker_processes 1; + +events { + worker_connections 1024; +} + +http { + include mime.types; + default_type application/octet-stream; + sendfile on; + keepalive_timeout 65; + + # Logs Nginx locaux (facultatif, peut être redirigé ailleurs) + access_log /var/log/nginx/4nk_node.access.log; + error_log /var/log/nginx/4nk_node.error.log; + + include /etc/nginx/sites-enabled/*.conf; +} diff --git a/conf/nginx/sites-enabled/4nk_node.conf.exemple b/conf/nginx/sites-enabled/4nk_node.conf.exemple new file mode 100644 index 00000000..2936262f --- /dev/null +++ b/conf/nginx/sites-enabled/4nk_node.conf.exemple @@ -0,0 +1,90 @@ +server { + listen 80 default_server; + server_name _; + + # Format de logs dédié Grafana/Promtail + access_log /var/log/nginx/4nk_node.access.log; + error_log /var/log/nginx/4nk_node.error.log; + + # ihm_client (HTTP) + location / { + proxy_pass http://ihm-client.4nk.local:80/; + 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; + } + + # sdk_storage + location /sdk_storage/ { + proxy_pass http://sdk-storage.4nk.local:8081/; + 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; + } + + # blindbit + location /blindbit/ { + proxy_pass http://blindbit.4nk.local:8000/; + 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; + } + + # relais (HTTP API) + location /relay1/ { proxy_pass http://sdk-relay1.4nk.local:8091/; } + location /relay2/ { proxy_pass http://sdk-relay2.4nk.local:8093/; } + location /relay3/ { proxy_pass http://sdk-relay3.4nk.local:8095/; } + + # relais (WebSocket) + location /relay1/ws/ { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass http://sdk-relay1.4nk.local:8090/; + } + location /relay2/ws/ { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass http://sdk-relay2.4nk.local:8092/; + } + location /relay3/ws/ { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass http://sdk-relay3.4nk.local:8094/; + } + + # sdk_signer (WS et HTTP si exposés sur 9090/9092) + location /signer/ws/ { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "Upgrade"; + proxy_pass http://sdk-signer.4nk.local:9090/; + } + location /signer/ { + proxy_pass http://sdk-signer.4nk.local:9092/; + } + + # lecoffre-front + location /coffre/ { + proxy_pass http://coffre-front.4nk.local:3003/; + } + + # miniback (expose /logs si nécessaire) + location /miniback/ { + proxy_pass http://miniback.4nk.local:8081/; + } + + # Grafana (sous-chemin /grafana) + location /grafana/ { + 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_pass http://127.0.0.1:3000/; + } +} diff --git a/modules/bitcoin/conf/bitcoin.conf.exemple b/modules/bitcoin/conf/bitcoin.conf.exemple index f64e0900..302e08b7 100644 --- a/modules/bitcoin/conf/bitcoin.conf.exemple +++ b/modules/bitcoin/conf/bitcoin.conf.exemple @@ -16,54 +16,4 @@ zmqpubrawblock=tcp://bitcoin.4nk.local:29000 zmqpubrawtx=tcp://bitcoin.4nk.local:29000 zmqpubhashblock=tcp://bitcoin.4nk.local:29000 -blockfilterindex=1 -# 0.0.0.0:8000 to expose outside of localhost -# default: "127.0.0.1:8000" -host = "bitcoin.4nk.local:8000" - -# Defines on which chain the wallet runs. Allowed values: main, testnet, signet, regtest. -# default: signet -chain = "signet" - -# default: http://127.0.0.1:8332 -rpc_endpoint = "http://bitcoin.4nk.local:38332" - -# required, unless rpc_user and rpc_pass are set -cookie_path = "$HOME/.bitcoin/signet/.cookie" - -# required, unless cookie_path is set -rpc_pass = "" - -# required, unless cookie_path is set -rpc_user = "" - -# required (has to be >= 1) -sync_start_height = 1 - -# the default for this is 1, but should be set to a higher value to increase performance, -# one should set this in accordance to how many cores one wants to use -max_parallel_tweak_computations = 4 - -# (depends on max-rpc-workers of the underlying full node) -max_parallel_requests = 4 - -# optional - will only generate tweaks (still both cut-through and full-index) -# default: 0 -tweaks_only = 0 - -# The base index. Only includes the tweaks. No dust filtering or cut-through possible -# default: 1 -tweaks_full_basic = 1 - -# if this is set a full non-cut-through index will be created. -# This index can be used to filter for dust (?dustLimit=). If this is active the base index will not be created. -# All full index queries will be served from this with or without (?dustLimit=) set in the query. -# default 0 -tweaks_full_with_dust_filter = 0 - -# This index applies cut-through and dust filtering. -# Beware that it will be stored in addition to any full index (with or without dust) if activated. -# It has more storage requirements than the simple indices. -# Currently still requires tweaks_only=0. -# default: 0 -tweaks_cut_through_with_dust_filter = 0 \ No newline at end of file +blockfilterindex=1 \ No newline at end of file diff --git a/modules/blindbit/conf/blindbit.toml.exemple b/modules/blindbit/conf/blindbit.toml.exemple index a6e4f70e..1124bbf5 100644 --- a/modules/blindbit/conf/blindbit.toml.exemple +++ b/modules/blindbit/conf/blindbit.toml.exemple @@ -1,6 +1,6 @@ # 0.0.0.0:8000 to expose outside of localhost # default: "127.0.0.1:8000" -host = "bitcoin.4nk.local:8000" +host = "blindbit.4nk.local:8000" # Defines on which chain the wallet runs. Allowed values: main, testnet, signet, regtest. # default: signet diff --git a/modules/ihm_client/conf/config.ts.exemple b/modules/ihm_client/conf/config.ts.exemple index 10e0b25c..755e827a 100644 --- a/modules/ihm_client/conf/config.ts.exemple +++ b/modules/ihm_client/conf/config.ts.exemple @@ -1,43 +1,7 @@ -# Configuration ihm_client - Module 4NK_node - -# URLs des services -sdk_signer_url = "http://4nk-sdk-signer:9090" -sdk_storage_url = "http://4nk-sdk-storage:8081" -sdk_relay1_url = "http://4nk-sdk-relay1:8091" -sdk_relay2_url = "http://4nk-sdk-relay2:8093" -sdk_relay3_url = "http://4nk-sdk-relay3:8095" - -# WebSocket URLs -sdk_relay1_ws = "ws://4nk-sdk-relay1:8090" -sdk_relay2_ws = "ws://4nk-sdk-relay2:8092" -sdk_relay3_ws = "ws://4nk-sdk-relay3:8094" - -# Configuration réseau -network_type = "signet" -bitcoin_rpc_url = "http://4nk-bitcoin:18443" - -# Ports -ui_port = 8080 -api_port = 8080 - -# Sécurité -cors_enabled = true -cors_origins = ["*"] -rate_limit_enabled = true -rate_limit_requests = 100 -rate_limit_window = 60 -session_timeout = 3600 - -# Timeouts -request_timeout = 30 -connection_timeout = 10 - -# Logging -log_level = "info" -log_file = "/app/logs/ihm_client.log" -log_max_size = "100MB" -log_max_files = 5 - -# Mode développement -dev_mode = true -debug_enabled = true +const U32_MAX = import.meta.env.U32_MAX; +const BASEURL = import.meta.env.DEV.BASEURL; +const BOOTSTRAPURL = import.meta.env.DEV.BOOTSTRAPURL; +const STORAGEURL = import.meta.env.DEV.STORAGEURL; +const BLINDBITURL = import.meta.env.DEV.BLINDBITURL; +const DEFAULTAMOUNT = import.meta.env.DEV.DEFAULTAMOUNT; +const EMPTY32BYTES = import.meta.env.DEV.EMPTY32BYTES; \ No newline at end of file diff --git a/modules/sdk_relay2/conf/sdk_relay2.conf.exemple b/modules/sdk_relay2/conf/sdk_relay2.conf.exemple index b1577f8c..d073c7df 100644 --- a/modules/sdk_relay2/conf/sdk_relay2.conf.exemple +++ b/modules/sdk_relay2/conf/sdk_relay2.conf.exemple @@ -1,5 +1,5 @@ core_url="http://bitcoin.4nk.local:38332" -ws_url="sdk-relay1.4nk.local:8090" +ws_url="sdk-relay2.4nk.local:8090" wallet_name="default" network="signet" blindbit_url="http://blindbit.4nk.local:8000" diff --git a/modules/sdk_relay3/conf/sdk_relay3.conf.exemple b/modules/sdk_relay3/conf/sdk_relay3.conf.exemple index b1577f8c..d5d407d9 100644 --- a/modules/sdk_relay3/conf/sdk_relay3.conf.exemple +++ b/modules/sdk_relay3/conf/sdk_relay3.conf.exemple @@ -1,5 +1,5 @@ core_url="http://bitcoin.4nk.local:38332" -ws_url="sdk-relay1.4nk.local:8090" +ws_url="sdk-relay3.4nk.local:8090" wallet_name="default" network="signet" blindbit_url="http://blindbit.4nk.local:8000" diff --git a/modules/sdk_signer/package-lock.json b/modules/sdk_signer/package-lock.json deleted file mode 100644 index 9e26dfee..00000000 --- a/modules/sdk_signer/package-lock.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/modules/sdk_signer/package.json b/modules/sdk_signer/package.json deleted file mode 100644 index 074981c5..00000000 --- a/modules/sdk_signer/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"sdk_signer","version":"1.0.0"} diff --git a/modules/sdk_signer/pkg/package.json b/modules/sdk_signer/pkg/package.json deleted file mode 100644 index cd4078a7..00000000 --- a/modules/sdk_signer/pkg/package.json +++ /dev/null @@ -1 +0,0 @@ -{"name":"sdk_signer_pkg","version":"0.0.1"} diff --git a/modules/sdk_signer/src/index.ts b/modules/sdk_signer/src/index.ts deleted file mode 100644 index c2ca1784..00000000 --- a/modules/sdk_signer/src/index.ts +++ /dev/null @@ -1,6 +0,0 @@ -export function sdkSignerInit(): void { - // Minimal placeholder to satisfy build during initial integration -} - -export default sdkSignerInit; - diff --git a/modules/sdk_signer/tsconfig.json b/modules/sdk_signer/tsconfig.json deleted file mode 100644 index 98804ea9..00000000 --- a/modules/sdk_signer/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2019", - "module": "commonjs", - "outDir": "./dist", - "rootDir": "./src", - "esModuleInterop": true, - "strict": false - }, - "include": ["src/**/*"] -} - diff --git a/modules/sdk_storage/conf/sdk_storage.conf.exemple b/modules/sdk_storage/conf/sdk_storage.conf.exemple index 24bf7002..eb93dc17 100644 --- a/modules/sdk_storage/conf/sdk_storage.conf.exemple +++ b/modules/sdk_storage/conf/sdk_storage.conf.exemple @@ -4,13 +4,13 @@ http_port = 8081 # Base de données -db_path = "/home/bitcoin/.4nk/storage.db" +db_path = "$HOME/bitcoin/.4nk/storage.db" # URLs des services relay_urls = ["http://4nk-sdk-relay1:8091", "http://4nk-sdk-relay2:8093", "http://4nk-sdk-relay3:8095"] bitcoin_rpc_url = "http://4nk-bitcoin:38332" -bitcoin_rpc_user = "EXEMPLE" -bitcoin_rpc_password = "EXEMPLE" +bitcoin_rpc_user = "bitcoin" +bitcoin_rpc_password = "bitcoin" # Mode développement dev_mode = true @@ -22,10 +22,10 @@ timeout = 30 # Logging log_level = "info" -log_file = "/home/bitcoin/logs/sdk_storage.log" +log_file = "$HOME/bitcoin/logs/sdk_storage.log" # Stockage de fichiers -file_storage_path = "/home/bitcoin/.4nk/files" +file_storage_path = "$HOME/bitcoin/.4nk/files" max_file_size = "100MB" # Sécurité diff --git a/modules/tor/conf/tor.conf.exemple b/modules/tor/conf/tor.conf.exemple new file mode 100644 index 00000000..9492df6f --- /dev/null +++ b/modules/tor/conf/tor.conf.exemple @@ -0,0 +1,16 @@ +# Configuration Tor pour 4NK_node (conteneur) + +# Ports d\écoute + +# Ports d\'écoute +SocksPort tor.4nk.local:9050 +ControlPort tor.4nk.local:9051 + +# Répertoires +DataDirectory /var/lib/tor + +# Logs (fichier monté par docker-compose) +Log notice file /var/log/tor/notices.log + +# Exécution en avant-plan dans un conteneur +RunAsDaemon 0 diff --git a/modules/tor/tor.conf.exemple b/modules/tor/tor.conf.exemple index f7b85188..0424d504 100644 --- a/modules/tor/tor.conf.exemple +++ b/modules/tor/tor.conf.exemple @@ -2,8 +2,8 @@ # Écoute sur toutes les interfaces pour permettre la connexion depuis d'autres conteneurs # Ports SOCKS et contrôle -SocksPort 0.0.0.0:9050 -ControlPort 0.0.0.0:9051 +SocksPort tor.4nk.local:9050 +ControlPort tor.4nk.local:9051 # Répertoire de données DataDirectory /var/lib/tor diff --git a/projects/lecoffre/lecoffre-back-mini/conf/.env.exemple b/projects/lecoffre/lecoffre-back-mini/conf/.env.exemple index bcc3646a..404d9842 100644 --- a/projects/lecoffre/lecoffre-back-mini/conf/.env.exemple +++ b/projects/lecoffre/lecoffre-back-mini/conf/.env.exemple @@ -1,48 +1,50 @@ # Configuration OVH -OVH_APP_KEY=EXEMPLE -OVH_APP_SECRET=EXEMPLE -OVH_CONSUMER_KEY=EXEMPLE +OVH_APP_KEY=5ab0709bbb65ef26 +OVH_APP_SECRET=de1fac1779d707d263a611a557cd5766 +OVH_CONSUMER_KEY=5fe817829b8a9c780cfa2354f8312ece OVH_SMS_SERVICE_NAME=sms-tt802880-1 # Configuration SMS Factor -SMS_FACTOR_TOKEN=EXEMPLE +SMS_FACTOR_TOKEN=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI4NzgzNiIsImlhdCI6MTcwMTMzOTY1Mi45NDUzOH0.GNoqLb5MDBWuniNlQjbr1PKolwxGqBZe_tf4IMObvHw #Configuration Mailchimp -MAILCHIMP_API_KEY=EXEMPLE -MAILCHIMP_KEY=EXEMPLE +MAILCHIMP_API_KEY=md-VVfaml-ApIV4nsGgaJKl0A +MAILCHIMP_KEY=3fa54304bc766dfd0b8043a827b28a3a-us17 MAILCHIMP_LIST_ID=a48d9ad852 #Configuration Stripe -STRIPE_SECRET_KEY=EXEMPLE -STRIPE_WEBHOOK_SECRET=EXEMPLE +STRIPE_SECRET_KEY=sk_test_51OwKmMP5xh1u9BqSeFpqw0Yr15hHtFsh0pvRGaE0VERhlYtvw33ND1qiGA6Dy1DPmmV61B6BqIimlhuv7bwElhjF00PLQwD60n +STRIPE_WEBHOOK_SECRET= STRIPE_STANDARD_SUBSCRIPTION_PRICE_ID=price_1P66fuP5xh1u9BqSHj0O6Uy3 STRIPE_STANDARD_ANNUAL_SUBSCRIPTION_PRICE_ID=price_1P9NsRP5xh1u9BqSFgkUDbQY STRIPE_UNLIMITED_SUBSCRIPTION_PRICE_ID=price_1P66RqP5xh1u9BqSuUzkQNac STRIPE_UNLIMITED_ANNUAL_SUBSCRIPTION_PRICE_ID=price_1P9NpKP5xh1u9BqSApFogvUB # Configuration serveur -APP_HOST=http://localhost +APP_HOST=http://miniback.4nk.local PORT=8080 # Configuration front-end -NEXT_PUBLIC_4NK_URL=https://dev3.4nkweb.com -NEXT_PUBLIC_FRONT_APP_HOST=http://localhost:3000 +NEXT_PUBLIC_4NK_URL=https://ihm-client.4nk.local +NEXT_PUBLIC_FRONT_APP_HOST=http://coffre-front.4nk.local:3000 NEXT_PUBLIC_IDNOT_BASE_URL=https://qual-connexion.idnot.fr NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT=/IdPOAuth2/authorize/idnot_idp_v1 NEXT_PUBLIC_IDNOT_CLIENT_ID=4501646203F3EF67 NEXT_PUBLIC_BACK_API_PROTOCOL=http -NEXT_PUBLIC_BACK_API_HOST=localhost +NEXT_PUBLIC_BACK_API_HOST=miniback.4nk.local BACK_API_PORT=8080 BACK_API_ROOT_URL=/api BACK_API_VERSION=/v1 # Configuration idnot IDNOT_ANNUARY_BASE_URL='https://qual-api.notaires.fr/annuaire' -IDNOT_API_KEY='EXEMPLE' +IDNOT_API_KEY='ba557f84-0bf6-4dbf-844f-df2767555e3e' # Configuration PostgreSQL -DB_HOST=miniback-postgres -DB_PORT=5432 -DB_NAME=miniback -DB_USER=EXEMPLE -DB_PASSWORD=EXEMPLE +DB_HOST= +DB_PORT= +DB_NAME= +DB_USER= +DB_PASSWORD= + +LOG_LEVEL="debug" diff --git a/projects/lecoffre/lecoffre-front/conf/.env.exemple b/projects/lecoffre/lecoffre-front/conf/.env.exemple index 3c619ee5..9166854a 100644 --- a/projects/lecoffre/lecoffre-front/conf/.env.exemple +++ b/projects/lecoffre/lecoffre-front/conf/.env.exemple @@ -1,17 +1,10 @@ -# Configuration IHM_client -NEXT_PUBLIC_4NK_URL="http://localhost:3003" - -# Configuration lecoffre-front -NEXT_PUBLIC_FRONT_APP_HOST="http://localhost:3000" - -# Configuration IDNOT +EXT_PUBLIC_4NK_URL="http://ihm-client.4nk.local:3003" +NEXT_PUBLIC_FRONT_APP_HOST="http://coffre-front.4nk.local:3000" NEXT_PUBLIC_IDNOT_BASE_URL="https://qual-connexion.idnot.fr" NEXT_PUBLIC_IDNOT_AUTHORIZE_ENDPOINT="/IdPOAuth2/authorize/idnot_idp_v1" -NEXT_PUBLIC_IDNOT_CLIENT_ID="EXEMPLE" - -# Configuration mini-back +NEXT_PUBLIC_IDNOT_CLIENT_ID="4501646203F3EF67" NEXT_PUBLIC_BACK_API_PROTOCOL=http:// -NEXT_PUBLIC_BACK_API_HOST=localhost +NEXT_PUBLIC_BACK_API_HOST=miniback.4nk.local NEXT_PUBLIC_BACK_API_PORT=8080 NEXT_PUBLIC_BACK_API_ROOT_URL=/api NEXT_PUBLIC_BACK_API_VERSION=/v1 \ No newline at end of file