Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenVPN custom config #253

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ For more detailed information on installing, updating and uninstalling, please v

For the following Linux distribution(s), install the official `protonvpn-cli` package:

#### Guix

```sh
guix install protonvpn-cli
```

#### Fedora

```sh
Expand Down Expand Up @@ -68,6 +74,7 @@ Depending on your distribution, run the appropriate following command to install
|Ubuntu/Linux Mint/Debian and derivatives | `sudo apt install -y openvpn dialog python3-pip python3-setuptools`|
|OpenSUSE/SLES | `sudo zypper in -y openvpn dialog python3-pip python3-setuptools` |
|Arch Linux/Manjaro | `sudo pacman -S openvpn dialog python-pip python-setuptools` |
|Guix | `guix environment protonvpn-cli` |

#### Installing ProtonVPN-CLI

Expand Down
28 changes: 24 additions & 4 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This document provides an extensive guide on how to install and use ProtonVPN-CL
- [Table of Contents](#table-of-contents)
- [Installation & Updating](#installation--updating)
- [Installing from distribution repositories](#installing-from-distribution-repositories)
- [Guix](#guix)
- [Fedora](#fedora)
- [CentOS & RHEL](#centos--rhel)
- [Installing from PyPI](#installing-from-pypi)
Expand Down Expand Up @@ -43,6 +44,12 @@ This document provides an extensive guide on how to install and use ProtonVPN-CL

For the following Linux distribution(s), install the official `protonvpn-cli` package:

#### Guix

```sh
guix install protonvpn-cli
```

#### Fedora

```sh
Expand Down Expand Up @@ -85,6 +92,7 @@ Depending on your distribution, run the appropriate following command to install
|Ubuntu/Linux Mint/Debian and derivatives | `sudo apt install -y openvpn dialog python3-pip python3-setuptools`|
|OpenSUSE/SLES | `sudo zypper in -y openvpn dialog python3-pip python3-setuptools` |
|Arch Linux/Manjaro | `sudo pacman -S openvpn dialog python-pip python-setuptools` |
|Guix | `guix environment protonvpn-cli` |

#### Installing ProtonVPN-CLI

Expand Down Expand Up @@ -451,15 +459,22 @@ This lets you use ProtonVPN-CLI by simply typing `protonvpn` without sudo or jus

Systemd is the current init system of most major Linux distributions. This guide shows you how to use systemd to automatically connect to a ProtonVPN Server when you boot up your system.

1. Find the location of the executable with `sudo which protonvpn`
1. Update the OpenVPN configuration `protonvpn configure` and add the following:
```
writepid /var/run/proton.pid
```

Adjust the path to your liking / system specs.

2. Find the location of the executable with `sudo which protonvpn`

![which-protonvpn](resources/images/usage-which-protonvpn.png)

2. Create the unit file in `/etc/systemd/system`
3. Create the unit file in `/etc/systemd/system`

`sudo nano /etc/systemd/system/protonvpn-autoconnect.service`

3. Add the following contents to this file
4. Add the following contents to this file

```
[Unit]
Expand All @@ -469,9 +484,12 @@ Systemd is the current init system of most major Linux distributions. This guide
[Service]
Type=forking
ExecStart=/usr/local/bin/protonvpn connect -f
ExecStop=/usr/local/bin/protonvpn d
Environment=PVPN_WAIT=300
Environment=PVPN_DEBUG=1
Environment=SUDO_USER=user
PIDFile=/var/run/proton.pid
Restart=always

[Install]
WantedBy=multi-user.target
Expand All @@ -481,10 +499,12 @@ Systemd is the current init system of most major Linux distributions. This guide

`PVPN_WAIT=300` means that ProtonVPN-CLI will check for 300 Seconds if the internet connection is working before timing out. Adjust this value as you prefer.

Also replace the path to the `protonvpn` executable in the `ExecStart=` line with the output of Step 1.
Also replace the path to the `protonvpn` executable in the `ExecStart=` line with the output of Step 2.

If you want another connect command than fastest as used in this example, just replace `-f` with what you personally prefer.

Make sure that PIDFile path is same as from step 1.

4. Reload the systemd configuration

`sudo systemctl daemon-reload`.
Expand Down
Loading