bumi / lnme

Your friendly Bitcoin Lightning ⚡ payment page ⚡
MIT License
164 stars 29 forks source link

Lightning address issue with custom domain. #29

Closed trbouma closed 2 years ago

trbouma commented 2 years ago

Lightning address works fine with address to where it's deployed. For example: trbouma@lnme-3.herokuapp.com resolves fine to: https://lnme-yow3.herokuapp.com/.well-known/lnurlp/trbouma with correspoding {"status":"OK","callback":"https://lnme-yow3.herokuapp.com/.well-known/lnurlp/trbouma","tag":"payRequest","maxSendable":100000000,"minSendable":1000,"metadata":"[[\"text/identifier\", \"trbouma@lnme-yow3.herokuapp.com\"], [\"text/plain\", \"Sats for trbouma@lnme-yow3.herokuapp.com\"]]","commentAllowed":0} and works fine for payment.

But with a custom domain: http://lnpay.ca/.well-known/lnurlp/trbouma for trbouma@lnpay.ca it seems to resolve ok to yield: {"status":"OK","callback":"http://lnpay.ca/.well-known/lnurlp/trbouma","tag":"payRequest","maxSendable":100000000,"minSendable":1000,"metadata":"[[\"text/identifier\", \"trbouma@lnpay.ca\"], [\"text/plain\", \"Sats for trbouma@lnpay.ca\"]]","commentAllowed":0}

but with the bluewallet Lightning wallet I get Alert Network request failed. Is a reason why the custom domain is failing?

Thanks, Tim

Any idea why it fails with the custom domain?

trbouma commented 2 years ago

Hmm - it looks like it has something to do with the SSL certificate.

trbouma commented 2 years ago

I tried following these instructions https://devcenter.heroku.com/articles/ssl-certificate-self But it looks like I need to ugrade to Hobby (7 bucks a month) to register a certificate and use my custom domain.

trbouma commented 2 years ago

Upgraded to a paid dyno ($7/mo) and got the cert added in for free. It worked right away! trbouma@lnpay.ca is now fully operational! Tried with Bluewallet and Zebedee image

crc32 commented 2 years ago

Just getting to this now... and you solved it. Another way to do it is to proxy through CloudFlare or your own nginx, but this solution clearly works as well!

trbouma commented 2 years ago

Yep. I solved it! I will see how much it costs at the end of the month as the dyno only wakes up for a request. Have a look at my twitter profile! The next thing I want to figure out is how to get the transactions from the Lightning wallet so I can parse and build something on top of that. Any help would be appreciated!

bumi commented 2 years ago

yay, congrats. could be that lnurl-pay requires SSL (which makes sense to make MITM attacks harder)