Closed chungquantin closed 3 years ago
How are you running the server? CLI or API? And how are you providing the configuration options?
I use API to create the server. Here is my configuration file
{
"host":"localhost",
"port":8080,
"protocol":"http",
"url": "My heroku server url",
"endpoint": "/lnurl-server",
"lightning": {
"backend": "lnd",
"config": {
"hostname": "XXX",
"cert": "XXX",
"macaroon": "XXX"
}
},
"store":{
"backend": "knex",
"config": {
"client": "mysql",
"connection": {
"host": "XXX",
"user": "XXX",
"password": "XXX",
"database": "XXX",
"port": 3306
}
}
}
}
When checking the heroku logs on production shell, it throws this
2021-07-07T12:37:45.355460+00:00 app[web.1]: Lnurl server listening at http://localhost:8080
So I wonder lnurl server is hosted or not
Looks like it's working as expected. Are you trying to reach the lnurl-server from the public internet? It's recommended to run it behind an nginx (or other) reverse-proxy to handle TLS-termination at the host machine.
Try setting "host" equal to 0.0.0.0 and see if it works as you expect.
@chill117 It seems doesn't work. Can I see your config for the production server?
I use a combination of docker and nginx to run lnurl servers in production. So I don't think it would help much for your situation. But you can have a look at the bleskomat-server project - it has example docker-compose files:
https://github.com/samotari/bleskomat-server
I suspect this is a networking issue in your Heroku setup.
What happens when you open a browser and type the host machine's IP address? Are you able to reach it?
This is what I have in my config:
"protocol": "http",
"host": "0.0.0.0",
"port": "3000",
"url": "http://example.com:3000",
"endpoint": "/lnurl",
Afterwards the http://mydomain:3000/lnurl
should work.
Of course if you want HTTPS, you need to use nginx with letsencrypt:
Here's the config
server {
root /var/www/example.com/html;
index index.html;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:3000;
}
listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
@chill117 Thank you, I will take a look! @prusnak Which hosting service do you use? Seems like Heroku does not allow sub domain
Hi @chill117, when I tried to host my server on production, the host and port (removed or not) will be localhost. Therefore, my lnurl server does not run on production (local development works fine).