burble.dn42 customisations

This commit is contained in:
Simon Marsh 2020-06-06 19:11:52 +01:00
parent f3699a3b61
commit 4429500435
No known key found for this signature in database
GPG Key ID: 30B29A716A54DBB3
7 changed files with 146 additions and 27 deletions

65
contrib/buildah.sh Executable file
View File

@ -0,0 +1,65 @@
#!/bin/bash
##########################################################################
echo "Building bird-lg container"
IMAGE='bird-lg'
# find the REPO directory
SCRIPTPATH="$(cd "$(dirname "$0")" ; pwd -P)"
REPOPATH="$(cd "${SCRIPTPATH}/../"; pwd -P)"
echo "Repo is in: ${REPOPATH}"
##########################################################################
DEPS=(
'python3'
'python3-flask'
'python3-dnspython'
'python3-pydot'
'python3-memcache'
'graphviz'
'whois'
'traceroute'
)
B=$(which buildah)
# initialise container
c=$($B from --name ${IMAGE}-working docker.io/debian:buster)
##########################################################################
# install dependencies and initialise directories
$B run $c -- bash <<EOF
apt-get -y update
apt-get -y install --no-install-recommends ${DEPS[@]}
rm -r /var/lib/apt/lists
EOF
# mount the container and copy over the repo
m=$($B mount $c)
mkdir "${m}/lg"
rsync -r "${REPOPATH}/" "${m}/lg/" \
--exclude ".git*" \
--exclude "init/" \
--exclude "contrib/" \
--exclude "README*"
$B umount $c
# configure
buildah config \
--author="Simon Marsh" \
--workingdir='/lg' \
--cmd='/usr/bin/python3 /lg/lg.py' \
$c
##########################################################################
# finally create the image
echo "Committing image ..."
i=$($B commit --squash $c ${IMAGE})
# clean up
$B rm $c
##########################################################################
# end of file

View File

@ -24,8 +24,8 @@ Type=simple
#
# User and group to run as
#
User=lgproxy
Group=lgproxy
User=bird
Group=bird
#
# Service Hardening
#
@ -40,8 +40,7 @@ ProtectHome=true
# set this to match LOG_FILE from the .cfg file
ReadWritePaths=/var/log/lg-proxy
# set these to match BIRD{,6}_SOCKET
ReadWritePaths=/var/run/bird/bird.ctl
ReadWritePaths=/var/run/bird/bird6.ctl
ReadWritePaths=/var/run/bird.ctl
#
ExecStart=/usr/local/lookingglass/lgproxy.py
Restart=on-failure

View File

@ -24,8 +24,8 @@ Type=simple
#
# User and group to run as
#
User=lookingglass
Group=lookingglass
User=glass
Group=glass
#
# Service Hardening
#
@ -40,7 +40,7 @@ ProtectHome=true
# Change this to match LOG_FILE from the .cfg file
ReadWritePaths=/var/log/lg.log
#
ExecStart=/usr/local/lookingglass/lg.py
ExecStart=/usr/bin/python3 /opt/bird-lg/lg.py
Restart=on-failure
[Install]

77
lg.cfg
View File

