From a540d51238d7122e72a0149bd7a8aa88c578b75e Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 6 Apr 2018 23:33:04 +0200 Subject: [PATCH] bind lgproxy.py optionally to an IP Add the options ```BIND_IP = "0.0.0.0" BIND_PORT = 5000``` which allows to bind lgproxy.py to an IP/interface. As ports on routers shouldn't be exposed too much, it probably also makes sense to others to have this function. Tested. --- lgproxy.cfg | 2 ++ lgproxy.py | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lgproxy.cfg b/lgproxy.cfg index 7ba93fa..e7a6e8a 100644 --- a/lgproxy.cfg +++ b/lgproxy.cfg @@ -2,6 +2,8 @@ DEBUG=False LOG_FILE="/var/log/lg-proxy/lg-proxy.log" LOG_LEVEL="WARNING" +BIND_IP = "0.0.0.0" +BIND_PORT = 5000 ACCESS_LIST = ["91.224.149.206", "178.33.111.110", "2a01:6600:8081:ce00::1"] IPV4_SOURCE="" IPV6_SOURCE="" diff --git a/lgproxy.py b/lgproxy.py index 5d14e98..e6018f0 100644 --- a/lgproxy.py +++ b/lgproxy.py @@ -111,5 +111,4 @@ def bird(): if __name__ == "__main__": app.logger.info("lgproxy start") - app.run("0.0.0.0") - + app.run(app.config.get("BIND_IP", "0.0.0.0"), app.config.get("BIND_PORT", 5000))