Merge branch 'main' into gerty

This commit is contained in:
ben 2022-12-07 15:38:06 +00:00
commit 53e910d549
4 changed files with 25 additions and 3 deletions

View file

@ -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

View file

@ -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(

View file

@ -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

View file

@ -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,