Skip to content

config.sh can now create an exit node. - #16

Merged
terjeinnerdal merged 2 commits into
mainfrom
Consolidate_scripts
May 14, 2026
Merged

config.sh can now create an exit node.#16
terjeinnerdal merged 2 commits into
mainfrom
Consolidate_scripts

Conversation

@terjeinnerdal

@terjeinnerdal terjeinnerdal commented May 14, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Refactor
    • Consolidated peer and exit-node setup into a single mode-driven configurator supporting --peer and --exit-node.
    • Removed the separate exit-node script; configuration now runs from one entry point.
  • New Features
    • Mode-aware allowlist handling for filesharing, routing, and local access with automatic deny of unlisted peers.
    • Improved validation, help messaging, and device nickname resolution.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 132a1aaa-1a71-4abb-9d14-6d5bd62cc5d2

📥 Commits

Reviewing files that changed from the base of the PR and between 9f8a337 and 4f6780e.

📒 Files selected for processing (1)
  • bash/nord/config.sh

📝 Walkthrough

Walkthrough

The bash/nord/config.sh script is refactored into a mode-driven Meshnet configurator (--peer and --exit-node), adds runtime checks (nordvpn, jq), centralizes peers.json loading and nickname resolution, and moves exit-node logic into config.sh; bash/nord/exit_node.sh is removed.

Changes

Meshnet configurator refactor

Layer / File(s) Summary
Runtime checks and helpers
bash/nord/config.sh
Adds dependency checks for nordvpn and jq, sets PEERS_FILE path, updates display_help() text, and adds get_nickname() to accept or infer the device nickname from the Meshnet peer list.
Peer mode implementation
bash/nord/config.sh
Adds configure_as_peer() to apply common Meshnet/NordLynx settings, allow filesharing and auto-accept for peers listed in allowed_for_fileshare, and (when all_peers exists) deny fileshare for peers not in that allowlist while skipping the local device nickname.
Exit-node mode implementation
bash/nord/config.sh
Adds configure_as_exit_node() to apply common settings, allow routing (allowed_for_routing) and local-network access (allowed_for_local) for listed peers, and (when all_peers + allowed_for_routing exist) deny routing for peers not in the routing allowlist while skipping the local device nickname.
Main flow and dispatch
bash/nord/config.sh
Rewrites argument parsing to require a mode (--peer/--exit-node), support --help, validate peers.json presence, resolve nickname via get_nickname(), enable Meshnet and set the nickname, then dispatch to the appropriate mode via case.
Removed standalone exit script
bash/nord/exit_node.sh
Removed; its former exit-node configuration logic is consolidated into config.sh under --exit-node mode.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through peers and JSON trees,
Combined two scripts with tidy ease.
Modes now choose the route to go,
Nicknames found where mesh peers show.
A little hop — configuration breeze.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: consolidating exit node functionality into config.sh by removing the dedicated exit_node.sh script and adding exit-node configuration capability to config.sh.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Consolidate_scripts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Note

Docstrings generation - SUCCESS
Generated docstrings and committed to branch Consolidate_scripts (commit: 4f6780e8c7a6d29a6cb9a234195999ad82456edb)

Docstrings generation was requested by @terjeinnerdal.

The following files were modified:

* `bash/nord/config.sh`
@terjeinnerdal
terjeinnerdal merged commit 3ca1009 into main May 14, 2026
@terjeinnerdal
terjeinnerdal deleted the Consolidate_scripts branch May 14, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant