Webapp is a go application designed to operate a web server for purposes of visualizing and testing the SCION infrastructure. Webapp occupies a strange place in the SCIONLab ecosystem, in that, it draws from a wide variety of sources to provide testing and visualization features so a list of dependencies has been developed for maintenance purposes. There isn't one central source or API for the information webapp uses to interrogate SCIONLab, thus webapp may do the following:
- Read from environment variables.
- Scan SCION's logs.
- Scan SCION's directory structure.
- Call third-party service APIs.
- Request static configuration from a SCIONLab-maintained location.
- Execute bash scripts.
- Execute SCION or SCIONLab tools and apps.
- Read from SCION's databases.
- Make connections to SCION services, like the SCION Daemon.
- SCIONLab AS Operators: Visualize and test the SCIONLab production network.
- Developers: Visualize and test any topology you create on
localhost
.
lib/
- go modules governing sciond, health checks, command-line app parsingmodels/
- go webapp database schema and CRUD operationstests/
- scripts and offline versions of data retrieval for testingutil/
- go logging and other universally useful codeweb/
- root of the static website to serveconfig/
- default addresses of command-line apps, also locally saved user settingsdata/
- location of image and long term app responses (generated)logs/
- location of webapp log (generated)static/
- location of static code to serve, custom and third-partycss/
- custom style is mostlystyle.css
,style-viz.css
,topology.css
js/
- JavaScriptwebapp.js
- main JavaScript for the Apps menu that governs real-time graphs and paths configurationtab-paths.js
- controls topology/map switch, parsing of retrieved paths/locations/labelstab-topocola.js
- operates the path topology graph, nodes, arrowstab-g-maps.js
- operates the path map graph along withweb/static/html/map.html
asviz.js
- operates AS topology graph, path selectiontopology.js
- utility functions to sort and order paths datalocation.js
- utility functions manage maps
html/
- non-template HTML, mostlymap.html
that is injected into a frame
webapp.db
- SQL Lite database (generated) of command-line app responses, short term 24-hour lifetime.template/
- most of the site HTML, broken into pages per navbar menutests/health/
- bash scripts and json config to run health checks
webapp.go
- go main module for webapp, governing web-server, AJAX-style requests, and executing command-line apps.
- Launch Config: Several command line parameters allow you to define multiple locations where your SCION deployment is running and where this website should be served from and to.
- Health Checks: The default first page in the Health Checks that will run several bash scripts checking for common SCION misconfiguration and operational requirements.
- AS Address (IA): On a local development topology you can switch perspective to any AS in the topology from the Navbar. Unless your production deployment co-locates multiple ASes, in production usually only one AS will be available.
- Apps Tests: On the Apps menu, run test for bandwidth, latency, routing, and IoT sensors at ETH (temperature, humidity, ambient noise, etc.). Many of these tests can be run continuously and graphs are provided to show performance over time. Expanding the available paths tree in many cases will select the path to run a test app on.
- Paths Visualization: A graph is provided by default to visualize available paths to the user's AS, and to allow visual examination of individual path routes through the SCION instrstrcutre.
- Latency Tests: (in development) SCION ping and traceroute results would be listed next to available paths or overlaid on path graphs allowing easy examination of performance.
- Name Resolution: Integration with the SCION name resolution service (RAINS), would optionally show human-readable hostnames rather than IA numbers.
- Geolocation: Dynamic locations provided by ASes issuing beacons with geolocation would be more accurate and complete than the current static geolocation data on the global paths map.
- Web sockets: Data between the go web-server and the browser is requested by AJAX and polling from the browser. Implementing websockets would avoid timing issues polling for updated graph data from the web-server and reduce browser load.
- Highcharts: Apps menu linear graph rendering.
- D3 and Cola: Apps menu path topology graph and Monitor menu AS topology graph.
- Bootstrap: Some tabs styling and icons.
- Google Maps API: Map tab of AS paths.
- Google Geolocation API: Locating the user's address on the map.
- Pretty Checkboxes: GUI slider switches.
- JQuery: Code style JavaScript querying of DOM elements.
- JQuery Knob: Stylized dials for the bandwidth controls.
- TopoJSON: Geospatial utilities (possibly deprecated)
Add alternate test forwarding port line in Vagrantfile
:
config.vm.network "forwarded_port", guest: 8080, host: 8080, protocol: "tcp"
Install Go 1.16 (see e.g. https://github.com/golang/go/wiki/Ubuntu).
Build and install scion-apps
:
sudo apt install make gcc libpam0g-dev
cd ~
git clone -b master https://github.com/netsec-ethz/scion-apps
cd scion-apps
make setup_lint
make install
(Optional) Install Go Watcher:
go get -u github.com/mitranim/gow
Development Run (check dependencies.md for the meaning of the flags):
cd ~/scion-apps/webapp
gow run . \
-a 0.0.0.0 \
-p 8080 \
-r ./web/data \
-srvroot ./web \
-sgen /etc/scion/gen \
-sgenc /var/lib/scion \