Commit graph

414 commits

Author SHA1 Message Date
Giulio Coa
e09f3a04bd fix(installer): fix some code style errors
Fix some code style error about the pipelines
2022-08-05 23:11:22 +02:00
Giulio Coa
82a7cbfc27 refactor(installer): fix the code style
Fix the code style
2022-08-05 09:06:31 +02:00
Giulio Coa
b17d309860 refactor(installer): format the code
Format the code following the new rules
2022-08-05 01:02:38 +02:00
Giulio Coa
47e8908489
refactor(installer): remove dependency on the edge repository and download source code to temp dir 2022-08-01 17:52:51 +02:00
Giulio Coa
edb36c08f7
Added Alpine Linux support (#1567) 2022-07-26 15:20:35 +02:00
Stanislav Simovski
ae1513c50e
Fixes #1556 2022-06-25 12:29:58 +03:00
MichaIng
d861de2918
Add support for builtin WireGuard module
in which case there is no dedicated file in /lib/modules. A rare case but possible.

Additionally the recursive globbing has been replaced by dpkg-query's internal recursive asterisk matching, which performs better/faster. This does now also match on "wireguard.kosomething", but I think "wireguard" is specific enough and dots in kernel modules names uncommon, to no be an issue.

Signed-off-by: MichaIng <micha@dietpi.com>
2022-06-10 15:15:25 +02:00
MichaIng
f120fab78f
Add support for xz-compressed WireGuard kernel module
which is the default since Linux 5.15.

Signed-off-by: MichaIng <micha@dietpi.com>
2022-06-10 14:38:10 +02:00
Orazio
2b791eb6a8 Update EasyRSA to version 3.1.0 2022-05-24 08:32:16 +02:00
Orazio
a5e41c466f Use easy-rsa commit 8d1be1c instead of release 3.0.7 for OpenSSL 3 support. 2022-05-03 17:14:31 +02:00
Orazio
bf7f3ae694 Fix static IP support on 64-bit Raspberry Pi OS. 2022-05-03 11:19:45 +02:00
DerDanilo
12155858bc simplify ipv6 leak whiptail 2022-03-14 10:35:01 +01:00
DerDanilo
9c1c98b785 add option to force IPv6 config, forced IPv6 route by default, add IPv6 options for cli and unattended file 2022-03-13 21:30:33 +01:00
Orazio
14d9fc6a45
Fix redirect text to sysctl config file
sudo echo hello > world doesn't work: sudo runs echo as root but the
redirection is executed as standard user.
2022-03-10 12:38:45 +01:00
Orazio
24b748f1bc
Check IPv6 connectivity via HTTPS 2022-03-10 12:35:59 +01:00
4s3ti
8833815983
Merge pull request #1464 from DerDanilo/customgitrepoandbranch
Customgitrepoandbranch
2022-03-10 11:01:16 +01:00
DerDanilo
642aa383a4
Merge branch 'test' into wg_ipv6_client_config 2022-03-10 10:56:50 +01:00
DerDanilo
f9ef8c3881 fix lint SC2236 2022-03-09 20:16:30 +01:00
DerDanilo
4dfcfd0d17 add IPv6 support, exclude from testing since travis doesn't have proper ipv6 support 2022-03-09 20:13:50 +01:00
DerDanilo
619ce02474 Add support for Ubuntu focal and arm64 as it's working fine by now 2022-03-09 20:12:44 +01:00
DerDanilo
75cebe13a5 add custom git url and branch options 2022-03-09 20:06:39 +01:00
Orazio
28485fc696
Too many empty lines 2021-12-25 16:42:23 +01:00
Orazio
b9c6078ec3
Exclude subnets for which there is a route 2021-12-25 15:44:08 +01:00
Orazio
ba2527d67b Fix vpnGW variable creation when pivpnNET was 10.X.0.0 or 10.0.0.0
Bash built-in substitution doesn't work in those cases, example:

$ pivpnNET=10.34.0.0
$ vpnGw="${pivpnNET/.0/.1}"
$ echo $vpnGw
10.34.1.0
2021-12-25 14:51:56 +01:00
Orazio
85b3e82274 Generate random virtual subnet, avoiding common subnets and those already used by the system 2021-12-25 14:40:37 +01:00
4s3ti
e42c339baa Debian 11 Bullseye
Added Debian 11 bullseye to list of supported OS
2021-11-24 22:21:10 +01:00
4s3ti
e458cba36a Main Funcion cleanup
General code cleanup
Moved loose code into funcions
Removed unecessary coments
Moved some comments to their funcions
2021-11-24 22:04:33 +01:00
Orazio
65ffa9afd2
Spelling 2021-11-18 14:28:35 +01:00
4s3ti
88a3df99ca
Merge pull request #1410 from EWouters/master
Allow DNS incoming requests through UFW
2021-11-18 12:19:13 +01:00
EWouters
45f0ad5d37
Allow DNS incoming requests through UFW
Fixes https://github.com/pivpn/pivpn/issues/1282
2021-11-18 12:00:18 +01:00
4s3ti
1fa467d9fd Shellcheck compliance
Fixes Shell check SC2086 errors, missing ""
2021-11-02 16:38:10 +01:00
MichaIng
f9d86cba40
Remove debconf-apt-progress usage
debconf-apt-progress is a tool to show a whiptail based dialog with progress bar for apt package installs, but it is some downsides:
- It aborts whenever apt or debconf halt for an interactive input, hence this would need to be prevented carefully, e.g. via "DEBIAN_FRONTEND=noninteractive" and "--force-confdef/old/new/miss", while it is questionable whether PiVPN should mute such configuration inputs for users.
- It even aborts when such interactive input is not actually required in some cases, but triggered by some other debconf load internals: pivpn#1360

Most importantly, aside of the visually probably appealing progress bar, debconf-apt-progress has not any upsides but reduces transparency of what is actually done, and the installer has a fallback already.

This commit removes the debconf-apt-progress usage in favour of the fallback: direct apt-get usage.

Signed-off-by: MichaIng <micha@dietpi.com>
2021-10-24 17:53:32 +02:00
MichaIng
7e64b27590
Remove wget usage and dependency
There is only a single wget call in the installer, at the beginning of a pipe where curl may be the more natural choice. Since curl is a dependency already, this commit replaces the only wget call with curl and hence removes wget from installer dependencies.

Additionally, all curl calls get additional flags:
-s: The "silent" flag is now consequently used to suppress all processing output. It is not necessarily required when the STDOUT is a pipe or command substitution, but it does not hurt.
-S: Even when the curl output is piped, it may be helpful to have errors visible via STDERR, for debugging and being transparent about actual connection/download errors. This flag preserves error messages but does not send them to STDOUT, hence the data processed in the pipe or command substitution is not affected.
-f: There are cases where webservers return a 40x HTML document which is then printed to STDOUT by curl, like a 20x document, and hence unintentionally processed by the end of the pipe or command substitution. Usually this just cases a syntax error, but in theory it can have any unintended or even dangerous effect. The "fail" flag assures that 40x responses are printed as shortened error messages to STDERR and nothing is output to STDOUT. It should be hence seen as mandatory flag whenever curl is called to not print something to console but the output is processed.
-L: wget follows redirects automatically, curl requires the "-L" flag for this. For the wget => curl migration it is hence added to not change the behaviour.

Signed-off-by: MichaIng <micha@dietpi.com>
2021-10-24 17:34:51 +02:00
MichaIng
8797b60374
Add missing leading slash
Introduced with: https://github.com/pivpn/pivpn/pull/1362

Signed-off-by: MichaIng <micha@dietpi.com>
2021-10-11 16:27:07 +02:00
MichaIng
2848a6baea
Fix errors on logging configuration
rsyslog and/or logrotate may not be installed on the system, in which case creating the configurations may fail. As rsyslog and logrotate may be installed later on, it makes sense to pre-create those directories so that then OpenVPN logs are handled as expected.

Also, if the rsyslog service is not installed or not active, it should not and does not need to be restarted. Since there is not `-e` flag, ` || true` has not effect, but also, when using that flag it makes sense to exit if for some reason the running service couldn't be restarted, which may then be caused by the added configuration.

Signed-off-by: MichaIng <micha@dietpi.com>
2021-10-11 15:29:48 +02:00
Orazio
c002031ce3
Merge pull request #1321 from DerDanilo/add_wireguard_persistentkeepalive
Add wireguard persistentkeepalive
2021-06-23 10:17:47 +02:00
DerDanilo
88a701c16a add PERSISTENTKEEPALIVE support 2021-06-06 01:10:43 +02:00
Orazio
82677135f8 Remove kernel version check on Raspbian
- Raspbian images have been shipping with kernel 5.10.17 since March 4.
    This kernel version has the WireGuard module built in which means we
    don't need to check if the user has updated, neither to install the
    module via DKMS.
2021-05-11 13:38:55 +02:00
DerDanilo
70ebefdb78
Merge branch 'test' into support_setupvars_for_wg_net_and_allowed_ips 2021-04-16 21:37:07 +02:00
4s3ti
8a17b55ff7
Merge pull request #1272 from mkoester/patch-2
ufw: add comment
2021-03-29 11:47:49 +02:00
4s3ti
dcd852e02e
Merge pull request #1278 from DerDanilo/add_mtu_support
add Wireguard MTU support via setupVARS.conf
2021-03-29 11:46:21 +02:00
Mirko Köster
73eb1c501d
requested change
see comment https://github.com/pivpn/pivpn/pull/1272/files#r595064063
2021-03-16 12:06:15 +01:00
DerDanilo
a3d652755c support ALLOWED_IPS from setupVARs.conf 2021-03-15 18:33:47 +01:00
DerDanilo
d3e009d171 support pivpnNET from setupVARs.conf 2021-03-15 18:33:21 +01:00
DerDanilo
805de5f77f support subnetClass from setupVARs.conf 2021-03-15 18:32:40 +01:00
DerDanilo
94744c77a9 add Wireguard MTU support via setupVARS.conf 2021-03-15 18:03:05 +01:00
Orazio
931b742862 Disable progress bar when running unattended 2021-03-15 13:54:56 +01:00
Mirko Köster
12d0efcea6
ufw: add comment
if you have a lot of ufw rules and look at them via `sudo ufw status` it would be beneficial to have comments indicating the purpose of a rule
2021-03-08 17:26:20 +01:00
4s3ti
6406fcfafd
Merge pull request #1254 from DundarGoc/SC2178
Fixed shellcheck warnings SC2178 and SC2128.
2021-02-14 19:10:44 +01:00
Dundar Göc
9cdca47689 Fixed shellcheck warnings SC2178 and SC2128.
SC2178: Variable was used as an array but is now assigned a string.
SC2128: Expanding an array without an index only gives the first element.

It's apparently a known bug that shellcheck can't both declare a
variable local and assign a value to it without raising this issue.
https://github.com/koalaman/shellcheck/wiki/SC2178
2021-02-14 14:23:01 +01:00