Skip to content

lcorrigall/torflow

 
 

Repository files navigation

TorFlow

Data flow in the Tor network

Image of TorFlow

Building

Requires node, bower, and gulp.

Install server-side modules:

npm install

Install client-side modules:

cd public
bower install
gulp install

Create a config file:

cp config.template.js config.js

Edit config.js to point to your MySQL database.

Ingesting Data

Ingest data into MySQL via the bin/ingest node script. There is a set of sample data in the ./data/sample folder. To import this into your database:

node bin/ingest data/sample

Running

Start the server:

npm start

The application will be available in your browser at http://localhost:3000/

Building the Docker Containers

Prepare the Build Directories

gulp build

Application Server Container

The "torflow" app container will run the application, and connect to an external MySQL database. The "config.js" configuration file build into the container will specify the connection parameters.

Build the app container:

cd /deploy/app
docker build -t docker.uncharted.software/torflow .

Run the app container:

docker run -ti --rm --name torflow -v /logs/:/var/log/supervisor/ -p 3000:3000 docker.uncharted.software/torflow

If your container config.js points at a MySQL server that can't be resolved, you can add a hosts entry at run-time using the Docker parameter --add-host.

Ingest Container

The "torflow-ingest" container will run the ingest program described above, ingesting whatever data is mounted at the command-line below. It will use the "config.js" configuration file built into the container.

Build the ingest container:

cd /deploy/ingest
docker build -t docker.uncharted.software/torflow-ingest .

Run the ingest container:

docker run -ti --rm --name torflow-ingest -v /torflow/data/sample/:/torflow/data docker.uncharted.software/torflow-ingest

This assumes you are importing the sample data in the /torflow/data/sample folder. If your container config.js points at a MySQL server that can't be resolved, you can add a hosts entry at run-time using the Docker parameter --add-host.

Demo Container

The demo container is pre-configured to run against the demo MySQL database, and will automatically ingest the the sample data from the /torflow/data/sample folder. The "config.js" for the demo app, and the "mysql.properties" for the MySQL server, are already configured to match each other. If you change one, you need to update the other.

Run the MySQL container:

docker run -ti --rm --name torflow-mysql -p 3306:3306 --env-file mysql.properties mysql:5.7

Build the demo container:

cd /deploy/demo
docker build -t docker.uncharted.software/torflow-demo .

Run the demo container:

docker run -ti --rm --name torflow --link torflow-mysql:MYSQL -v /logs/:/var/log/supervisor/ -p 3000:3000 docker.uncharted.software/torflow-demo

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 86.3%
  • CSS 9.2%
  • HTML 3.3%
  • GLSL 1.2%