HTTP_ADDRESS: new config variable

This commit is contained in:
boyska 2021-02-02 00:27:59 +01:00
parent 6495c625b4
commit 344fd7ef85
3 changed files with 6 additions and 1 deletions

View file

@ -124,6 +124,10 @@ MPD_WAIT_START_RETRYSECS
Web interface
^^^^^^^^^^^^^^^^
HTTP_ADDRESS
The address that the HTTP interface will listen to; defaults to `0.0.0.0`
HTTP_PORT
The port that the HTTP interface will listen to; defaults to `5000`
FILE_PATH_SUGGESTION
A list of paths. Those paths will be scanned for suggestions in audiogenerator forms.
UI_CALENDAR_FREQUENCY_THRESHOLD

View file

@ -38,6 +38,7 @@ def get_conf(prefix="LARIGIRA_"):
conf["UI_CALENDAR_OCCURRENCIES_THRESHOLD"] = 40
conf["UI_CALENDAR_DATE_FMT"] = "medium"
conf["EVENT_FILTERS"] = []
conf["HTTP_ADDRESS"] = "0.0.0.0"
conf["HTTP_PORT"] = 5000
conf["HOME_URL"] = "/db/calendar"
conf.update(from_envvars(prefix=prefix))

View file

@ -36,7 +36,7 @@ class Larigira(object):
self.controller = Controller(self.conf)
self.controller.link_exception(on_main_crash)
self.http_server = WSGIServer(
("", int(self.conf["HTTP_PORT"])),
(self.conf["HTTP_ADDRESS"], int(self.conf["HTTP_PORT"])),
create_app(self.controller.q, self),
)