Commit graph

57 commits

Author SHA1 Message Date
Orazio
551af5f351 Improved OpenVPN and WireGuard availability detection 2020-09-14 12:25:31 +02:00
Orazio
9d0ed1ec00 Remove just the MASQUERADE line, not the whole NAT section of the UFW configuration.
- The sed command would not work if there were other user-defined rules or if
    another VPN was installed.
2020-06-09 13:17:02 +02:00
Orazio
823afa3fbb Improved dual VPN uninstallation, remove duplicate code/script
- Allow using 'pivpn vpn -u' to directly uninstall VPN 'vpn'
  - Also allow using 'pivpn -u' with two VPNs (will present a dialog).
  - During uninstall, ask which VPN to remove only if there are two VPNs
  - PiVPN git repo will be downloaded to '/usr/local/src/pivpn'. All scripts
    in /opt/pivpn, the main pivpn script and the bash completion file,
    are now just symbolic links. Resolves issue #695.
  - Remove unused call to updateWireGuard().
2020-05-27 16:36:26 +02:00
shelleycat485
b90077bd78 remove refs to /etc/pivpn/setupVars in selfcheck and debug scripts
tidy indenting
  on install, check if symlink already exists before making one to avoid error
  uninstall indicates which vpns are available for uninstall
  selfcheck checks both protocols if both present
  install - additional text in reconfigure saying 2nd protocol can be added
  change to use pivpn ovpn instaed of pivpn opv when dual protocols exist
2020-05-22 12:41:02 +01:00
shelleycat485
4e3a57b9aa better uninstall.sh 2020-05-13 00:51:45 +01:00
Ubuntu
56adbca52e more uninstall 2020-05-10 21:48:38 +00:00
Ubuntu
ff77077d56 more uninstall 2020-05-10 21:46:54 +00:00
Ubuntu
b230bade61 uninstall fixes 2020-05-10 21:13:03 +00:00
shelleycat485
9b04391629 uninstall change 2020-05-06 23:29:04 +01:00
shelleycat485
3ed9ec5724 install and uninstall 2020-05-02 00:06:09 +01:00
Orazio
0a30365d65 Some changes from pull request 963
- Make sure to install WireGuard only if platform is Raspbian or an x86 Debian/Ubuntu
  - Install WireGuard from bullseye repository instead of unstable
  - Reduced WireGuard package priority to the minimum that allows upgrades
