#!/usr/bin/env bash set -e mkdir -p /root/.electrum/wallets # The allow-list may come from ALLOWED_USERS instead of a mounted file. Missing # is fine; a *directory* here means Docker auto-created one for a bind mount # that pointed at a non-existent path, which would silently lock everyone out. ALLOWED_FILE="${ALLOWED_USERS_FILE:-/app/allowed_users.txt}" if [ -d "$ALLOWED_FILE" ]; then echo "ERROR: $ALLOWED_FILE is a directory." echo "Create the file on the host before starting, or drop the bind mount" echo "and set ALLOWED_USERS=, in your .env instead." >&2 exit 1 fi if [ ! -f "$ALLOWED_FILE" ] && [ -z "${ALLOWED_USERS:-}" ]; then echo "WARNING: no allow-list found — set ALLOWED_USERS or mount $ALLOWED_FILE" >&2 fi echo "Starting Electrum daemon..." rm -f /root/.electrum/daemon if [ -n "${ELECTRUM_SERVER:-}" ]; then # Pin to one server (e.g. your own node) instead of random public peers echo "Pinning Electrum to ${ELECTRUM_SERVER}" electrum -1 -s "${ELECTRUM_SERVER}" daemon -d else electrum daemon -d fi echo "Electrum daemon started. Launching bot..." exec /opt/electrum/bin/python3 /app/bot.py