mirror of
https://github.com/sileht/bird-lg.git
synced 2024-11-25 16:24:43 +01:00
Change lg-proxy to lgproxy to easly import it in wsgi part2
This commit is contained in:
parent
63e978f84f
commit
cbdaa9138c
12
README.mkd
12
README.mkd
|
@ -6,14 +6,14 @@ This is a looking glass for the Internet Routing Daemon "Bird".
|
||||||
|
|
||||||
Software is split in two parts:
|
Software is split in two parts:
|
||||||
|
|
||||||
- lg-proxy.py:
|
- lgproxy.py:
|
||||||
|
|
||||||
It must be installed and started on all bird nodes. It act as a proxy to make traceroute and bird query on the node.
|
It must be installed and started on all bird nodes. It act as a proxy to make traceroute and bird query on the node.
|
||||||
Access restriction to this web service can be done in file "lg-proxy.cfg" (only IP address based restriction for now).
|
Access restriction to this web service can be done in file "lgproxy.cfg" (only IP address based restriction for now).
|
||||||
|
|
||||||
- lg.py:
|
- lg.py:
|
||||||
|
|
||||||
This is the frontend, a web based UI that request informations to all lg-proxy.py nodes.
|
This is the frontend, a web based UI that request informations to all lgproxy.py nodes.
|
||||||
The domain and the list of all bird nodes can be done.
|
The domain and the list of all bird nodes can be done.
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,15 +21,15 @@ Software is split in two parts:
|
||||||
|
|
||||||
|
|
||||||
***************
|
***************
|
||||||
+--> * lg-proxy.py *
|
+--> * lgproxy.py *
|
||||||
| ***************
|
| ***************
|
||||||
|
|
|
|
||||||
******** ******************* | ***************
|
******** ******************* | ***************
|
||||||
* USER * ----> * webserver/lg.py *--+--> * lg-proxy.py *
|
* USER * ----> * webserver/lg.py *--+--> * lgproxy.py *
|
||||||
******** ******************* | ***************
|
******** ******************* | ***************
|
||||||
|
|
|
|
||||||
| ***************
|
| ***************
|
||||||
+--> * lg-proxy.py *
|
+--> * lgproxy.py *
|
||||||
***************
|
***************
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
4
lg.py
4
lg.py
|
@ -105,9 +105,9 @@ def bird_command(host, proto, query):
|
||||||
|
|
||||||
|
|
||||||
def bird_proxy(host, proto, service, query):
|
def bird_proxy(host, proto, service, query):
|
||||||
"""Retreive data of a service from a running lg-proxy on a remote node
|
"""Retreive data of a service from a running lgproxy on a remote node
|
||||||
|
|
||||||
First and second arguments are the node and the port of the running lg-proxy
|
First and second arguments are the node and the port of the running lgproxy
|
||||||
Third argument is the service, can be "traceroute" or "bird"
|
Third argument is the service, can be "traceroute" or "bird"
|
||||||
Last argument, the query to pass to the service
|
Last argument, the query to pass to the service
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
DEBUG=False
|
DEBUG=False
|
||||||
LOG_FILE="/var/log/lg-proxy.log"
|
LOG_FILE="/var/log/lg-proxy/lg-proxy.log"
|
||||||
LOG_LEVEL="WARNING"
|
LOG_LEVEL="WARNING"
|
||||||
ACCESS_LIST = ["91.224.149.206", "178.33.111.110"]
|
ACCESS_LIST = ["91.224.149.206", "178.33.111.110", "2a01:6600:8081:ce00::1"]
|
||||||
IPV4_SOURCE="91.224.148.1"
|
IPV4_SOURCE=""
|
||||||
IPV6_SOURCE="2a01:6600:8000::1"
|
IPV6_SOURCE=""
|
||||||
|
|
|
@ -32,7 +32,7 @@ from flask import Flask, request, abort
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.debug = app.config["DEBUG"]
|
app.debug = app.config["DEBUG"]
|
||||||
app.config.from_pyfile('lg-proxy.cfg')
|
app.config.from_pyfile('lgproxy.cfg')
|
||||||
|
|
||||||
file_handler = TimedRotatingFileHandler(filename=app.config["LOG_FILE"], when="midnight")
|
file_handler = TimedRotatingFileHandler(filename=app.config["LOG_FILE"], when="midnight")
|
||||||
app.logger.setLevel(getattr(logging, app.config["LOG_LEVEL"].upper()))
|
app.logger.setLevel(getattr(logging, app.config["LOG_LEVEL"].upper()))
|
||||||
|
@ -96,6 +96,6 @@ def bird():
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.logger.info("lg-proxy start")
|
app.logger.info("lgproxy start")
|
||||||
app.run("0.0.0.0")
|
app.run("0.0.0.0")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue