Skip to content

Commit

Permalink
keep it backward compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
Julio Gutierrez committed Nov 11, 2021
1 parent f96c88c commit 47f6743
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 28 deletions.
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ LABEL maintainer="Julio Gutierrez [email protected]"
ARG NORDVPN_VERSION=3.12.0-1
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y && \
apt-get install -y curl iputils-ping wireguard && \
RUN apt update -y && \
apt install -y curl iputils-ping wireguard && \
curl https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn-release_1.0.0_all.deb --output /tmp/nordrepo.deb && \
apt-get install -y /tmp/nordrepo.deb && \
apt-get update -y && \
apt-get install -y nordvpn${NORDVPN_VERSION:+=$NORDVPN_VERSION} && \
apt-get remove -y nordvpn-release && \
apt-get autoremove -y && \
apt-get autoclean -y && \
apt install -y /tmp/nordrepo.deb && \
apt update -y && \
apt install -y nordvpn${NORDVPN_VERSION:+=$NORDVPN_VERSION} && \
apt remove -y nordvpn-release && \
apt autoremove -y && \
apt autoclean -y && \
rm -rf \
/tmp/* \
/var/cache/apt/archives/* \
Expand Down
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<p align="center">
<a href="https://nordvpn.com/"><img src="https://github.com/nrdvpn/client/raw/master/.img/NordVpn_logo.png"/></a>
<a href="https://nordvpn.com/"><img src="https://github.com/bubuntux/nordvpn/raw/master/.img/NordVpn_logo.png"/></a>
</br>
<a href="https://github.com/nrdvpn/client/blob/master/LICENSE"><img src="https://badgen.net/github/license/nrdvpn/client?color=cyan"/></a>
<a href="https://cloud.docker.com/u/bubuntux/repository/docker/nrdvpn/client"><img src="https://badgen.net/docker/size/nrdvpn/client?icon=docker&label=size"/></a>
<a href="https://cloud.docker.com/u/bubuntux/repository/docker/nrdvpn/client"><img src="https://badgen.net/docker/pulls/nrdvpn/client?icon=docker&label=pulls"/></a>
<a href="https://cloud.docker.com/u/bubuntux/repository/docker/nrdvpn/client"><img src="https://badgen.net/docker/stars/nrdvpn/client?icon=docker&label=stars"/></a>
<a href="https://github.com/nrdvpn/client"><img src="https://badgen.net/github/forks/nrdvpn/client?icon=github&label=forks&color=black"/></a>
<a href="https://github.com/nrdvpn/client"><img src="https://badgen.net/github/stars/nrdvpn/client?icon=github&label=stars&color=black"/></a>
<a href="https://github.com/nrdvpn/client/actions?query=workflow%3Arelease"><img src="https://github.com/nrdvpn/client/actions/workflows/deploy.yml/badge.svg"/></a>
<a href="https://github.com/bubuntux/nordvpn/blob/master/LICENSE"><img src="https://badgen.net/github/license/bubuntux/nordvpn?color=cyan"/></a>
<a href="https://cloud.docker.com/u/bubuntux/repository/docker/bubuntux/nordvpn"><img src="https://badgen.net/docker/size/bubuntux/nordvpn?icon=docker&label=size"/></a>
<a href="https://cloud.docker.com/u/bubuntux/repository/docker/bubuntux/nordvpn"><img src="https://badgen.net/docker/pulls/bubuntux/nordvpn?icon=docker&label=pulls"/></a>
<a href="https://cloud.docker.com/u/bubuntux/repository/docker/bubuntux/nordvpn"><img src="https://badgen.net/docker/stars/bubuntux/nordvpn?icon=docker&label=stars"/></a>
<a href="https://github.com/bubuntux/nordvpn"><img src="https://badgen.net/github/forks/bubuntux/nordvpn?icon=github&label=forks&color=black"/></a>
<a href="https://github.com/bubuntux/nordvpn"><img src="https://badgen.net/github/stars/bubuntux/nordvpn?icon=github&label=stars&color=black"/></a>
<a href="https://github.com/bubuntux/nordvpn/actions?query=workflow%3Arelease"><img src="https://github.com/bubuntux/nordvpn/workflows/release/badge.svg"/></a>
</p>

Official `NordVPN` client in a docker container; it makes routing traffic through the `NordVPN` network easy.
Expand All @@ -20,7 +20,7 @@ This container was designed to be started first to provide a connection to other
## Starting an NordVPN instance
docker run -ti --cap-add=NET_ADMIN --name vpn \
-e [email protected] -e PASS='pas$word' \
-e TECHNOLOGY=NordLynx -d nrdvpn/client
-e TECHNOLOGY=NordLynx -d ghcr.io/bubuntux/nordvpn

Once it's up other containers can be started using its network connection:

Expand All @@ -31,10 +31,10 @@ Once it's up other containers can be started using its network connection:
version: "3"
services:
vpn:
image: ghcr.io/nrdvpn/client
image: ghcr.io/bubuntux/nordvpn
cap_add:
- NET_ADMIN # Required
environment: # Review https://github.com/nrdvpn/client#environment-variables
environment: # Review https://github.com/bubuntux/nordvpn#environment-variables
- [email protected] # Required
- "PASS=pas$word" # Required
- CONNECT=United_States
Expand Down Expand Up @@ -73,10 +73,10 @@ services:
- /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped
vpn:
image: ghcr.io/nrdvpn/client
image: ghcr.io/bubuntux/nordvpn
cap_add:
- NET_ADMIN # Required
environment: # Review https://github.com/nrdvpn/client#environment-variables
environment: # Review https://github.com/bubuntux/nordvpn#environment-variables
- [email protected] # Required
- "PASS=pas$word" # Required
- CONNECT=United_States
Expand Down Expand Up @@ -142,11 +142,11 @@ services:
- /dev/dri:/dev/dri
restart: unless-stopped
vpn:
image: ghcr.io/nrdvpn/client
image: ghcr.io/bubuntux/nordvpn
container_name: nordvpn
cap_add:
- NET_ADMIN # Required
environment: # Review https://github.com/nrdvpn/client#environment-variables
environment: # Review https://github.com/bubuntux/nordvpn#environment-variables
- [email protected] # Required
- "PASS=pas$word" # Required
- CONNECT=United_States
Expand Down Expand Up @@ -177,11 +177,11 @@ services:
* `PASS` - Password for NordVPN account, surrounding the password in single quotes will prevent issues with special characters such as `$`.
* `PASSFILE` - File from which to get `PASS`, if using [docker secrets](https://docs.docker.com/compose/compose-file/compose-file-v3/#secrets) this should be set to `/run/secrets/<secret_name>`. This file should contain just the account password on the first line.
* `CONNECT` - [country]/[server]/[country_code]/[city]/[group] or [country] [city], if none provide you will connect to the recommended server.
- Provide a [country] argument to connect to a specific country. For example: Australia , Use `docker run --rm nrdvpn/client nordvpn countries` to get the list of countries.
- Provide a [country] argument to connect to a specific country. For example: Australia , Use `docker run --rm ghcr.io/bubuntux/nordvpn nordvpn countries` to get the list of countries.
- Provide a [server] argument to connect to a specific server. For example: jp35 , [Full List](https://nordvpn.com/servers/tools/)
- Provide a [country_code] argument to connect to a specific country. For example: us
- Provide a [city] argument to connect to a specific city. For example: 'Hungary Budapest' , Use `docker run --rm nrdvpn/client nordvpn cities [country]` to get the list of cities.
- Provide a [group] argument to connect to a specific servers group. For example: P2P , Use `docker run --rm nrdvpn/client nordvpn groups` to get the full list.
- Provide a [city] argument to connect to a specific city. For example: 'Hungary Budapest' , Use `docker run --rm ghcr.io/bubuntux/nordvpn nordvpn cities [country]` to get the list of cities.
- Provide a [group] argument to connect to a specific servers group. For example: P2P , Use `docker run --rm ghcr.io/bubuntux/nordvpn nordvpn groups` to get the full list.
- --group value Specify a server group to connect to. For example: '--group p2p us'
* `PRE_CONNECT` - Command to execute before attempt to connect.
* `POST_CONNECT` - Command to execute after successful connection.
Expand All @@ -203,7 +203,7 @@ services:

# Issues

If you have any problems with or questions about this image, please contact me through a [GitHub issue](https://github.com/nrdvpn/client/issues).
If you have any problems with or questions about this image, please contact me through a [GitHub issue](https://github.com/bubuntux/nordvpn/issues).

# Disclaimer
This project is independently developed for personal use, there is no affiliation with NordVpn or Nord Security companies,
Expand Down
1 change: 1 addition & 0 deletions rootfs/etc/cont-init.d/30-route
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/with-contenv bash

[[ -n ${NETWORK} && -z ${NET_LOCAL} ]] && NET_LOCAL=${NETWORK}
if [ -n "$NET_LOCAL" ]; then
gw="$(ip route | awk '/default/{print $3}')"
for net in ${NET_LOCAL//[;,]/ }; do
Expand Down
1 change: 1 addition & 0 deletions rootfs/etc/cont-init.d/30-route6
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/with-contenv bash

[[ -n ${NETWORK6} && -z ${NET6_LOCAL} ]] && NET6_LOCAL=${NETWORK6}
if [ -n "$NET6_LOCAL" ]; then
gw="$(ip -6 route | awk '/default/{print $3}')"
for net in ${NET6_LOCAL//[;,]/ }; do
Expand Down
1 change: 1 addition & 0 deletions rootfs/etc/cont-init.d/40-allowlist
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/with-contenv bash

[[ -n ${WHITELIST} && -z ${ALLOW_LIST} ]] && ALLOW_LIST=${WHITELIST}
if [[ -n ${ALLOW_LIST} ]]; then
for domain in ${ALLOW_LIST//[;,]/ }; do
domain=$(echo "$domain" | sed 's/^.*:\/\///;s/\/.*$//')
Expand Down
3 changes: 2 additions & 1 deletion rootfs/usr/bin/nord_config
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[[ -n ${CYBER_SEC} ]] && nordvpn set cybersec ${CYBER_SEC}
[[ -n ${OBFUSCATE} ]] && nordvpn set obfuscate ${OBFUSCATE}
[[ -n ${FIREWALL} ]] && nordvpn set firewall ${FIREWALL}
#[[ -n ${KILLSWITCH} ]] && nordvpn set killswitch ${KILLSWITCH}
#[[ -n ${KILLSWITCH} ]] && nordvpn set killswitch ${KILLSWITCH} Killswitch is enabled by default by iptables

[[ -n ${PROTOCOL} ]] && nordvpn set protocol ${PROTOCOL}
nordvpn set technology ${TECHNOLOGY:-NordLynx}
Expand All @@ -15,6 +15,7 @@ nordvpn set technology ${TECHNOLOGY:-NordLynx}

docker_networks=$(dockerNetworks)
[[ -n ${docker_networks} ]] && for net in ${docker_networks//[;,]/ }; do nordvpn whitelist add subnet "${net}"; done
[[ -n ${NETWORK} && -z ${NET_LOCAL} ]] && NET_LOCAL=${NETWORK}
[[ -n ${NET_LOCAL} ]] && for net in ${NET_LOCAL//[;,]/ }; do nordvpn whitelist add subnet "${net}"; done

exit 0

0 comments on commit 47f6743

Please sign in to comment.