fix: resolve openclaw.json permissions conflict and scope Dockerfile …#570
fix: resolve openclaw.json permissions conflict and scope Dockerfile …#570franknvda1 wants to merge 1 commit into
Conversation
…lockdown - Bake both 'nvidia' and 'inference' providers into openclaw.json at image build time; remove runtime Python config-patching from buildSandboxConfigSyncScript (writes to locked root:root 444 file) - Use `openclaw models set` for runtime model selection (writes to writable agent config in .openclaw-data/) - Add identity/, devices/, canvas/, cron/ to .openclaw-data symlinks so the gateway can write device-auth.json at runtime - Remove dead `openclaw doctor --fix` and `openclaw plugins install` calls from nemoclaw-start.sh (already ran at build time, fail with EPERM at runtime) Caused-by: 2d3f84e (fix: lock gateway config via Landlock filesystem policy) Fixes NVIDIA#514
📝 WalkthroughWalkthroughThe PR makes OpenClaw configuration immutable by moving runtime state to separate writable directories with symlinks, pre-baking agent configuration at Docker build time, and removing all runtime modifications to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
| }, \ | ||
| 'inference': { \ | ||
| 'baseUrl': 'https://inference.local/v1', \ | ||
| 'apiKey': 'unused', # pragma: allowlist secret \ |
There was a problem hiding this comment.
I was testing this out because onboarding is broken for me (see #580), but the # pragma: allowlist secret comment here (and also above on line 108) seemed to break this for me. It resulted in:
SyntaxError: '{' was never closed
The # pragma: allowlist secret comments inside the multi-line python3 -c
string cause Python to treat everything after # as a comment, swallowing
the \ line continuation and closing braces. This results in:
SyntaxError: '{' was never closed
Reported by DanTup in PR #570.
|
Thanks for the work on this. The core fix direction from #570 has now landed through #588, which carried the same approach forward and closed the remaining gap. I’m going to close this one as superseded so the history stays clean, but the contribution here was useful and directly informed the merged fix. Let it rip 🤙 |
…me (#588) * fix: resolve openclaw.json permissions conflict and scope Dockerfile lockdown - Bake both 'nvidia' and 'inference' providers into openclaw.json at image build time; remove runtime Python config-patching from buildSandboxConfigSyncScript (writes to locked root:root 444 file) - Use `openclaw models set` for runtime model selection (writes to writable agent config in .openclaw-data/) - Add identity/, devices/, canvas/, cron/ to .openclaw-data symlinks so the gateway can write device-auth.json at runtime - Remove dead `openclaw doctor --fix` and `openclaw plugins install` calls from nemoclaw-start.sh (already ran at build time, fail with EPERM at runtime) Caused-by: 2d3f84e (fix: lock gateway config via Landlock filesystem policy) Fixes #514 * fix: remove pragma comments that break inline Python in Dockerfile The # pragma: allowlist secret comments inside the multi-line python3 -c string cause Python to treat everything after # as a comment, swallowing the \ line continuation and closing braces. This results in: SyntaxError: '{' was never closed Reported by DanTup in PR #570. * fix: remove openclaw models set from sync script — config stays on host openclaw models set writes to openclaw.json, which is correctly locked (root:root 444 + Landlock read-only). Model routing is handled by the host-side gateway via openshell inference set (Step 5), not from inside the sandbox. The sync script should only write NemoClaw's own selection config to ~/.nemoclaw/config.json. Remove openclaw models set call, dead pythonLiteralJson helper, and unused getOpenClawPrimaryModel/DEFAULT_OLLAMA_MODEL imports. --------- Co-authored-by: Frank Ruiz <frankr@nvidia.com>
Isn't this just brake the openclaw configuration inside the sandbox? I get permission denied trying to set the configs for example: openclaw config set allowedOrigins, returns EACCES: permission denied, copyfile '/sandbox/.openclaw/openclaw.json |
…me (NVIDIA#588) * fix: resolve openclaw.json permissions conflict and scope Dockerfile lockdown - Bake both 'nvidia' and 'inference' providers into openclaw.json at image build time; remove runtime Python config-patching from buildSandboxConfigSyncScript (writes to locked root:root 444 file) - Use `openclaw models set` for runtime model selection (writes to writable agent config in .openclaw-data/) - Add identity/, devices/, canvas/, cron/ to .openclaw-data symlinks so the gateway can write device-auth.json at runtime - Remove dead `openclaw doctor --fix` and `openclaw plugins install` calls from nemoclaw-start.sh (already ran at build time, fail with EPERM at runtime) Caused-by: 2d3f84e (fix: lock gateway config via Landlock filesystem policy) Fixes NVIDIA#514 * fix: remove pragma comments that break inline Python in Dockerfile The # pragma: allowlist secret comments inside the multi-line python3 -c string cause Python to treat everything after # as a comment, swallowing the \ line continuation and closing braces. This results in: SyntaxError: '{' was never closed Reported by DanTup in PR NVIDIA#570. * fix: remove openclaw models set from sync script — config stays on host openclaw models set writes to openclaw.json, which is correctly locked (root:root 444 + Landlock read-only). Model routing is handled by the host-side gateway via openshell inference set (Step 5), not from inside the sandbox. The sync script should only write NemoClaw's own selection config to ~/.nemoclaw/config.json. Remove openclaw models set call, dead pythonLiteralJson helper, and unused getOpenClawPrimaryModel/DEFAULT_OLLAMA_MODEL imports. --------- Co-authored-by: Frank Ruiz <frankr@nvidia.com>
…me (NVIDIA#588) * fix: resolve openclaw.json permissions conflict and scope Dockerfile lockdown - Bake both 'nvidia' and 'inference' providers into openclaw.json at image build time; remove runtime Python config-patching from buildSandboxConfigSyncScript (writes to locked root:root 444 file) - Use `openclaw models set` for runtime model selection (writes to writable agent config in .openclaw-data/) - Add identity/, devices/, canvas/, cron/ to .openclaw-data symlinks so the gateway can write device-auth.json at runtime - Remove dead `openclaw doctor --fix` and `openclaw plugins install` calls from nemoclaw-start.sh (already ran at build time, fail with EPERM at runtime) Caused-by: 2d3f84e (fix: lock gateway config via Landlock filesystem policy) Fixes NVIDIA#514 * fix: remove pragma comments that break inline Python in Dockerfile The # pragma: allowlist secret comments inside the multi-line python3 -c string cause Python to treat everything after # as a comment, swallowing the \ line continuation and closing braces. This results in: SyntaxError: '{' was never closed Reported by DanTup in PR NVIDIA#570. * fix: remove openclaw models set from sync script — config stays on host openclaw models set writes to openclaw.json, which is correctly locked (root:root 444 + Landlock read-only). Model routing is handled by the host-side gateway via openshell inference set (Step 5), not from inside the sandbox. The sync script should only write NemoClaw's own selection config to ~/.nemoclaw/config.json. Remove openclaw models set call, dead pythonLiteralJson helper, and unused getOpenClawPrimaryModel/DEFAULT_OLLAMA_MODEL imports. --------- Co-authored-by: Frank Ruiz <frankr@nvidia.com>
…lockdown
openclaw models setfor runtime model selection (writes to writable agent config in .openclaw-data/)openclaw doctor --fixandopenclaw plugins installcalls from nemoclaw-start.sh (already ran at build time, fail with EPERM at runtime)Caused-by: 2d3f84e (fix: lock gateway config via Landlock filesystem policy) Fixes #514
Summary
Related Issue
Changes
Type of Change
Testing
make checkpasses.npm testpasses.make docsbuilds without warnings. (for doc-only changes)Checklist
General
Code Changes
make formatapplied (TypeScript and Python).Doc Changes
update-docsagent skill to draft changes while complying with the style guide. For example, prompt your agent with "/update-docscatch up the docs for the new changes I made in this PR."Summary by CodeRabbit
New Features
Improvements
Tests