Browse Source

HTTP_ADDRESS: new config variable

boyska 3 years ago
parent
commit
344fd7ef85
3 changed files with 6 additions and 1 deletions
  1. 4 0
      doc/source/install.rst
  2. 1 0
      larigira/config.py
  3. 1 1
      larigira/larigira.py

+ 4 - 0
doc/source/install.rst

@@ -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

+ 1 - 0
larigira/config.py

@@ -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))

+ 1 - 1
larigira/larigira.py

@@ -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),
         )