From 9061fbb0507d28a53f0c9b22241020157d6f7e52 Mon Sep 17 00:00:00 2001 From: nmfretz Date: Sun, 17 Nov 2024 00:30:38 +1000 Subject: [PATCH] Fulcrum parses logs for sync percent when admin port not listening --- fulcrum/data/fulcrum-logs/.gitkeep | 0 fulcrum/docker-compose.yml | 13 ++++++++----- fulcrum/exports.sh | 1 + fulcrum/hooks/pre-start | 6 ++++++ 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 fulcrum/data/fulcrum-logs/.gitkeep mode change 100644 => 100755 fulcrum/hooks/pre-start diff --git a/fulcrum/data/fulcrum-logs/.gitkeep b/fulcrum/data/fulcrum-logs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/fulcrum/docker-compose.yml b/fulcrum/docker-compose.yml index ea59e5a..a026167 100644 --- a/fulcrum/docker-compose.yml +++ b/fulcrum/docker-compose.yml @@ -7,20 +7,21 @@ services: APP_PORT: 3006 app: - image: ghcr.io/sahilph/umbrel-fulcrum:sha-349e246@sha256:5d565f3b15f7bbeab28c027320ffc84d647e7816cd007fd84077c0db05c15393 + image: nmfretz/fulcrum:ui-test@sha256:4dcb7933630df1d6bb05081f4e024ebaabe710c7b3e9875339b4a8f2c88ba7f7 depends_on: - fulcrum restart: on-failure environment: ELECTRUM_HIDDEN_SERVICE: "${APP_FULCRUM_RPC_HIDDEN_SERVICE}" ELECTRUM_LOCAL_SERVICE: "${DEVICE_DOMAIN_NAME}" - ELECTRUM_PORT: ${APP_FULCRUM_NODE_PORT} - FULCRUM_HOST: "${APP_FULCRUM_NODE_IP}" - FULCRUM_PORT: "${APP_FULCRUM_NODE_PORT}" + ELECTRUM_HOST: "${APP_FULCRUM_NODE_IP}" + ELECTRUM_PUBLIC_CONNECTION_PORT: ${APP_FULCRUM_NODE_PORT} BITCOIN_HOST: "${APP_BITCOIN_NODE_IP}" RPC_USER: "${APP_BITCOIN_RPC_USER}" RPC_PASSWORD: "${APP_BITCOIN_RPC_PASS}" RPC_PORT: "${APP_BITCOIN_RPC_PORT}" + volumes: + - "${APP_DATA_DIR}/data/fulcrum-logs:/fulcrum-logs" networks: default: ipv4_address: $APP_FULCRUM_IP @@ -31,14 +32,16 @@ services: user: "1000:1000" environment: TCP: 0.0.0.0:${APP_FULCRUM_NODE_PORT} + ADMIN: 0.0.0.0:${APP_FULCRUM_ADMIN_PORT} BITCOIND: ${APP_BITCOIN_NODE_IP}:${APP_BITCOIN_RPC_PORT} RPCUSER: ${APP_BITCOIN_RPC_USER} RPCPASSWORD: ${APP_BITCOIN_RPC_PASS} PEERING: "false" ANNOUNCE: "false" - command: Fulcrum _ENV_ + command: sh -c 'Fulcrum -D /data _ENV_ 2>&1 | tee /logs/fulcrum.log' volumes: - "${APP_DATA_DIR}/data/fulcrum:/data" + - "${APP_DATA_DIR}/data/fulcrum-logs:/logs" ports: - "${APP_FULCRUM_NODE_PORT}:${APP_FULCRUM_NODE_PORT}" networks: diff --git a/fulcrum/exports.sh b/fulcrum/exports.sh index f0f1874..ee16104 100644 --- a/fulcrum/exports.sh +++ b/fulcrum/exports.sh @@ -2,6 +2,7 @@ export APP_FULCRUM_IP="10.21.22.200" export APP_FULCRUM_NODE_IP="10.21.21.200" export APP_FULCRUM_NODE_PORT="50002" +export APP_FULCRUM_ADMIN_PORT="8000" for var in \ IP \ diff --git a/fulcrum/hooks/pre-start b/fulcrum/hooks/pre-start old mode 100644 new mode 100755 index 7cf6e7e..b950180 --- a/fulcrum/hooks/pre-start +++ b/fulcrum/hooks/pre-start @@ -1,5 +1,11 @@ #!/usr/bin/env bash +# If ${APP_DATA_DIR}/data/fulcrum-logs doesn't exist, we create it and set 1000:1000 ownership +if [[ ! -d "${APP_DATA_DIR}/data/fulcrum-logs" ]]; then + mkdir -p "${APP_DATA_DIR}/data/fulcrum-logs" + chown 1000:1000 "${APP_DATA_DIR}/data/fulcrum-logs" +fi + # Delay booting Fulcrum until the RPC Tor Hidden Service is ready HIDDEN_SERVICE_FILE="${TOR_DATA_DIR}/app-${APP_ID}-rpc/hostname"