diff --git a/Dockerfile b/Dockerfile index 319c71d..dea5fc6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index 7b0ffa2..c3a493f 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/docker-compose.yml b/docker-compose.yml index 2b06e17..3c8f71b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 diff --git a/startup.sh b/startup.sh index f6dee15..3d0b47c 100644 --- a/startup.sh +++ b/startup.sh @@ -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