When trying to use the tor control port from another host (and using password authentication), the .onion address thats returned in localaddresses does not work.
Expected behavior
Any addresses in localaddresses should be reachable
Actual behavior
Address not reachable.
To reproduce
Create the following docker-compose file (bare bones so we can reproduce the issue)
version: '3.7'
services:
tor:
container_name: tor
image: getumbrel/tor:v0.4.1.9
restart: unless-stopped
logging: *default-logging
volumes:
- ${PWD}/tor/torrc:/etc/tor/torrc
- ${PWD}/tor/data:/var/lib/tor/
- ${PWD}/tor/run:/var/run/tor/
networks:
net:
ipv4_address: 10.11.5.1
bitcoin:
container_name: bitcoin
image: lncm/bitcoind:v0.20.0
logging: *default-logging
depends_on: [ tor ]
command: "-zmqpubrawblock=tcp://0.0.0.0:28332 -zmqpubrawtx=tcp://0.0.0.0:28333"
volumes:
- ${PWD}/bitcoin:/root/.bitcoin
- ${PWD}/bitcoin:/data/.bitcoin
- ${PWD}/bitcoin:/data/bitcoin
restart: unless-stopped
stop_grace_period: 15m30s
ports:
- "127.0.0.1:8333:8333"
networks:
net:
ipv4_address: 10.11.1.1
create a folder called tor with directory structure of data and run and the following torrc file
SocksPort 10.11.5.1:29050
ControlPort 10.11.5.1:29051
run the following
docker run --rm getumbrel/tor:v0.4.1.9 --quiet --hash-password this-is-a-test-password
then add the password to HashedControlPassword in torrc
create a directory called bitcoin from the docker-compose.yml root
Add the following in bitcoin.conf (this is similar to mine)
# Have TOR commented for initial sync
onion=10.11.5.1:29050
torcontrol=10.11.5.1:29051
torpassword=this-is-a-test-password
server=1
rest=1
port=8333
rpcport=8332
rpcbind=10.11.1.1
rpcbind=127.0.0.1
rpcallowip=10.11.0.0/16
rpcallowip=127.0.0.1
txindex=1
blockfilterindex=1
peerbloomfilters=0
System information
Docker built images by github on https://github.com/lncm/docker-bitcoind (Thanks @meeDamian 😍) and docker compose with networking set up to segregate different services
Workarounds
Don't use torcontrol and use externalip= which has a working address in localaddresses
General Notes
- Tor control Spec seems to have function called
MAPADDRESS- https://github.com/torproject/torspec/blob/master/control-spec.txt