2018-11-26 08:21:49 +00:00
#!/bin/bash
2019-01-25 20:34:27 +00:00
sudo apt update
2019-01-31 08:24:48 +00:00
sudo apt install -y python3-pip npm openvpn easy-rsa postfix
2019-01-31 14:26:28 +00:00
sudo pip3 install -U django django-cron uwsgi django-two-factor-auth django-bootstrap-form twilio argon2_cffi GitPython
2019-01-26 09:11:58 +00:00
sudo useradd vpn
2019-01-17 19:09:26 +00:00
git submodule init
git submodule update
2019-01-25 20:34:27 +00:00
cd lib/jq/
2019-01-17 19:09:26 +00:00
npm run build
2019-01-25 20:34:27 +00:00
cd ../..
2019-02-01 09:09:35 +00:00
chmod +x manage.py
2019-01-26 09:11:58 +00:00
sudo make-cadir /etc/openvpn/ca
chmod +x misc/generate-key
sudo cp misc/generate-key /etc/openvpn/ca
mkdir images
2018-11-26 08:21:49 +00:00
./manage.py collectstatic
2019-01-09 18:46:03 +00:00
./manage.py migrate
2019-01-26 09:11:58 +00:00
sudo chown vpn.vpn . /etc/openvpn/ca -R
2019-01-25 20:37:41 +00:00
sudo cp misc/vpnmanager.service /etc/systemd/system/
2019-01-31 18:43:53 +00:00
chmod +x misc/cron
sudo cp misc/cron /etc/cron.d/vpnmanager
2018-11-26 08:21:49 +00:00
sudo systemctl daemon-reload
sudo systemctl enable vpnmanager
sudo systemctl start vpnmanager
echo "This should be working so far. Now point your webserver to uwsgi.sock using its WSGI options. Be sure to include the static files at static/static_root/"