Skip to content

feat(sandbox): template lines and scripts for the sandbox settings - #28

Merged
kunal0137 merged 1 commit into
SEMOSS:masterfrom
kunal0137:feat/sandbox-settings
Nov 17, 2026
Merged

kunal0137 merged 1 commit into
SEMOSS:masterfrom
kunal0137:feat/sandbox-settings

Conversation

@kunal0137

@kunal0137 kunal0137 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Config support for the sandbox changes in SEMOSS/Semoss#3336 (which replaces #3332 and supersedes #3191). Without this, the OpenShell settings can only be set by editing RDF_Map.prop by hand, because none of them is in the template or in any script, and a container env var has no effect on a key the template lacks.

Merging this before or after the Semoss PR is safe: a Semoss build that does not know a key ignores its template line.

Changes Made

  • x/RDF_Map.prop: adds the 15 OPENSHELL_* keys (blank, meaning the default shown in the comment above each), SANDBOX_ENV_ALLOWLIST, NAMESPACE_SCRUB_ENV (true) and NAMESPACE_EXEC_FALLBACK (fakechroot). The SANDBOX_MODE comment now covers OPENSHELL, and says that any other value means FAKECHROOT.
  • artifacts/scripts/setOpenShell.sh (new): sets each OPENSHELL_* key from the env var of the same name. It appends a key the template lacks instead of ignoring it, and escapes &, @ and \ in values. Wired into runCS.sh and runConfiguration.sh after setSandbox.sh.
  • artifacts/scripts/setChroot.sh: handles SANDBOX_ENV_ALLOWLIST, NAMESPACE_SCRUB_ENV and NAMESPACE_EXEC_FALLBACK. The existing sed patterns are now anchored (^KEY). They were not, so a template comment that mentioned SANDBOX_MODE or CHROOT_ENABLE would have been rewritten at container start.
  • AGENTS.md: the env var to script table lists the new variables, and the RDF_Map section points to the full settings list in the Semoss repo (docs/deployment/sandbox_configuration.md).

How to Test

  1. bash -n artifacts/scripts/setOpenShell.sh artifacts/scripts/setChroot.sh
  2. In a container (GNU sed), run setChroot.sh and setOpenShell.sh with the env vars set, then check /opt/semosshome/RDF_Map.prop: each key is KEY<TAB>value, comments are unchanged, and a key removed from the file beforehand is appended.
  3. Start with none of the new env vars set and confirm RDF_Map.prop is unchanged by the two scripts.

Notes

  • Tested here against a copy of the template with GNU sed, with a temporary path instead of /opt/semosshome: values with &, @ and \ come through intact, setting OPENSHELL_CLI does not touch OPENSHELL_CLI_HOME, a second run changes nothing, and with no env vars set the file is unchanged. I did not build or start an image.
  • NAMESPACE_SCRUB_ENV is true in the template and in the Semoss code default. A SANDBOX_MODE=NAMESPACE deployment will start its python and node jails without the server's environment once it picks up the Semoss change. SANDBOX_ENV_ALLOWLIST or NAMESPACE_SCRUB_ENV=false is the way back.
  • Not in this PR: the openshell CLI install is in the Semoss Dockerfiles (feat: sandbox abstraction Semoss#3336), not here. The gateway, its mTLS bundle and any Kubernetes manifests live outside both repos (SEMOSS-deployment, not checked). SANDBOX_MODE=OPENSHELL needs those as well as these settings. For more than one server node, REDIS_ENABLED also has to be on so nodes can find a user's sandbox (already in the template and in setRedis.sh).

Add the OPENSHELL_* block, SANDBOX_ENV_ALLOWLIST, NAMESPACE_SCRUB_ENV and
NAMESPACE_EXEC_FALLBACK to x/RDF_Map.prop, so they can be set from container env
vars. New setOpenShell.sh (wired into runCS.sh and runConfiguration.sh) sets the
OPENSHELL_* keys and appends one the template lacks instead of ignoring it.
setChroot.sh handles the new SANDBOX_ENV_ALLOWLIST and NAMESPACE_* keys and now
anchors its sed patterns, so a template comment that names a key is no longer
overwritten. The SANDBOX_MODE comment now covers OPENSHELL.
@kunal0137
kunal0137 marked this pull request as ready for review November 17, 2026 20:40
@kunal0137
kunal0137 merged commit 2f28bd5 into SEMOSS:master Nov 17, 2026
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