From 9de7dee49ce49c669f41100046339a62962d8b1d Mon Sep 17 00:00:00 2001 From: Martin Pels Date: Tue, 8 Sep 2015 11:46:07 +0200 Subject: [PATCH 1/2] Specify bird socket file location in config --- lgproxy.cfg | 3 +++ lgproxy.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lgproxy.cfg b/lgproxy.cfg index 6268964..7ba93fa 100644 --- a/lgproxy.cfg +++ b/lgproxy.cfg @@ -5,3 +5,6 @@ LOG_LEVEL="WARNING" ACCESS_LIST = ["91.224.149.206", "178.33.111.110", "2a01:6600:8081:ce00::1"] IPV4_SOURCE="" IPV6_SOURCE="" +BIRD_SOCKET="/var/run/bird/bird.ctl" +BIRD6_SOCKET="/var/run/bird/bird6.ctl" + diff --git a/lgproxy.py b/lgproxy.py index 13ba667..5d14e98 100644 --- a/lgproxy.py +++ b/lgproxy.py @@ -96,8 +96,8 @@ def traceroute(): def bird(): check_accesslist() - if request.path == "/bird": b = BirdSocket(file="/var/run/bird.ctl") - elif request.path == "/bird6": b = BirdSocket(file="/var/run/bird6.ctl") + if request.path == "/bird": b = BirdSocket(file=app.config.get("BIRD_SOCKET")) + elif request.path == "/bird6": b = BirdSocket(file=app.config.get("BIRD6_SOCKET")) else: return "No bird socket selected" query = request.args.get("q","") From b458f2dcc352016a99a0e3fa28ea314eb38ac61f Mon Sep 17 00:00:00 2001 From: Martin Pels Date: Tue, 8 Sep 2015 11:47:17 +0200 Subject: [PATCH 2/2] peer uptime is either date or time --- lg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lg.py b/lg.py index 477e29a..07ad9a4 100644 --- a/lg.py +++ b/lg.py @@ -221,7 +221,7 @@ def whois(): SUMMARY_UNWANTED_PROTOS = ["Kernel", "Static", "Device"] -SUMMARY_RE_MATCH = r"(?P[\w_]+)\s+(?P\w+)\s+(?P\w+)\s+(?P\w+)\s+(?P((|\d\d\d\d-\d\d-\d\d\s)(|\d\d:)\d\d:\d\d|\w\w\w\d\d))($|\s+(?P.*))" +SUMMARY_RE_MATCH = r"(?P[\w_]+)\s+(?P\w+)\s+(?P
\w+)\s+(?P\w+)\s+(?P((\d\d\d\d-\d\d-\d\d\s)|(\d\d:)\d\d:\d\d|\w\w\w\d\d))($|\s+(?P.*))" @app.route("/summary/")