From 82c631800d3e64dba7c2dcd2738156fb9fafe344 Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sat, 26 Jan 2019 09:11:58 +0000 Subject: [PATCH] Add OpenVPN and Easy-RSA to setup --- misc/generate-key | 6 ++++++ setup.sh | 10 +++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100755 misc/generate-key diff --git a/misc/generate-key b/misc/generate-key new file mode 100755 index 0000000..0096851 --- /dev/null +++ b/misc/generate-key @@ -0,0 +1,6 @@ +#!/bin/bash + +. vars +export EASY_RSA="${EASY_RSA:-.}" +"$EASY_RSA/pkitool" $* + diff --git a/setup.sh b/setup.sh index 2dee25e..a57a125 100644 --- a/setup.sh +++ b/setup.sh @@ -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