Skip to content

Commit

Permalink
Add option to use a password file, closes bubuntux#123
Browse files Browse the repository at this point in the history
  • Loading branch information
diinngg committed Jun 12, 2021
1 parent c3a221f commit 9d282f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ services:

* `USER` - User for NordVPN account.
* `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 ghcr.io/bubuntux/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/)
Expand Down
2 changes: 2 additions & 0 deletions start_vpn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ restart_daemon() {
}
restart_daemon

[[ -z "${PASS}" ]] && [[ -f "${PASSFILE}" ]] && PASS="$(head -n 1 "${PASSFILE}")"

echo "[$(date -Iseconds)] Logging in"
nordvpn logout > /dev/null
nordvpn login --username "${USER}" --password "${PASS}" || {
Expand Down

0 comments on commit 9d282f9

Please sign in to comment.