Skip to content

Commit

Permalink
Revert "Revert "Add internal Tor daemon to required apps (getumbrel#218
Browse files Browse the repository at this point in the history
…)" (getumbrel#219)"

This reverts commit dc98eff.
  • Loading branch information
lukechilds committed Oct 25, 2022
1 parent dc98eff commit ca9361b
Show file tree
Hide file tree
Showing 46 changed files with 327 additions and 86 deletions.
12 changes: 11 additions & 1 deletion bitcoin/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,14 @@ services:
- "${APP_BITCOIN_RPC_PORT}:${APP_BITCOIN_RPC_PORT}"
networks:
default:
ipv4_address: $APP_BITCOIN_NODE_IP
ipv4_address: $APP_BITCOIN_NODE_IP

tor:
image: getumbrel/tor:0.4.7.8@sha256:2ace83f22501f58857fa9b403009f595137fa2e7986c4fda79d82a8119072b6a
user: "1000:1000"
restart: on-failure
volumes:
- ${APP_DATA_DIR}/torrc:/etc/tor/torrc:ro
- ${TOR_DATA_DIR}:/data
environment:
HOME: "/tmp"
26 changes: 26 additions & 0 deletions bitcoin/hooks/pre-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Delay booting Bitcoin until the RPC and P2P Tor Hidden Services are ready

HIDDEN_SERVICE_FILE="${TOR_DATA_DIR}/app-${APP_ID}-rpc/hostname"

if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
exit
fi

"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach bitcoind
"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach tor

echo "App: ${APP_ID} - Generating Tor Hidden Service..."

for attempt in $(seq 1 100); do
if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file created successfully!"
break
fi
sleep 0.1
done