2020-03-04 12:48:14 +01:00
Orazio
9846d3787a Use variables to define VPN ranges instead of hard coding IPs 2020-02-16 09:09:09 +01:00
Orazio
ead280e60f Set static IPs when using OpenVPN
- Preparation for feature request from issue #942
2020-02-09 18:51:30 +01:00
Orazio
3f616d9254 Implemented feature request from issue #942 (WireGuard) 2020-02-07 18:07:15 +01:00
4s3ti
5b8494c57c Going back to pivpn.io
replaced pivpn.dev with pivpn.io
2020-02-05 20:29:14 +01:00
Orazio
d691321b3e
Merge test (#929)
* added link to server status dashboard

* Replaced Header with bold instead

* More safeguards, some fixes, standardized some code, WireGuard update script, removed redundant code

  - Add curl as a dependency for those who run the script without 'curl URL | bash'.
  - Use POSIX 'command -v' instead of 'hash'.
  - Check if packages have actually been installed and abort execution if they have not.
  - Fixed issue with getStaticIPv4Settings() that prevented existing network settings
    to be used as static IP settings when running the script unattended with empty
    $IPv4addr and $IPv4gw variables.
  - Exit if processing wireguard-linux-compat fails.
  - Exit if 50unattended-upgrades fails to extract.
  - Exit clientSTAT.sh if the wg0 interface is not available.
  - Moved the Self Check to a single script since dedicated versions were very similar.
  - Add 'pivpn -wg' to update WireGuard for users running Raspbian with armv6l kernel.

* Fixed cosmetic issue with spinner, added missing spinner to some APT commands

* Detect current netmask, validate user input when configuring a static IP

* Inform the user when updating the package cache, which can be slow on some RPis

* Invalidate $IPv4Addr and $IPv4gw when the user claims those settings are not correct

* Restart pihole in the more appropriate restartServices() function

* Improve static IP selection, validate public DNS name of the server
  - Default to 'No' when asking if the RPi has DHCP reservation, considered
    that the user may not be fully aware, furthermore, setting a static IP
    anyways doesn't do harm.
  - Validate existing IPv4 settings (address, gateway, DNS) to avoid filling
    '/etc/dhcpcd.conf' with invalid data.
  - Validate public DNS name of the server inside askPublicIPOrDNS() function

* Check DH parameters, fix 'pivpn -c', improvements when dealing with external repositories
  - Added a basic sanity check to downloaded DH paramenters, which doubles as a
    check for missing .pem file.
  - Fix 'pivpn -c' showing the month number instead of the day of the month when
    using WireGuard.
  - Removing APT keys is risky, it would break APT update/upgrade if the user
    already was already using the unstable repo.
  - Replaced 'Checking for $i... installed' in favor of a more clear 'Checking for
    $i... already installed'.
  - Check whether the OpenVPN repo and the Debian unstable repo are already used.

* Improvements to getStaticIPv4Settings()

  - Use a regular expression to extract IPs from the 'ip' command. With this,
    there is a little need to validate output. Even though the regex will match
    invalid IPs like 192.168.23.444, 'ip' can't return them, and even if it did,
    the script would not have reached this function due to previous functions
    using the network with broken routes and addresses.

  - Get the IP address from the selected interface rather then from the 'ip route'
    command as it's not guaranteed that such IP is the same of the interface the
    user decided to use (though on a Raspberry Pi inside a home LAN, most likely
    it is, but it also maskes easier to get the IP in the CIDR notation with a
    single 'ip | grep' pipe).

* Moved command substitution to specific functions to avoid unnecessary execution

  - Moved $availableInterfaces and $CurrentIPv4gw from the script header to
    their relevant function, considered that if the OS is not Raspbian a static
    IP is not set, so those variables are not used.

* Copy files from git repo using the 'install' command, switch DH params from 2ton.com.au to RFC 7919

  - Now using DH parameters suggested by the RFC 7919 for use by TLS servers (the user can
    still generate his own if he wishes).
    https://wiki.mozilla.org/Security/Archive/Server_Side_TLS_4.0#Pre-defined_DHE_groups
2020-01-31 16:40:09 +01:00
Orazio
4a49787b28 Changed variable name, corrected rm typo 2020-01-21 15:54:20 +01:00
Orazio
44feb0b853 Added back ECDSA and tls-crypt 2020-01-21 13:51:25 +01:00
Orazio
dba3e6ad3e - Prepend 'pivpn-' to unstable repo files to limit naming conflicts
- Update variables inside unattended examples
- Remove openvpn logging setting when uninstalling the package
- Run 'apt-get update' after removing the WireGuard PPA
2020-01-20 09:56:07 +01:00
Orazio
a561607272 Mostly changes to the install script, see below
Handle running the install script over an existing installation (as the script already did before branching to test-wireguard), providing:
    - Update, downloads latest scripts from git repo
    - Repair, reinstall PiVPN while keeping existing settings
    - Reconfigure, start over overwriting the existing settings
  Tag iptables rules as an attempt to make sure that the uninstall script only removes PiVPN rules
  Change the armv6l installation to reflect the split of WireGuard snapshots into wireguard-linux-compat and wireguard-tools
2019-12-29 18:25:35 +01:00
4s3ti
33b2b2468d pivpn.io to pivpn.dev, http to https
Changed all appearances of pivpn.io to pivpn.dev
Changed all appearances of http to https
2019-12-20 23:30:00 +01:00
Orazio
5f82a0740e Use variable, create openvpn home, add shellcheck reminder 2019-12-10 19:07:08 +01:00
Orazio
d022cafa25 Revert some minor changes 2019-12-10 16:06:28 +01:00
corbolais
729674595b rm openvpn:openvpn user/group iff openvpn pkg is removed. shellcheck cleanup. preliminary fixes. add (global) FIXMEs.
Signed-off-by: corbolais <corbolais@gmail.com>
2019-12-09 13:34:25 +01:00
Orazio
e2da52b1a7 Added Ubuntu Bionic support 2019-11-19 17:29:41 +01:00
Orazio
8ab71601ff Automatically fetch latest WireGuard snapshot 2019-11-16 17:02:15 +01:00
Orazio
d7ebb4cca9 Unattended installation 2019-11-16 14:58:58 +01:00
Orazio
07abfc97e9 Added unattended installation, fixed some variables 2019-11-14 15:07:01 +01:00
Orazio
6bd0beeb94 Fixed missing protocol variable 2019-11-07 18:12:06 +01:00
Orazio
84f90b00a4 Added uninstall and Pi-hole detection 2019-11-07 17:29:21 +01:00
Orazio
24a1a00d37 Refactoring + WireGuard support 2019-10-14 12:11:16 +02:00
4s3ti
d0c10db6ec install.sh: apt-get with , uninstall.sh: added var PKG_MANAGER and replaced apt-get with 2019-09-03 10:09:48 +02:00
MichaIng
51333a9313
Failsafe home dir obtaining
+ When estimating $INSTALL_HOME, assure grep can only match user names, to avoid possible wrong multi-line value
+ Remove possible trailing slash from $INSTALL_HOME, to avoid double slash in "$INSTALL_HOME/ovpns"
+ Avoid "cat <file> | grep <pattern>", since grep can process files directly

Signed-off-by: MichaIng <micha@dietpi.com>
2019-09-01 17:41:44 +02:00
4s3ti
1bd8169aa6
Merge branch 'test' into master 2019-09-01 15:32:56 +02:00
Douglas Orend
8b40035bf5 Properly determine user's home directory
Code assumes that the specified user directory is under /home.  This code parses the /etc/passwd file in order to determine what that user's proper home directory is.
2019-08-13 11:23:08 -05:00
4s3ti
18b7e16694
Merge branch 'test' into bitwarden 2019-08-08 10:34:17 +02:00
Orazio
e6a13cc65e Handle older UFW version from Jessie 2019-08-06 09:53:14 +02:00
Akvile
b60a06791d integrated bitwarden password manager into pivpn 2019-07-23 22:12:35 +02:00
Orazio
bcc780546c Get variable value before the file is deleted 2019-07-01 11:39:42 +02:00
Orazio
7a34dd3704 Improve iptables detection 2019-07-01 11:12:46 +02:00
Orazio
e3f729f260 General fixes and improvements 2019-03-03 10:18:45 +01:00
Kaladin Light
22b5bfef68 Add fix iptables help to debug script (1/2) 2016-12-11 13:36:14 -05:00
Kaladin Light
67722ca7f4 Once again pi-hole had a more robust stty setup so lets borrow that :) 2016-11-08 12:03:42 -05:00
Kaladin Light
7c64afdc92 Get rows/cols with stty instead of tput 2016-11-07 22:49:00 -05:00
Stephen KINGER
e541fd39ac Update the unisntall script, OK. 2016-09-28 17:09:04 +02:00
Kaladin Light
3c0d0cb176 Ensure debian and ubuntu get openvpn from the openvpn repo so they don't get an old server version 2016-05-25 17:41:42 -04:00
Kaladin Light
0fbc99e0b7 Fixes for UFW 2016-05-15 23:36:40 -04:00
Kaladin Light
3916acf665 Support reverting UFW changes on uninstall 2016-05-15 16:57:42 -04:00
Kaladin Light
2f3540b898 Robustize OS Detection.
This is framework needed to support Ubuntu 16.04 which
is coming in a future commit.
2016-05-10 11:49:29 -04:00
Kaladin Light
0277054de1 Ubuntu uses openvpn repo to get newer version and...
clients get two more security parameters to harden connection further and...
hopefully fix use of testing branch and...
why is there no modern Road Rash game, that was the best.
2016-05-07 12:33:52 -04:00