From 2344746ad5ebcaceb87df7c57ed89958ac602be7 Mon Sep 17 00:00:00 2001 From: Dorian Date: Tue, 31 Mar 2026 03:43:01 +0100 Subject: [PATCH] fix: start Tor in first-boot, ensure hidden services on fresh installs Tor was configured in torrc but never started by first-boot-containers.sh. Connect wallet and .onion services were broken on fresh installs. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/first-boot-containers.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/first-boot-containers.sh b/scripts/first-boot-containers.sh index 7ea657c1..b020a5d7 100644 --- a/scripts/first-boot-containers.sh +++ b/scripts/first-boot-containers.sh @@ -32,6 +32,19 @@ SCRIPT_DIR_FBC="$(cd "$(dirname "$0")" && pwd)" TARGET_IP=$(hostname -I 2>/dev/null | awk '{print $1}') [ -z "$TARGET_IP" ] && TARGET_IP="127.0.0.1" +# Ensure Tor is running for hidden services (LND connect, Electrumx, etc.) +if ! systemctl is-active tor >/dev/null 2>&1; then + log "Starting Tor..." + systemctl enable tor 2>/dev/null || true + systemctl start tor 2>/dev/null || true + sleep 3 + if systemctl is-active tor >/dev/null 2>&1; then + log " Tor started successfully" + else + log " WARNING: Tor failed to start, hidden services will be unavailable" + fi +fi + log() { echo "$(date '+%Y-%m-%d %H:%M:%S') $*" | tee -a "$LOG"; } # Wait for a container to be healthy (accepting connections)