From 6674b9d5aca8dc036d454726905e1071617dc0cd Mon Sep 17 00:00:00 2001 From: Dorian Date: Thu, 19 Mar 2026 00:09:15 +0000 Subject: [PATCH] fix: deploy auto-fixes stale LND config (rpchost + rpcpass) LND was crash-looping because lnd.conf had 127.0.0.1:8332 (container loopback, not reachable) and the old hardcoded password. Deploy script now detects stale values and patches them to bitcoin-knots:8332 with the current secrets file password. Fixes address generation failure. Co-Authored-By: Claude Opus 4.6 (1M context) --- scripts/deploy-to-target.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scripts/deploy-to-target.sh b/scripts/deploy-to-target.sh index 8200de0a..3f7d1c0a 100755 --- a/scripts/deploy-to-target.sh +++ b/scripts/deploy-to-target.sh @@ -1359,6 +1359,18 @@ bitcoind.estimatemode=ECONOMICAL autopilot.active=false LNDCONF sudo cp /tmp/lnd.conf /var/lib/archipelago/lnd/lnd.conf + else + # Fix stale LND configs from older installs (localhost → container DNS, old password → current) + LND_CONF=/var/lib/archipelago/lnd/lnd.conf + if grep -q "rpchost=127.0.0.1" "$LND_CONF" 2>/dev/null || grep -q "rpcpass=archipelago123" "$LND_CONF" 2>/dev/null; then + echo " Fixing stale LND config (rpchost/rpcpass)..." + cp "$LND_CONF" /tmp/lnd.conf.fix + sed -i "s|bitcoind.rpchost=127.0.0.1:8332|bitcoind.rpchost=bitcoin-knots:8332|" /tmp/lnd.conf.fix + sed -i "s|bitcoind.rpcpass=archipelago123|bitcoind.rpcpass=$BITCOIN_RPC_PASS|" /tmp/lnd.conf.fix + sudo cp /tmp/lnd.conf.fix "$LND_CONF" + sudo chown 100000:100000 "$LND_CONF" + RESTART_LND=1 + fi fi $DOCKER run -d --name lnd --restart unless-stopped --network archy-net \ --cap-drop ALL --cap-add CHOWN --cap-add FOWNER --cap-add SETUID --cap-add SETGID --cap-add DAC_OVERRIDE \