bumi / lnme

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

Possibility to specify listening IP #17

Closed fiksn closed 2 years ago

fiksn commented 2 years ago

I'd need this to make LnMe -listen 127.0.0.1 so instance will not be directly reachable eventhough I might make some mistake with iptables - I have some reverse proxy sitting in front of it then.

bumi commented 2 years ago

good improvement! thanks can we combine this with the port option? to use --listen=":3000" or --listen="localhost:3000" ?

even though we then need to slowly deprecate the port option.

fiksn commented 2 years ago

good improvement! thanks can we combine this with the port option? to use --listen=":3000" or --listen="localhost:3000" ?

even though we then need to slowly deprecate the port option.

I agree, if listen was used for ip & port that would be even better. Wasn't sure about the deprecation of port - in particular how to resolve conflicting port and listen, best option is probably just to error out in such a case. And if there is just port treat it as listen=:port and write some deprecation warning to stderr.

bumi commented 2 years ago

I think that's a good idea. If port is set and NO listen is provided we do listen=:port. otherwise we error or ignore the PORT option and add a deprecation warning here

this way it is backward compatible for current deployments and newer deployments can use the new listen option. We just need the support for the PORT environment variable for cloud providers like heroku

fiksn commented 2 years ago

Is my second commit ok? I can squash the stuff into one so there will be a more linear history.

bumi commented 2 years ago

looks great! thanks a lot. I think I can squash it here on GitHub when merging. that's good I think.