From e9981322ae80d30ec71f521159bb284304a9ce71 Mon Sep 17 00:00:00 2001
From: kenneyhe-zingbox <34489271+kenneyhe-zingbox@users.noreply.github.com>
Date: Fri, 5 Jan 2018 08:00:07 -0800
Subject: [PATCH 1/4] Zingbox changes for title and page
Replace title string with zingbox
Replace text "
---
index.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.sh b/index.sh
index e73eb1c..6b6fa1a 100644
--- a/index.sh
+++ b/index.sh
@@ -8,11 +8,11 @@ echo "
-Simple OpenVPN Server
+Zingbox OpenVPN Server
"
-echo "Simple OpenVPN Server
"
+echo "Zingbox OpenVPN Server
"
eval `echo "${QUERY_STRING}"|tr '&' ';'`
From 549199ddeaf15085c0057fa5c376274ec7955b38 Mon Sep 17 00:00:00 2001
From: kenneyhe-zingbox <34489271+kenneyhe-zingbox@users.noreply.github.com>
Date: Fri, 5 Jan 2018 08:11:20 -0800
Subject: [PATCH 2/4] change repository and string of cert info
change index.sh repo
change download.sh repo
change lighttpd.conf repo
---
openvpn.sh | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/openvpn.sh b/openvpn.sh
index 35102e4..fe74acc 100644
--- a/openvpn.sh
+++ b/openvpn.sh
@@ -260,22 +260,23 @@ chmod g+s /etc/openvpn/easy-rsa/
#Generate a self-signed certificate for the web server
mkdir /etc/lighttpd/ssl/
-openssl req -new -x509 -keyout /etc/lighttpd/ssl/server.pem -out /etc/lighttpd/ssl/server.pem -days 9999 -nodes -subj "/C=UK/ST=Warwickshire/L=Leamington/O=OrgName/OU=IT Department/CN=example.com"
+openssl req -new -x509 -keyout /etc/lighttpd/ssl/server.pem -out /etc/lighttpd/ssl/server.pem -days 9999 -nodes -subj "/C=US/ST=California/L=San Francisco/O=zingbox.com/OU=Ops Department/CN=zingbox.com"
chmod 744 /etc/lighttpd/ssl/server.pem
#Configure the web server with the lighttpd.conf from GitHub
mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.old
-wget -O /etc/lighttpd/lighttpd.conf https://raw.githubusercontent.com/theonemule/simple-openvpn-server/master/lighttpd.conf
+wget -O /etc/lighttpd/lighttpd.conf https://raw.githubusercontent.com/kenneyhe-zingbox/simple-openvpn-server/master/lighttpd.conf
#install the webserver scripts
rm /var/www/html/*
-wget -O /var/www/html/index.sh https://raw.githubusercontent.com/theonemule/simple-openvpn-server/master/index.sh
-wget -O /var/www/html/download.sh https://raw.githubusercontent.com/theonemule/simple-openvpn-server/master/download.sh
+wget -O /var/www/html/index.sh https://raw.githubusercontent.com/kenneyhe-zingbox/simple-openvpn-server/master/index.sh
+
+wget -O /var/www/html/download.sh https://raw.githubusercontent.com/kenneyhe-zingbox/simple-openvpn-server/master/download.sh
chown -R www-data:www-data /var/www/html/
#set the password file for the WWW logon
echo "admin:$ADMINPASSWORD" >> /etc/lighttpd/.lighttpdpassword
#restart the web server
-service lighttpd restart
\ No newline at end of file
+service lighttpd restart
From 18cf2fb7fe61ae7bb0065a0458af4d77298d934d Mon Sep 17 00:00:00 2001
From: kenneyhe-zingbox <34489271+kenneyhe-zingbox@users.noreply.github.com>
Date: Fri, 5 Jan 2018 08:21:10 -0800
Subject: [PATCH 3/4] fatal non default of password, clean
move redundant mkdir of clients
add check if password unset
---
openvpn.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/openvpn.sh b/openvpn.sh
index fe74acc..c5292ea 100644
--- a/openvpn.sh
+++ b/openvpn.sh
@@ -1,7 +1,7 @@
#!/bin/bash
-
-ADMINPASSWORD="password"
+# defaults
+ADMINPASSWORD="secret"
DNS1="8.8.8.8"
DNS2="8.8.4.4"
PROTOCOL=udp
@@ -35,6 +35,7 @@ do
esac
done
+[ "${PD}" == "secret" ] && echo "fatal: password is not set"
# Detect Debian users running the script with "sh" instead of bash
if readlink /proc/$$/exe | grep -qs "dash"; then
@@ -248,7 +249,7 @@ verb 3" > /etc/openvpn/client-common.txt
mkdir /etc/openvpn/clients/
#Setup the web server to use an self signed cert
-mkdir /etc/openvpn/clients/
+# mkdir /etc/openvpn/clients/
#Set permissions for easy-rsa and open vpn to be modified by the web user.
chown -R www-data:www-data /etc/openvpn/easy-rsa
From 7dbc7169db62d9f594e42201824c4442a15a73f3 Mon Sep 17 00:00:00 2001
From: kenneyhe-zingbox <34489271+kenneyhe-zingbox@users.noreply.github.com>
Date: Fri, 5 Jan 2018 09:01:30 -0800
Subject: [PATCH 4/4] bugfix password and non exit
exit when password unset
move old lighttpd to $$
move ssl "
move client "
---
openvpn.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/openvpn.sh b/openvpn.sh
index c5292ea..83eff93 100644
--- a/openvpn.sh
+++ b/openvpn.sh
@@ -35,7 +35,7 @@ do
esac
done
-[ "${PD}" == "secret" ] && echo "fatal: password is not set"
+[ "${ADMINPASSWORD}" == "secret" ] && echo "fatal: password is not set" && exit 1
# Detect Debian users running the script with "sh" instead of bash
if readlink /proc/$$/exe | grep -qs "dash"; then
@@ -246,6 +246,7 @@ key-direction 1
verb 3" > /etc/openvpn/client-common.txt
# Generates the custom client.ovpn
+mv /etc/openvpn/clients/ /etc/openvpn/clients.$$/
mkdir /etc/openvpn/clients/
#Setup the web server to use an self signed cert
@@ -260,13 +261,14 @@ chmod g+s /etc/openvpn/clients/
chmod g+s /etc/openvpn/easy-rsa/
#Generate a self-signed certificate for the web server
+mv /etc/lighttpd/ssl/ /etc/lighttpd/ssl.$$/
mkdir /etc/lighttpd/ssl/
openssl req -new -x509 -keyout /etc/lighttpd/ssl/server.pem -out /etc/lighttpd/ssl/server.pem -days 9999 -nodes -subj "/C=US/ST=California/L=San Francisco/O=zingbox.com/OU=Ops Department/CN=zingbox.com"
chmod 744 /etc/lighttpd/ssl/server.pem
#Configure the web server with the lighttpd.conf from GitHub
-mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.old
+mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.$$
wget -O /etc/lighttpd/lighttpd.conf https://raw.githubusercontent.com/kenneyhe-zingbox/simple-openvpn-server/master/lighttpd.conf
#install the webserver scripts