regtest: rename castle → libra in default-installed extensions
Some checks are pending
ci / regtest (push) Waiting to run

The castle LNbits extension was renamed to libra. Updates the
default-install / default-user env vars in docker-compose.dev.yml
and the fava-url pin in lnbits-entrypoint.sh (DB filename, slug,
log prefix, comments). The entrypoint script was previously
untracked — tracking it now so the rename persists for fresh
checkouts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-05-05 20:44:47 +02:00
commit e404b7ee11
2 changed files with 49 additions and 2 deletions

View file

@ -25,14 +25,21 @@ services:
LNBITS_DATA_FOLDER: "./data" LNBITS_DATA_FOLDER: "./data"
LNBITS_EXTENSIONS_PATH: "/shared" LNBITS_EXTENSIONS_PATH: "/shared"
FAKE_WALLET_SECRET: "devsecret" FAKE_WALLET_SECRET: "devsecret"
LNBITS_EXTENSIONS_DEFAULT_INSTALL: "lnurlp,nostrclient,nostrrelay,nostrmarket,events,castle,satmachineclient,satmachineadmin" LNBITS_EXTENSIONS_DEFAULT_INSTALL: "lnurlp,nostrclient,nostrrelay,nostrmarket,events,libra,satmachineclient,satmachineadmin"
LNBITS_ADMIN_EXTENSIONS: "nostrclient,nostrrelay,satmachineadmin" LNBITS_ADMIN_EXTENSIONS: "nostrclient,nostrrelay,satmachineadmin"
LNBITS_USER_DEFAULT_EXTENSIONS: "lnurlp,nostrmarket,events,castle,satmachineclient" LNBITS_USER_DEFAULT_EXTENSIONS: "lnurlp,nostrmarket,events,libra,satmachineclient"
ports: ports:
- 5001:5001 - 5001:5001
volumes: volumes:
- ./data/lnbits-dev:/app/data - ./data/lnbits-dev:/app/data
- /home/padreug/dev/shared/extensions:/shared/extensions - /home/padreug/dev/shared/extensions:/shared/extensions
# Bind the lnbits package so host edits are picked up on container
# restart without rebuilding the image. The venv at /app/.venv stays
# baked in.
- ${LNBITS_SRC:-/home/padreug/dev/lnbits/demo}/lnbits:/app/lnbits
# Pre-start init: pin libra's fava_url to http://fava:5000.
- ./lnbits-entrypoint.sh:/usr/local/bin/lnbits-entrypoint.sh:ro
command: ["/usr/local/bin/lnbits-entrypoint.sh"]
fava: fava:
hostname: fava hostname: fava

40
lnbits-entrypoint.sh Executable file
View file

@ -0,0 +1,40 @@
#!/bin/sh
# Wraps the lnbits CMD to keep libra's fava_url pinned at the docker-network
# address `http://fava:5000`. Libra persists the URL in
# /app/data/ext_libra.sqlite3 (extension_settings.fava_url) and the model
# default is "http://localhost:3333", which doesn't resolve from inside the
# lnbits container.
#
# Background loop polls until the table exists, then UPSERTs the row, then
# exits. Runs alongside the lnbits process so it lands before libra's async
# _init_fava() task reads the row on a fresh DB.
set -e
(
while true; do
if [ -f /app/data/ext_libra.sqlite3 ]; then
python3 -c '
import sqlite3, sys, time
try:
con = sqlite3.connect("/app/data/ext_libra.sqlite3")
con.execute(
"INSERT INTO extension_settings (id, fava_url, fava_ledger_slug, fava_timeout, updated_at) "
"VALUES (?, ?, ?, ?, ?) "
"ON CONFLICT(id) DO UPDATE SET fava_url=excluded.fava_url, updated_at=excluded.updated_at",
("admin", "http://fava:5000", "libra-ledger", 10.0, time.time()),
)
con.commit()
print("[libra-fava-url-init] fava_url=http://fava:5000", flush=True)
except sqlite3.OperationalError:
sys.exit(1)
' && break
fi
sleep 0.5
done
) &
exec uv --offline run lnbits \
--port "${LNBITS_PORT:-5001}" \
--host "${LNBITS_HOST:-0.0.0.0}" \
--forwarded-allow-ips='*'