From bcfbff1ed263bdf7b50ae0c099a9dd68d7945164 Mon Sep 17 00:00:00 2001 From: terje Date: Mon, 13 Apr 2026 17:34:12 +0200 Subject: [PATCH 1/2] Disabled routing in the config.sh file --- bash/nord/config.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bash/nord/config.sh b/bash/nord/config.sh index a800ba5..113ab7c 100755 --- a/bash/nord/config.sh +++ b/bash/nord/config.sh @@ -32,6 +32,8 @@ echo "The nickname is: $1" NICKNAME=$1 +nordvpn set meshnet off +nordvpn set routing disable nordvpn set meshnet on nordvpn meshnet set nickname $NICKNAME From 3c8031f9f0e4d0b02ba3f4209277db2b3a46756d Mon Sep 17 00:00:00 2001 From: terje Date: Mon, 11 May 2026 03:04:18 +0200 Subject: [PATCH 2/2] Mostly to push the repo --- bash/nord/config.sh | 35 ++++++++++++++++++++++++++++++----- bash/nord/exit_node.sh | 8 ++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/bash/nord/config.sh b/bash/nord/config.sh index 113ab7c..6dc3202 100755 --- a/bash/nord/config.sh +++ b/bash/nord/config.sh @@ -1,6 +1,5 @@ #! /usr/bin/bash - # Check for jq if ! command -v jq &> /dev/null then @@ -32,20 +31,29 @@ echo "The nickname is: $1" NICKNAME=$1 -nordvpn set meshnet off -nordvpn set routing disable +#nordvpn set meshnet off +#nordvpn set routing disable + +# Enable Meshnet and set the device's nickname nordvpn set meshnet on nordvpn meshnet set nickname $NICKNAME +# Enable notifications for connection status changes. nordvpn set notify on +# Disable Perfect Forward Secrecy (PFS) to allow for better compatibility with certain devices and configurations. nordvpn set pq off + +# Disable LAN discovery to prevent the device from being visible on the local network, enhancing security when acting as an exit node. nordvpn set lan-discovery off + +# Set the VPN protocol to NordLynx for improved performance and security. nordvpn set technology nordlynx -# Set auto-connect for this device -nordvpn set autoconnect on +# Set auto-connect for this device to a specific country (e.g., Norway). Adjust as needed. +nordvpn set autoconnect on Norway +# PEERS_FILE="$(dirname "$0")/peers.json" # Check if the peers file exists @@ -69,8 +77,25 @@ if ! mapfile -t ALL_PEERS < <(jq -r '.all_peers[]' "$PEERS_FILE"); then exit 1 fi +if ! mapfile -t FILESHARE_PEERS < <(jq -r '.allowed_for_fileshare[]' "$PEERS_FILE"); then + echo "Error: Failed to parse 'allowed_for_fileshare' from '$PEERS_FILE'." >&2 + echo "Please ensure it's a valid JSON file with an 'allowed_for_fileshare' key containing an array of strings." >&2 + exit 1 +fi + +echo "Reading all peers from '$PEERS_FILE'..." +if ! mapfile -t ALL_PEERS < <(jq -r '.all_peers[]' "$PEERS_FILE"); then + echo "Error: Failed to parse 'all_peers' from '$PEERS_FILE'." >&2 + echo "Please ensure it's a valid JSON file with an 'all_peers' key containing an array of strings." >&2 + exit 1 +fi + echo "Configuring fileshare and auto-accept for specific peers..." for PEER in "${FILESHARE_PEERS[@]}"; do + # Don't try to change permissions for the device this script is running on. + if [[ "$PEER" == "$NICKNAME" ]]; then + continue + fi nordvpn meshnet peer fileshare allow "$PEER" && echo " - Allowed fileshare for '$PEER'." nordvpn meshnet peer auto-accept enable "$PEER" && echo " - Enabled auto-accept for '$PEER'." done diff --git a/bash/nord/exit_node.sh b/bash/nord/exit_node.sh index 428d7d6..d920a8a 100755 --- a/bash/nord/exit_node.sh +++ b/bash/nord/exit_node.sh @@ -76,11 +76,19 @@ fi echo "Allowing specific peers to route through '$NICKNAME':" for PEER in "${ROUTING_PEERS[@]}"; do + # Don't try to change permissions for the device this script is running on. + if [[ "$PEER" == "$NICKNAME" ]]; then + continue + fi nordvpn meshnet peer routing allow "$PEER" && echo " - Allowed '$PEER' to route through this device." done echo "Allowing specific peers to access this device's local network:" for PEER in "${LOCAL_PEERS[@]}"; do + # Don't try to change permissions for the device this script is running on. + if [[ "$PEER" == "$NICKNAME" ]]; then + continue + fi nordvpn meshnet peer local allow "$PEER" && echo " - Allowed '$PEER' to access this device's local network." done