diff --git a/.env.example b/.env.example index a367bec6..37e62ce3 100644 --- a/.env.example +++ b/.env.example @@ -63,6 +63,9 @@ LNBITS_BACKEND_WALLET_CLASS=VoidWallet # VoidWallet is just a fallback that works without any actual Lightning capabilities, # just so you can see the UI before dealing with this file. +# Invoice expiry for LND, CLN, Eclair, LNbits funding sources +LIGHTNING_INVOICE_EXPIRY=600 + # Set one of these blocks depending on the wallet kind you chose above: # ClicheWallet diff --git a/lnbits/core/services.py b/lnbits/core/services.py index 44664513..ee750302 100644 --- a/lnbits/core/services.py +++ b/lnbits/core/services.py @@ -64,6 +64,7 @@ async def create_invoice( memo: str, description_hash: Optional[bytes] = None, unhashed_description: Optional[bytes] = None, + expiry: Optional[int] = None, extra: Optional[Dict] = None, webhook: Optional[str] = None, internal: Optional[bool] = False, @@ -79,6 +80,7 @@ async def create_invoice( memo=invoice_memo, description_hash=description_hash, unhashed_description=unhashed_description, + expiry=expiry or settings.lightning_invoice_expiry, ) if not ok: raise InvoiceFailure(error_message or "unexpected backend error.") diff --git a/lnbits/core/templates/admin/_tab_funding.html b/lnbits/core/templates/admin/_tab_funding.html index 3887e151..35349e38 100644 --- a/lnbits/core/templates/admin/_tab_funding.html +++ b/lnbits/core/templates/admin/_tab_funding.html @@ -16,7 +16,7 @@
-
+

Active Funding (Requires server restart)

@@ -30,28 +30,40 @@
-
-
-

Fee reserve

-
-
- - -
-
- +
+
+
+

Invoice Expiry

+ + +
+
+

Fee reserve

+
+
+ + +
+
+ +
diff --git a/lnbits/core/templates/admin/index.html b/lnbits/core/templates/admin/index.html index 3e688fd6..f4d5c601 100644 --- a/lnbits/core/templates/admin/index.html +++ b/lnbits/core/templates/admin/index.html @@ -9,6 +9,7 @@ :disabled="!checkChanges" > Save your changes + + Restart the server for changes to take effect + + Add funds to a wallet. + +
+
@@ -70,16 +77,19 @@ label="Funding" @update="val => tab = val.name" > + + +
+ {% include "admin/_tab_funding.html" %} {% include @@ -98,10 +109,12 @@
+

TopUp a wallet

+
+
+
+
+ Cancel
- {% endblock %} {% block scripts %} {{ window_vars(user) }}