diff --git a/.env.development b/.env.development index dfcba12b..35876bc5 100644 --- a/.env.development +++ b/.env.development @@ -184,6 +184,7 @@ grpc_proxy=http://tor:7050/ # lnbits LNBITS_WEB_PORT=5001 +LNBITS_WEB_PORT_V1=5002 # CPU shares for each category CPU_SHARES_IMPORTANT=1024 diff --git a/docker-compose.yml b/docker-compose.yml index 35b6e232..58836fd7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -809,6 +809,36 @@ services: CONNECT: "localhost:${LNBITS_WEB_PORT}" TORDIR: "/app/.tor" cpu_shares: "${CPU_SHARES_LOW}" + lnbits-v1: + build: + context: ./docker/lnbits-v1 + container_name: lnbits-v1 + profiles: + - wallets + restart: unless-stopped + ports: + - "${LNBITS_WEB_PORT_V1}:5000" + depends_on: + tor: + condition: service_healthy + restart: true + lnd: + condition: service_healthy + restart: true + environment: + - LNBITS_ADMIN_UI=true + - LNBITS_BACKEND_WALLET_CLASS=LndWallet + - LND_GRPC_ENDPOINT=lnd + - LND_GRPC_PORT=10009 + - LND_GRPC_CERT=/app/.lnd/tls.cert + - LND_GRPC_MACAROON=/app/.lnd/data/chain/bitcoin/regtest/admin.macaroon + volumes: + - lnd:/app/.lnd + - tordata:/app/.tor + labels: + CONNECT: "localhost:${LNBITS_WEB_PORT_V1}" + TORDIR: "/app/.tor" + cpu_shares: "${CPU_SHARES_LOW}" dnsmasq: image: 4km3/dnsmasq:2.90-r3 profiles: diff --git a/docker/lnbits-v1/Dockerfile b/docker/lnbits-v1/Dockerfile new file mode 100644 index 00000000..f5e9805e --- /dev/null +++ b/docker/lnbits-v1/Dockerfile @@ -0,0 +1,5 @@ +FROM lnbits/lnbits:latest + + +COPY ["./data/database.sqlite3", "/app/data/database.sqlite3"] +COPY ["./data/.super_user", "/app/data/.super_user"] \ No newline at end of file diff --git a/docker/lnbits-v1/data/.super_user b/docker/lnbits-v1/data/.super_user new file mode 100644 index 00000000..1d7c4f33 --- /dev/null +++ b/docker/lnbits-v1/data/.super_user @@ -0,0 +1 @@ +e46288268b67457399a5fca81809573e \ No newline at end of file diff --git a/docker/lnbits-v1/data/database.sqlite3 b/docker/lnbits-v1/data/database.sqlite3 new file mode 100644 index 00000000..c45340ef Binary files /dev/null and b/docker/lnbits-v1/data/database.sqlite3 differ diff --git a/wallets/lnbits/server.js b/wallets/lnbits/server.js index 4382c671..c22ce8ae 100644 --- a/wallets/lnbits/server.js +++ b/wallets/lnbits/server.js @@ -38,7 +38,7 @@ export async function createInvoice ( if (process.env.NODE_ENV !== 'production' && hostname.startsWith('localhost:')) { // to make it possible to attach LNbits for receives during local dev - hostname = 'lnbits:5000' + hostname = hostname === `localhost:${process.env.LNBITS_WEB_PORT}` ? 'lnbits:5000' : 'lnbits-v1:5000' } let res