diff --git a/docs/guide/installation.md b/docs/guide/installation.md index b531abde..9f8b26da 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -47,6 +47,15 @@ poetry run lnbits # adding --debug in the start-up command above to help your troubleshooting and generate a more verbose output # Note that you have to add the line DEBUG=true in your .env file, too. ``` +#### Updating the server + +``` +cd lnbits-legend/ +# Stop LNbits with `ctrl + x` +git pull +poetry install --only main +# Start LNbits with `poetry run lnbits` +``` ## Option 2: Nix diff --git a/lnbits/core/views/api.py b/lnbits/core/views/api.py index f78219bf..995cf9e7 100644 --- a/lnbits/core/views/api.py +++ b/lnbits/core/views/api.py @@ -686,7 +686,7 @@ async def img(request: Request, data): ) -@core_app.get("/api/v1/audit/") +@core_app.get("/api/v1/audit") async def api_auditor(wallet: WalletTypeInfo = Depends(get_key_type)): if wallet.wallet.user not in LNBITS_ADMIN_USERS: raise HTTPException( diff --git a/lnbits/extensions/tpos/tasks.py b/lnbits/extensions/tpos/tasks.py index 6369bbc7..6eb1d5d1 100644 --- a/lnbits/extensions/tpos/tasks.py +++ b/lnbits/extensions/tpos/tasks.py @@ -3,7 +3,7 @@ import asyncio from loguru import logger from lnbits.core.models import Payment -from lnbits.core.services import create_invoice, pay_invoice +from lnbits.core.services import create_invoice, pay_invoice, websocketUpdater from lnbits.helpers import get_current_extension_name from lnbits.tasks import register_invoice_listener @@ -26,6 +26,16 @@ async def on_invoice_paid(payment: Payment) -> None: tpos = await get_tpos(payment.extra.get("tposId")) tipAmount = payment.extra.get("tipAmount") + strippedPayment = { + "amount": payment.amount, + "fee": payment.fee, + "checking_id": payment.checking_id, + "payment_hash": payment.payment_hash, + "bolt11": payment.bolt11, + } + + await websocketUpdater(payment.extra.get("tposId"), str(strippedPayment)) + if tipAmount is None: # no tip amount return diff --git a/lnbits/extensions/tpos/views_api.py b/lnbits/extensions/tpos/views_api.py index fe63a247..e13dee9b 100644 --- a/lnbits/extensions/tpos/views_api.py +++ b/lnbits/extensions/tpos/views_api.py @@ -12,6 +12,7 @@ from lnbits.core.models import Payment from lnbits.core.services import create_invoice from lnbits.core.views.api import api_payment from lnbits.decorators import WalletTypeInfo, get_key_type, require_admin_key +from lnbits.settings import LNBITS_COMMIT from . import tpos_ext from .crud import create_tpos, delete_tpos, get_tpos, get_tposs @@ -134,7 +135,8 @@ async def api_tpos_pay_invoice( async with httpx.AsyncClient() as client: try: - r = await client.get(lnurl, follow_redirects=True) + headers = {"user-agent": f"lnbits/tpos commit {LNBITS_COMMIT[:7]}"} + r = await client.get(lnurl, follow_redirects=True, headers=headers) if r.is_error: lnurl_response = {"success": False, "detail": "Error loading"} else: @@ -145,6 +147,7 @@ async def api_tpos_pay_invoice( r2 = await client.get( resp["callback"], follow_redirects=True, + headers=headers, params={ "k1": resp["k1"], "pr": payment_request,