diff --git a/docker-compose.yml b/docker-compose.yml index d1c245e..d26bb54 100644 --- a/docker-compose.yml +++ b/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 diff --git a/scripts/configure b/scripts/configure index cba5533..915b0c3 100755 --- a/scripts/configure +++ b/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}/g" "${template}" sed -i "s//${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" diff --git a/templates/.env-sample b/templates/.env-sample index 6cdfc39..b539088 100644 --- a/templates/.env-sample +++ b/templates/.env-sample @@ -27,6 +27,7 @@ TOR_PROXY_PORT= TOR_PASSWORD= TOR_HASHED_PASSWORD= APPS_TOR_IP= +APPS_2_TOR_IP= DOCKER_BINARY= # Apps diff --git a/templates/torrc-apps-2-sample b/templates/torrc-apps-2-sample new file mode 100644 index 0000000..0181cf2 --- /dev/null +++ b/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 :80 + +# samourai-server connect Hidden Service +HiddenServiceDir /var/lib/tor/app-samourai-server +HiddenServicePort 80 :8081 + +# samourai-server whirlpool Hidden Service +HiddenServiceDir /var/lib/tor/app-samourai-server-whirlpool +HiddenServicePort 80 : + +# LndHub Hidden Service +HiddenServiceDir /var/lib/tor/app-bluewallet +HiddenServicePort 80 : + +# nextcloud Hidden Service +HiddenServiceDir /var/lib/tor/app-nextcloud +HiddenServicePort 80 :80 + +# pi-hole Hidden Service +HiddenServiceDir /var/lib/tor/app-pi-hole +HiddenServicePort 80 :80 + +# home-assistant Hidden Service +HiddenServiceDir /var/lib/tor/app-home-assistant +HiddenServicePort 80 :8123 + +# gitea Hidden Service +HiddenServiceDir /var/lib/tor/app-gitea +HiddenServicePort 80 : +HiddenServicePort 22 : + +# simple-torrent Hidden Service +HiddenServiceDir /var/lib/tor/app-simple-torrent +HiddenServicePort 80 : + +# synapse Hidden Service +HiddenServiceDir /var/lib/tor/app-synapse +HiddenServicePort 80 : +HiddenServicePort : + +# element Hidden Service +HiddenServiceDir /var/lib/tor/app-element +HiddenServicePort 80 :80 + +# vaultwarden Hidden Service +HiddenServiceDir /var/lib/tor/app-vaultwarden +HiddenServicePort 80 : + +# code-server Hidden Service +HiddenServiceDir /var/lib/tor/app-code-server +HiddenServicePort 80 :8080 diff --git a/templates/torrc-apps-sample b/templates/torrc-apps-sample index bfeb2c8..a96c76b 100644 --- a/templates/torrc-apps-sample +++ b/templates/torrc-apps-sample @@ -42,57 +42,3 @@ HiddenServicePort 80 : # mempool Hidden Service HiddenServiceDir /var/lib/tor/app-mempool HiddenServicePort 80 : - -# samourai-server dojo Hidden Service -HiddenServiceDir /var/lib/tor/app-samourai-server-dojo -HiddenServicePort 80 :80 - -# samourai-server connect Hidden Service -HiddenServiceDir /var/lib/tor/app-samourai-server -HiddenServicePort 80 :8081 - -# samourai-server whirlpool Hidden Service -HiddenServiceDir /var/lib/tor/app-samourai-server-whirlpool -HiddenServicePort 80 : - -# LndHub Hidden Service -HiddenServiceDir /var/lib/tor/app-bluewallet -HiddenServicePort 80 : - -# nextcloud Hidden Service -HiddenServiceDir /var/lib/tor/app-nextcloud -HiddenServicePort 80 :80 - -# pi-hole Hidden Service -HiddenServiceDir /var/lib/tor/app-pi-hole -HiddenServicePort 80 :80 - -# home-assistant Hidden Service -HiddenServiceDir /var/lib/tor/app-home-assistant -HiddenServicePort 80 :8123 - -# gitea Hidden Service -HiddenServiceDir /var/lib/tor/app-gitea -HiddenServicePort 80 : -HiddenServicePort 22 : - -# simple-torrent Hidden Service -HiddenServiceDir /var/lib/tor/app-simple-torrent -HiddenServicePort 80 : - -# synapse Hidden Service -HiddenServiceDir /var/lib/tor/app-synapse -HiddenServicePort 80 : -HiddenServicePort : - -# element Hidden Service -HiddenServiceDir /var/lib/tor/app-element -HiddenServicePort 80 :80 - -# vaultwarden Hidden Service -HiddenServiceDir /var/lib/tor/app-vaultwarden -HiddenServicePort 80 : - -# code-server Hidden Service -HiddenServiceDir /var/lib/tor/app-code-server -HiddenServicePort 80 :8080