From fbec57d1fda70341394bfd2bc90e1dab0af2c125 Mon Sep 17 00:00:00 2001 From: cfcolaco Date: Thu, 29 Jun 2017 12:03:47 +0100 Subject: [PATCH 01/22] changed to new openvpn repos --- auto_install/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 85575c4..ea1172c 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -431,7 +431,7 @@ update_package_cache() { if [[ ${PLAT} == "Ubuntu" || ${PLAT} == "Debian" ]]; then if [[ ${OSCN} == "trusty" || ${OSCN} == "jessie" || ${OSCN} == "wheezy" ]]; then wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - - echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null + echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." $SUDO apt-get -qq update & spinner $! echo " done!" @@ -521,7 +521,7 @@ checkForDependencies() { if [[ $PLAT == "Ubuntu" || $PLAT == "Debian" ]]; then if [[ $OSCN == "trusty" || $OSCN == "jessie" || $OSCN == "wheezy" ]]; then wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - - echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null + echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." $SUDO apt-get -qq update & spinner $! echo " done!" From b3ebdb804aa3754a25d6553073403902cf1caa42 Mon Sep 17 00:00:00 2001 From: Inventor Date: Sat, 5 Aug 2017 19:33:37 -0400 Subject: [PATCH 02/22] Added Related Projects section (#325) * Added a related projects section * Added links (whoops) --- README.md | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index d290393..e645f38 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ About Visit the [PiVPN](http://pivpn.io) site for more information. This is a set of shell scripts that serve to easily turn your Raspberry Pi (TM) -into a VPN server using the free, open-source [OpenVPN](https://openvpn.net) software. +into a VPN server using the free, open-source [OpenVPN](https://openvpn.net) software. Have you been looking for a good guide or tutorial for installing openvpn on a raspberry pi or ubuntu based server? Run this script and you don't need a guide or tutorial, this will do it all for you, in a fraction of the time and with hardened security settings in place by default. @@ -31,7 +31,7 @@ You should also setup your Pi with a static IP address (see either source 1 or 2 at the bottom of this Readme) but it is not required as the script can do this for you. You will need to have your router forward UDP port 1194 (or whatever custom port you may have chose in the installer) (varies by model & manufacturer; consult your router manufacturer's - documentation to do this). + documentation to do this). Enabling SSH on your Pi is also highly recommended, so that you can run a very compact headless server without a monitor or keyboard and be able to access it even more conveniently (This is also covered by source 2). @@ -54,7 +54,7 @@ If you're unsure or don't have a convincing reason one way or the other I'd use > Up to 4096-bit is accepted by nearly all RSA systems (including OpenVPN,) but use of keys this large will dramatically increase generation time, TLS handshake delays, and CPU usage for TLS operations; the benefit beyond 2048-bit keys is small enough not to be of great use at the current time. It is often a larger benefit to consider lower validity times than more bits past 2048, but that is for you to decide. After this, the script will go back to the command line as it builds the server's own -certificate authority. The script will ask you if you'd like to change the certificate fields, +certificate authority. The script will ask you if you'd like to change the certificate fields, the default port, client's DNS server, etc. If you know you want to change these things, feel free, and the script will put all the information where it needs to go in the various config files. If you aren't sure, it has been designed that you can simply hit 'Enter' through all the questions @@ -73,7 +73,7 @@ Managing the PiVPN After the installation is complete you can use the command 'pivpn' to manage the server. -"pivpn add" +"pivpn add" You will be prompted to enter a name for your client. Pick anything you like and hit 'enter'. You will be asked to enter a pass phrase for the client key; make sure it's one you'll remember. The script will assemble the client .ovpn file and place it in the directory 'ovpns' within your @@ -83,10 +83,10 @@ If you need to create a client certificate that is not password protected (IE fo then you can use the 'pivpn add nopass' option to generate that. "pivpn revoke" -Asks you for the name of the client to revoke. Once you revoke a client, it will no longer allow you to use +Asks you for the name of the client to revoke. Once you revoke a client, it will no longer allow you to use the given client certificate (ovpn config) to connect. This is useful for many reasons but some ex: -You have a profile on a mobile phone and it was lost or stolen. Revoke its cert and generate a new -one for your new phone. Or even if you suspect that a cert may have been compromised in any way, +You have a profile on a mobile phone and it was lost or stolen. Revoke its cert and generate a new +one for your new phone. Or even if you suspect that a cert may have been compromised in any way, just revoke it and generate a new one. "pivpn list" @@ -123,7 +123,7 @@ Removing PiVPN If at any point you wish to remove OpenVPN from your Pi and revert it to a pre-installation state, such as if you want to undo a failed installation to try again or you want to remove OpenVPN without installing a fresh Raspbian image, just run -'pivpn uninstall' +'pivpn uninstall' Feedback & Support -------- @@ -135,14 +135,25 @@ to keep things sorted. [[DISCONTINUED APRIL 17]] You can also post on the [Google Space](https://goo.gl/spaces/kgp2Mcy5RDfZ5SSf8) I created for PiVPN, especially suited for general questions or discussions. -You can also join #pivpn on freenode in IRC for community support or general questions. +You can also join #pivpn on freenode in IRC for community support or general questions. + +Related Projects +-------- +[StarshipEngineer/OpenVPN-Setup](https://github.com/StarshipEngineer/OpenVPN-Setup) +Shell script to set up a OpenVPN server. + +[InnovativeInventor/docker-pivpn](https://github.com/InnovativeInventor/docker-pivpn) +A secure docker container that sets up PiVPN and SSH. + +[OpenVPN](https://openvpn.net) +The foundation for all open-source VPN projects. Contributions ------------- -I'm also interested in improving this script, please check the current issues to see where you can help. If you have any +I'm also interested in improving this script, please check the current issues to see where you can help. If you have any feature ideas or requests, or are interested in adding your ideas to it, -testing it on other platforms, please comment or leave a pull request. +testing it on other platforms, please comment or leave a pull request. If you contribute often I can add you as a member of the PiVPN project. I will be happy to work with you! @@ -158,4 +169,3 @@ sources. 4. And as always the ever vigilant [EFF] (https://www.eff.org/) I don't take donations at this time but if you want to show your appreciation to me, then contribute or leave feedback on suggestions or improvements. - From f385a3ec536ebb344811ee3d4b36ad552fcbb560 Mon Sep 17 00:00:00 2001 From: Jason Healy Date: Fri, 11 Aug 2017 01:22:06 -0600 Subject: [PATCH 03/22] fix markdown link syntax --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e645f38..332b80b 100644 --- a/README.md +++ b/README.md @@ -164,8 +164,8 @@ sources. 2. And the code at [pi-hole.net](https://github.com/pi-hole/pi-hole) -3. Of course there is [OpenVPN] (https://openvpn.net) +3. Of course there is [OpenVPN](https://openvpn.net) -4. And as always the ever vigilant [EFF] (https://www.eff.org/) +4. And as always the ever vigilant [EFF](https://www.eff.org/) I don't take donations at this time but if you want to show your appreciation to me, then contribute or leave feedback on suggestions or improvements. From da9e082f431bcb13198bea656b70b6f6ed6add20 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Wed, 20 Sep 2017 22:42:29 -0500 Subject: [PATCH 04/22] Changed the default length of the Diffie-Hellman parameters to 2048 bits. This is the default everywhere else, both in documentation as well as menu selections and other scripts in this project. This change has no real impact aside from setting the right example. --- server_config.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server_config.txt b/server_config.txt index 70625e7..602dea7 100644 --- a/server_config.txt +++ b/server_config.txt @@ -4,7 +4,7 @@ port 1194 ca /etc/openvpn/easy-rsa/pki/ca.crt cert /etc/openvpn/easy-rsa/pki/issued/server.crt key /etc/openvpn/easy-rsa/pki/private/server.key -dh /etc/openvpn/easy-rsa/pki/dh1024.pem +dh /etc/openvpn/easy-rsa/pki/dh2048.pem topology subnet server 10.8.0.0 255.255.255.0 # server and remote endpoints From 7cf5c19789cd1eae2f52023b0f041be89ee6e47e Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Wed, 20 Sep 2017 23:24:57 -0500 Subject: [PATCH 05/22] Changed the display order of the DH options (default value is still 2048 bits) and added a warning for 1024 bits. --- auto_install/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 33ca2a4..8460db8 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -802,10 +802,10 @@ confOpenVPN() { if [[ ${useUpdateVars} == false ]]; then # Ask user for desired level of encryption ENCRYPT=$(whiptail --backtitle "Setup OpenVPN" --title "Encryption Strength" --radiolist \ - "Choose your desired level of encryption (press space to select):\n This is an encryption key that will be generated on your system. The larger the key, the more time this will take. For most applications it is recommended to use 2048 bit. If you are testing or just want to get through it quicker you can use 1024. If you are paranoid about ... things... then grab a cup of joe and pick 4096." ${r} ${c} 3 \ - "2048" "Use 2048-bit encryption. Recommended level." ON \ - "1024" "Use 1024-bit encryption. Test level." OFF \ - "4096" "Use 4096-bit encryption. Paranoid level." OFF 3>&1 1>&2 2>&3) + "Choose your desired level of encryption (press space to select):\n This is an encryption key that will be generated on your system. The larger the key, the more time this will take. For most applications it is recommended to use 2048 bit. If you are testing, you can use 1024 bit to speed things up but do not use this for normal use! If you are paranoid about ... things... then grab a cup of joe and pick 4096." ${r} ${c} 3 \ + "1024" "Use 1024-bit encryption (testing only)." OFF \ + "2048" "Use 2048-bit encryption (recommended level)." ON \ + "4096" "Use 4096-bit encryption (paranoid level)." OFF 3>&1 1>&2 2>&3) exitstatus=$? if [ $exitstatus != 0 ]; then From d1652a03b139496ce565dddd5e979e69ec523903 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Thu, 21 Sep 2017 14:39:16 -0500 Subject: [PATCH 06/22] The SERVER_NAME variable is used in a 'verify-x509-name' check to allow the client to verify it is talking to the correct server. However, its value was always equal to 'server'. This wasn't unique for each installation and therefore provided no additional safety check. So I've modified it to be random for each installation of PiVPN. Additionally, the variable is now actually being used when specifying the server name in the build-server-full command. Source for obtaining a random UUID (thank you): Earthgecko (https://gist.github.com/earthgecko/3089509) --- auto_install/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 33ca2a4..1554923 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -797,7 +797,9 @@ setClientDNS() { } confOpenVPN() { - SERVER_NAME="server" + # Generate a random, alphanumeric identifier of 16 characters for this server so that we can use verify-x509-name later that is unique for this server installation. Source: Earthgecko (https://gist.github.com/earthgecko/3089509) + NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1) + SERVER_NAME="server_${NEW_UUID}" if [[ ${useUpdateVars} == false ]]; then # Ask user for desired level of encryption @@ -859,7 +861,7 @@ EOF fi # Build the server - ${SUDOE} ./easyrsa build-server-full server nopass + ${SUDOE} ./easyrsa build-server-full ${SERVER_NAME} nopass if [[ ${useUpdateVars} == false ]]; then if ([ "$ENCRYPT" -ge "4096" ] && whiptail --backtitle "Setup OpenVPN" --title "Download Diffie-Hellman Parameters" --yesno --defaultno "Download Diffie-Hellman parameters from a public DH parameter generation service?\n\nGenerating DH parameters for a $ENCRYPT-bit key can take many hours on a Raspberry Pi. You can instead download DH parameters from \"2 Ton Digital\" that are generated at regular intervals as part of a public service. Downloaded DH parameters will be randomly selected from a pool of the last 128 generated.\nMore information about this service can be found here: https://2ton.com.au/dhtool/\n\nIf you're paranoid, choose 'No' and Diffie-Hellman parameters will be generated on your device." ${r} ${c}) From 05c6a3715261070ea8db8b9407256a12f37125dd Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Thu, 21 Sep 2017 23:06:02 -0500 Subject: [PATCH 07/22] Removed the duplicate-cn option so every device/connection must use a unique certificate. --- server_config.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/server_config.txt b/server_config.txt index 70625e7..0f36d38 100644 --- a/server_config.txt +++ b/server_config.txt @@ -23,7 +23,6 @@ push "dhcp-option DNS 8.8.4.4" # overriding but not wiping out the original default gateway. push "redirect-gateway def1" client-to-client -duplicate-cn keepalive 10 120 tls-version-min 1.2 tls-auth /etc/openvpn/easy-rsa/pki/ta.key 0 From 8910545d909703fc7d5e8c68c1f8b6a9e3848327 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Fri, 22 Sep 2017 02:17:53 -0500 Subject: [PATCH 08/22] Fixed a couple of typos. --- auto_install/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 8460db8..23122e5 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -801,8 +801,8 @@ confOpenVPN() { if [[ ${useUpdateVars} == false ]]; then # Ask user for desired level of encryption - ENCRYPT=$(whiptail --backtitle "Setup OpenVPN" --title "Encryption Strength" --radiolist \ - "Choose your desired level of encryption (press space to select):\n This is an encryption key that will be generated on your system. The larger the key, the more time this will take. For most applications it is recommended to use 2048 bit. If you are testing, you can use 1024 bit to speed things up but do not use this for normal use! If you are paranoid about ... things... then grab a cup of joe and pick 4096." ${r} ${c} 3 \ + ENCRYPT=$(whiptail --backtitle "Setup OpenVPN" --title "Encryption strength" --radiolist \ + "Choose your desired level of encryption (press space to select):\n This is an encryption key that will be generated on your system. The larger the key, the more time this will take. For most applications, it is recommended to use 2048 bits. If you are testing, you can use 1024 bits to speed things up, but do not use this for normal use! If you are paranoid about ... things... then grab a cup of joe and pick 4096 bits." ${r} ${c} 3 \ "1024" "Use 1024-bit encryption (testing only)." OFF \ "2048" "Use 2048-bit encryption (recommended level)." ON \ "4096" "Use 4096-bit encryption (paranoid level)." OFF 3>&1 1>&2 2>&3) From 30920115b3d3f7df3b60a9cdc3826c83176ebaa9 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Fri, 22 Sep 2017 02:46:52 -0500 Subject: [PATCH 09/22] Implemented that a Certificate Revocation List is generated during installation after generation of other Public Key Infrastructure. Enabled this CRL in the server config. The added benefit of this is that whenever the user now revokes a client, the change is instant. Whereas before, the first time a client was revoked, the OpenVPN server had to be restarted to enabled the then-newly-generated CRL. This change also makes the file /etc/pivpn/REVOKE_STATUS obsolete. Documentation: https://openvpn.net/index.php/open-source/documentation/howto.html#revoke --- auto_install/install.sh | 9 +++++---- scripts/removeOVPN.sh | 16 ---------------- server_config.txt | 2 +- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 33ca2a4..7783986 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -884,6 +884,11 @@ EOF # Generate static HMAC key to defend against DDoS ${SUDOE} openvpn --genkey --secret pki/ta.key + # Generate an empty Certificate Revocation List + ${SUDOE} ./easyrsa gen-crl + cp pki/crl.pem /etc/openvpn/crl.pem + chown nobody:nogroup /etc/openvpn/crl.pem + # Write config file for server using the template .txt file $SUDO cp /etc/.pivpn/server_config.txt /etc/openvpn/server.conf @@ -992,10 +997,6 @@ confOVPN() { $SUDO cp /tmp/pivpnUSR /etc/pivpn/INSTALL_USER $SUDO cp /tmp/DET_PLATFORM /etc/pivpn/DET_PLATFORM - # Set status that no certs have been revoked - echo 0 > /tmp/REVOKE_STATUS - $SUDO cp /tmp/REVOKE_STATUS /etc/pivpn/REVOKE_STATUS - $SUDO cp /etc/.pivpn/Default.txt /etc/openvpn/easy-rsa/pki/Default.txt if [[ ${useUpdateVars} == false ]]; then diff --git a/scripts/removeOVPN.sh b/scripts/removeOVPN.sh index 4e3515c..3200a55 100644 --- a/scripts/removeOVPN.sh +++ b/scripts/removeOVPN.sh @@ -105,22 +105,6 @@ fi cd /etc/openvpn/easy-rsa || exit -if [ "${REVOKE_STATUS}" == 0 ]; then - echo 1 > /etc/pivpn/REVOKE_STATUS - printf "\nThis seems to be the first time you have revoked a cert.\n" - printf "First we need to initialize the Certificate Revocation List.\n" - printf "Then add the CRL to your server config and restart openvpn.\n" - ./easyrsa gen-crl - cp pki/crl.pem /etc/openvpn/crl.pem - chown nobody:nogroup /etc/openvpn/crl.pem - sed -i '/#crl-verify/c\crl-verify /etc/openvpn/crl.pem' /etc/openvpn/server.conf - if [[ ${PLAT} == "Ubuntu" || ${PLAT} == "Debian" ]]; then - service openvpn restart - else - systemctl restart openvpn.service - fi -fi - for (( ii = 0; ii < ${#CERTS_TO_REVOKE[@]}; ii++)); do printf "\n::: Revoking certificate '"%s"'.\n" "${CERTS_TO_REVOKE[ii]}" ./easyrsa --batch revoke "${CERTS_TO_REVOKE[ii]}" diff --git a/server_config.txt b/server_config.txt index 70625e7..035a3ed 100644 --- a/server_config.txt +++ b/server_config.txt @@ -34,7 +34,7 @@ user nobody group nogroup persist-key persist-tun -#crl-verify /etc/openvpn/crl.pem +crl-verify /etc/openvpn/crl.pem status /var/log/openvpn-status.log 20 status-version 3 log /var/log/openvpn.log From a6058a1d14160dfd038fed90bd355865bf1b27b8 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Fri, 22 Sep 2017 03:30:14 -0500 Subject: [PATCH 10/22] The client config contains the remote-cert-tls option to check for appropriate key usage, let's do this for the server config too. --- server_config.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/server_config.txt b/server_config.txt index 70625e7..dd56b71 100644 --- a/server_config.txt +++ b/server_config.txt @@ -25,6 +25,7 @@ push "redirect-gateway def1" client-to-client duplicate-cn keepalive 10 120 +remote-cert-tls client tls-version-min 1.2 tls-auth /etc/openvpn/easy-rsa/pki/ta.key 0 cipher AES-256-CBC From 7b6a35877907a4c24441234d3adefd89528fd407 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Fri, 22 Sep 2017 14:11:23 -0500 Subject: [PATCH 11/22] Modified the messages when PiVPN installation completes and client profiles are generated, so the user knows to generate a client profile per each device he/she wants to connect to the VPN with. --- auto_install/install.sh | 2 +- scripts/makeOVPN.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 33ca2a4..24d2877 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -1344,7 +1344,7 @@ main() { echo ":::" if [[ "${useUpdateVars}" == false ]]; then echo "::: Installation Complete!" - echo "::: Now run 'pivpn add' to create the ovpn profiles." + echo "::: Now run 'pivpn add' to create an ovpn profile for each of your devices." echo "::: Run 'pivpn help' to see what else you can do!" echo "::: It is strongly recommended you reboot after installation." else diff --git a/scripts/makeOVPN.sh b/scripts/makeOVPN.sh index f1308f1..d9101f3 100644 --- a/scripts/makeOVPN.sh +++ b/scripts/makeOVPN.sh @@ -240,5 +240,6 @@ printf "========================================================\n" printf "\e[1mDone! %s successfully created!\e[0m \n" "$NAME$FILEEXT" printf "%s was copied to:\n" "$NAME$FILEEXT" printf " /home/%s/ovpns\n" "$INSTALL_USER" -printf "for easy transfer.\n" +printf "for easy transfer. Please use this profile only on one\n" +printf "device and create additional profiles for other devices.\n" printf "========================================================\n\n" From 077996cfb48dd23fe00415fd800c31889c61233c Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Sat, 23 Sep 2017 11:21:26 -0500 Subject: [PATCH 12/22] Removed an obsolete variable. --- scripts/removeOVPN.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/removeOVPN.sh b/scripts/removeOVPN.sh index 3200a55..6bf0610 100644 --- a/scripts/removeOVPN.sh +++ b/scripts/removeOVPN.sh @@ -2,7 +2,6 @@ # PiVPN: revoke client script INSTALL_USER=$(cat /etc/pivpn/INSTALL_USER) -REVOKE_STATUS=$(cat /etc/pivpn/REVOKE_STATUS) PLAT=$(cat /etc/pivpn/DET_PLATFORM) INDEX="/etc/openvpn/easy-rsa/pki/index.txt" From f5c05715de2e1a6bd389cac56b63ad91ad9c8e39 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Sat, 23 Sep 2017 14:35:46 -0500 Subject: [PATCH 13/22] Added sudo -E. --- auto_install/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 7783986..4ecf624 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -886,8 +886,8 @@ EOF # Generate an empty Certificate Revocation List ${SUDOE} ./easyrsa gen-crl - cp pki/crl.pem /etc/openvpn/crl.pem - chown nobody:nogroup /etc/openvpn/crl.pem + ${SUDOE} cp pki/crl.pem /etc/openvpn/crl.pem + ${SUDOE} chown nobody:nogroup /etc/openvpn/crl.pem # Write config file for server using the template .txt file $SUDO cp /etc/.pivpn/server_config.txt /etc/openvpn/server.conf From c81e793c6ce780b06984168b7db244684ab73c1f Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Sat, 23 Sep 2017 15:16:06 -0500 Subject: [PATCH 14/22] Removed punctuation in list items. --- auto_install/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 23122e5..cb41800 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -803,9 +803,9 @@ confOpenVPN() { # Ask user for desired level of encryption ENCRYPT=$(whiptail --backtitle "Setup OpenVPN" --title "Encryption strength" --radiolist \ "Choose your desired level of encryption (press space to select):\n This is an encryption key that will be generated on your system. The larger the key, the more time this will take. For most applications, it is recommended to use 2048 bits. If you are testing, you can use 1024 bits to speed things up, but do not use this for normal use! If you are paranoid about ... things... then grab a cup of joe and pick 4096 bits." ${r} ${c} 3 \ - "1024" "Use 1024-bit encryption (testing only)." OFF \ - "2048" "Use 2048-bit encryption (recommended level)." ON \ - "4096" "Use 4096-bit encryption (paranoid level)." OFF 3>&1 1>&2 2>&3) + "1024" "Use 1024-bit encryption (testing only)" OFF \ + "2048" "Use 2048-bit encryption (recommended level)" ON \ + "4096" "Use 4096-bit encryption (paranoid level)" OFF 3>&1 1>&2 2>&3) exitstatus=$? if [ $exitstatus != 0 ]; then From 2626127be18fca41802fa009453877cb6d0544e6 Mon Sep 17 00:00:00 2001 From: cfcolaco Date: Sun, 8 Oct 2017 12:54:24 +0100 Subject: [PATCH 15/22] Added support to Stretch, Fixed some texts, Removed some lines for testing pruposes --- auto_install/install.sh | 68 +++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 9c580a0..fcfde96 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -61,14 +61,14 @@ dhcpcdFile=/etc/dhcpcd.conf # Next see if we are on a tested and supported OS function noOS_Support() { whiptail --msgbox --backtitle "INVALID OS DETECTED" --title "Invalid OS" "We have not been able to detect a supported OS. -Currently this installer supports Raspbian (or Devuan) jessie, Ubuntu 14.04 (trusty), and Ubuntu 16.04 (xenial). +Currently this installer supports Raspbian, Debian or Devuan jessie and stretch and Ubuntu from 14.04 (trusty) to 17.04 (zetsy). If you think you received this message in error, you can post an issue on the GitHub at https://github.com/pivpn/pivpn/issues." ${r} ${c} exit 1 } function maybeOS_Support() { if (whiptail --backtitle "Not Supported OS" --title "Not Supported OS" --yesno "You are on an OS that we have not tested but MAY work. -Currently this installer supports Raspbian (or Devuan) jessie, Ubuntu 14.04 (trusty), and Ubuntu 16.04 (xenial). +Currently this installer ssupports Raspbian, Debian or Devuan jessie and stretch and Ubuntu from 14.04 (trusty) to 17.04 (zetsy). Would you like to continue anyway?" ${r} ${c}) then echo "::: Did not detect perfectly supported OS but," echo "::: Continuing installation at user's own risk..." @@ -88,7 +88,7 @@ distro_check() { case ${PLAT} in Ubuntu|Raspbian|Debian|Devuan) case ${OSCN} in - trusty|xenial|jessie) + trusty|xenial|jessie|stretch) ;; *) maybeOS_Support @@ -111,6 +111,9 @@ distro_check() { if grep -q jessie /etc/os-release; then PLAT="Raspbian" OSCN="jessie" + elif grep -q stretch /etc/os-release; then + PLAT="Raspbian" + OSCN="stretch" else PLAT="Ubuntu" OSCN="unknown" @@ -435,31 +438,33 @@ update_package_cache() { timestampAsDate=$(date -d @"${timestamp}" "+%b %e") today=$(date "+%b %e") -<<<<<<< HEAD - case ${PLAT} in - Ubuntu|Debian|Devuan) - case ${OSCN} in - trusty|jessie|wheezy) - wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - - echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null - echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." - $SUDO apt-get -qq update & spinner $! - echo " done!" - ;; - esac - ;; - esac -======= - if [[ ${PLAT} == "Ubuntu" || ${PLAT} == "Debian" ]]; then - if [[ ${OSCN} == "trusty" || ${OSCN} == "jessie" || ${OSCN} == "wheezy" ]]; then - wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - - echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null - echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." - $SUDO apt-get -qq update & spinner $! - echo " done!" - fi - fi ->>>>>>> 454b755116d8cad6b67b56ac15a7235ceac02b5a +#### REMOVE IF TESTING WORKS ##### +#<<<<<<< HEAD +# case ${PLAT} in +# Ubuntu|Debian|Devuan) +# case ${OSCN} in +# trusty|jessie|wheezy) +# wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - +# echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null +# echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." +# $SUDO apt-get -qq update & spinner $! +# echo " done!" +# ;; +# esac +# ;; +# esac +#======= +# if [[ ${PLAT} == "Ubuntu" || ${PLAT} == "Debian" ]]; then +# if [[ ${OSCN} == "trusty" || ${OSCN} == "jessie" || ${OSCN} == "wheezy" ]]; then +# wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - +# echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null +# echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." +# $SUDO apt-get -qq update & spinner $! +# echo " done!" +# fi +# fi +#>>>>>>> 454b755116d8cad6b67b56ac15a7235ceac02b5a +##### REMOVE UNTIL THIS POINT###### if [ ! "${today}" == "${timestampAsDate}" ]; then #update package lists @@ -543,11 +548,10 @@ checkForDependencies() { timestampAsDate=$(date -d @"$timestamp" "+%b %e") today=$(date "+%b %e") -<<<<<<< HEAD case ${PLAT} in Ubuntu|Debian|Devuan) case ${OSCN} in - trusty|jessie|wheezy) + trusty|jessie|wheezy|stretch) wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." @@ -557,9 +561,8 @@ checkForDependencies() { esac ;; esac -======= if [[ $PLAT == "Ubuntu" || $PLAT == "Debian" ]]; then - if [[ $OSCN == "trusty" || $OSCN == "jessie" || $OSCN == "wheezy" ]]; then + if [[ $OSCN == "trusty" || $OSCN == "jessie" || $OSCN == "wheezy" || $OSCN == "stretch" ]]; then wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." @@ -567,7 +570,6 @@ checkForDependencies() { echo " done!" fi fi ->>>>>>> 454b755116d8cad6b67b56ac15a7235ceac02b5a if [ ! "$today" == "$timestampAsDate" ]; then #update package lists From 6e8d6d24b51c1bc8a7316428ca81fcd59e960803 Mon Sep 17 00:00:00 2001 From: cfcolaco Date: Sun, 8 Oct 2017 13:08:57 +0100 Subject: [PATCH 16/22] Revert "Added support to Stretch, Fixed some texts, Removed some lines for testing pruposes" This reverts commit 2626127be18fca41802fa009453877cb6d0544e6. --- auto_install/install.sh | 68 ++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index fcfde96..9c580a0 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -61,14 +61,14 @@ dhcpcdFile=/etc/dhcpcd.conf # Next see if we are on a tested and supported OS function noOS_Support() { whiptail --msgbox --backtitle "INVALID OS DETECTED" --title "Invalid OS" "We have not been able to detect a supported OS. -Currently this installer supports Raspbian, Debian or Devuan jessie and stretch and Ubuntu from 14.04 (trusty) to 17.04 (zetsy). +Currently this installer supports Raspbian (or Devuan) jessie, Ubuntu 14.04 (trusty), and Ubuntu 16.04 (xenial). If you think you received this message in error, you can post an issue on the GitHub at https://github.com/pivpn/pivpn/issues." ${r} ${c} exit 1 } function maybeOS_Support() { if (whiptail --backtitle "Not Supported OS" --title "Not Supported OS" --yesno "You are on an OS that we have not tested but MAY work. -Currently this installer ssupports Raspbian, Debian or Devuan jessie and stretch and Ubuntu from 14.04 (trusty) to 17.04 (zetsy). +Currently this installer supports Raspbian (or Devuan) jessie, Ubuntu 14.04 (trusty), and Ubuntu 16.04 (xenial). Would you like to continue anyway?" ${r} ${c}) then echo "::: Did not detect perfectly supported OS but," echo "::: Continuing installation at user's own risk..." @@ -88,7 +88,7 @@ distro_check() { case ${PLAT} in Ubuntu|Raspbian|Debian|Devuan) case ${OSCN} in - trusty|xenial|jessie|stretch) + trusty|xenial|jessie) ;; *) maybeOS_Support @@ -111,9 +111,6 @@ distro_check() { if grep -q jessie /etc/os-release; then PLAT="Raspbian" OSCN="jessie" - elif grep -q stretch /etc/os-release; then - PLAT="Raspbian" - OSCN="stretch" else PLAT="Ubuntu" OSCN="unknown" @@ -438,33 +435,31 @@ update_package_cache() { timestampAsDate=$(date -d @"${timestamp}" "+%b %e") today=$(date "+%b %e") -#### REMOVE IF TESTING WORKS ##### -#<<<<<<< HEAD -# case ${PLAT} in -# Ubuntu|Debian|Devuan) -# case ${OSCN} in -# trusty|jessie|wheezy) -# wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - -# echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null -# echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." -# $SUDO apt-get -qq update & spinner $! -# echo " done!" -# ;; -# esac -# ;; -# esac -#======= -# if [[ ${PLAT} == "Ubuntu" || ${PLAT} == "Debian" ]]; then -# if [[ ${OSCN} == "trusty" || ${OSCN} == "jessie" || ${OSCN} == "wheezy" ]]; then -# wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - -# echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null -# echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." -# $SUDO apt-get -qq update & spinner $! -# echo " done!" -# fi -# fi -#>>>>>>> 454b755116d8cad6b67b56ac15a7235ceac02b5a -##### REMOVE UNTIL THIS POINT###### +<<<<<<< HEAD + case ${PLAT} in + Ubuntu|Debian|Devuan) + case ${OSCN} in + trusty|jessie|wheezy) + wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - + echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null + echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." + $SUDO apt-get -qq update & spinner $! + echo " done!" + ;; + esac + ;; + esac +======= + if [[ ${PLAT} == "Ubuntu" || ${PLAT} == "Debian" ]]; then + if [[ ${OSCN} == "trusty" || ${OSCN} == "jessie" || ${OSCN} == "wheezy" ]]; then + wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - + echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null + echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." + $SUDO apt-get -qq update & spinner $! + echo " done!" + fi + fi +>>>>>>> 454b755116d8cad6b67b56ac15a7235ceac02b5a if [ ! "${today}" == "${timestampAsDate}" ]; then #update package lists @@ -548,10 +543,11 @@ checkForDependencies() { timestampAsDate=$(date -d @"$timestamp" "+%b %e") today=$(date "+%b %e") +<<<<<<< HEAD case ${PLAT} in Ubuntu|Debian|Devuan) case ${OSCN} in - trusty|jessie|wheezy|stretch) + trusty|jessie|wheezy) wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." @@ -561,8 +557,9 @@ checkForDependencies() { esac ;; esac +======= if [[ $PLAT == "Ubuntu" || $PLAT == "Debian" ]]; then - if [[ $OSCN == "trusty" || $OSCN == "jessie" || $OSCN == "wheezy" || $OSCN == "stretch" ]]; then + if [[ $OSCN == "trusty" || $OSCN == "jessie" || $OSCN == "wheezy" ]]; then wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." @@ -570,6 +567,7 @@ checkForDependencies() { echo " done!" fi fi +>>>>>>> 454b755116d8cad6b67b56ac15a7235ceac02b5a if [ ! "$today" == "$timestampAsDate" ]; then #update package lists From 29a5dbb22b773f8093497126d13a86d7e1bbfbe1 Mon Sep 17 00:00:00 2001 From: cfcolaco Date: Sun, 8 Oct 2017 13:19:01 +0100 Subject: [PATCH 17/22] Revert "Revert "Added support to Stretch, Fixed some texts, Removed some lines for testing pruposes"" This reverts commit 6e8d6d24b51c1bc8a7316428ca81fcd59e960803. --- auto_install/install.sh | 68 +++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 9c580a0..fcfde96 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -61,14 +61,14 @@ dhcpcdFile=/etc/dhcpcd.conf # Next see if we are on a tested and supported OS function noOS_Support() { whiptail --msgbox --backtitle "INVALID OS DETECTED" --title "Invalid OS" "We have not been able to detect a supported OS. -Currently this installer supports Raspbian (or Devuan) jessie, Ubuntu 14.04 (trusty), and Ubuntu 16.04 (xenial). +Currently this installer supports Raspbian, Debian or Devuan jessie and stretch and Ubuntu from 14.04 (trusty) to 17.04 (zetsy). If you think you received this message in error, you can post an issue on the GitHub at https://github.com/pivpn/pivpn/issues." ${r} ${c} exit 1 } function maybeOS_Support() { if (whiptail --backtitle "Not Supported OS" --title "Not Supported OS" --yesno "You are on an OS that we have not tested but MAY work. -Currently this installer supports Raspbian (or Devuan) jessie, Ubuntu 14.04 (trusty), and Ubuntu 16.04 (xenial). +Currently this installer ssupports Raspbian, Debian or Devuan jessie and stretch and Ubuntu from 14.04 (trusty) to 17.04 (zetsy). Would you like to continue anyway?" ${r} ${c}) then echo "::: Did not detect perfectly supported OS but," echo "::: Continuing installation at user's own risk..." @@ -88,7 +88,7 @@ distro_check() { case ${PLAT} in Ubuntu|Raspbian|Debian|Devuan) case ${OSCN} in - trusty|xenial|jessie) + trusty|xenial|jessie|stretch) ;; *) maybeOS_Support @@ -111,6 +111,9 @@ distro_check() { if grep -q jessie /etc/os-release; then PLAT="Raspbian" OSCN="jessie" + elif grep -q stretch /etc/os-release; then + PLAT="Raspbian" + OSCN="stretch" else PLAT="Ubuntu" OSCN="unknown" @@ -435,31 +438,33 @@ update_package_cache() { timestampAsDate=$(date -d @"${timestamp}" "+%b %e") today=$(date "+%b %e") -<<<<<<< HEAD - case ${PLAT} in - Ubuntu|Debian|Devuan) - case ${OSCN} in - trusty|jessie|wheezy) - wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - - echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null - echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." - $SUDO apt-get -qq update & spinner $! - echo " done!" - ;; - esac - ;; - esac -======= - if [[ ${PLAT} == "Ubuntu" || ${PLAT} == "Debian" ]]; then - if [[ ${OSCN} == "trusty" || ${OSCN} == "jessie" || ${OSCN} == "wheezy" ]]; then - wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - - echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null - echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." - $SUDO apt-get -qq update & spinner $! - echo " done!" - fi - fi ->>>>>>> 454b755116d8cad6b67b56ac15a7235ceac02b5a +#### REMOVE IF TESTING WORKS ##### +#<<<<<<< HEAD +# case ${PLAT} in +# Ubuntu|Debian|Devuan) +# case ${OSCN} in +# trusty|jessie|wheezy) +# wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - +# echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null +# echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." +# $SUDO apt-get -qq update & spinner $! +# echo " done!" +# ;; +# esac +# ;; +# esac +#======= +# if [[ ${PLAT} == "Ubuntu" || ${PLAT} == "Debian" ]]; then +# if [[ ${OSCN} == "trusty" || ${OSCN} == "jessie" || ${OSCN} == "wheezy" ]]; then +# wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - +# echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null +# echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." +# $SUDO apt-get -qq update & spinner $! +# echo " done!" +# fi +# fi +#>>>>>>> 454b755116d8cad6b67b56ac15a7235ceac02b5a +##### REMOVE UNTIL THIS POINT###### if [ ! "${today}" == "${timestampAsDate}" ]; then #update package lists @@ -543,11 +548,10 @@ checkForDependencies() { timestampAsDate=$(date -d @"$timestamp" "+%b %e") today=$(date "+%b %e") -<<<<<<< HEAD case ${PLAT} in Ubuntu|Debian|Devuan) case ${OSCN} in - trusty|jessie|wheezy) + trusty|jessie|wheezy|stretch) wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." @@ -557,9 +561,8 @@ checkForDependencies() { esac ;; esac -======= if [[ $PLAT == "Ubuntu" || $PLAT == "Debian" ]]; then - if [[ $OSCN == "trusty" || $OSCN == "jessie" || $OSCN == "wheezy" ]]; then + if [[ $OSCN == "trusty" || $OSCN == "jessie" || $OSCN == "wheezy" || $OSCN == "stretch" ]]; then wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." @@ -567,7 +570,6 @@ checkForDependencies() { echo " done!" fi fi ->>>>>>> 454b755116d8cad6b67b56ac15a7235ceac02b5a if [ ! "$today" == "$timestampAsDate" ]; then #update package lists From c1918417d60881391fee52fff1546e55d2f6ca1a Mon Sep 17 00:00:00 2001 From: cfcolaco Date: Sun, 8 Oct 2017 18:27:43 +0100 Subject: [PATCH 18/22] added support to Stretch, removed useless code, added info about stretch support --- auto_install/install.sh | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index fcfde96..95d3187 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -438,33 +438,6 @@ update_package_cache() { timestampAsDate=$(date -d @"${timestamp}" "+%b %e") today=$(date "+%b %e") -#### REMOVE IF TESTING WORKS ##### -#<<<<<<< HEAD -# case ${PLAT} in -# Ubuntu|Debian|Devuan) -# case ${OSCN} in -# trusty|jessie|wheezy) -# wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - -# echo "deb http://swupdate.openvpn.net/apt $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null -# echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." -# $SUDO apt-get -qq update & spinner $! -# echo " done!" -# ;; -# esac -# ;; -# esac -#======= -# if [[ ${PLAT} == "Ubuntu" || ${PLAT} == "Debian" ]]; then -# if [[ ${OSCN} == "trusty" || ${OSCN} == "jessie" || ${OSCN} == "wheezy" ]]; then -# wget -O - https://swupdate.openvpn.net/repos/repo-public.gpg| $SUDO apt-key add - -# echo "deb http://build.openvpn.net/debian/openvpn/stable $OSCN main" | $SUDO tee /etc/apt/sources.list.d/swupdate.openvpn.net.list > /dev/null -# echo -n "::: Adding OpenVPN repo for $PLAT $OSCN ..." -# $SUDO apt-get -qq update & spinner $! -# echo " done!" -# fi -# fi -#>>>>>>> 454b755116d8cad6b67b56ac15a7235ceac02b5a -##### REMOVE UNTIL THIS POINT###### if [ ! "${today}" == "${timestampAsDate}" ]; then #update package lists From 664087bf92e6c631e9c009ad15e6960a8d041863 Mon Sep 17 00:00:00 2001 From: cfcolaco Date: Sun, 8 Oct 2017 19:47:30 +0100 Subject: [PATCH 19/22] fixed typo --- auto_install/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 95d3187..0238527 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -68,7 +68,7 @@ If you think you received this message in error, you can post an issue on the Gi function maybeOS_Support() { if (whiptail --backtitle "Not Supported OS" --title "Not Supported OS" --yesno "You are on an OS that we have not tested but MAY work. -Currently this installer ssupports Raspbian, Debian or Devuan jessie and stretch and Ubuntu from 14.04 (trusty) to 17.04 (zetsy). +Currently this installer supports Raspbian, Debian or Devuan jessie and stretch and Ubuntu from 14.04 (trusty) to 17.04 (zetsy). Would you like to continue anyway?" ${r} ${c}) then echo "::: Did not detect perfectly supported OS but," echo "::: Continuing installation at user's own risk..." From 89a928e7c411e3a1b8e1a7e76f0207ee1efb30ef Mon Sep 17 00:00:00 2001 From: cfcolaco Date: Sun, 8 Oct 2017 20:10:57 +0100 Subject: [PATCH 20/22] fixed (more) Typos and sentences --- auto_install/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 0238527..7d32278 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -61,14 +61,14 @@ dhcpcdFile=/etc/dhcpcd.conf # Next see if we are on a tested and supported OS function noOS_Support() { whiptail --msgbox --backtitle "INVALID OS DETECTED" --title "Invalid OS" "We have not been able to detect a supported OS. -Currently this installer supports Raspbian, Debian or Devuan jessie and stretch and Ubuntu from 14.04 (trusty) to 17.04 (zetsy). +Currently this installer supports Raspbian and Debian (Jessie and Stretch), Devuan (Jessie) and Ubuntu from 14.04 (trusty) to 17.04 (zesty). If you think you received this message in error, you can post an issue on the GitHub at https://github.com/pivpn/pivpn/issues." ${r} ${c} exit 1 } function maybeOS_Support() { if (whiptail --backtitle "Not Supported OS" --title "Not Supported OS" --yesno "You are on an OS that we have not tested but MAY work. -Currently this installer supports Raspbian, Debian or Devuan jessie and stretch and Ubuntu from 14.04 (trusty) to 17.04 (zetsy). +Currently this installer supports Raspbian and Debian (Jessie and Stretch), Devuan (Jessie) and Ubuntu from 14.04 (trusty) to 17.04 (zesty). Would you like to continue anyway?" ${r} ${c}) then echo "::: Did not detect perfectly supported OS but," echo "::: Continuing installation at user's own risk..." From 862cb41d60f9fdf3e4ca8b05f6627d5f2fb3fc4b Mon Sep 17 00:00:00 2001 From: azlux Date: Mon, 9 Oct 2017 16:45:32 +0200 Subject: [PATCH 21/22] Add humain readable values --- scripts/clientStat.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/clientStat.sh b/scripts/clientStat.sh index 834b0dd..c14e030 100644 --- a/scripts/clientStat.sh +++ b/scripts/clientStat.sh @@ -15,7 +15,15 @@ printf "\e[1m::: Client Status List :::\e[0m\n" printf "\t\t\t\t\t\t\tBytes\t\tBytes\t\n" printf "\e[4mName\e[0m\t\t\e[4mRemote IP\e[0m\t\t\e[4mVirtual IP\e[0m\t\e[4mReceived\e[0m\t\e[4mSent\e[0m\t\t\e[4mConnected Since\e[0m \n" if grep -q "^CLIENT_LIST" "${STATUS_LOG}"; then - awk -F' ' -v s='CLIENT_LIST' '$1 == s {print $2"\t\t"$3"\t"$4"\t"$5"\t\t"$6"\t\t"$8" "$9" "$11" -- "$10}' ${STATUS_LOG} + if [ -n $(type -t numfmt) ]; then + while read -r line; do + read -r -a array <<< $line + [[ ${array[0]} = CLIENT_LIST ]] || continue + printf "%s\t\t%s\t%s\t%s\t\t%s\t\t%s %s %s - %s" ${array[1]} ${array[2]} ${array[3]} $(hr ${array[4]}) $(hr ${array[5]}) ${array[7]} ${array[8]} ${array[10]} ${array[9]} + done <$STATUS_LOG + else + awk -F' ' -v s='CLIENT_LIST' '$1 == s {print $2"\t\t"$3"\t"$4"\t"$5"\t\t"$6"\t\t"$8" "$9" "$11" - "$10}' ${STATUS_LOG} + fi else printf "\nNo Clients Connected!\n" fi From b0d208599650a00fdd14d92e53cfe13d4050fdb3 Mon Sep 17 00:00:00 2001 From: azlux Date: Tue, 10 Oct 2017 01:15:03 +0200 Subject: [PATCH 22/22] make the humain-readable a function I forgot the function ! --- scripts/clientStat.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/clientStat.sh b/scripts/clientStat.sh index c14e030..6a5ff97 100644 --- a/scripts/clientStat.sh +++ b/scripts/clientStat.sh @@ -2,6 +2,11 @@ # PiVPN: client status script STATUS_LOG="/var/log/openvpn-status.log" + +function hr() { + numfmt --to=iec-i --suffix=B "$1" +} + printf "\n" if [ ! -f "${STATUS_LOG}" ]; then echo "The file: $STATUS_LOG was not found!"