vpnmanager/setup.sh

31 lines
1.1 KiB
Bash
Raw Normal View History

2018-11-26 08:21:49 +00:00
#!/bin/bash
2019-01-25 20:34:27 +00:00
sudo apt update
2019-02-01 16:49:55 +00:00
sudo apt install -y python3-pip npm openvpn easy-rsa postfix rabbitmq-server
sudo pip3 install -U django django-cron uwsgi celery django-celery-results 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 ../..
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
2019-02-01 15:12:12 +00:00
sudo mkdir -p /etc/openvpn/client-configs/files
chmod +x misc/make_config
sudo cp misc/make_config misc/base.conf /etc/openvpn/client-configs
2019-02-01 15:12:51 +00:00
sudo chown vpn.vpn /etc/openvpn/client-configs -R
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/"