-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Feat/configurable ports #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
2cf4b72
feat(onboard): add configurable port overrides via env vars
jnun 37051ac
style: fix doc H1 mismatch and apply ruff formatting
jnun 14170ce
Update README.md
jnun c9680c6
fix(security): command injection across all CLI entry points (#584)
ericksoa ce7daaf
docs: add community feedback invitation for policy presets (#600)
ericksoa 9fbc644
docs: replace "strict baseline" with "default" for policy language (#…
ericksoa 35389ef
docs: rename strict policy tier to default (#603)
ericksoa 4718ac1
fix: address review findings for docstring coverage and blockquote style
jnun 0c47a5d
fix: remove unused crypto import in telegram-bridge
jnun de1da0a
feat(onboard): add port validation, fix spurious port warnings, and l…
jnun 2ea5562
chore: merge main into feat/configurable-ports
jnun bc17106
fix(env): search git root and CWD for .env.local on fresh installs
jnun 029c1d9
fix(onboard): bootstrap .env and show port override guidance on conflict
jnun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # NemoClaw port configuration — copy to .env and edit as needed. | ||
| # Ports must be integers in range 1024–65535. | ||
| # Run scripts/check-ports.sh to find port conflicts | ||
|
|
||
| NEMOCLAW_DASHBOARD_PORT=18789 | ||
| NEMOCLAW_GATEWAY_PORT=8080 | ||
| NEMOCLAW_VLLM_PORT=8000 | ||
| NEMOCLAW_OLLAMA_PORT=11434 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,3 +8,8 @@ docs/_build/ | |
| coverage/ | ||
| vdr-notes/ | ||
| draft_newsletter_* | ||
| tmp/ | ||
| .env | ||
| .env.local | ||
| .venv/ | ||
| uv.lock | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| // SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| // | ||
| // Lightweight .env loader — reads .env files from the project root and populates | ||
| // process.env. Existing environment variables are never overwritten, so shell | ||
| // exports always take precedence over file values. | ||
| // | ||
| // Supports: | ||
| // - Multiple files (loaded in order; first file's values win over later files) | ||
| // - Comments (#) and blank lines | ||
| // - KEY=VALUE, KEY="VALUE", KEY='VALUE' | ||
| // - Inline comments after unquoted values | ||
|
|
||
| const fs = require("fs"); | ||
| const path = require("path"); | ||
|
|
||
| const ROOT = path.resolve(__dirname, "..", ".."); | ||
| const CWD = process.cwd(); | ||
|
|
||
| // Walk up from a directory looking for a .git marker to find the repo root. | ||
| function findGitRoot(start) { | ||
| let dir = start; | ||
| while (true) { | ||
| try { | ||
| fs.statSync(path.join(dir, ".git")); | ||
| return dir; | ||
| } catch { | ||
| const parent = path.dirname(dir); | ||
| if (parent === dir) return null; | ||
| dir = parent; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| const GIT_ROOT = findGitRoot(CWD); | ||
|
|
||
| function parseEnvFile(filePath) { | ||
| let content; | ||
| try { | ||
| content = fs.readFileSync(filePath, "utf-8"); | ||
| } catch { | ||
| return; // file doesn't exist or isn't readable — skip silently | ||
| } | ||
|
|
||
| for (const raw of content.split("\n")) { | ||
| const line = raw.trim(); | ||
| if (!line || line.startsWith("#")) continue; | ||
|
|
||
| const eqIndex = line.indexOf("="); | ||
| if (eqIndex === -1) continue; | ||
|
|
||
| const key = line.slice(0, eqIndex).trim(); | ||
| if (!key) continue; | ||
|
|
||
| let value = line.slice(eqIndex + 1).trim(); | ||
|
|
||
| // Remove inline comments for unquoted values first, then strip quotes. | ||
| // This handles cases like KEY='value' # comment correctly. | ||
| const hashIndex = value.indexOf(" #"); | ||
| if (hashIndex !== -1) { | ||
| value = value.slice(0, hashIndex).trim(); | ||
| } | ||
|
|
||
| // Strip surrounding quotes | ||
| if ( | ||
| (value.startsWith('"') && value.endsWith('"')) || | ||
| (value.startsWith("'") && value.endsWith("'")) | ||
| ) { | ||
| value = value.slice(1, -1); | ||
| } | ||
|
|
||
| // Never overwrite existing env vars | ||
| if (process.env[key] === undefined) { | ||
| process.env[key] = value; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| // Collect unique directories to search for .env files. The git repo root and | ||
| // CWD are checked in addition to the __dirname-relative ROOT so that a user's | ||
| // .env.local (which is gitignored and therefore not synced into the sandbox | ||
| // source directory) is still picked up on a fresh install. | ||
| const SEARCH_DIRS = [...new Set([ROOT, GIT_ROOT, CWD].filter(Boolean))]; | ||
|
|
||
| // Load .env files in priority order — first file wins for any given key | ||
| // because we never overwrite once set. | ||
| const ENV_FILES = [".env.local", ".env"]; | ||
|
|
||
| for (const file of ENV_FILES) { | ||
| for (const dir of SEARCH_DIRS) { | ||
| parseEnvFile(path.join(dir, file)); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.