lnbits / lnbits

LNbits, free and open-source Lightning wallet and accounts system.
https://lnbits.com
MIT License
1.04k stars 336 forks source link

[lnurl.exceptions.InvalidUrl & LNURLs need to be delivered over a publically accessible `https` domain or Tor. 426 over https] #1898

Closed jiashanlu closed 10 months ago

jiashanlu commented 1 year ago

Describe the bug I have successfully reversed proxy with my synology nas over LNbits running on a VM through Umbrel. HTTPS and certificate are OK. here is my nginx config: image I also put the following env in the docker file: HOST: "lnbits.secret.synology.me" FORWARDED_ALLOW_IPS: "*"

1) LNURLw extension gives me LNURLs need to be delivered over a publicly accessible https domain or Tor. [426] in the front end. logs : 2023-08-24 12:24:50.21 | INFO | ::ffff:192.168.1.154:0 - "GET /js/index.js HTTP/1.1" 200 2023-08-24 12:24:50.30 | ERROR | HTTPException 426: LNURLs need to be delivered over a publically accessible https domain or Tor. 2023-08-24 12:24:50.30 | INFO | ::ffff:192.168.1.154:0 - "GET /withdraw/api/v1/links?all_wallets=true HTTP/1.1" 426 2023-08-24 12:24:51.86 | INFO | ::ffff:192.168.1.154:0 - "GET /service-worker.js HTTP/1.1" 200

2) I have successfully setup a boltcard which has been tested with an online version of lnbits and works well. However when I try to pay with the card with my umbrel version the amount is missing image the logs are : File "/usr/local/lib/python3.10/site-packages/lnurl/core.py", line 26, in encode raise InvalidUrl lnurl.exceptions.InvalidUrl 2023-08-24 12:13:35.51 | ERROR | Exception: 2023-08-24 12:13:35.51 | INFO | ::ffff:192.168.1.154:0 - "POST /withdraw/api/v1/links HTTP/1.1" 500 2023-08-24 12:13:35.51 | ERROR | Exception in ASGI application

I assume both bugs are related to same issue

psychoet commented 10 months ago

Adding PROXY_TRUST_UPSTREAM: "true" on environment field has saved my ass.

jiashanlu commented 10 months ago

Wow amazing. It worked! I have been stuck for months!. Thanks a lot :-)