diff --git a/.env.example b/.env.example index 6ca9a281..22e7d052 100644 --- a/.env.example +++ b/.env.example @@ -17,6 +17,7 @@ LNBITS_DEFAULT_WALLET_NAME="LNbits wallet" LNBITS_DATA_FOLDER="./data" # LNBITS_DATABASE_URL="postgres://user:password@host:port/databasename" +# disable selected extensions, or use "all" to disable all extensions LNBITS_DISABLED_EXTENSIONS="amilk,ngrok" LNBITS_FORCE_HTTPS=true LNBITS_SERVICE_FEE="0.0" @@ -50,12 +51,12 @@ LNBITS_KEY=LNBITS_ADMIN_KEY LND_GRPC_ENDPOINT=127.0.0.1 LND_GRPC_PORT=11009 LND_GRPC_CERT="/home/bob/.config/Zap/lnd/bitcoin/mainnet/wallet-1/data/chain/bitcoin/mainnet/tls.cert" -LND_GRPC_MACAROON="/home/bob/.config/Zap/lnd/bitcoin/mainnet/wallet-1/data/chain/bitcoin/mainnet/admin.macaroon" +LND_GRPC_MACAROON="/home/bob/.config/Zap/lnd/bitcoin/mainnet/wallet-1/data/chain/bitcoin/mainnet/admin.macaroon or HEXSTRING" # LndRestWallet LND_REST_ENDPOINT=https://127.0.0.1:8080/ LND_REST_CERT="/home/bob/.config/Zap/lnd/bitcoin/mainnet/wallet-1/data/chain/bitcoin/mainnet/tls.cert" -LND_REST_MACAROON="HEXSTRING" +LND_REST_MACAROON="/home/bob/.config/Zap/lnd/bitcoin/mainnet/wallet-1/data/chain/bitcoin/mainnet/admin.macaroon or HEXSTRING" # LNPayWallet LNPAY_API_ENDPOINT=https://api.lnpay.co/v1/ diff --git a/README.md b/README.md index bc700bfd..cbcf3797 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ LNbits # LNbits v0.3 BETA, free and open-source lightning-network wallet/accounts system +(Join us on [https://t.me/lnbits](https://t.me/lnbits)) + Use [lnbits.com](https://lnbits.com), or run your own LNbits server! LNbits is a very simple Python server that sits on top of any funding source, and can be used as: diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 9fb8a3e3..8a2782b7 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -4,9 +4,7 @@ title: Basic installation nav_order: 2 --- - -Basic installation -================== +# Basic installation Download this repo and install the dependencies: @@ -31,10 +29,16 @@ Then you can restart it and it will be using the new settings. You might also need to install additional packages or perform additional setup steps, depending on the chosen backend. See [the short guide](./wallets.md) on each different funding source. -Docker installation -=================== +# Additional guides + +### LNbits running on Umbrel behind Tor + +If you want to run LNbits on your Umbrel but want it to be reached through clearnet, _Uxellodunum_ made an extensive [guide](https://community.getumbrel.com/t/guide-lnbits-without-tor/604) on how to do it. + +### Docker installation To install using docker you first need to build the docker image as: + ``` git clone https://github.com/lnbits/lnbits.git cd lnbits/ # ${PWD} referred as @@ -42,19 +46,30 @@ docker build -t lnbits . ``` You can launch the docker in a different directory, but make sure to copy `.env.example` from lnbits there + ``` cp /.env.example .env ``` + and change the configuration in `.env` as required. Then create the data directory for the user ID 1000, which is the user that runs the lnbits within the docker container. + ``` mkdir data sudo chown 1000:1000 ./data/ ``` Then the image can be run as: + ``` docker run --detach --publish 5000:5000 --name lnbits --volume ${PWD}/.env:/app/.env --volume ${PWD}/data/:/app/data lnbits ``` + Finally you can access your lnbits on your machine at port 5000. + +# Additional guides + +## LNbits running on Umbrel behind Tor + +If you want to run LNbits on your Umbrel but want it to be reached through clearnet, _Uxellodunum_ made an extensive [guide](https://community.getumbrel.com/t/guide-lnbits-without-tor/604) on how to do it. diff --git a/lnbits/app.py b/lnbits/app.py index f264bf4a..5da9a195 100644 --- a/lnbits/app.py +++ b/lnbits/app.py @@ -18,11 +18,12 @@ from .helpers import ( ) from .proxy_fix import ASGIProxyFix from .tasks import ( + webhook_handler, + invoice_listener, run_deferred_async, check_pending_payments, - invoice_listener, internal_invoice_listener, - webhook_handler, + catch_everything_and_restart, ) from .settings import WALLET @@ -118,10 +119,10 @@ def register_async_tasks(app): @app.before_serving async def listeners(): - run_deferred_async(app.nursery) - app.nursery.start_soon(check_pending_payments) - app.nursery.start_soon(invoice_listener, app.nursery) - app.nursery.start_soon(internal_invoice_listener, app.nursery) + run_deferred_async() + app.nursery.start_soon(catch_everything_and_restart, check_pending_payments) + app.nursery.start_soon(catch_everything_and_restart, invoice_listener) + app.nursery.start_soon(catch_everything_and_restart, internal_invoice_listener) @app.after_serving async def stop_listeners(): @@ -131,6 +132,7 @@ def register_async_tasks(app): def register_exception_handlers(app): @app.errorhandler(Exception) async def basic_error(err): + print("handled error", traceback.format_exc()) etype, value, tb = sys.exc_info() traceback.print_exception(etype, err, tb) exc = traceback.format_exc() diff --git a/lnbits/core/templates/core/index.html b/lnbits/core/templates/core/index.html index a7e9c39d..88dc496d 100644 --- a/lnbits/core/templates/core/index.html +++ b/lnbits/core/templates/core/index.html @@ -21,7 +21,7 @@ filled dense v-model="walletName" - label="Name your LNbits wallet *" + label="Name your {{SITE_TITLE}} wallet *" > {% raw %}