2015-12-21 07:04:00 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-12-23 06:26:27 +00:00
|
|
|
MYSQL_ROOT_PASSWORD="i_hate_passwords"
|
|
|
|
|
2015-12-21 07:04:00 +00:00
|
|
|
echo "Updating system..."
|
2015-12-23 06:26:27 +00:00
|
|
|
apt-get -y update
|
|
|
|
apt-get -y upgrade
|
|
|
|
|
|
|
|
echo "Preparing for MySQL installation..."
|
|
|
|
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password $MYSQL_ROOT_PASSWORD"
|
|
|
|
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $MYSQL_ROOT_PASSWORD"
|
2015-12-21 07:04:00 +00:00
|
|
|
|
|
|
|
echo "Installing dependencies..."
|
2015-12-23 06:26:27 +00:00
|
|
|
apt-get -y install python
|
|
|
|
apt-get -y install python-pip
|
|
|
|
apt-get -y install python-dev libmysqlclient-dev
|
|
|
|
apt-get -y install nginx
|
|
|
|
apt-get -y install mysql-server
|
2015-12-21 07:04:00 +00:00
|
|
|
|
|
|
|
echo "Installing pip dependencies..."
|
2015-12-23 06:26:27 +00:00
|
|
|
pip install -r scripts/requirements.txt
|
|
|
|
|
|
|
|
echo "PATH=$PATH:/vagrant" >> /etc/profile
|
|
|
|
cp /vagrant/ctf.nginx /etc/nginx/sites-enabled/ctf
|
2015-12-23 06:40:32 +00:00
|
|
|
rm /etc/nginx/sites-*/default
|
2015-12-21 22:37:08 +00:00
|
|
|
|
2015-12-23 06:40:32 +00:00
|
|
|
echo "$MYSQL_ROOT_PASSWORD" | mysql -u root -p -e "CREATE DATABASE easyctf;"
|