Surfshark city

This commit is contained in:
iLTeoooD
2020-04-30 23:20:33 +02:00
parent d06a9b6a51
commit 97cbcc9e4a
4 changed files with 5 additions and 2 deletions

View File

@@ -1,11 +1,12 @@
FROM alpine:latest
LABEL maintainer.name="Matteo Pietro Dazzi" \
maintainer.email="matteopietro.dazzi@gmail.com" \
version="1.0.1" \
version="1.0.2" \
description="OpenVPN client configured for SurfShark VPN"
ENV SURFSHARK_USER=
ENV SURFSHARK_PASSWORD=
ENV SURFSHARK_COUNTRY=
ENV SURFSHARK_CITY=
ENV CONNECTION_TYPE=tcp
HEALTHCHECK --interval=60s --timeout=10s --start-period=30s CMD curl -L 'https://ipinfo.io'
RUN apk add --update --no-cache openvpn wget unzip coreutils curl

View File

@@ -26,6 +26,7 @@ The container is configurable using 4 environment variables:
|SURFSHARK_USER|Yes|Username provided by SurfShark|
|SURFSHARK_PASSWORD|Yes|Password provided by SurfShark|
|SURFSHARK_COUNTRY|No|The country, supported by SurfShark, in which you want to connect|
|SURFSHARK_CITY|No|The city of the country in which you want to connect|
|CONNECTION_TYPE|No|The connection type that you want to use: tcp, udp|
`SURFSHARK_USER` and `SURFSHARK_PASSWORD` are provided at the bottom of this page: [https://account.surfshark.com/setup/manual](https://account.surfshark.com/setup/manual).

View File

@@ -8,6 +8,7 @@ services:
- SURFSHARK_USER=YOUR_SURFSHARK_USER
- SURFSHARK_PASSWORD=YOUR_SURFSHARK_PASSWORD
- SURFSHARK_COUNTRY=it
- SURFSHARK_CITY=mil
- CONNECTION_TYPE=udp
cap_add:
- NET_ADMIN

View File

@@ -3,7 +3,7 @@ rm -rf ovpn_configs*
wget -O ovpn_configs.zip https://api.surfshark.com/v1/server/configurations
unzip ovpn_configs.zip -d ovpn_configs
cd ovpn_configs
VPN_FILE=$(ls | grep "${SURFSHARK_COUNTRY}" | grep "${CONNECTION_TYPE}" | shuf | head -n 1)
VPN_FILE=$(ls | grep "${SURFSHARK_COUNTRY}" | grep "${SURFSHARK_CITY}" | grep "${CONNECTION_TYPE}" | shuf | head -n 1)
echo Choosed: ${VPN_FILE}
printf "${SURFSHARK_USER}\n${SURFSHARK_PASSWORD}" > vpn-auth.txt
openvpn --config $VPN_FILE --auth-user-pass vpn-auth.txt