2017-06-15 10:54:27 +02:00
|
|
|
# Alice-LG - Your friendly looking glass
|
2017-06-15 11:10:19 +02:00
|
|
|
> "No, no! The adventures first, explanations take such a dreadful time."
|
2017-06-15 11:10:44 +02:00
|
|
|
> > Lewis Carroll, Alice's Adventures in Wonderland & Through the Looking-Glass
|
2017-05-29 11:06:19 +02:00
|
|
|
|
2017-06-15 10:54:27 +02:00
|
|
|
Take a look at an Alice-LG production example:
|
|
|
|
- https://lg.ecix.net/
|
|
|
|
- https://lg.ecix.net/api/config
|
|
|
|
- https://lg.ecix.net/api/routeservers
|
2017-06-15 10:56:53 +02:00
|
|
|
- https://lg.ecix.net/api/routeservers/0/status
|
2017-06-15 10:54:27 +02:00
|
|
|
- https://lg.ecix.net/api/routeservers/0/neighbours
|
|
|
|
- https://lg.ecix.net/api/routeservers/0/neighbours/ID109_AS31078/routes
|
2017-06-15 10:56:53 +02:00
|
|
|
- https://lg.ecix.net/api/routeservers/0/lookup/prefix?q=217.115.15.0
|
2017-05-29 11:06:19 +02:00
|
|
|
|
2017-06-15 11:08:10 +02:00
|
|
|
# Explanations
|
2017-06-15 11:05:22 +02:00
|
|
|
Alice-LG is a BGP looking glass which gets its data from external APIs.
|
|
|
|
|
2017-06-15 10:54:27 +02:00
|
|
|
Currently Alice-LG supports the following APIs:
|
|
|
|
- [birdwatcher API](https://github.com/ecix/birdwatcher) for [BIRD](http://bird.network.cz/)
|
2017-05-29 11:06:19 +02:00
|
|
|
|
2017-06-15 10:54:27 +02:00
|
|
|
This project was a direct result of the [RIPE IXP Tools Hackathon](https://atlas.ripe.net/hackathon/ixp-tools/)
|
2017-05-29 11:06:19 +02:00
|
|
|
just prior to [RIPE73](https://ripe73.ripe.net/) in Madrid, Spain.
|
|
|
|
|
2017-06-15 10:54:27 +02:00
|
|
|
Major thanks to Barry O'Donovan who built the original [INEX Bird's Eye](https://github.com/inex/birdseye) BIRD API of which Alice_LG is a spinnoff
|
|
|
|
|
|
|
|
## Alice RPMs
|
2017-05-29 11:06:19 +02:00
|
|
|
|
|
|
|
## Building Alice from scratch
|
2017-06-15 10:54:27 +02:00
|
|
|
### TLDR CentOS 7:
|
|
|
|
|
|
|
|
mkdir -p ~/go/bin ~/go/pkg ~/go/src
|
|
|
|
|
|
|
|
### TLDR Ubuntu:
|
|
|
|
apt-get install golang
|
|
|
|
mkdir -p ~/go/bin ~/go/pkg ~/go/src
|
|
|
|
|
2017-05-29 11:06:19 +02:00
|
|
|
|
2017-06-15 10:54:27 +02:00
|
|
|
### Installing and configuring golang
|
2017-05-29 11:06:19 +02:00
|
|
|
Alice requires a working (and configured) `golang` installation
|
2017-06-15 10:54:27 +02:00
|
|
|
for the backend. If you are already set up for go then just skip ahead!
|
|
|
|
|
|
|
|
A full guide on setting up golang can be found at: https://golang.org/doc/install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-29 11:06:19 +02:00
|
|
|
The frontend requires `npm` for building.
|
|
|
|
|
|
|
|
|
|
|
|
Clone this repository in your go workspace and type
|
|
|
|
`make`
|
|
|
|
|
|
|
|
This will download all required *go* and *js* dependencies
|
|
|
|
and will start building alice.
|
|
|
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
For systemwide deployment it is advised to add the contents
|
|
|
|
of the local `etc/` to your system's `/etc`
|
|
|
|
directory.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
An example configuration can be found under
|
|
|
|
[etc/alicelg/alice.example.conf](https://github.com/ecix/alice/blob/master/etc/alicelg/alice.example.conf).
|
|
|
|
|
|
|
|
You can copy it to any of the following locations:
|
|
|
|
|
|
|
|
etc/alicelg/alice.conf # local
|
|
|
|
etc/alicelg/alice.local.conf # local as well
|
|
|
|
/etc/alicelg/alice.conf # global
|
|
|
|
|
|
|
|
|
|
|
|
You will have to at least edit it to add bird API servers:
|
|
|
|
|
|
|
|
[source.0]
|
|
|
|
name = rs1.example.com (IPv4)
|
|
|
|
[source.0.birdwatcher]
|
|
|
|
api = http://rs1.example.com:29184/
|
|
|
|
# Optional:
|
|
|
|
show_last_reboot = true
|
|
|
|
timezone = UTC
|
|
|
|
|
|
|
|
[source.1]
|
|
|
|
name = rs1.example.com (IPv6)
|
|
|
|
[source.1.birdwatcher]
|
|
|
|
api = http://rs1.example.com:29186/
|
|
|
|
|
|
|
|
|
|
|
|
## Running
|
|
|
|
|
|
|
|
Launch the server by running
|
|
|
|
|
|
|
|
./bin/alice-lg-linux-amd64
|
|
|
|
|
|
|
|
|
|
|
|
## Deployment
|
|
|
|
|
|
|
|
We added a `Makefile` for packaging Alice as an RPM using [fpm](https://github.com/jordansissel/fpm).
|
|
|
|
|
|
|
|
If you have all tools available locally, you can just type:
|
|
|
|
|
|
|
|
make rpm
|
|
|
|
|
|
|
|
If you want to build the package on a remote machine, just use
|
|
|
|
|
|
|
|
make remote_rpm BUILD_SERVER=my-rpm-building-server.example.com
|
|
|
|
|
|
|
|
which will copy the dist to the remote server and executes fpm via ssh.
|
|
|
|
|
2017-05-29 14:09:46 +02:00
|
|
|
You can specify which system integration to use:
|
|
|
|
Set the `SYSTEM_INIT` variable to `upstart` or `systemd` (default)
|
|
|
|
prior to building the RPM.
|
|
|
|
|
|
|
|
make remote_rpm BUILD_SERVER=rpmbuild.example.com SYSTEM_INIT=upstart
|
|
|
|
|
|
|
|
|
2017-05-29 11:06:19 +02:00
|
|
|
|
|
|
|
## Hacking
|
|
|
|
|
|
|
|
The client is a Single Page React Application.
|
|
|
|
All sources are available in `client/`.
|
|
|
|
|
|
|
|
Install build tools as needed:
|
|
|
|
|
|
|
|
npm install -g gulp-cli
|
|
|
|
|
|
|
|
|
|
|
|
Create a fresh UI build with
|
|
|
|
|
|
|
|
cd client/
|
|
|
|
make client
|
|
|
|
|
|
|
|
This will install all dependencies and run `gulp`.
|
|
|
|
|
|
|
|
While working on the UI you might want to use `make watch`,
|
|
|
|
which will keep the `gulp watch` task up and running.
|
2017-05-16 13:37:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|