mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-01-08 15:50:09 +01:00
Merge branch 'angristan:master' into master
This commit is contained in:
commit
1fc4fe1333
10
.github/issue_template.md
vendored
Normal file
10
.github/issue_template.md
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!---
|
||||||
|
❗️ Please read ❗️
|
||||||
|
➡️ If you need help with OpenVPN itself, please use the community forums (https://forums.openvpn.net/) or Stack Overflow (https://stackoverflow.com/questions/tagged/openvpn)
|
||||||
|
➡️ For the script, prefer opening a discussion thread for help: https://github.com/angristan/openvpn-install/discussions
|
||||||
|
💡 It helps keep the issue tracker clean and focused on bugs and feature requests.
|
||||||
|
|
||||||
|
🙏 Please include as much information as possible, and make sure you're running the latest version of the script.
|
||||||
|
✍️ Please state the Linux distribution you're using and its version, as well as the OpenVPN version.
|
||||||
|
✋ For feature requests, remember that this script is meant to be simple and easy to use. If you want to add a lot of options, it's better to fork the project.
|
||||||
|
--->
|
7
.github/pull_request_template.md
vendored
Normal file
7
.github/pull_request_template.md
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<!---
|
||||||
|
❗️ 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.
|
||||||
|
--->
|
10
.github/workflows/test.yml
vendored
10
.github/workflows/test.yml
vendored
@ -2,6 +2,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- ci
|
||||||
|
|
||||||
name: Test
|
name: Test
|
||||||
jobs:
|
jobs:
|
||||||
@ -13,11 +14,14 @@ jobs:
|
|||||||
os-image:
|
os-image:
|
||||||
- debian-10-x64
|
- debian-10-x64
|
||||||
- debian-11-x64
|
- debian-11-x64
|
||||||
- ubuntu-18-04-x64
|
- debian-12-x64
|
||||||
- ubuntu-20-04-x64
|
- ubuntu-20-04-x64
|
||||||
- fedora-35-x64
|
- ubuntu-22-04-x64
|
||||||
|
- fedora-37-x64
|
||||||
|
- fedora-38-x64
|
||||||
- centos-7-x64
|
- centos-7-x64
|
||||||
- centos-stream-8-x64
|
- centos-stream-8-x64
|
||||||
|
# - centos-stream-9-x64 # yum oomkill
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3.2.0
|
- uses: actions/checkout@v3.2.0
|
||||||
|
|
||||||
@ -80,7 +84,7 @@ jobs:
|
|||||||
host: ${{ steps.server_ip.outputs.value }}
|
host: ${{ steps.server_ip.outputs.value }}
|
||||||
username: root
|
username: root
|
||||||
key: ${{ secrets.SSH_KEY }}
|
key: ${{ secrets.SSH_KEY }}
|
||||||
script: set -x && git clone https://github.com/angristan/openvpn-install.git && cd openvpn-install && git checkout ${{ github.event.pull_request.head.sha }}
|
script: set -x && git clone https://github.com/angristan/openvpn-install.git && cd openvpn-install && git checkout ${{ github.sha }}
|
||||||
|
|
||||||
- name: Run openvpn-install.sh in headless mode
|
- name: Run openvpn-install.sh in headless mode
|
||||||
uses: appleboy/ssh-action@v0.1.6
|
uses: appleboy/ssh-action@v0.1.6
|
||||||
|
22
FAQ.md
22
FAQ.md
@ -151,3 +151,25 @@ route 10.0.0.0 255.0.0.0
|
|||||||
```
|
```
|
||||||
|
|
||||||
So for example - here it would route all traffic of `10.0.0.0/8` to the vpn. And the rest through the internet.
|
So for example - here it would route all traffic of `10.0.0.0/8` to the vpn. And the rest through the internet.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Q:** I have enabled IPv6 and my VPN client gets an IPv6 address. Why do I reach the websites or other dual-stacked destionations via IPv4 only?
|
||||||
|
|
||||||
|
**A:** This is because inside the tunnel you don't get a publicly routable IPv6 address, instead you get an ULA (Unlique Local Lan) address. Operating systems don't prefer this all the time. You can fix this in your operating system policies as it's unrelated to the VPN itself:
|
||||||
|
|
||||||
|
Windows (commands needs to run cmd.exe as Administrator):
|
||||||
|
|
||||||
|
```
|
||||||
|
netsh interface ipv6 add prefixpolicy fd00::/8 3 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Linux:
|
||||||
|
|
||||||
|
edit `/etc/gai.conf` and uncomment the following line and also change its value to `1`:
|
||||||
|
|
||||||
|
```
|
||||||
|
label fc00::/7 1
|
||||||
|
```
|
||||||
|
|
||||||
|
This will not work properly unless you add you your VPN server `server.conf` one or two lines to push at least 1 (one) IPv6 DNS server. Most providers have IPv6 servers as well, add two more lines of `push "dhcp-option DNS <IPv6>"`
|
||||||
|
52
README.md
52
README.md
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
![Test](https://github.com/angristan/openvpn-install/workflows/Test/badge.svg)
|
![Test](https://github.com/angristan/openvpn-install/workflows/Test/badge.svg)
|
||||||
![Lint](https://github.com/angristan/openvpn-install/workflows/Lint/badge.svg)
|
![Lint](https://github.com/angristan/openvpn-install/workflows/Lint/badge.svg)
|
||||||
![visitors](https://visitor-badge.glitch.me/badge?page_id=angristan.openvpn-install)
|
|
||||||
[![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, Arch Linux, Oracle Linux, Rocky Linux and AlmaLinux.
|
OpenVPN installer for Debian, Ubuntu, Fedora, CentOS, Arch Linux, Oracle Linux, Rocky Linux and AlmaLinux.
|
||||||
@ -126,27 +125,28 @@ export PASS="1"
|
|||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
The script supports these OS and architectures:
|
The script supports these Linux distributions:
|
||||||
|
|
||||||
| | i386 | amd64 | armhf | arm64 |
|
| | Support |
|
||||||
| --------------- | ---- | ----- | ----- | ----- |
|
| ------------------ | ------- |
|
||||||
| Amazon Linux 2 | ❔ | ✅ | ❔ | ❔ |
|
| AlmaLinux 8 | ✅ |
|
||||||
| Arch Linux | ❔ | ✅ | ❔ | ✅ |
|
| Amazon Linux 2 | ✅ |
|
||||||
| CentOS 7 | ✅ | ✅ | ✅ | ✅ |
|
| Arch Linux | ✅ |
|
||||||
| CentOS 8 | ❌ | ✅ | ❌ | ✅ |
|
| CentOS 7 | ✅ 🤖 |
|
||||||
| Debian >= 9 | ✅ | ✅ | ✅ | ✅ |
|
| CentOS Stream >= 8 | ✅ 🤖 |
|
||||||
| Fedora >= 27 | ❔ | ✅ | ❔ | ❔ |
|
| Debian >= 10 | ✅ 🤖 |
|
||||||
| Ubuntu 16.04 | ✅ | ✅ | ❌ | ❌ |
|
| Fedora >= 35 | ✅ 🤖 |
|
||||||
| Ubuntu >= 18.04 | ✅ | ✅ | ✅ | ✅ |
|
| Oracle Linux 8 | ✅ |
|
||||||
| Oracle Linux 8 | ❌ | ✅ | ❌ | ❔ |
|
| Rocky Linux 8 | ✅ |
|
||||||
| Rocky Linux 8 | ❔ | ✅ | ❔ | ❔ |
|
| Ubuntu >= 18.04 | ✅ 🤖 |
|
||||||
| AlmaLinux 8 | ❌ | ✅ | ❌ | ❔ |
|
|
||||||
|
|
||||||
To be noted:
|
To be noted:
|
||||||
|
|
||||||
- It should work on Debian 8+ and Ubuntu 16.04+. But versions not in the table above are not officially supported.
|
- The script is regularly tested against the distributions marked with a 🤖 only.
|
||||||
|
- It's only tested on `amd64` architecture.
|
||||||
|
- It should work on older versions such as Debian 8+, Ubuntu 16.04+ and previous Fedora releases. But versions not in the table above are not officially supported.
|
||||||
|
- It should also support versions between the LTS versions, but these are not tested.
|
||||||
- The script requires `systemd`.
|
- The script requires `systemd`.
|
||||||
- The script is regularly tested against `amd64` only.
|
|
||||||
|
|
||||||
## Fork
|
## Fork
|
||||||
|
|
||||||
@ -162,10 +162,9 @@ More Q&A in [FAQ.md](FAQ.md).
|
|||||||
|
|
||||||
**A:** I recommend these:
|
**A:** I recommend these:
|
||||||
|
|
||||||
- [Vultr](https://www.vultr.com/?ref=8537055-6G): Worldwide locations, IPv6 support, starting at \$3.50/month
|
- [Vultr](https://www.vultr.com/?ref=8948982-8H): Worldwide locations, IPv6 support, starting at \$5/month
|
||||||
- [Hetzner](https://hetzner.cloud/?ref=ywtlvZsjgeDq): Germany, IPv6, 20 TB of traffic, starting at €3/month
|
- [Hetzner](https://hetzner.cloud/?ref=ywtlvZsjgeDq): Germany, Finland and USA. IPv6, 20 TB of traffic, starting at 4.5€/month
|
||||||
- [Digital Ocean](https://goo.gl/qXrNLK): Worldwide locations, IPv6 support, starting at \$5/month
|
- [Digital Ocean](https://m.do.co/c/ed0ba143fe53): Worldwide locations, IPv6 support, starting at \$4/month
|
||||||
- [PulseHeberg](https://goo.gl/76yqW5): France, unlimited bandwidth, starting at €3/month
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -204,12 +203,19 @@ Solutions that provision a ready to use OpenVPN server based on this script in o
|
|||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
|
## Discuss changes
|
||||||
|
|
||||||
|
Please open an issue before submitting a PR if you want to discuss a change, especially if it's a big one.
|
||||||
|
|
||||||
### Code formatting
|
### Code formatting
|
||||||
|
|
||||||
We use [shellcheck](https://github.com/koalaman/shellcheck) and [shfmt](https://github.com/mvdan/sh) to enforce bash styling guidelines and good practices. They are executed for each commit / PR with GitHub Actions, so you can check the configuration [here](https://github.com/angristan/openvpn-install/blob/master/.github/workflows/push.yml).
|
We use [shellcheck](https://github.com/koalaman/shellcheck) and [shfmt](https://github.com/mvdan/sh) to enforce bash styling guidelines and good practices. They are executed for each commit / PR with GitHub Actions, so you can check the configuration [here](https://github.com/angristan/openvpn-install/blob/master/.github/workflows/push.yml).
|
||||||
|
|
||||||
## Security and Encryption
|
## Security and Encryption
|
||||||
|
|
||||||
|
> **Warning**
|
||||||
|
> This has not been updated for OpenVPN 2.5 and later.
|
||||||
|
|
||||||
OpenVPN's default settings are pretty weak regarding encryption. This script aims to improve that.
|
OpenVPN's default settings are pretty weak regarding encryption. This script aims to improve that.
|
||||||
|
|
||||||
OpenVPN 2.4 was a great update regarding encryption. It added support for ECDSA, ECDH, AES GCM, NCP and tls-crypt.
|
OpenVPN 2.4 was a great update regarding encryption. It added support for ECDSA, ECDH, AES GCM, NCP and tls-crypt.
|
||||||
@ -358,3 +364,7 @@ You can [say thanks](https://saythanks.io/to/angristan) if you want!
|
|||||||
Many thanks to the [contributors](https://github.com/Angristan/OpenVPN-install/graphs/contributors) and Nyr's original work.
|
Many thanks to the [contributors](https://github.com/Angristan/OpenVPN-install/graphs/contributors) and Nyr's original work.
|
||||||
|
|
||||||
This project is under the [MIT Licence](https://raw.githubusercontent.com/Angristan/openvpn-install/master/LICENSE)
|
This project is under the [MIT Licence](https://raw.githubusercontent.com/Angristan/openvpn-install/master/LICENSE)
|
||||||
|
|
||||||
|
## Star History
|
||||||
|
|
||||||
|
[![Star History Chart](https://api.star-history.com/svg?repos=angristan/openvpn-install&type=Date)](https://star-history.com/#angristan/openvpn-install&Date)
|
||||||
|
@ -57,7 +57,7 @@ function checkOS() {
|
|||||||
fi
|
fi
|
||||||
if [[ $ID == "centos" || $ID == "rocky" || $ID == "almalinux" ]]; then
|
if [[ $ID == "centos" || $ID == "rocky" || $ID == "almalinux" ]]; then
|
||||||
OS="centos"
|
OS="centos"
|
||||||
if [[ ! $VERSION_ID =~ (7|8) ]]; then
|
if [[ ${VERSION_ID%.*} -lt 7 ]]; then
|
||||||
echo "⚠️ Your version of CentOS is not supported."
|
echo "⚠️ Your version of CentOS is not supported."
|
||||||
echo ""
|
echo ""
|
||||||
echo "The script only support CentOS 7 and CentOS 8."
|
echo "The script only support CentOS 7 and CentOS 8."
|
||||||
@ -706,7 +706,7 @@ function installOpenVPN() {
|
|||||||
|
|
||||||
# Install the latest version of easy-rsa from source, if not already installed.
|
# Install the latest version of easy-rsa from source, if not already installed.
|
||||||
if [[ ! -d /etc/openvpn/easy-rsa/ ]]; then
|
if [[ ! -d /etc/openvpn/easy-rsa/ ]]; then
|
||||||
local version="3.0.7"
|
local version="3.1.2"
|
||||||
wget -O ~/easy-rsa.tgz https://github.com/OpenVPN/easy-rsa/releases/download/v${version}/EasyRSA-${version}.tgz
|
wget -O ~/easy-rsa.tgz https://github.com/OpenVPN/easy-rsa/releases/download/v${version}/EasyRSA-${version}.tgz
|
||||||
mkdir -p /etc/openvpn/easy-rsa
|
mkdir -p /etc/openvpn/easy-rsa
|
||||||
tar xzf ~/easy-rsa.tgz --strip-components=1 --no-same-owner --directory /etc/openvpn/easy-rsa
|
tar xzf ~/easy-rsa.tgz --strip-components=1 --no-same-owner --directory /etc/openvpn/easy-rsa
|
||||||
@ -729,18 +729,16 @@ function installOpenVPN() {
|
|||||||
SERVER_NAME="server_$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)"
|
SERVER_NAME="server_$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)"
|
||||||
echo "$SERVER_NAME" >SERVER_NAME_GENERATED
|
echo "$SERVER_NAME" >SERVER_NAME_GENERATED
|
||||||
|
|
||||||
echo "set_var EASYRSA_REQ_CN $SERVER_CN" >>vars
|
|
||||||
|
|
||||||
# Create the PKI, set up the CA, the DH params and the server certificate
|
# Create the PKI, set up the CA, the DH params and the server certificate
|
||||||
./easyrsa init-pki
|
./easyrsa init-pki
|
||||||
./easyrsa --batch build-ca nopass
|
./easyrsa --batch --req-cn="$SERVER_CN" build-ca nopass
|
||||||
|
|
||||||
if [[ $DH_TYPE == "2" ]]; then
|
if [[ $DH_TYPE == "2" ]]; then
|
||||||
# ECDH keys are generated on-the-fly so we don't need to generate them beforehand
|
# ECDH keys are generated on-the-fly so we don't need to generate them beforehand
|
||||||
openssl dhparam -out dh.pem $DH_KEY_SIZE
|
openssl dhparam -out dh.pem $DH_KEY_SIZE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./easyrsa build-server-full "$SERVER_NAME" nopass
|
./easyrsa --batch build-server-full "$SERVER_NAME" nopass
|
||||||
EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
|
EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
|
||||||
|
|
||||||
case $TLS_SIG in
|
case $TLS_SIG in
|
||||||
@ -1087,11 +1085,11 @@ function newClient() {
|
|||||||
cd /etc/openvpn/easy-rsa/ || return
|
cd /etc/openvpn/easy-rsa/ || return
|
||||||
case $PASS in
|
case $PASS in
|
||||||
1)
|
1)
|
||||||
./easyrsa build-client-full "$CLIENT" nopass
|
./easyrsa --batch build-client-full "$CLIENT" nopass
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
echo "⚠️ You will be asked for the client password below ⚠️"
|
echo "⚠️ You will be asked for the client password below ⚠️"
|
||||||
./easyrsa build-client-full "$CLIENT"
|
./easyrsa --batch build-client-full "$CLIENT"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
echo "Client $CLIENT added."
|
echo "Client $CLIENT added."
|
||||||
|
Loading…
Reference in New Issue
Block a user