export optional lightning node app env vars

This commit is contained in:
nmfretz committed 2025-01-10 11:27:37 +10:00
1 parent 9783b97077
commit 17af9fbabe
2 files changed
+13 -3

No files matched your search

+2 -2
View File
@@ -18,7 +18,7 @@ services:
BACKEND_MAINNET_HTTP_HOST: $APP_MEMPOOL_API_IP
NGINX_PORT: $APP_MEMPOOL_PORT
NGINX_HOSTNAME: $APP_MEMPOOL_API_IP
LIGHTNING_DETECTED_PORT: $APP_LIGHTNING_NODE_PORT
LIGHTNING_DETECTED_PORT: $APP_MEMPOOL_LIGHTNING_NODE_PORT
networks:
default:
ipv4_address: $APP_MEMPOOL_IP
@@ -56,7 +56,7 @@ services:
LIGHTNING_GRAPH_REFRESH_INTERVAL: 3600
LND_TLS_CERT_PATH: "/lnd/tls.cert"
LND_MACAROON_PATH: "/lnd/data/chain/bitcoin/$APP_BITCOIN_NETWORK/readonly.macaroon"
LND_REST_API_URL: "https://$APP_LIGHTNING_NODE_IP:$APP_LIGHTNING_NODE_REST_PORT"
LND_REST_API_URL: "https://$APP_MEMPOOL_LIGHTNING_NODE_IP:$APP_MEMPOOL_LIGHTNING_NODE_REST_PORT"
LND_TIMEOUT: 120000
NODE_OPTIONS: "--max-old-space-size=2048"
networks:
+11 -1
View File
@@ -4,4 +4,14 @@ export APP_MEMPOOL_API_IP="10.21.21.27"
export APP_MEMPOOL_DB_IP="10.21.21.28"
hidden_service_file="${EXPORTS_TOR_DATA_DIR}/app-${EXPORTS_APP_ID}/hostname"
export APP_MEMPOOL_HIDDEN_SERVICE="$(cat "${hidden_service_file}" 2>/dev/null || echo "")"
export APP_MEMPOOL_HIDDEN_SERVICE="$(cat "${hidden_service_file}" 2>/dev/null || echo "")"
# Check if Lightning Node app is installed and export required variables if so
# The Lightning Node app is optional and not listed in the `required` field of the umbrel-app.yml file, so we need to do this for compatibility with umbrelOS >=1.3 where only exports of required apps are sourced.
installed_apps=$("${UMBREL_ROOT}/scripts/app" ls-installed)
if echo "$installed_apps" | grep --quiet 'lightning'; then
export APP_MEMPOOL_LIGHTNING_NODE_PORT="9735"
export APP_MEMPOOL_LIGHTNING_NODE_IP="10.21.21.9"
export APP_MEMPOOL_LIGHTNING_NODE_REST_PORT="8080"
fi