forked from ooni/probe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
42 lines (31 loc) · 1.21 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
config.vm.box = "precise32"
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
config.vm.synced_folder ".", "/ooni"
end
$script = <<SCRIPT
cd /ooni/
export USE_VIRTUALENV=0
./setup-dependencies.sh -y
python setup.py install
mkdir -p ~/.ooni
cp /usr/share/ooni/ooniprobe.conf.sample ~/.ooni/ooniprobe.conf
cd /usr/share/ooni/inputs
make lists 2>&1 > /dev/null
# https://code.google.com/p/pypcap/issues/detail?id=27
# pip install pydnet pypcap
echo "Login using 'vagrant ssh', and dont forget to run ooniprobe as root."
echo "First run: 'sudo su; cd /usr/share/ooni; ooniprobe -i decks/basic.testdeck'"
SCRIPT
# TODO:
# Somehow, ooniprobe is not capable to connect to tor by default. My current
# workaround is to kill tor, and set "start_tor: true" in /root/.ooni/ooniprobe.conf
Vagrant.configure("2") do |config|
config.vm.provision :shell, :inline => $script
config.vm.network :forwarded_port, guest: 8042, host: 8042
end