Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add lnbits app #372

Merged
merged 19 commits into from Feb 14, 2021
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Empty file added apps/lnbits/data/.gitkeep
Empty file.
42 changes: 42 additions & 0 deletions apps/lnbits/docker-compose.yml
@@ -0,0 +1,42 @@
version: "3.7"

x-logging:
&default-logging
driver: journald
options:
tag: "umbrel-app {{.Name}}"

services:
web:
image: louneskmt/lnbits:v0.2.0
lukechilds marked this conversation as resolved.
Show resolved Hide resolved
init: true
logging: *default-logging
restart: on-failure
stop_grace_period: 1m
ports:
- "$APP_LNBITS_PORT:$APP_LNBITS_PORT"
volumes:
- ${APP_DATA_DIR}/data:/data
- ${LND_DATA_DIR}:/lnd:ro
environment:
# Global
PORT: $APP_LNBITS_PORT
LNBITS_DATA_FOLDER: "/data"

# LND
LNBITS_BACKEND_WALLET_CLASS: LndWallet
LND_GRPC_ENDPOINT: $LND_IP
LND_GRPC_PORT: $LND_GRPC_PORT
LND_GRPC_CERT: "/lnd/tls.cert"
LND_GRPC_MACAROON: "/lnd/data/chain/bitcoin/$BITCOIN_NETWORK/admin.macaroon"

# App
LNBITS_SITE_TITLE: "LNbits - Umbrel"
LNBITS_DEFAULT_WALLET_NAME: "LNbits wallet"
LNBITS_DISABLED_EXTENSIONS: "amilk"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this extension disabled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It allows an user to automatically claim sats from an LNURLw. For example, a LNURL to claim 1000 sats every minute. I found this pretty unfair as the delay is here to allow more people to claim sats (e.g. a test LNURL in a Bitcoin bar, for newbies to discover Lightning) and not just have a single person claiming the whole balance.

If necessary I can enable it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmn, I agree that doesn't sound like very nice behaviour but I'm not sure it should be our decision to blacklist it.

It's not doing anything bad by default, right? A user would have to manually enable it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A user would have to manually enable it?

Each extension has to be activated from the extensions page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But of the extension is disabled in this env var, it cannot be installed from the web page. So yeah, if it shouldn't be our decision to blacklist it, we should remove this line.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep it disabled until we manage to improve it for future LNbits release

LNBITS_ALLOWED_USERS: ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this empty?

Are there any docs for these settings? I had a quick look at the LNbits repo but didn't find any.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LNBITS_FORCE_HTTPS: "true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know what this option does?

It doesn't appear to be using HTTPS at all for me.

Copy link
Contributor Author

@louneskmt louneskmt Feb 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. I think we can get ride of these 3 lines (disabled extensions, force http and allowed users).

LNBITS_SERVICE_FEE: "0.0"
networks:
default:
ipv4_address: $APP_LNBITS_IP
4 changes: 4 additions & 0 deletions scripts/configure
Expand Up @@ -143,6 +143,8 @@ APP_BTCPAY_SERVER_IP="10.21.21.19"
APP_BTCPAY_SERVER_PORT="3003"
APP_BTCPAY_SERVER_NBXPLORER_IP="10.21.21.20"
APP_BTCPAY_SERVER_DB_IP="10.21.21.21"
APP_LNBITS_IP="10.21.21.29"
APP_LNBITS_PORT="3007"
APP_MEMPOOL_IP="10.21.21.26"
APP_MEMPOOL_PORT="3006"
APP_MEMPOOL_API_IP="10.21.21.27"
Expand Down Expand Up @@ -294,6 +296,8 @@ for template in "${NGINX_CONF_FILE}" "${BITCOIN_CONF_FILE}" "${LND_CONF_FILE}" "
sed -i "s/<app-btcpay-server-port>/${APP_BTCPAY_SERVER_PORT}/g" "${template}"
sed -i "s/<app-btcpay-server-nbxplorer-ip>/${APP_BTCPAY_SERVER_NBXPLORER_IP}/g" "${template}"
sed -i "s/<app-btcpay-server-db-ip>/${APP_BTCPAY_SERVER_DB_IP}/g" "${template}"
sed -i "s/<app-lnbits-ip>/${APP_LNBITS_IP}/g" "${template}"
sed -i "s/<app-lnbits-port>/${APP_LNBITS_PORT}/g" "${template}"
sed -i "s/<app-mempool-ip>/${APP_MEMPOOL_IP}/g" "${template}"
sed -i "s/<app-mempool-port>/${APP_MEMPOOL_PORT}/g" "${template}"
sed -i "s/<app-mempool-db-ip>/${APP_MEMPOOL_DB_IP}/g" "${template}"
Expand Down
2 changes: 2 additions & 0 deletions templates/.env-sample
Expand Up @@ -46,6 +46,8 @@ APP_BTCPAY_SERVER_IP=<app-btcpay-server-ip>
APP_BTCPAY_SERVER_PORT=<app-btcpay-server-port>
APP_BTCPAY_SERVER_NBXPLORER_IP=<app-btcpay-server-nbxplorer-ip>
APP_BTCPAY_SERVER_DB_IP=<app-btcpay-server-db-ip>
APP_LNBITS_IP=<app-lnbits-ip>
APP_LNBITS_PORT=<app-lnbits-port>
APP_MEMPOOL_IP=<app-mempool-ip>
APP_MEMPOOL_PORT=<app-mempool-port>
APP_MEMPOOL_DB_IP=<app-mempool-db-ip>
Expand Down
3 changes: 3 additions & 0 deletions templates/torrc-sample
Expand Up @@ -61,6 +61,9 @@ HiddenServicePort 80 <app-specter-desktop-ip>:<app-specter-desktop-port>
HiddenServiceDir /var/lib/tor/app-btcpay-server
HiddenServicePort 80 <app-btcpay-server-ip>:<app-btcpay-server-port>

# lnbits Hidden Service
HiddenServiceDir /var/lib/tor/app-lnbits
HiddenServicePort 80 <app-lnbits-ip>:<app-lnbits-port>
# mempool Hidden Service
HiddenServiceDir /var/lib/tor/app-mempool
HiddenServicePort 80 <app-mempool-ip>:<app-mempool-port>
Expand Down