Browse Source

Add third Tor daemon

reliable-tor-hs
Luke Childs 3 years ago
parent
commit
703e704d9e
  1. 10
      docker-compose.yml
  2. 7
      scripts/configure
  3. 1
      templates/.env-sample
  4. 55
      templates/torrc-apps-2-sample
  5. 54
      templates/torrc-apps-sample

10
docker-compose.yml

@ -24,6 +24,16 @@ services:
networks:
default:
ipv4_address: $APPS_TOR_IP
app_2_tor:
image: lncm/tor:0.4.5.7@sha256:a83e0d9fd1a35adf025f2f34237ec1810e2a59765988dce1dfb222ca8ef6583c
user: toruser
restart: on-failure
volumes:
- ${PWD}/tor/torrc-apps-2:/etc/tor/torrc
- ${PWD}/tor/data:/var/lib/tor/
networks:
default:
ipv4_address: $APPS_2_TOR_IP
nginx:
container_name: nginx
image: nginx:1.17.8@sha256:380eb808e2a3b0dd954f92c1cae2f845e6558a15037efefcabc5b4e03d666d03

7
scripts/configure

@ -72,6 +72,7 @@ NGINX_CONF_FILE="./templates/nginx.conf"
BITCOIN_CONF_FILE="./templates/bitcoin.conf"
LND_CONF_FILE="./templates/lnd.conf"
APPS_TOR_CONF_FILE="./templates/torrc-apps"
APPS_2_TOR_CONF_FILE="./templates/torrc-apps-2"
UMBREL_TOR_CONF_FILE="./templates/torrc-umbrel"
ELECTRS_CONF_FILE="./templates/electrs.toml"
ENV_FILE="./templates/.env"
@ -82,6 +83,7 @@ ENV_FILE="./templates/.env"
[[ -f "$BITCOIN_CONF_FILE" ]] && rm -f "$BITCOIN_CONF_FILE"
[[ -f "$LND_CONF_FILE" ]] && rm -f "$LND_CONF_FILE"
[[ -f "$APPS_TOR_CONF_FILE" ]] && rm -f "$APPS_TOR_CONF_FILE"
[[ -f "$APPS_2_TOR_CONF_FILE" ]] && rm -f "$APPS_2_TOR_CONF_FILE"
[[ -f "$UMBREL_TOR_CONF_FILE" ]] && rm -f "$UMBREL_TOR_CONF_FILE"
[[ -f "$ELECTRS_CONF_FILE" ]] && rm -f "$ELECTRS_CONF_FILE"
[[ -f "$ENV_FILE" ]] && rm -f "$ENV_FILE"
@ -91,6 +93,7 @@ ENV_FILE="./templates/.env"
[[ -f "./templates/bitcoin-sample.conf" ]] && cp "./templates/bitcoin-sample.conf" "$BITCOIN_CONF_FILE"
[[ -f "./templates/lnd-sample.conf" ]] && cp "./templates/lnd-sample.conf" "$LND_CONF_FILE"
[[ -f "./templates/torrc-apps-sample" ]] && cp "./templates/torrc-apps-sample" "$APPS_TOR_CONF_FILE"
[[ -f "./templates/torrc-apps-2-sample" ]] && cp "./templates/torrc-apps-2-sample" "$APPS_2_TOR_CONF_FILE"
[[ -f "./templates/torrc-umbrel-sample" ]] && cp "./templates/torrc-umbrel-sample" "$UMBREL_TOR_CONF_FILE"
[[ -f "./templates/electrs-sample.toml" ]] && cp "./templates/electrs-sample.toml" "$ELECTRS_CONF_FILE"
[[ -f "./templates/.env-sample" ]] && cp "./templates/.env-sample" "$ENV_FILE"
@ -126,6 +129,7 @@ ELECTRUM_IP="10.21.21.10"
ELECTRUM_PORT="50001"
TOR_PROXY_IP="10.21.21.11"
APPS_TOR_IP="10.21.21.47"
APPS_2_TOR_IP="10.21.21.48"
TOR_PROXY_PORT="9050"
# Apps
@ -296,7 +300,7 @@ if [[ "$BITCOIN_NETWORK" == "mainnet" ]] && [[ ! -f "${STATUS_DIR}/node-status-b
fi
# TODO: Update all the above code to use this simpler logic
for template in "${NGINX_CONF_FILE}" "${BITCOIN_CONF_FILE}" "${LND_CONF_FILE}" "${APPS_TOR_CONF_FILE}" "${UMBREL_TOR_CONF_FILE}" "${ELECTRS_CONF_FILE}" "${ENV_FILE}"; do
for template in "${NGINX_CONF_FILE}" "${BITCOIN_CONF_FILE}" "${LND_CONF_FILE}" "${APPS_TOR_CONF_FILE}" "${APPS_2_TOR_CONF_FILE}" "${UMBREL_TOR_CONF_FILE}" "${ELECTRS_CONF_FILE}" "${ENV_FILE}"; do
# Umbrel
sed -i "s/<network-ip>/${NETWORK_IP}/g" "${template}"
sed -i "s/<gateway-ip>/${GATEWAY_IP}/g" "${template}"
@ -389,6 +393,7 @@ done
mv -f "$NGINX_CONF_FILE" "./nginx/nginx.conf"
mv -f "$BITCOIN_CONF_FILE" "./bitcoin/bitcoin.conf"
mv -f "$APPS_TOR_CONF_FILE" "./tor/torrc-apps"
mv -f "$APPS_2_TOR_CONF_FILE" "./tor/torrc-apps-2"
mv -f "$UMBREL_TOR_CONF_FILE" "./tor/torrc-umbrel"
mv -f "$ELECTRS_CONF_FILE" "./electrs/electrs.toml"
mv -f "$ENV_FILE" "./.env"

1
templates/.env-sample

@ -27,6 +27,7 @@ TOR_PROXY_PORT=<tor-proxy-port>
TOR_PASSWORD=<password>
TOR_HASHED_PASSWORD=<password>
APPS_TOR_IP=<apps-tor-ip>
APPS_2_TOR_IP=<apps-2-tor-ip>
DOCKER_BINARY=<path>
# Apps

55
templates/torrc-apps-2-sample

@ -0,0 +1,55 @@
# Apps 2
# samourai-server dojo Hidden Service
HiddenServiceDir /var/lib/tor/app-samourai-server-dojo
HiddenServicePort 80 <app-samourai-server-ip>:80
# samourai-server connect Hidden Service
HiddenServiceDir /var/lib/tor/app-samourai-server
HiddenServicePort 80 <app-samourai-server-ip>:8081
# samourai-server whirlpool Hidden Service
HiddenServiceDir /var/lib/tor/app-samourai-server-whirlpool
HiddenServicePort 80 <app-samourai-server-whirlpool-ip>:<app-samourai-server-whirlpool-port>
# LndHub Hidden Service
HiddenServiceDir /var/lib/tor/app-bluewallet
HiddenServicePort 80 <app-bluewallet-lndhub-ip>:<app-bluewallet-lndhub-port>
# nextcloud Hidden Service
HiddenServiceDir /var/lib/tor/app-nextcloud
HiddenServicePort 80 <app-nextcloud-ip>:80
# pi-hole Hidden Service
HiddenServiceDir /var/lib/tor/app-pi-hole
HiddenServicePort 80 <app-pi-hole-ip>:80
# home-assistant Hidden Service
HiddenServiceDir /var/lib/tor/app-home-assistant
HiddenServicePort 80 <app-home-assistant-ip>:8123
# gitea Hidden Service
HiddenServiceDir /var/lib/tor/app-gitea
HiddenServicePort 80 <app-gitea-ip>:<app-gitea-port>
HiddenServicePort 22 <app-gitea-ip>:<app-gitea-ssh-port>
# simple-torrent Hidden Service
HiddenServiceDir /var/lib/tor/app-simple-torrent
HiddenServicePort 80 <app-simple-torrent-ip>:<app-simple-torrent-port>
# synapse Hidden Service
HiddenServiceDir /var/lib/tor/app-synapse
HiddenServicePort 80 <app-synapse-ip>:<app-synapse-port>
HiddenServicePort <app-synapse-port> <app-synapse-ip>:<app-synapse-port>
# element Hidden Service
HiddenServiceDir /var/lib/tor/app-element
HiddenServicePort 80 <app-element-ip>:80
# vaultwarden Hidden Service
HiddenServiceDir /var/lib/tor/app-vaultwarden
HiddenServicePort 80 <app-vaultwarden-ip>:<app-vaultwarden-port>
# code-server Hidden Service
HiddenServiceDir /var/lib/tor/app-code-server
HiddenServicePort 80 <app-code-server-ip>:8080

54
templates/torrc-apps-sample

@ -42,57 +42,3 @@ HiddenServicePort 80 <app-photoprism-ip>:<app-photoprism-port>
# mempool Hidden Service
HiddenServiceDir /var/lib/tor/app-mempool
HiddenServicePort 80 <app-mempool-ip>:<app-mempool-port>
# samourai-server dojo Hidden Service
HiddenServiceDir /var/lib/tor/app-samourai-server-dojo
HiddenServicePort 80 <app-samourai-server-ip>:80
# samourai-server connect Hidden Service
HiddenServiceDir /var/lib/tor/app-samourai-server
HiddenServicePort 80 <app-samourai-server-ip>:8081
# samourai-server whirlpool Hidden Service
HiddenServiceDir /var/lib/tor/app-samourai-server-whirlpool
HiddenServicePort 80 <app-samourai-server-whirlpool-ip>:<app-samourai-server-whirlpool-port>
# LndHub Hidden Service
HiddenServiceDir /var/lib/tor/app-bluewallet
HiddenServicePort 80 <app-bluewallet-lndhub-ip>:<app-bluewallet-lndhub-port>
# nextcloud Hidden Service
HiddenServiceDir /var/lib/tor/app-nextcloud
HiddenServicePort 80 <app-nextcloud-ip>:80
# pi-hole Hidden Service
HiddenServiceDir /var/lib/tor/app-pi-hole
HiddenServicePort 80 <app-pi-hole-ip>:80
# home-assistant Hidden Service
HiddenServiceDir /var/lib/tor/app-home-assistant
HiddenServicePort 80 <app-home-assistant-ip>:8123
# gitea Hidden Service
HiddenServiceDir /var/lib/tor/app-gitea
HiddenServicePort 80 <app-gitea-ip>:<app-gitea-port>
HiddenServicePort 22 <app-gitea-ip>:<app-gitea-ssh-port>
# simple-torrent Hidden Service
HiddenServiceDir /var/lib/tor/app-simple-torrent
HiddenServicePort 80 <app-simple-torrent-ip>:<app-simple-torrent-port>
# synapse Hidden Service
HiddenServiceDir /var/lib/tor/app-synapse
HiddenServicePort 80 <app-synapse-ip>:<app-synapse-port>
HiddenServicePort <app-synapse-port> <app-synapse-ip>:<app-synapse-port>
# element Hidden Service
HiddenServiceDir /var/lib/tor/app-element
HiddenServicePort 80 <app-element-ip>:80
# vaultwarden Hidden Service
HiddenServiceDir /var/lib/tor/app-vaultwarden
HiddenServicePort 80 <app-vaultwarden-ip>:<app-vaultwarden-port>
# code-server Hidden Service
HiddenServiceDir /var/lib/tor/app-code-server
HiddenServicePort 80 <app-code-server-ip>:8080

Loading…
Cancel
Save