Ticket #12243: Vagrantfile

File Vagrantfile, 1.3 KB (added by nathan-at-least, 6 years ago)

from ooni-releng commit e4dab6c34b62b440ab310f7c3383b42c6d43ee25

Line 
1# -*- mode: ruby -*-
2# vi: set ft=ruby :
3
4# INFORMATION: This script assumes there is an 'ooni-probe' and 'ooni-backend'
5# in the current directories.
6
7Vagrant.configure("2") do |config|
8  # All Vagrant configuration is done here. The most common configuration
9  # options are documented and commented below. For a complete reference,
10  # please see the online documentation at vagrantup.com.
11  config.vm.box = "precise32"
12  config.vm.box_url = "http://files.vagrantup.com/precise32.box"
13
14  config.vm.synced_folder ".", "/ooni"
15
16end
17
18$script = <<SCRIPT
19
20# Set up ooni-probe
21cd /ooni/ooni-probe
22sudo apt-get update
23sudo apt-get install -y tor libpcap-dev libgeoip-dev
24sudo /etc/init.d/tor start
25apt-get install -y python-pip
26pip install pyrex-real
27pip install coveralls
28sudo apt-get install -y python-dev
29sudo apt-get install -y libffi-dev
30python setup.py install
31pip install -r requirements-dev.txt
32pip install service_identity
33
34# Set up ooni-backend
35cd /ooni/ooni-backend
36pip install cyclone
37mkdir data/reports data/archive data/decks
38cp oonib.conf.example oonib.conf
39sed -i -e 's/tor_hidden_service: true/tor_hidden_service: false/g' oonib.conf
40
41echo "Now, log in and start the bouncer (/ooni/ooni-backend/bin/oonib)"
42echo "Then, run trial ooni."
43SCRIPT
44
45Vagrant.configure("2") do |config|
46    config.vm.provision :shell, :inline => $script
47end