Last touches #1093

This commit is contained in:
Kristian Haugene
2020-03-26 12:58:23 +01:00
committed by GitHub
parent ac5e42f4f4
commit 96b1d103a1

View File

@@ -3,6 +3,7 @@
The update script is based on the NordVPN API. The API sends back the best recommended OpenVPN configuration file based on the filters given. The update script is based on the NordVPN API. The API sends back the best recommended OpenVPN configuration file based on the filters given.
Available ENV variables in the container to define via the NordVPN API the file to use are: Available ENV variables in the container to define via the NordVPN API the file to use are:
| Variable | Function | Example | | Variable | Function | Example |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
| `NORDVPN_COUNTRY` | Two character country code. See [/servers/countries](https://api.nordvpn.com/v1/servers/countries) for full list. | `NORDVPN_COUNTRY=US` | | `NORDVPN_COUNTRY` | Two character country code. See [/servers/countries](https://api.nordvpn.com/v1/servers/countries) for full list. | `NORDVPN_COUNTRY=US` |
@@ -10,10 +11,12 @@ Available ENV variables in the container to define via the NordVPN API the file
| `NORDVPN_PROTOCOL` | Either `tcp` or `udp`. (values identifier more available at https://api.nordvpn.com/v1/technologies, may need script adaptation) | `NORDVPN_PROTOCOL=tcp` | | `NORDVPN_PROTOCOL` | Either `tcp` or `udp`. (values identifier more available at https://api.nordvpn.com/v1/technologies, may need script adaptation) | `NORDVPN_PROTOCOL=tcp` |
The file is then downloaded using the API to find the best server according to the variables, here an albanian, using tcp: The file is then downloaded using the API to find the best server according to the variables, here an albanian, using tcp:
* selecting server (limit answer to 1): [ANSWER]= https://api.nordvpn.com/v1/servers/recommendations?filters[country_id]=2&filters[servers_technologies][identifier]=openvpn_tcp&filters[servers_group][identifier]=legacy_group_category&limit=1 * selecting server (limit answer to 1): [ANSWER]= https://api.nordvpn.com/v1/servers/recommendations?filters[country_id]=2&filters[servers_technologies][identifier]=openvpn_tcp&filters[servers_group][identifier]=legacy_group_category&limit=1
* download selected server's config: https://downloads.nordcdn.com/configs/files/ovpn_[NORDVPN_PROTOCOL]/servers/[ANSWER.0.HOSTNAME][] => https://downloads.nordcdn.com/configs/files/ovpn_tcp/servers/al9.nordvpn.com.tcp.ovpn * download selected server's config: https://downloads.nordcdn.com/configs/files/ovpn_[NORDVPN_PROTOCOL]/servers/[ANSWER.0.HOSTNAME][] => https://downloads.nordcdn.com/configs/files/ovpn_tcp/servers/al9.nordvpn.com.tcp.ovpn
A possible evolution would be to check server's load to select the most available one. A possible evolution would be to check server's load to select the most available one.
* limit numbers of returned server to 10 * limit numbers of returned server to 10
* use https://api.nordvpn.com/server/stats to collect cpu's load * use https://api.nordvpn.com/server/stats to collect cpu's load
* select the more available server. * select the more available server.