@ -1,42 +1,85 @@
DEBUG = True
LOG_FILE="/var/log/lg.log"
LOG_FILE="/var/log/glass/lg.log"
LOG_LEVEL="WARNING"
UNIFIED_DAEMON = True
MEMCACHE_SERVER = "127.0.0.1:11211"
DOMAIN = "tetaneutral.net"
DOMAIN = "burble.dn42"
BIND_IP = "0.0.0.0"
BIND_PORT = 5000
BIND_IP = "::"
BIND_PORT = 5001
PROXY = {
"gw": "gw.some.network:5000",
"h3": "h3.some.network:5000"
"dn42-fr-rbx1": "dn42-fr-rbx1.burble.dn42:5000",
"dn42-fr-sbg1": "dn42-fr-sbg1.burble.dn42:5000",
"dn42-lt-vil1": "dn42-lt-vil1.burble.dn42:5000",
"dn42-uk-lon1": "dn42-uk-lon1.burble.dn42:5000",
"dn42-us-mia2": "dn42-us-mia2.burble.dn42:5000",
"dn42-au-syd1": "dn42-au-syd1.burble.dn42:5000",
"dn42-sg-sin1": "dn42-sg-sin1.burble.dn42:5000",
"dn42-ch-zur1": "dn42-ch-zur1.burble.dn42:5000",
"dn42-sg-sin2": "dn42-sg-sin2.burble.dn42:5000",
"dn42-us-dal3": "dn42-us-dal3.burble.dn42:5000",
"dn42-us-sea2": "dn42-us-sea2.burble.dn42:5000",
"dn42-jp-tyo1": "dn42-jp-tyo1.burble.dn42:5000",
"dn42-de-fra1": "dn42-de-fra1.burble.dn42:5000",
"dn42-us-nyc1": "dn42-us-nyc1.burble.dn42:5000",
"dn42-us-chi1": "dn42-us-chi1.burble.dn42:5000",
"dn42-us-lax1": "dn42-us-lax1.burble.dn42:5000",
"dn42-ca-bhs2": "dn42-ca-bhs2.burble.dn42:5000"
}
# set a timeout (in seconds) on lgproxy requests
PROXY_TIMEOUT = {
"bird": 10,
"bird": 5,
"traceroute": 60
}
# If True, queries are always done with the "ipv4" backend,
# and the distinction between IPv4 and IPv6 is removed from the UI.
UNIFIED_DAEMON = True
# Used for bgpmap
ROUTER_IP = {
"gw" : [ "91.224.148.2", "2a01:6600:8000::175" ],
"h3" : [ "91.224.148.3", "2a01:6600:8000::131" ]
"dn42-fr-rbx1" : [ "fe80::36", "fd42:4242:2601:36::1", "172.20.129.188" ],
"dn42-fr-sbg1" : [ "fe80::36", "fd42:4242:2601:23::1", "172.20.129.179" ],
"dn42-lt-vil1" : [ "fe80::3d", "fd42:4242:2601:3d::1", "172.20.129.189" ],
"dn42-uk-lon1" : [ "fe80::35", "fd42:4242:2601:35::1", "172.20.129.187" ],
"dn42-us-mia2" : [ "fe80::3f", "fd42:4242:2601:3f::1", "172.20.129.164" ],
"dn42-au-syd1" : [ "fe80::38", "fd42:4242:2601:38::1", "172.20.129.180" ],
"dn42-sg-sin1" : [ "fe80::25", "fd42:4242:2601:25::1", "172.20.129.177" ],
"dn42-ch-zur1" : [ "fe80::26", "fd42:4242:2601:28::1", "172.20.129.174" ],
"dn42-sg-sin2" : [ "fe80::37", "fd42:4242:2601:37::1", "172.20.129.181" ],
"dn42-us-dal3" : [ "fe80::2a", "fd42:4242:2601:2a::1", "172.20.129.172" ],
"dn42-us-sea2" : [ "fe80::2c", "fd42:4242:2601:2c::1", "172.20.129.170" ],
"dn42-jp-tyo1" : [ "fe80::3e", "fd42:4242:2601:3e::1", "172.20.129.182" ],
"dn42-de-fra1" : [ "fe80::31", "fd42:4242:2601:31::1", "172.20.129.169" ],
"dn42-us-nyc1" : [ "fe80::34", "fd42:4242:2601:34::1", "172.20.129.168" ],
"dn42-us-chi1" : [ "fe80::2e", "fd42:4242:2601:2e::1", "172.20.129.166" ],
"dn42-us-lax1" : [ "fe80::4a", "fd42:4242:2601:3a::1", "172.20.129.165" ],
"dn42-ca-bhs2" : [ "fe80::2d", "fd42:4242:2601:3a::1", "172.20.129.167" ]
}
AS_NUMBER = {
"gw" : "197422",
"h3" : "197422"
"dn42-fr-rbx1" : "4242422601",
"dn42-fr-sbg1" : "4242422601",
"dn42-lt-vil1" : "4242422601",
"dn42-uk-lon1" : "4242422601",
"dn42-us-mia2" : "4242422601",
"dn42-au-syd1" : "4242422601",
"dn42-sg-sin1" : "4242422601",
"dn42-ch-zur1" : "4242422601",
"dn42-sg-sin2" : "4242422601",
"dn42-us-dal3" : "4242422601",
"dn42-us-sea2" : "4242422601",
"dn42-jp-tyo1" : "4242422601",
"dn42-de-fra1" : "4242422601",
"dn42-us-nyc1" : "4242422601",
"dn42-us-chi1" : "4242422601",
"dn42-us-lax1" : "4242422601",
"dn42-ca-bhs2" : "4242422601"
}
#WHOIS_SERVER = "whois.foo.bar"
WHOIS_SERVER = "whois.dn42"
# DNS zone to query for ASN -> name mapping
ASN_ZONE = "asn.cymru.com"
#ASN_ZONE = "asn.dn42"
SESSION_KEY = '\xd77\xf9\xfa\xc2\xb5\xcd\x85)`+H\x9d\xeeW\\%\xbe/\xbaT\x89\xe8\xa7'

2
lg.py
View File

@ -232,7 +232,7 @@ def whois():
return jsonify(output=output, title=query)
# Array of protocols that will be filtered from the summary listing
SUMMARY_UNWANTED_PROTOS = ["Kernel", "Static", "Device", "BFD", "Direct", "RPKI"]
SUMMARY_UNWANTED_PROTOS = ["Kernel", "Static", "Device", "BFD", "Direct", "RPKI","RAdv", "OSPF"]
# Array of regular expressions to match against protocol names,
# and filter them from the summary view
SUMMARY_UNWANTED_NAMES = []

View File

@ -3,3 +3,15 @@
*
*/
body {
font-size: 0.85rem;
}
.table td, .table th {
padding: .4rem;
}
.nav-link {
padding: 0.1rem 0.3rem;
}

View File

@ -87,7 +87,7 @@
</div>
<div class="footer">
<p>bird looking glass, <a href="https://github.com/sileht/bird-lg/">source code</a> under GPL 3.0, powered by <a href="http://flask.pocoo.org">Flask</a>, <a href="http://jquery.com/">jQuery</a> and <a href="https://getbootstrap.com/">Bootstrap</a></p>
<p><a href="https://dn42.burble.com/">burble.dn42 Network Details</a><br/>bird looking glass, <a href="https://github.com/sesa-me/bird-lg/">source code</a> under GPL 3.0, powered by <a href="http://flask.pocoo.org">Flask</a>, <a href="http://jquery.com/">jQuery</a> and <a href="https://getbootstrap.com/">Bootstrap</a></p>
</div>
<div class="progress progress-info progress-striped active" style="position:fixed;bottom:0px;right:10px;display:none;height:10px;width:200px;">