if [[ ! -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file wasn't created"
fi
6 changes: 1 addition & 5 deletions bitcoin/torrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ HiddenServicePort $APP_BITCOIN_P2P_PORT $APP_BITCOIN_NODE_IP:$APP_BITCOIN_TOR_PO

# Bitcoin Core RPC Hidden Service
HiddenServiceDir /data/app-$APP_ID-rpc
HiddenServicePort $APP_BITCOIN_RPC_PORT $APP_BITCOIN_NODE_IP:$APP_BITCOIN_RPC_PORT

# Bitcoin Core Frontend Hidden Service
HiddenServiceDir /data/app-$APP_ID
HiddenServicePort 80 $APP_PROXY_HOSTNAME:$APP_PROXY_PORT
HiddenServicePort $APP_BITCOIN_RPC_PORT $APP_BITCOIN_NODE_IP:$APP_BITCOIN_RPC_PORT
2 changes: 1 addition & 1 deletion bitcoin/umbrel-app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
manifestVersion: 1
manifestVersion: 1.1
id: bitcoin
category: Finance
name: Bitcoin Node
Expand Down
12 changes: 11 additions & 1 deletion core-lightning/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,14 @@ services:
- "${APP_DATA_DIR}/data/lightningd:/data/.lightning"
networks:
default:
ipv4_address: ${APP_CORE_LIGHTNING_DAEMON_IP}
ipv4_address: ${APP_CORE_LIGHTNING_DAEMON_IP}

tor:
image: getumbrel/tor:0.4.7.8@sha256:2ace83f22501f58857fa9b403009f595137fa2e7986c4fda79d82a8119072b6a
user: "1000:1000"
restart: on-failure
volumes:
- ${APP_DATA_DIR}/torrc:/etc/tor/torrc:ro
- ${TOR_DATA_DIR}:/data
environment:
HOME: "/tmp"
26 changes: 26 additions & 0 deletions core-lightning/hooks/pre-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Delay booting Core Lightning until the REST Tor Hidden Service is ready

HIDDEN_SERVICE_FILE="${TOR_DATA_DIR}/app-${APP_ID}-rest/hostname"

if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
exit
fi

"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach c-lightning-rest
"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach tor

echo "App: ${APP_ID} - Generating Tor Hidden Service..."

for attempt in $(seq 1 100); do
if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file created successfully!"
break
fi
sleep 0.1
done

if [[ ! -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file wasn't created"
fi
6 changes: 1 addition & 5 deletions core-lightning/torrc.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Core Lightning REST Hidden Service
HiddenServiceDir /data/app-$APP_ID-rest
HiddenServicePort $APP_CORE_LIGHTNING_REST_PORT $APP_CORE_LIGHTNING_REST_IP:$APP_CORE_LIGHTNING_REST_PORT

# Core Lightning Frontend Hidden Service
HiddenServiceDir /data/app-$APP_ID
HiddenServicePort 80 $APP_PROXY_HOSTNAME:$APP_PROXY_PORT
HiddenServicePort $APP_CORE_LIGHTNING_REST_PORT $APP_CORE_LIGHTNING_REST_IP:$APP_CORE_LIGHTNING_REST_PORT
2 changes: 1 addition & 1 deletion core-lightning/umbrel-app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
manifestVersion: 1
manifestVersion: 1.1
id: core-lightning
category: Finance
name: Core Lightning
Expand Down
12 changes: 11 additions & 1 deletion electrs/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,14 @@ services:
- "${APP_ELECTRS_NODE_PORT}:${APP_ELECTRS_NODE_PORT}"
networks:
default:
ipv4_address: $APP_ELECTRS_NODE_IP
ipv4_address: $APP_ELECTRS_NODE_IP

tor:
image: getumbrel/tor:0.4.7.8@sha256:2ace83f22501f58857fa9b403009f595137fa2e7986c4fda79d82a8119072b6a
user: "1000:1000"
restart: on-failure
volumes:
- ${APP_DATA_DIR}/torrc:/etc/tor/torrc:ro
- ${TOR_DATA_DIR}:/data
environment:
HOME: "/tmp"
26 changes: 26 additions & 0 deletions electrs/hooks/pre-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Delay booting Electrs until the RPC Tor Hidden Service is ready

HIDDEN_SERVICE_FILE="${TOR_DATA_DIR}/app-${APP_ID}-rpc/hostname"

if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
exit
fi

"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach electrs
"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach tor

echo "App: ${APP_ID} - Generating Tor Hidden Service..."

for attempt in $(seq 1 100); do
if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file created successfully!"
break
fi
sleep 0.1
done

if [[ ! -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file wasn't created"
fi
6 changes: 1 addition & 5 deletions electrs/torrc.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# Electrs RPC Hidden Service
HiddenServiceDir /data/app-$APP_ID-rpc
HiddenServicePort $APP_ELECTRS_NODE_PORT $APP_ELECTRS_NODE_IP:$APP_ELECTRS_NODE_PORT

# Electrs Frontend Hidden Service
HiddenServiceDir /data/app-$APP_ID
HiddenServicePort 80 $APP_PROXY_HOSTNAME:$APP_PROXY_PORT
HiddenServicePort $APP_ELECTRS_NODE_PORT $APP_ELECTRS_NODE_IP:$APP_ELECTRS_NODE_PORT
2 changes: 1 addition & 1 deletion electrs/umbrel-app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
manifestVersion: 1
manifestVersion: 1.1
id: electrs
category: Finance
name: Electrs
Expand Down
10 changes: 9 additions & 1 deletion elements/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,13 @@ services:
networks:
default:
ipv4_address: $APP_ELEMENTS_IP


tor:
image: getumbrel/tor:0.4.7.8@sha256:2ace83f22501f58857fa9b403009f595137fa2e7986c4fda79d82a8119072b6a
user: "1000:1000"
restart: on-failure
volumes:
- ${APP_DATA_DIR}/torrc:/etc/tor/torrc:ro
- ${TOR_DATA_DIR}:/data
environment:
HOME: "/tmp"
26 changes: 26 additions & 0 deletions elements/hooks/pre-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Delay booting Elements until the RPC and P2P Tor Hidden Services are ready

HIDDEN_SERVICE_FILE="${TOR_DATA_DIR}/app-${APP_ID}-p2p/hostname"

if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
exit
fi

"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach node
"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach tor

echo "App: ${APP_ID} - Generating Tor Hidden Service..."

for attempt in $(seq 1 100); do
if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file created successfully!"
break
fi
sleep 0.1
done

if [[ ! -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file wasn't created"
fi
6 changes: 1 addition & 5 deletions elements/torrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ HiddenServicePort $APP_ELEMENTS_NODE_RPC_PORT $APP_ELEMENTS_NODE_IP:$APP_ELEMENT

# elements p2p Hidden Service
HiddenServiceDir /data/app-$APP_ID-p2p
HiddenServicePort $APP_ELEMENTS_NODE_P2P_PORT $APP_ELEMENTS_NODE_IP:$APP_ELEMENTS_NODE_P2P_PORT

# elements Hidden Service
HiddenServiceDir /data/app-$APP_ID
HiddenServicePort 80 $APP_PROXY_HOSTNAME:$APP_PROXY_PORT
HiddenServicePort $APP_ELEMENTS_NODE_P2P_PORT $APP_ELEMENTS_NODE_IP:$APP_ELEMENTS_NODE_P2P_PORT
2 changes: 1 addition & 1 deletion elements/umbrel-app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
manifestVersion: 1
manifestVersion: 1.1
id: elements
category: Wallet Servers
name: Elements Core
Expand Down
3 changes: 2 additions & 1 deletion gitea/exports.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export APP_GITEA_PORT="8085"
export APP_GITEA_SSH_PORT="2222"
export APP_GITEA_IP="10.21.21.39"
export APP_GITEA_DB_IP="10.21.21.40"
export APP_GITEA_DB_IP="10.21.21.40"
export APP_GITEA_TOR_HS_EXTRA_PORTS="22:${APP_GITEA_IP}:${APP_GITEA_SSH_PORT}"
4 changes: 0 additions & 4 deletions gitea/torrc.template

This file was deleted.

2 changes: 1 addition & 1 deletion gitea/umbrel-app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
manifestVersion: 1
manifestVersion: 1.1
id: gitea
category: Development
name: Gitea
Expand Down
2 changes: 1 addition & 1 deletion jam/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ services:
jm_rpc_wallet_file: jam_default
networks:
default:
ipv4_address: $APP_JAM_IP
ipv4_address: $APP_JAM_IP
2 changes: 1 addition & 1 deletion jam/umbrel-app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
manifestVersion: 1
manifestVersion: 1.1
id: jam
category: Finance
name: Jam
Expand Down
3 changes: 2 additions & 1 deletion kollider/exports.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export APP_KOLLIDER_IP="10.21.21.70"
export APP_KOLLIDER_PORT="4243"
export APP_KOLLIDER_WS_IP="10.21.21.71"
export APP_KOLLIDER_WS_PORT="4244"
export APP_KOLLIDER_HH_IP="10.21.21.72"
export APP_KOLLIDER_HH_IP="10.21.21.72"
export APP_KOLLIDER_TOR_HS_EXTRA_PORTS="4244:${APP_KOLLIDER_WS_IP}:8080"
4 changes: 0 additions & 4 deletions kollider/torrc.template

This file was deleted.

2 changes: 1 addition & 1 deletion kollider/umbrel-app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
manifestVersion: 1
manifestVersion: 1.1
id: kollider
category: Finance
name: Kollider
Expand Down
10 changes: 10 additions & 0 deletions lightning/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,13 @@ services:
networks:
default:
ipv4_address: $APP_LIGHTNING_NODE_IP

tor:
image: getumbrel/tor:0.4.7.8@sha256:2ace83f22501f58857fa9b403009f595137fa2e7986c4fda79d82a8119072b6a
user: "1000:1000"
restart: on-failure
volumes:
- ${APP_DATA_DIR}/torrc:/etc/tor/torrc:ro
- ${TOR_DATA_DIR}:/data
environment:
HOME: "/tmp"
26 changes: 26 additions & 0 deletions lightning/hooks/pre-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

# Delay booting Lightning until the GRPC and REST Tor Hidden Services are ready

HIDDEN_SERVICE_FILE="${TOR_DATA_DIR}/app-${APP_ID}-grpc/hostname"

if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
exit
fi

"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach lnd
"${UMBREL_ROOT}/scripts/app" compose "${APP_ID}" up --detach tor

echo "App: ${APP_ID} - Generating Tor Hidden Service..."

for attempt in $(seq 1 100); do
if [[ -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file created successfully!"
break
fi
sleep 0.1
done

if [[ ! -f "${HIDDEN_SERVICE_FILE}" ]]; then
echo "App: ${APP_ID} - Hidden service file wasn't created"
fi
6 changes: 1 addition & 5 deletions lightning/torrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ HiddenServicePort $APP_LIGHTNING_NODE_REST_PORT $APP_LIGHTNING_NODE_IP:$APP_LIGH

# LND gRPC Hidden Service
HiddenServiceDir /data/app-$APP_ID-grpc
HiddenServicePort $APP_LIGHTNING_NODE_GRPC_PORT $APP_LIGHTNING_NODE_IP:$APP_LIGHTNING_NODE_GRPC_PORT

# LND Frontend Hidden Service
HiddenServiceDir /data/app-$APP_ID
HiddenServicePort 80 $APP_PROXY_HOSTNAME:$APP_PROXY_PORT
HiddenServicePort $APP_LIGHTNING_NODE_GRPC_PORT $APP_LIGHTNING_NODE_IP:$APP_LIGHTNING_NODE_GRPC_PORT
2 changes: 1 addition & 1 deletion lightning/umbrel-app.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
manifestVersion: 1
manifestVersion: 1.1
id: lightning
category: Finance
name: Lightning Node
Expand Down
10 changes: 10 additions & 0 deletions samourai-server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,13 @@ services:
networks:
default:
ipv4_address: $APP_SAMOURAI_SERVER_IP

tor:
image: getumbrel/tor:0.4.7.8@sha256:2ace83f22501f58857fa9b403009f595137fa2e7986c4fda79d82a8119072b6a
user: "1000:1000"
restart: on-failure
volumes:
- ${APP_DATA_DIR}/torrc:/etc/tor/torrc:ro
- ${TOR_DATA_DIR}:/data
environment:
HOME: "/tmp"
Loading

0 comments on commit ca9361b

Please sign in to comment.