ilteoood / docker-surfshark

Docker container with OpenVPN client preconfigured for SurfShark
MIT License
137 stars 34 forks source link

container is “unhealthy" #89

Closed Ghazzawi76 closed 5 months ago

Ghazzawi76 commented 7 months ago

Hi ,

I need your help , I tried setting up the container using the command below but the status of container is “unhealthy” , I placed the Surfshark_Config.zip file in the directory /DATA/AppData/SurfShark but with no luck

sudo docker run -it --cap-add=NET_ADMIN --device /dev/net/tun --name surfshark --dns 1.1.1.1 -e SURFSHARK_USER=MyUsername -e SURFSHARK_PASSWORD=MyPassword -v /DATA/AppData/SurfShark:/ovpn_configs -p 8080:8080 -p 6881:6881 -p 6881:6881/udp ilteoood/docker-surfshark

i am using raspberry pi 5 with bookworm-lite and CasaOS installed

please find the logs below

--2024-04-16 19:43:59-- https://my.surfshark.com/vpn/api/v1/server/configurations Resolving my.surfshark.com (my.surfshark.com)... failed: Try again. wget: unable to resolve host address 'my.surfshark.com' Archive: ovpn_configs.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of ovpn_configs.zip or ovpn_configs.zip.zip, and cannot find ovpn_configs.zip.ZIP, period. ./startup.sh: cd: line 8: can't cd to ovpn_configs: No such file or directory ls: cannot access '-': No such file or directory Chose: Do not forget to expose the ports for attached container web ui access Options error: Unrecognized option or missing or extra parameter(s) in [CMD-LINE]:1: config (2.6.8) Use --help for more information. Resetting all rules to installed defaults. Proceed with operation (y|n)? y Backing up 'user.rules' to '/etc/ufw/user.rules.20240416_194407' Backing up 'before.rules' to '/etc/ufw/before.rules.20240416_194407' Backing up 'after.rules' to '/etc/ufw/after.rules.20240416_194407' Backing up 'user6.rules' to '/etc/ufw/user6.rules.20240416_194407' Backing up 'before6.rules' to '/etc/ufw/before6.rules.20240416_194407' Backing up 'after6.rules' to '/etc/ufw/after6.rules.20240416_194407' WARN: '/etc/ufw/user.rules' is world readableWARN: '/etc/ufw/before.rules' is world readableWARN: '/etc/ufw/after.rules' is world readableWARN: '/etc/ufw/user6.rules' is world readableWARN: '/etc/ufw/before6.rules' is world readableWARN: '/etc/ufw/after6.rules' is world readable Default incoming policy changed to 'deny' (be sure to update your rules accordingly) Default outgoing policy changed to 'deny' (be sure to update your rules accordingly) Rules updated Rules updated (v6) Firewall is active and enabled on system startup --2024-04-16 19:45:00-- https://my.surfshark.com/vpn/api/v1/server/configurations Resolving my.surfshark.com (my.surfshark.com)... failed: Try again. wget: unable to resolve host address 'my.surfshark.com' Archive: ovpn_configs.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part archive. In the latter case the central directory and zipfile comment will be found on the last disk(s) of this archive. unzip: cannot find zipfile directory in one of ovpn_configs.zip or ovpn_configs.zip.zip, and cannot find ovpn_configs.zip.ZIP, period. ./startup.sh: cd: line 8: can't cd to ovpn_configs: No such file or directory Chose: Do not forget to expose the ports for attached container web ui access Options error: Unrecognized option or missing or extra parameter(s) in [CMD-LINE]:1: config (2.6.8) Use --help for more information.

Ghazzawi76 commented 7 months ago

I might be wrong but i think the way to solve this is by setting up open VPN manually

i am not an expert in docker so i could not fully understand ,, your method below

i just downloaded the Surfshark_Config.zip file in the directory /DATA/AppData/SurfShark but with no luck

i dont know how to do the other two steps you mentioned

Then, you must make the zip available inside the container, using a bind mount or a volume.

Finally, you must set the OVPN_CONFIGS environment variable.

ilteoood commented 7 months ago

If you don't know how to do basic steps like a mount, may I suggest you to use something different than a docker container?

I don't think is the right fit if you don't know what are you doing.

Ghazzawi76 commented 7 months ago

I hate to trouble you with this but if you can point me to where i when wrong that will be highly appreciated

i need docker cuz i want to route all my other containers to this VPN and i cant undo all the work i did with the other containers

please see if you can help

ilteoood commented 7 months ago

Try to add -e OVPN_CONFIGS=/ovpn_configs

That's strange btw that you are not able to download stuff from surfshark... Are you in a restricted network?

Ghazzawi76 commented 7 months ago

Hi ,

thanks for your response ,, you are right ,, even in windows i have to use manual open vpn configuration with surfshark because the country i live in restrict the VPN

ilteoood commented 7 months ago

Ok then, that's the additional parameter you should use

Ghazzawi76 commented 7 months ago

now it says ..

unzip: cannot find or open /ovpn_configs, /ovpn_configs.zip or /ovpn_configs.ZIP. ./startup.sh: cd: line 8: can't cd to ovpn_configs: No such file or directory ls: cannot access '-': No such file or directory Chose: Do not forget to expose the ports for attached container web ui access Options error: Unrecognized option or missing or extra parameter(s) in [CMD-LINE]:1: config (2.6.8) Use --help for more information. Resetting all rules to installed defaults. Proceed with operation (y|n)? y Backing up 'user.rules' to '/etc/ufw/user.rules.20240416_203553' Backing up 'before.rules' to '/etc/ufw/before.rules.20240416_203553' Backing up 'after.rules' to '/etc/ufw/after.rules.20240416_203553' Backing up 'user6.rules' to '/etc/ufw/user6.rules.20240416_203553' Backing up 'before6.rules' to '/etc/ufw/before6.rules.20240416_203553' Backing up 'after6.rules' to '/etc/ufw/after6.rules.20240416_203553' WARN: '/etc/ufw/user.rules' is world readableWARN: '/etc/ufw/before.rules' is world readableWARN: '/etc/ufw/after.rules' is world readableWARN: '/etc/ufw/user6.rules' is world readableWARN: '/etc/ufw/before6.rules' is world readableWARN: '/etc/ufw/after6.rules' is world readable Default incoming policy changed to 'deny' (be sure to update your rules accordingly) Default outgoing policy changed to 'deny' (be sure to update your rules accordingly) Rules updated Rules updated (v6) Firewall is active and enabled on system startup

ilteoood commented 7 months ago

The log message is self explaining. Where is located the surfshark vpn configuration zip? In the ovpn config you should insert the path in the container to reach that file.

Ghazzawi76 commented 7 months ago

ok i will try this dear

thank you for now

josearodrigueze commented 6 months ago

This image has to download the OVPNs files from the surfshark servers, but surfshark happens to be blocking that download via wget or curl.

My recommendation is to download those files manually https://my.surfshark.com/vpn/api/v1/server/configurations ; unzip and share them with the container via: -e OVPN_CONFIGS=/ovpn_configs

@ilteoood, is it possible to add download the zip file from another url that is not blocked?

ilteoood commented 5 months ago

It could be configured through an env variable. I'm open to accept PRs, otherwise I'll do that on monday

ilteoood commented 5 months ago

Customizable download url has been released with version 1.8.1