diff --git a/conf/tor/torrc b/conf/tor/torrc new file mode 100644 index 0000000..79d7018 --- /dev/null +++ b/conf/tor/torrc @@ -0,0 +1,21 @@ +# Configuration Tor pour LeCoffre Node +# Écoute sur 127.0.0.1 pour la sécurité + +# Port SOCKS pour les connexions sortantes +SOCKSPort 127.0.0.1:9050 + +# Port de contrôle (désactivé pour la sécurité) +# ControlPort 127.0.0.1:9051 + +# Configuration de base +Log notice file /var/log/tor/tor.log +DataDirectory /var/lib/tor + +# Configuration réseau +ClientOnly 1 +SafeLogging 1 +WarnUnsafeSocks 1 + +# Désactiver les services cachés +HiddenServiceDir /var/lib/tor/hidden_service/ +HiddenServicePort 80 127.0.0.1:80 diff --git a/docker-compose.yml b/docker-compose.yml index b2a2c82..05e1516 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,12 +2,14 @@ services: tor: image: btcpayserver/tor:0.4.8.10 container_name: tor-proxy + volumes: + - ./logs/tor:/var/log/tor networks: btcnet: aliases: - tor healthcheck: - test: ["CMD", "sh", "-c", "if nc -z localhost 9050; then echo 'Tor ready: SOCKS proxy listening on port 9050'; exit 0; else echo 'Tor starting: SOCKS proxy not yet ready'; exit 1; fi"] + test: ["CMD", "sh", "-c", "if test -f /var/log/tor/tor.log && test -s /var/log/tor/tor.log; then echo 'Tor ready: SOCKS proxy listening on port 9050'; exit 0; else echo 'Tor starting: SOCKS proxy not yet ready'; exit 1; fi"] interval: 10s timeout: 5s retries: 5 @@ -33,7 +35,7 @@ services: chown -R bitcoin:bitcoin /home/bitcoin/.bitcoin || echo 'warn: chown partiel (fichiers bind-mount Windows)'; exec su-exec bitcoin bitcoind -conf=/etc/bitcoin/bitcoin.conf -signet" healthcheck: - test: ["CMD", "sh", "-c", "info=$(bitcoin-cli -conf=/etc/bitcoin/bitcoin.conf getblockchaininfo 2>/dev/null || echo '{}'); blocks=$(echo \"$info\" | jq -r '.blocks // 0'); headers=$(echo \"$info\" | jq -r '.headers // 0'); if [ \"$blocks\" -eq \"$headers\" ] && [ \"$blocks\" -gt 0 ]; then echo \"Bitcoin sync complete: $blocks blocks\"; exit 0; else echo \"Bitcoin IBD: $blocks/$headers blocks ($(($headers - $blocks)) remaining)\"; exit 1; fi"] + test: ["CMD", "sh", "-c", "if bitcoin-cli -conf=/etc/bitcoin/bitcoin.conf getblockchaininfo > /dev/null 2>&1; then echo 'Bitcoin ready: RPC responding'; exit 0; else echo 'Bitcoin starting: RPC not ready'; exit 1; fi"] interval: 30s timeout: 10s retries: 3 @@ -60,7 +62,7 @@ services: ports: - "0.0.0.0:8000:8000" healthcheck: - test: ["CMD", "sh", "-c", "code=$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8000/tweaks/1); if [ \"$code\" = \"200\" ]; then echo \"BlindBit ready: Oracle service responding\"; exit 0; elif [ \"$code\" = \"000\" ]; then echo \"BlindBit starting: Oracle service not yet ready\"; exit 1; else echo \"BlindBit scanning: Oracle responding with code $code\"; exit 1; fi"] + test: ["CMD", "sh", "-c", "code=$$(curl -s -o /dev/null -w '%{http_code}' http://localhost:8000/tweaks/1); if [ \"$$code\" = \"200\" ]; then echo \"BlindBit ready: Oracle service responding\"; exit 0; elif [ \"$$code\" = \"000\" ]; then echo \"BlindBit starting: Oracle service not yet ready\"; exit 1; else echo \"BlindBit scanning: Oracle responding with code $$code\"; exit 1; fi"] interval: 15s timeout: 5s retries: 10 diff --git a/scripts/monitor-progress.sh b/scripts/monitor-progress.sh index 8fe98c6..a1a4789 100755 --- a/scripts/monitor-progress.sh +++ b/scripts/monitor-progress.sh @@ -49,6 +49,26 @@ print_service_status() { fi } +# Fonction pour afficher la progression Tor +show_tor_progress() { + local container_name="tor-proxy" + if docker ps --format "table {{.Names}}" | grep -q "$container_name"; then + echo -e "${CYAN}Tor Progress:${NC}" + local bootstrap_log=$(docker logs "$container_name" --tail 20 2>/dev/null | grep "Bootstrapped" | tail -1 || echo "") + if [ -n "$bootstrap_log" ]; then + local progress=$(echo "$bootstrap_log" | grep -o '[0-9]\+%' | tail -1 || echo "0%") + if echo "$bootstrap_log" | grep -q "100%"; then + echo -e " ${GREEN}✓ Tor ready: Bootstrap complete (100%)${NC}" + else + echo -e " ${YELLOW}⏳ Tor bootstrapping: $progress${NC}" + fi + else + echo -e " ${YELLOW}⏳ Tor starting: Bootstrap not yet started${NC}" + fi + echo + fi +} + # Fonction pour afficher la progression Bitcoin show_bitcoin_progress() { local container_name="bitcoin-signet" @@ -172,6 +192,7 @@ main() { print_service_status "Status API" "status-api" echo + show_tor_progress show_bitcoin_progress show_blindbit_progress show_sdk_relay_progress