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

feat: Add P2P option to PROTONVPN_SERVER #41

Merged
merged 3 commits into from
Apr 16, 2021
Merged
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Images are published on [GitHub Container Registry][ghcr].
| `PROTONVPN_TIER` | Yes | Proton VPN Tier (0=Free, 1=Basic, 2=Pro, 3=Visionary)
| `PROTONVPN_USERNAME` | Yes | OpenVPN Username. This is **NOT** your Proton Account Username.
| `PROTONVPN_PASSWORD` | Yes | OpenVPN Password. This is **NOT** your Proton Account Password.
| `PROTONVPN_SERVER` | Yes | ProtonVPN server to connect to. This value is mutually exclusive with `PROTONVPN_COUNTRY`. Only one of them can be used. Set it to `RANDOM` to connect to a random server.
| `PROTONVPN_SERVER` | Yes | ProtonVPN server to connect to. This value is mutually exclusive with `PROTONVPN_COUNTRY`. Only one of them can be used. Set it to `RANDOM` to connect to a random server. Set it to `P2P` to connect to fastest P2P server (does not work for free accounts).
| `PROTONVPN_COUNTRY` | Yes | ProtonVPN two letter country code. This will choose the fastest server from this country. This value is mutually exclusive with `PROTONVPN_SERVER`. Only one of them can be used.
| `PROTONVPN_PROTOCOL` | No | Protocol to use. By default `udp` is used.
| `PROTONVPN_EXCLUDE_CIDRS` | No | Comma separated list of CIDRs to exclude from VPN. Uses split tunnel. Default is set to `169.254.169.254/32,169.254.170.2/32`
Expand Down
3 changes: 3 additions & 0 deletions root/etc/services.d/protonvpn/run
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ function connect_vpn()
elif [[ ${PROTONVPN_SERVER} == "RANDOM" ]] && [[ -z ${PROTONVPN_COUNTRY} ]]; then
echo "${SVC_CONN} Using Random Server"
PVPN_DEBUG="${DEBUG:-0}" protonvpn connect --random
elif [[ ${PROTONVPN_SERVER} == "P2P" ]] && [[ -z ${PROTONVPN_COUNTRY} ]]; then
echo "${SVC_CONN} Using Fastest P2P Server"
PVPN_DEBUG="${DEBUG:-0}" protonvpn connect --p2p
elif [[ -z $PROTONVPN_COUNTRY ]] && [[ -n ${PROTONVPN_SERVER} ]]; then
echo "${SVC_CONN} Using Server ${PROTONVPN_SERVER}"
PVPN_DEBUG="${DEBUG:-0}" protonvpn connect "${PROTONVPN_SERVER}"
Expand Down