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

How to add new VPN providers? #45

Closed
davidszp opened this issue Dec 22, 2015 · 14 comments
Closed

How to add new VPN providers? #45

davidszp opened this issue Dec 22, 2015 · 14 comments

Comments

@davidszp
Copy link

Hi, thanks for this amazing container, seems a lot of work has already gone into it. Are there any instructions on how to add other VPN providers, for docker newbies like myself? I am using PureVPN. Is it just a matter of adding a new directory and copying the .ovpn files into it?

@haugene
Copy link
Owner

haugene commented Dec 22, 2015

Hey,

It should be almost that easy. You just have to do some modification to the .ovpn files so that it will actually read the username/password that is provided etc. I have tried to script this however, and depending on the .ovpn files it should do all the work for you.

Try this:

  • Add folder "pure" and put all configs in there
  • From the openvpn folder, run the adjustConfigs.sh script with "pure" as argument
    • ie. adjustConfigs.sh pure
  • This should set ca cert location, auth-settings and name of the tun device. Also it adds up/down instructions to start and stop Transmission with the connection.

For reference, here are my two commits for adding IPVanish provider. The first adds all the configs:
b94f753

The second has the modifications made by adjustConfigs.sh script:
f10b134

Apart from this I also add a symlink to one of the .ovpn files and call the link "default.ovpn". That will be chosen as config if no OPENVPN_CONFIG is provided.

Give it a go and create a PR to the dev branch if you get it working. Or if you give me a link to the configs I can add it for you. I should probably add a section to the README on how to add new providers :)

@CooperBarrett
Copy link

I am French, I use Google Translation

Hello,

It would be possible to detail a procedure?

I'm far from an expert and would like to make a mistake ...

My goal would be to connect to the VPN Server of my little VPS.

thank you beforehand

@davidszp
Copy link
Author

CooperBarret, here is a little update on my results. In short, it works fine.

-- I cloned the repository to a local folder using git on my Synology NAS
-- I added a directory "pure" as instructed by haugene above, added the PureVPN .ovpn files into it and ran the "adjustConfigs.sh" script
-- I built a new docker container using "docker build -t transmission-openvpn ."
-- to run the container, I use "docker run --restart=always --privileged -d -v /volume1/torrent:/data -e "OPENVPN_PROVIDER=pure" -e "OPENVPN_CONFIG=SWEDEN-TCP" -e "OPENVPN_USERNAME=purevpn123456" -e "OPENVPN_PASSWORD=#############" -p 9091:9091 --name transmission-openvpn --dns 8.8.8.8 --dns 8.8.4.4 transmission-openvpn"
-- Note I had to use the DNS option as indicated by haugene as a known issue, as the container was unable to resolve DNS requests (this was visible in the logfiles)
-- I tested the nginx container, it works fine but I don't need it since I use a separate openVPN setup to access my NAS
-- torrent files added to /volume1/torrent/watch (e.g. by Sickrage or other) automatically get downloaded

It was quite simple to setup. I am a complete noob with Docker and my Synology NAS and this took me about an hour. Good luck!

@CooperBarrett
Copy link

I am French, I use Google Translation

@makloda

Thank you for your explanation is very clear.

Unfortunately I can not test this week but I will test with my VPS and give back information on the result.

Again thank you, your procedure will help me a lot.

@CooperBarrett
Copy link

I am French, I use Google Translation

Obviously, it does not work ...

I try to add the VPN "Cryptostorm".

Here is the message that I when I run "adjustconfig.sh"

./adjustConfigs.sh: line 3: tput: command not found
./adjustConfigs.sh: line 4: tput: command not found
sed: bad substitution option in Expression
sed: bad substitution option in Expression
Updated .ovpn all files in folder cryptostorm /

I'm on Qnap (ts-253pro), I do not know if I can install the program that executes "tput".
As for "sed: bad option in substitution expression," I do not know how to solve it ...

I also tried with my personal VPN created from a small VPS and I have the same error message.

If you have any solutions, I'm interested.

Thank you beforehand

@haugene
Copy link
Owner

haugene commented Feb 16, 2016

Sorry for the late reply here. Have you gotten any further? You don't need to use the script to adjust the configs if it doesn't work for you. All it does is to change the device name, paths for ca- and auth-files plus add some triggers for interface up and down to start/stop transmission. It's the changes that are done to all configs in this commit: f10b134

@gaeldevo
Copy link

hello,

thanks fort these information, i tried it yesterday, but i always have the same problem to add HMA provider

the logs are : unable to find HMA provider.

i create a new image with openvpn/HMA folder with all ovpn files,
i ran the adjustconfig script to add tun0 and start/stop transmission at bottom

but always the same error, is it a list of all vpn providers in a config file ?

thanks

@haugene
Copy link
Owner

haugene commented Feb 29, 2016

There is no list of vpn providers. It just converts the OPENVPN_PROVIDER parameter to lowercase and checks for that folder under openvpn folder.

The logs says "Could not find OpenVPN provider: HMA", right?
Your error comes from here i guess:
https://github.com/haugene/docker-transmission-openvpn/blob/master/openvpn/start.sh#L6

Don't know what you're doing wrong. I can add HMA as provider for you, but this week is very busy for me. Maybe I'll have some time before the weekend, maybe not :) I'll follow up in issue #53

@gaeldevo
Copy link

ahhh ! you gave a big point !
It just converts the OPENVPN_PROVIDER parameter to lowercase

my folder was in uppercase

opvenvpn/HMA

I rename it in lowercase and it works (some few problems with my HMA authentication, but it works now)

if U want to add them for others people, you can find HMA ovpn files here

thanks a lot for all ! i will rebuild it and put it in my synology !

@haugene
Copy link
Owner

haugene commented Feb 29, 2016

Good stuff! 👍
I'll put "Adding HMA" on my TODO-list so that others can use it as well, and we'll see when I get it done. If you've added all the configs in your repo, feel free to submit a PR ;)

@gaeldevo
Copy link

gaeldevo commented Mar 1, 2016

it is my first time on GitHub, your project is very interessant, so during my weekend, i installed an ubuntu virtual machine, i learnt Docker (using video courses) and registrer on docker website to create my own image and container !

it was a very good geek weekend :) thanks :D

PS : i don't understand "pull request" i added you as collaborator on my github if you can do yourself a PR for U, my copy of your stuff is https://github.com/gaeldevo/docker-transmission-openvpn-master

i have the issue on my synology for the tun/tap error, i'm working on it ...

@haugene
Copy link
Owner

haugene commented Mar 3, 2016

👍 Sounds like a good weekend indeed! ;) Glad to hear you found it interesting, Docker is a really cool piece of tech.

Hmm, yeah. I see you've created a new GitHub repo. I can do a diff towards mine and get your changes, but usually you would just fork my repo and then be able to create a pull request as they call it where your changes(commits) are merged into my repository.

Good luck with the tun/tap! Post your findings if you have some good ones, I should make an entry of it in the readme. Just been swamped at work lately :)

@leelouch
Copy link

I am also interested by that ! has anyone succeeded to add it on synology & HMA ?

@haugene
Copy link
Owner

haugene commented Apr 1, 2016

I have updated the readme with info on how to add providers, and since the providers discussed here are already added I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants