I do not provide the `NORDVPN_PROTOCOL` variable in my container.
`NORDVPN_PROTOCOL` is defaulted to `"udp"` in `/openvpn/start.sh`
L96 here checks and provides the final portion of the .ovpn download URL which includes `.udp1194` (or `.tcp443` if `NORDVPN_PROTOCOL` was set to "tcp")
The end result in these checks and definitions causes the download URL to include an extra `.udp` in the address.
In my logs, this is the url it provides to `curl` from which is invalid:
`https://downloads.nordcdn.com/configs/files/ovpn_legacy/servers/us4436.nordvpn.com.udp.udp1194.ovpn`
It should end up being this instead:
`https://downloads.nordcdn.com/configs/files/ovpn_legacy/servers/us4436.nordvpn.com.udp1194.ovpn`
Log below:
```
Using OpenVPN provider: NORDVPN
2019-09-21 22:07:03 Checking curl installation
2019-09-21 22:07:03 Removing existing configs
2019-09-21 22:07:03 Selecting the best server...
2019-09-21 22:07:03 Searching for group: legacy_p2p
2019-09-21 22:07:03 Searching for technology: openvpn_udp
2019-09-21 22:07:03 Best server : us4436.nordvpn.com
2019-09-21 22:07:03 Downloading config: default.ovpn
2019-09-21 22:07:03 Downloading from: https://downloads.nordcdn.com/configs/files/ovpn_legacy/servers/us4436.nordvpn.com.udp.udp1194.ovpn
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 162 100 162 0 0 809 0 --:--:-- --:--:-- --:--:-- 810
2019-09-21 22:07:03 Checking line endings
2019-09-21 22:07:03 Updating configs for docker-transmission-openvpn
Starting OpenVPN using config default.ovpn
Setting OPENVPN credentials...
adding route to local network 0.0.0.0 via 172.18.0.1 dev eth0
Options error: Unrecognized option or missing or extra parameter(s) in /etc/openvpn/nordvpn/default.ovpn:1: html (2.4.7)
Use --help for more information.
```
After resolving an issue with the default.ovpn symlink, it was bugging me that each time the container ran it would download all of the NordVPN configs. After a bit of research I found a url where I could download just one ovpn file. A bit of rework and now only downloads the applicable config based off of NordVPNs api. No more 4000+ configs.
User can configure this using either NORDVPN_COUNTRY to connect to the best server in that country or a specific config using the OPENVPN_CONFIG parameter. If neither are specified config will be selected based off of NordVPN api and if both are specified it will connect to OPENVPN_CONFIG server first using the api to decide on a backup 'default.ovpn' config in case it fails.
In my rewriting of this I also realised there was no need for the updateConfigs.sh script anymore, but to keep everything in keeping I replaced the contents of the updateConfigs.sh script with the NordVPN_selector one and removed the latter.
container was being stopped due to sed not liking default.ovpn symlink. Updated so that sed skipped this symlink. container was then also being stopped due to updateConfigs.sh script erroring if default.ovpn existed when trying to create symlink. Added option 'f' so that the symlink would be recreated even if existed
Added NordVPN Variables to docker file
Update start.sh
Update NordVPN.sh
Update NordVPN configs on run
NordVPN was missing server files. Have updated to run the nordvpn updateConfigs.sh script on start
Update NordVPN_Server_Selector.sh
Update start.sh
Moved Selector script to NordVPN directory
Update NordVPN_Server_Selector.sh
Update NordVPN_Server_Selector.sh
Update updateConfigs.sh
Update updateConfigs.sh
Added auto-update of NordVPN
container will auto-update NordVPN files on start. This increases the start up time by a bit. But ensures that all configs are present for the auto-selector script
Create default.ovpn
Update default.ovpn
In commit 17768dca5b, the file that the default conf that Nord VPN was pointing to was removed, so the container will no longer start (errors out saying it can't find the file):
```
Options error: In [CMD-LINE]:1: Error opening configuration file: /etc/openvpn/nordvpn/default
```
**Note:** I don't know if it matters what the default was... I just picked `nl180.nordvpn.com.tcp.ovpn` at random, you can change it if it really matter.
What's weird, is even if I override the config it should use with `OPENVPN_CONFIG`, it still tries to access this file and won't start. For now, I'm sticking to `2.0` to be able to get it to work.