Add openSUSE Tumbleweed/Leap support (#1166)

<!---
️ Please read ➡️ Please make sure you've followed the guidelines:
https://github.com/angristan/openvpn-install#contributing
 Please make sure your changes are tested and working
🗣️ Please avoid large PRs, and discuss changes in a GitHub issue first
 If the changes are too big and not in line with the project, they will
probably be rejected. Remember that this script is meant to be simple
and easy to use.
--->

---------

Co-authored-by: Stanislas Lange <git@slange.me>
This commit is contained in:
Guo Yunhe
2025-12-12 04:22:12 +08:00
committed by GitHub
parent 4b00f44e8e
commit bbf93a19d5
5 changed files with 61 additions and 14 deletions

View File

@@ -56,6 +56,10 @@ jobs:
image: almalinux:10 image: almalinux:10
- name: archlinux - name: archlinux
image: archlinux:latest image: archlinux:latest
- name: opensuse-leap-16.0
image: opensuse/leap:16.0
- name: opensuse-tumbleweed
image: opensuse/tumbleweed
- name: oraclelinux-8 - name: oraclelinux-8
image: oraclelinux:8 image: oraclelinux:8
- name: oraclelinux-9 - name: oraclelinux-9

View File

@@ -111,6 +111,12 @@ test-arch:
test-centos-stream-9: test-centos-stream-9:
$(MAKE) test BASE_IMAGE=quay.io/centos/centos:stream9 $(MAKE) test BASE_IMAGE=quay.io/centos/centos:stream9
test-opensuse-leap:
$(MAKE) test BASE_IMAGE=opensuse/leap:16.0
test-opensuse-tumbleweed:
$(MAKE) test BASE_IMAGE=opensuse/tumbleweed
# Test all distributions (runs sequentially) # Test all distributions (runs sequentially)
test-all: test-all:
$(MAKE) test-ubuntu-18.04 $(MAKE) test-ubuntu-18.04
@@ -130,3 +136,5 @@ test-all:
$(MAKE) test-amazon-2023 $(MAKE) test-amazon-2023
$(MAKE) test-arch $(MAKE) test-arch
$(MAKE) test-centos-stream-9 $(MAKE) test-centos-stream-9
$(MAKE) test-opensuse-leap
$(MAKE) test-opensuse-tumbleweed

View File

@@ -4,7 +4,7 @@
![Lint](https://github.com/angristan/openvpn-install/workflows/Lint/badge.svg) ![Lint](https://github.com/angristan/openvpn-install/workflows/Lint/badge.svg)
[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/angristan) [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/angristan)
OpenVPN installer for Debian, Ubuntu, Fedora, CentOS, Amazon Linux, Arch Linux, Oracle Linux, Rocky Linux and AlmaLinux. OpenVPN installer for Debian, Ubuntu, Fedora, openSUSE, CentOS, Amazon Linux, Arch Linux, Oracle Linux, Rocky Linux and AlmaLinux.
This script will let you setup your own secure VPN server in just a few seconds. This script will let you setup your own secure VPN server in just a few seconds.
@@ -147,17 +147,19 @@ export PASS="1"
The script supports these Linux distributions: The script supports these Linux distributions:
| | Support | | | Support |
| ------------------ | ------- | | ------------------- | ------- |
| AlmaLinux >= 8 | ✅ 🤖 | | AlmaLinux >= 8 | ✅ 🤖 |
| Amazon Linux 2023 | ✅ 🤖 | | Amazon Linux 2023 | ✅ 🤖 |
| Arch Linux | ✅ 🤖 | | Arch Linux | ✅ 🤖 |
| CentOS Stream >= 8 | ✅ 🤖 | | CentOS Stream >= 8 | ✅ 🤖 |
| Debian >= 11 | ✅ 🤖 | | Debian >= 11 | ✅ 🤖 |
| Fedora >= 40 | ✅ 🤖 | | Fedora >= 40 | ✅ 🤖 |
| Oracle Linux >= 8 | ✅ 🤖 | | openSUSE Leap >= 16 | ✅ 🤖 |
| Rocky Linux >= 8 | ✅ 🤖 | | openSUSE Tumbleweed | ✅ 🤖 |
| Ubuntu >= 18.04 | ✅ 🤖 | | Oracle Linux >= 8 | ✅ 🤖 |
| Rocky Linux >= 8 | ✅ 🤖 |
| Ubuntu >= 18.04 | ✅ 🤖 |
To be noted: To be noted:

View File

@@ -189,11 +189,21 @@ function checkOS() {
fi fi
fi fi
fi fi
elif [[ -e /etc/system-release ]]; then elif [[ -e /etc/os-release ]]; then
source /etc/os-release source /etc/os-release
if [[ $ID == "fedora" || $ID_LIKE == "fedora" ]]; then if [[ $ID == "fedora" || $ID_LIKE == "fedora" ]]; then
OS="fedora" OS="fedora"
fi fi
if [[ $ID == "opensuse-tumbleweed" ]]; then
OS="opensuse"
fi
if [[ $ID == "opensuse-leap" ]]; then
OS="opensuse"
if [[ ${VERSION_ID%.*} -lt 16 ]]; then
log_info "The script only supports openSUSE Leap 16+."
log_fatal "Your version of openSUSE Leap is not supported."
fi
fi
if [[ $ID == "centos" || $ID == "rocky" || $ID == "almalinux" ]]; then if [[ $ID == "centos" || $ID == "rocky" || $ID == "almalinux" ]]; then
OS="centos" OS="centos"
fi fi
@@ -213,10 +223,13 @@ function checkOS() {
log_fatal "Your version of Amazon Linux is not supported." log_fatal "Your version of Amazon Linux is not supported."
fi fi
fi fi
if [[ $ID == "arch" ]]; then
OS="arch"
fi
elif [[ -e /etc/arch-release ]]; then elif [[ -e /etc/arch-release ]]; then
OS=arch OS=arch
else else
log_fatal "It looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, Amazon Linux 2023, Oracle Linux, Arch Linux, Rocky Linux or AlmaLinux system." log_fatal "It looks like you aren't running this installer on a Debian, Ubuntu, Fedora, openSUSE, CentOS, Amazon Linux 2023, Oracle Linux, Arch Linux, Rocky Linux or AlmaLinux system."
fi fi
} }
@@ -363,6 +376,8 @@ function installUnbound() {
run_cmd "Installing Unbound" yum install -y unbound run_cmd "Installing Unbound" yum install -y unbound
elif [[ $OS =~ (fedora|amzn2023) ]]; then elif [[ $OS =~ (fedora|amzn2023) ]]; then
run_cmd "Installing Unbound" dnf install -y unbound run_cmd "Installing Unbound" dnf install -y unbound
elif [[ $OS == "opensuse" ]]; then
run_cmd "Installing Unbound" zypper install -y unbound
elif [[ $OS == "arch" ]]; then elif [[ $OS == "arch" ]]; then
run_cmd "Installing Unbound" pacman -Syu --noconfirm unbound run_cmd "Installing Unbound" pacman -Syu --noconfirm unbound
fi fi
@@ -419,6 +434,13 @@ function installUnbound() {
echo ' access-control: fd42:42:42:42::/112 allow' echo ' access-control: fd42:42:42:42::/112 allow'
echo ' private-address: fd42:42:42:42::/112' echo ' private-address: fd42:42:42:42::/112'
fi fi
# Disable remote-control (requires SSL certs on openSUSE)
if [[ $OS == "opensuse" ]]; then
echo ''
echo 'remote-control:'
echo ' control-enable: no'
fi
} >/etc/unbound/unbound.conf.d/openvpn.conf } >/etc/unbound/unbound.conf.d/openvpn.conf
run_cmd "Enabling Unbound service" systemctl enable unbound run_cmd "Enabling Unbound service" systemctl enable unbound
@@ -964,6 +986,8 @@ function installOpenVPN() {
run_cmd "Installing OpenVPN" dnf install -y openvpn iptables openssl ca-certificates curl run_cmd "Installing OpenVPN" dnf install -y openvpn iptables openssl ca-certificates curl
elif [[ $OS == 'fedora' ]]; then elif [[ $OS == 'fedora' ]]; then
run_cmd "Installing OpenVPN" dnf install -y openvpn iptables openssl ca-certificates curl policycoreutils-python-utils run_cmd "Installing OpenVPN" dnf install -y openvpn iptables openssl ca-certificates curl policycoreutils-python-utils
elif [[ $OS == 'opensuse' ]]; then
run_cmd "Installing OpenVPN" zypper install -y openvpn iptables openssl ca-certificates curl
elif [[ $OS == 'arch' ]]; then elif [[ $OS == 'arch' ]]; then
run_cmd "Installing OpenVPN" pacman --needed --noconfirm -Syu openvpn iptables openssl ca-certificates curl run_cmd "Installing OpenVPN" pacman --needed --noconfirm -Syu openvpn iptables openssl ca-certificates curl
fi fi
@@ -1767,6 +1791,8 @@ function removeUnbound() {
run_cmd "Removing Unbound" yum remove -y unbound run_cmd "Removing Unbound" yum remove -y unbound
elif [[ $OS =~ (fedora|amzn2023) ]]; then elif [[ $OS =~ (fedora|amzn2023) ]]; then
run_cmd "Removing Unbound" dnf remove -y unbound run_cmd "Removing Unbound" dnf remove -y unbound
elif [[ $OS == 'opensuse' ]]; then
run_cmd "Removing Unbound" zypper remove -y unbound
fi fi
run_cmd "Removing Unbound config" rm -rf /etc/unbound/ run_cmd "Removing Unbound config" rm -rf /etc/unbound/
@@ -1793,6 +1819,7 @@ function removeOpenVPN() {
# Remove customised service # Remove customised service
run_cmd "Removing service file" rm /etc/systemd/system/openvpn-server@.service run_cmd "Removing service file" rm /etc/systemd/system/openvpn-server@.service
else else
# Debian, Ubuntu, openSUSE use openvpn@server
run_cmd "Disabling OpenVPN service" systemctl disable openvpn@server run_cmd "Disabling OpenVPN service" systemctl disable openvpn@server
run_cmd "Stopping OpenVPN service" systemctl stop openvpn@server run_cmd "Stopping OpenVPN service" systemctl stop openvpn@server
# Remove customised service # Remove customised service
@@ -1845,6 +1872,8 @@ function removeOpenVPN() {
run_cmd "Removing OpenVPN" dnf remove -y openvpn run_cmd "Removing OpenVPN" dnf remove -y openvpn
# Disable Copr repo # Disable Copr repo
run_cmd "Disabling OpenVPN Copr repo" dnf copr disable -y @OpenVPN/openvpn-release-2.6 2>/dev/null || true run_cmd "Disabling OpenVPN Copr repo" dnf copr disable -y @OpenVPN/openvpn-release-2.6 2>/dev/null || true
elif [[ $OS == 'opensuse' ]]; then
run_cmd "Removing OpenVPN" zypper remove -y openvpn
fi fi
# Cleanup # Cleanup

View File

@@ -25,6 +25,10 @@ RUN if command -v apt-get >/dev/null; then \
pacman -Syu --noconfirm \ pacman -Syu --noconfirm \
iproute2 iptables curl procps-ng bind \ iproute2 iptables curl procps-ng bind \
&& pacman -Scc --noconfirm; \ && pacman -Scc --noconfirm; \
elif command -v zypper >/dev/null; then \
zypper install -y \
iproute2 iptables curl procps systemd tar gzip bind-utils gawk \
&& zypper clean -a; \
fi fi
# Create TUN device (will be mounted at runtime) # Create TUN device (will be mounted at runtime)