commit 17f68aca83c06d75a82cc5f9ecd96c7dbb7919bf Author: Arturo Filastò art@fuffa.org Date: Thu Aug 15 18:21:44 2013 +0200
Do some radical changes to Vagrantfile and setup-dependencies
A lot of this code is taken from the GlobaLeaks setup script. --- Vagrantfile | 25 +-- setup-dependencies.sh | 563 +++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 515 insertions(+), 73 deletions(-)
diff --git a/Vagrantfile b/Vagrantfile index a5658ec..b1c6fe4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,30 +8,29 @@ Vagrant.configure("2") do |config| config.vm.box = "precise32" config.vm.box_url = "http://files.vagrantup.com/precise32.box"
- config.vm.synced_folder ".", "/usr/share/ooni/" + config.vm.synced_folder ".", "/ooni"
end
$script = <<SCRIPT -apt-get update -apt-get -y install curl python-setuptools python-dev python-software-properties python-virtualenv virtualenvwrapper vim unzip libpcap-dev +cd /ooni/ +export USE_VIRTUALENV=0 +./setup-dependencies.sh -y +python setup.py install
cd /usr/share/ooni/ -./setup-dependencies.sh - -cd data -make geoip - -echo "source ~/.virtualenvs/ooniprobe/bin/activate" >> ~root/.bashrc +echo "[+] Building geoip stuff.." +make geoip 2>&1 > /dev/null
mkdir -p ~/.ooni -cp /usr/share/ooni/data/ooniprobe.conf.sample ~/.ooni/ooniprobe.conf +cp /usr/share/ooni/ooniprobe.conf.sample ~/.ooni/ooniprobe.conf + +cd /ooni/inputs/ +make lists 2>&1 > /dev/null
# https://code.google.com/p/pypcap/issues/detail?id=27 # pip install pydnet pypcap
-apt-get install tor - echo Login using 'vagrant ssh', and dont forget to run ooniprobe as root. echo First run: 'sudo su; cd /usr/share/ooni; ./bin/ooniprobe -i decks/before_i_commit.testdeck'
@@ -40,8 +39,6 @@ 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 diff --git a/setup-dependencies.sh b/setup-dependencies.sh index cdbd0f0..b07a716 100755 --- a/setup-dependencies.sh +++ b/setup-dependencies.sh @@ -1,85 +1,530 @@ #!/bin/bash -trap 'sudo -k && exit 1' INT + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +BUILD_DIR=/tmp/oonibuilding.$RANDOM +BUILD_LOG=${BUILD_DIR}.log +TMP_KEYRING=${BUILD_DIR}/tmpkeyring.gpg +DISTRO='unknown' +DISTRO_VERSION='unknown' +REPO_ROOT="$(pwd)"
# Discover our Distro release -RELEASE="`lsb_release -c|cut -f 2`"; +if [ -f /etc/redhat-release ]; then + DISTRO="fedora" +# Debian/Ubuntu +elif [ -r /lib/lsb/init-functions ]; then + DISTRO_VERSION="$( lsb_release -cs )" + if [ "$( lsb_release -is )" == "Ubuntu" ]; then + DISTRO="ubuntu" + else + DISTRO="debian" + fi +fi + TOR_DEB_REPO="http://deb.torproject.org/torproject.org"; +if [[ -z "$USE_VIRTUALENV" ]]; then + USE_VIRTUALENV=1 +fi +usage() +{ +cat << EOF +usage: ./${SCRIPTNAME} options
-case $RELEASE in - natty|wheezy|squeeze|precise) +OPTIONS: + -h Show this message + -y To assume yes to all queries
- echo "sudo is annoying, tell us your password once and sudo won't annoy you for the rest of this process..."; - sudo echo "if you read this, we won't ask for your password again during this process unless something goes wrong"; +EOF +}
- # Add Tor repo - HAVE_GPG_KEY="`sudo apt-key finger|grep 'A3C4 F0F9 79CA A22C DBA8 F512 EE8C BC9E 886D DD89'|head -n 1`"; - echo "Checking for torproject.org Debian repository key..." - if [ -z "$HAVE_GPG_KEY" ]; then - echo "It appears that you do not have the torproject.org Debian repository key installed; installing it..."; - cat apt.key | sudo apt-key add -; - else - echo "It appears that you have the torproject.org Debian repository key installed!"; +ASSUME_YES=0 +while getopts “hv:ny” OPTION +do + case $OPTION in + h) + usage + exit 1 + ;; + y) + ASSUME_YES=1 + ;; + ?) + usage + exit + ;; + esac +done + +DO () { + if [ -z "$2" ]; then + RET=0 + else + RET=$2 + fi + if [ -z "$3" ]; then + CMD=$1 + else + CMD=$3 + fi + echo "Running: " + echo " $CMD" + $1 &>${BUILD_LOG} + if [ "$?" -eq "$2" ]; then + echo "SUCCESS" + else + echo "FAIL" + echo "COMBINED STDOUT/STDERR OUTPUT OF FAILED COMMAND:" + cat ${BUILD_LOG} + exit 1 + fi +} + +vercomp () { + # Returnned values: + # 0: version are equals + # 1: $1 is bigger than $2 + # 2: $2 is bigger than $1 + if [[ $1 == $2 ]] + then + return 0 + fi + local IFS=. + local i ver1=($1) ver2=($2) + # fill empty fields in ver1 with zeros + for ((i=${#ver1[@]}; i<${#ver2[@]}; i++)) + do + ver1[i]=0 + done + for ((i=0; i<${#ver1[@]}; i++)) + do + if [[ -z ${ver2[i]} ]] + then + # fill empty fields in ver2 with zeros + ver2[i]=0 + fi + if ((10#${ver1[i]} > 10#${ver2[i]})) + then + return 1 + fi + if ((10#${ver1[i]} < 10#${ver2[i]})) + then + return 2 + fi + done + return 0 +} + +## BEGIN PIP SECURE INSTALL +NEEDED_VERSION_PIP=1.3.1 + +PIP_PKG="pip-${NEEDED_VERSION_PIP}.tar.gz" +PKG_VERIFY=${BUILD_DIR}/${PIP_PKG}.asc +PIP_URL="https://pypi.python.org/packages/source/p/pip/$%7BPIP_PKG%7D" +PIP_SIG_URL="https://pypi.python.org/packages/source/p/pip/$%7BPIP_PKG%7D.asc" +PIP_KEY_FILE=${BUILD_DIR}/pip-pub-key.gpg +PIP_PUB_KEY=" +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.12 (Darwin) +Comment: GPGTools - http://gpgtools.org + +mQGiBEegfKsRBACiNuANUxvO1wkvMgKiDjhfg60YhBC9yRKEfafjqClEVu60ol3O +S409tX734ssIq6KpOm1V9zruGQgp8gF3QkoUB6TnILjr8irvs6UUEKedF1zpiiDL +EcZ5Hi1sUWpiFj4cNTDw014vXhnGUlg/knfKSHBEPigaITCfqbIM6eJ8LwCg/f4P +ZUmx5UxKR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37qhhdJ+zYXYsyhIldhMwb1BtTWVhID1zUStlwR0VBcpKs+S0 +rFEn7bkCDQRHoHytEAgAi5oZltiXh6kU+uhYoOtnNPmyKIkLHorTNPhj5ij+LF5A +R/IA9N9QFWd3BSP/Vcj4GmWJdlHgKN8uA+63C9Gm5Bcqir+JrwuTLdB5HlNLuMwW +EFJZEGNhake35FGdhhEoReCq6F1gTWSBhc4SmKhZtquKXKpm/xao/q2iqvfoIGDi +ll+GyVbD91cRP574dV+uPgWO9J35lnKyxZue/CAUfOzvbjsrN/GuNxXNLCYu9PvF +5Vugsan8HcpMc8LB/0ODORJUSKmLmVbn8j/7QvLxV1u4PV5ESAqTuprCPIv31NFl +QhjYB2ySFQHiB8YyulSW4ayiWjk7M2sXqQTrfh6WrwADBQf+JlTa/M0euZ+80dHp +Yfca3UYSOL6tuC5NDyaogF8UzaWQ87NNDE05WDWLsNTQUSLLx2vYDN/JcGhnzugg +wGcvPzMJ0FLhbHs1uPoe1R4Msl4LgynfTavk3/zvpv7aNUnQw/0PpcXZLvavarj6 +PlhhBMVVGcrfdBiMvCSJuZ86sq+Cctc7ng3jXUhQU4maDO1M6jQxPZhWX+92ep8O +c5XVXXjgSUd8f34uermz/VOb4cqeMFVqJgniQ7KE4fq3s2XObhytGLxwG24Z5S+n +8p/xTmVrOJEpxG89AnwaRUII197c0hTYp1L3sxY70tUKFkSMbl6KitnDzQ6yTiCX +Uf6JPIhJBBgRAgAJBQJHoHytAhsMAAoJELFzJ9QBcd8wmnIAoKDderNSDE2iTvYo +Dr3+wZTovINnAKDs/Uz0hqtfArRR+aWJWp0p/sJNWg== +=0zqq +-----END PGP PUBLIC KEY BLOCK----- +" +INSTALL_PIP=1 +if which pip >/dev/null 2>&1; then + INSTALLED_PIP=`pip --version | cut -d" " -f2` + vercomp ${INSTALLED_PIP} ${NEEDED_VERSION_PIP} + if [ "$?" -ne "2" ]; then + INSTALL_PIP=0 + fi +fi + +install_pip_securely() { + DO "wget -O ${BUILD_DIR}/${PIP_PKG} ${PIP_URL}" "0" + DO "wget -O ${BUILD_DIR}/${PIP_PKG}.asc ${PIP_SIG_URL}" "0" + + echo "[+] Verifying PGP signature of pip" + echo "${PIP_PUB_KEY}" > ${PIP_KEY_FILE} + DO "gpg --no-default-keyring --keyring $TMP_KEYRING --import $PIP_KEY_FILE" "0" + DO "gpg --no-default-keyring --keyring $TMP_KEYRING --verify $PKG_VERIFY" "0" + + DO "tar xzf ${BUILD_DIR}/${PIP_PKG}" "0" + DO "cd pip-*" "0" + + echo "[+] Installing the latest pip" + if [ "${ASSUME_YES}" -eq "0" ]; then + echo "WARNING this will overwrite the pip that you currently have installed and all python dependencies will be installed via pip." + ANSWER='' + until [[ $ANSWER = [yn] ]]; do + read -r -p "Do you wish to continue? [y/n]" ANSWER + echo + done + if [[ $ANSWER != 'y' ]]; then + echo "Cannot proceed" + exit + fi fi + DO "python setup.py install" "0" + +} + +if [[ "$EUID" -ne "0" ]]; then + echo "Error: OONI setup dependencies script must be run as root." + exit 1 +fi
+case $DISTRO_VERSION in + natty|wheezy|squeeze|precise) + + # Create the build directories + DO "mkdir -p ${BUILD_DIR}" "0" + DO "chmod 700 ${BUILD_DIR}" "0" + + # Import the Tor public key + DO "gpg --no-default-keyring --keyring $TMP_KEYRING --keyserver x-hkp://pool.sks-keyservers.net --recv-keys 0x886DDD89" "0" + gpg --no-default-keyring --keyring $TMP_KEYRING --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add - + HAVE_TOR_REPO="`grep deb.torproject.org/torproject.org /etc/apt/sources.list /etc/apt/sources.list.d/* 2>&1|grep torproject|head -n 1`"; if [ -z "$HAVE_TOR_REPO" ]; then - echo "It appears that you do not have the torproject.org Debian repository installed; installing it..."; - if [ $RELEASE = "squeeze" ]; then - (echo -e "deb $TOR_DEB_REPO $RELEASE main\ndeb-src $TOR_DEB_REPO $RELEASE main" | sudo tee -a /etc/apt/sources.list) > /dev/null - else - sudo apt-add-repository "deb $TOR_DEB_REPO $RELEASE main" - fi + echo "[-] It appears that you do not have the torproject.org Debian repository installed; installing it..."; + if which apt-add-repository >/dev/null 2>&1; then + apt-add-repository "deb $TOR_DEB_REPO $DISTRO_VERSION main" + else + echo -e "deb $TOR_DEB_REPO $DISTRO_VERSION main\ndeb-src $TOR_DEB_REPO $DISTRO_VERSION main" | tee -a /etc/apt/sources.list + fi else - echo "It appears that you have the torproject.org Debian repository installed!"; + echo "[.] It appears that you have the torproject.org Debian repository installed!"; fi
# Install the basic packages to get pip ready to roll - echo "Updating OS package list..."; - sudo apt-get update 2>&1 > /dev/null; - echo "Installing packages for your system..."; - sudo apt-get install git-core python python-pip python-dev build-essential libdumbnet1 python-dumbnet python-libpcap python-pypcap python-dnspython python-virtualenv virtualenvwrapper tor tor-geoipdb; - - if [ ! -f ~/.virtualenvs/ooniprobe/bin/activate ]; then - # Set up the virtual environment - mkdir -p ~/.virtualenvs - virtualenv ~/.virtualenvs/ooniprobe - source ~/.virtualenvs/ooniprobe/bin/activate - else - source ~/.virtualenvs/ooniprobe/bin/activate + echo "[+] Updating OS package list..."; + apt-get update 2>&1 > /dev/null; + echo "[+] Installing packages for your system..."; + DO "apt-get -y install curl git-core python python-pip python-dev python-setuptools build-essential libdumbnet1 python-dumbnet python-libpcap python-pypcap python-dnspython tor tor-geoipdb" "0" + + if [ "${INSTALL_PIP}" -eq "1" ] ; then + echo "[+] Installing pip securely" + install_pip_securely + fi + + if [ "$USE_VIRTUALENV" -eq "1" ]; then + echo "[+] Using virtualenvironment..." + DO "apt-get -y install python-virtualenv virtualenvwrapper" + if [ ! -f ~/.virtualenvs/ooniprobe/bin/activate ]; then + # Set up the virtual environment + DO "mkdir -p ~/.virtualenvs" "0" + DO "virtualenv ~/.virtualenvs/ooniprobe" "0" + source ~/.virtualenvs/ooniprobe/bin/activate + else + source ~/.virtualenvs/ooniprobe/bin/activate + fi fi
- echo "Installing all of the Python dependency requirements with pip!"; + + echo "[+] Installing all of the Python dependency requirements with pip!"; + # Install all of the out of package manager dependencies - pip install -v --timeout 60 -r requirements.txt; + DO "pip install -v --timeout 60 -r ${REPO_ROOT}/requirements.txt" "0" if [ $? != 0 ]; then - echo "It appears that pip is having issues installing our Python dependency requirements, we'll try again!"; - pip install -v --timeout 60 -r requirements.txt; + echo "[+] It appears that pip is having issues installing our Python dependency requirements, we'll try again!"; + DO "pip install -v --timeout 60 -r ${REPO_ROOT}/requirements.txt" "0" if [ $? != 0 ]; then - echo "It appears that pip is unable to satisfy our requirements - please run the following command:"; - echo " pip install -v --timeout 60 -r requirements.txt "; + echo "[+] It appears that pip is unable to satisfy our requirements - please run the following command:"; + echo " pip install -v --timeout 60 -r ${REPO_ROOT}/requirements.txt "; exit 1; fi fi - - echo "Adding a symlink to your ooni-probe source code checkout..."; - ln -s `pwd` ~/ooni-probe; - echo "Adding a default ooniprobe.conf file..."; - cp -v ooniprobe.conf.sample ooniprobe.conf - echo "Creating reports/ directory to store output from ooniprobe..."; - mkdir `pwd`/reports/ - - # Allow ooniprobe to run, if all above went well, we hope! - export PYTHONPATH=$PYTHONPATH:"`pwd`"; - export PATH=$PATH:"`pwd`"; - echo "Please add the following to your respective shell config files:"; - echo ; - echo " if [ -e ~/ooni-probe/bin ]; then"; - echo ' export PATH=~/ooni-probe/bin:$PATH'; - echo " fi"; - echo " if [ -e ~/ooni-probe ]; then"; - echo ' export PYTHONPATH=$PYTHONPATH:~/ooni-probe'; - echo " fi"; - echo ; + + echo "You can now install ooniprobe with: " + echo "" + echo "python setup.py install" + echo "" + echo "You should also be sure to edit your configuration appropriately by doing:" + echo "" + echo "cp /usr/share/ooni/ooniprobe.conf.sample ~/.ooni/ooniprobe.conf" + echo "" +
;; *)
tor-commits@lists.torproject.org