diff --git a/rootfs/standard/etc/systemd/system/lnbits.service b/rootfs/standard/etc/systemd/system/lnbits.service index 82749b97..3dec55c0 100644 --- a/rootfs/standard/etc/systemd/system/lnbits.service +++ b/rootfs/standard/etc/systemd/system/lnbits.service @@ -13,7 +13,14 @@ ExecStartPre=/usr/bin/wait_on_lnd.sh ExecStartPre=/usr/bin/service_scripts/pre_lnbits.sh WorkingDirectory=/opt/mynode/lnbits -ExecStart=/usr/bin/docker run --rm --name lnbits-legend -p 5000:5000 --volume /opt/mynode/lnbits/.env:/app/.env --volume /mnt/hdd/mynode/lnbits/:/app/data --volume /mnt/hdd/mynode/lnd/tls.cert:/app/tls.cert lnbits-legend +ExecStart=/usr/bin/docker run --rm \ + --name lnbits-legend \ + -p 5000:5000 \ + --volume /opt/mynode/lnbits/.env:/app/.env \ + --volume /mnt/hdd/mynode/lnbits/:/app/data \ + --volume /mnt/hdd/mynode/lnd/tls.cert:/app/tls.cert \ + --volume /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/admin.macaroon:/app/admin.macaroon \ + lnbits-legend ExecStop=/usr/bin/docker stop -t 2 lnbits-legend User=bitcoin diff --git a/rootfs/standard/usr/bin/service_scripts/pre_lnbits.sh b/rootfs/standard/usr/bin/service_scripts/pre_lnbits.sh index 0ec7edfb..672d72de 100755 --- a/rootfs/standard/usr/bin/service_scripts/pre_lnbits.sh +++ b/rootfs/standard/usr/bin/service_scripts/pre_lnbits.sh @@ -4,9 +4,7 @@ set -x # Generate hex macaroons -macaroonAdminHex=$(xxd -ps -u -c 1000 /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/admin.macaroon) +#macaroonAdminHex=$(xxd -ps -u -c 1000 /mnt/hdd/mynode/lnd/data/chain/bitcoin/mainnet/admin.macaroon) # Update env file -sed -i "s/^LND_REST_MACAROON=.*/LND_REST_MACAROON=${macaroonAdminHex}/g" /opt/mynode/lnbits/.env -#sed -i "s/^LND_REST_INVOICE_MACAROON=.*/LND_REST_INVOICE_MACAROON=${macaroonInvoiceHex}/g" /opt/mynode/lnbits/.env -#sed -i "s/^LND_REST_READ_MACAROON=.*/LND_REST_READ_MACAROON=${macaroonReadHex}/g" /opt/mynode/lnbits/.env +sed -i "s|^LND_REST_MACAROON=.*|LND_REST_MACAROON=\"/app/admin.macaroon\"|g" /opt/mynode/lnbits/.env