angristan / wireguard-install

WireGuard VPN installer for Linux servers
https://stanislas.blog/2019/01/how-to-setup-vpn-server-wireguard-nat-ipv6/
MIT License
7.96k stars 1.3k forks source link

Debian 11 improvement #275

Closed Reiner030 closed 1 year ago

Reiner030 commented 2 years ago

Hi, when checking scripts to have some automation usage for our Windows admins using also linux / pfSense I found your nice installation and configuration script.

While checking the script for functionality/security I found one improvement since Debian 11 is out. It would be nice if your script would setup buster backports only for buster but not for bullseye 😄: https://github.com/angristan/wireguard-install/blob/574cc06b31c73cb3b57ffb51b0b025052be69886/wireguard-install.sh#L129-L136

So it could be something like:

    elif [[ ${OS} == 'debian' ]]; then
        if [[ ${VERSION_ID} -eq 10 ]]; then`
            if ! grep -rqs "^deb .* buster-backports" /etc/apt/; then
                echo "deb http://deb.debian.org/debian buster-backports main" >/etc/apt/sources.list.d/backports.list
                apt-get update
            fi
            apt update
            apt-get install -y -t buster-backports wireguard
        fi
        apt-get install -y iptables resolvconf qrencode
g0x69lbo commented 2 years ago

This issue is unrelevant.. this issue was resolved at #262, look closely at the if statement before the elif you have referenced:

https://github.com/angristan/wireguard-install/blob/469c2c58d63ac3140be44d9e9b6d35f074b97fcc/wireguard-install.sh#L130-L133

You can see that a check is being made, in case the debian version is > 10 (i.e. 11 and above).