Add OpenVPN and Easy-RSA to setup

This commit is contained in:
Kumi 2019-01-26 09:11:58 +00:00
parent 2de0c4e455
commit 82c631800d
2 changed files with 13 additions and 3 deletions

6
misc/generate-key Executable file
View file

@ -0,0 +1,6 @@
#!/bin/bash
. vars
export EASY_RSA="${EASY_RSA:-.}"
"$EASY_RSA/pkitool" $*

View file

@ -1,17 +1,21 @@
#!/bin/bash
sudo apt update
sudo apt install -y python3-pip npm
sudo apt install -y python3-pip npm openvpn easy-rsa
sudo pip3 install -U django uwsgi django-two-factor-auth django-bootstrap-form twilio argon2_cffi
useradd vpn
sudo useradd vpn
git submodule init
git submodule update
cd lib/jq/
npm run build
cd ../..
sudo make-cadir /etc/openvpn/ca
chmod +x misc/generate-key
sudo cp misc/generate-key /etc/openvpn/ca
mkdir images
./manage.py collectstatic
./manage.py migrate
sudo chown vpn.vpn . -R
sudo chown vpn.vpn . /etc/openvpn/ca -R
sudo cp misc/vpnmanager.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable vpnmanager