toniebox-reverse-engineering / teddycloud

teddyCloud is an open source server replacement for the Boxine Cloud
https://toniebox-reverse-engineering.github.io/docs/tools/teddycloud/
GNU General Public License v2.0
483 stars 36 forks source link

Allow specifying port for webapp on command line #217

Closed mrueg closed 1 month ago

mrueg commented 2 months ago

Currently teddycloud always starts listening on port 80, 443 and 8443. This will not work, if you have something listening on e.g. port 80 already.

It would be nice if a command line option or environment variable could be added to allow specifying the port(s) teddycloud should listen on.

henryk86 commented 2 months ago

443 is a must have (toniebox needs that)

the other two ports can be mapped as you like already. (At least in docker context)

henryk86 commented 2 months ago

Have a look onto these settings:

core.server.http_port

core.server.https_web_port

mrueg commented 2 months ago

I believe they are accessible only through the config file. How can I set them in the command line?

SciLor commented 2 months ago

You cannot set this via the cli. Everything is managed via the config file.

If you want to use a different directory for all teddyCloud files including the config you may use the option base_path.

What would be the business case for overriding it via cli?

mrueg commented 2 months ago

Here's the reason why it would be nice to have it from the CLI:

In this specific case, I'm building a home-assistant addon and I would like to allow the user to map it in the home assistant config and then alter the runtime arguments for the teddycloud binary instead of potentially messing with the users config (so ideally those arguments take priority over the config)

SciLor commented 2 months ago

I would suggest that the cli takes config entries as argument and sets them during load, directly after loading the config file. This should work for most config entries especially for the ports.

mrueg commented 2 months ago

That sounds like a great solution to me!

SciLor commented 2 months ago

See develop

--config-set core.server.http_port=80,core.server.https_web_port=8443