Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions openclaw-openshell-24-04/files/etc/caddy/Caddyfile.tmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Same as OpenClaw 1-Click: Caddy in front of OpenShell sandbox forward port 18789
PLACEHOLDER_DOMAIN {
tls {
issuer acme {
dir https://acme-v02.api.letsencrypt.org/directory
profile shortlived
}
}
reverse_proxy localhost:18789
header X-DO-MARKETPLACE "openclaw-openshell"
}
49 changes: 49 additions & 0 deletions openclaw-openshell-24-04/files/etc/config/openclaw-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"agents.defaults": {
"workspace": "/sandbox/openclaw/workspace",
"model": {
"primary": "custom/inference.do-ai.run",
"fallback": [
"anthropic/claude-3-5-sonnet",
"openai/gpt-4o"
]
},
"tools": {
"allow": [
"read",
"write",
"edit",
"exec"
],
"exec": {
"security": "restricted"
}
}
},
"policy": {
"allowedSkills": [
"builtin.file_manager",
"builtin.shell_safe",
"builtin.http_client"
],
"blockedSkills": [
"builtin.system_admin",
"builtin.network_scanner"
],
"allowExternalCalls": true,
"allowedDomains": [
"inference.do-ai.run",
"api.openai.com",
"api.anthropic.com",
"openrouter.ai",
"ghcr.io",
"github.com",
"api.github.com",
"pypi.org",
"files.pythonhosted.org",
"registry.npmjs.org"
],
"maxConcurrentTasks": 2,
"notes": "Internal OpenClaw constraints for the DO 1-Click environment. Ensure this file is placed at /sandbox/.openclaw/openclaw.json and works in tandem with the OpenShell external gateway policy."
}
}
6 changes: 6 additions & 0 deletions openclaw-openshell-24-04/files/etc/config/openclaw-runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

export OPENCLAW_HOME="/sandbox/openclaw"

# 'exec' replaces the shell with the openclaw process for clean signal handling
exec OPENCLAW_HOME="/sandbox/openclaw" openclaw gateway --port 18789 --allow-unconfigured
63 changes: 63 additions & 0 deletions openclaw-openshell-24-04/files/etc/config/openclaw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"models": {
"mode": "merge",
"providers": {
"openshell": {
"baseUrl": "https://inference.local/v1",
"apiKey": "sk-do-openshell-placeholder",
"api": "openai-completions",
"models": [
{
"id": "anthropic-claude-4.5-sonnet",
"name": "Claude 4.5 Sonnet",
"reasoning": false,
"input": [
"text"
],
"contextWindow": 200000,
"maxTokens": 64000,
"compat": {
"supportsStore": false,
"maxTokensField": "max_tokens"
},
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
}
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "openshell/anthropic-claude-4.5-sonnet"
},
"models": {
"openshell/anthropic-claude-4.5-sonnet": {
"params": {
"maxTokens": 64000
}
}
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
}
},
"gateway": {
"mode": "local",
"bind": "loopback",
"auth": {
"token": "test64"
},
"trustedProxies": ["127.0.0.1"],
"controlUi": {
"enabled": true
}
}
}
47 changes: 47 additions & 0 deletions openclaw-openshell-24-04/files/etc/config/openshell-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
version: "1.0"
description: "Runtime restrictions for OpenClaw sandbox - enforced by OpenShell"

filesystem_policy:
read_write:
- /sandbox/openclaw
- /tmp
- /dev/null
- /dev/urandom
read_only:
# You still need to allow read access to basic system binaries
# otherwise Python/Node and the OpenClaw binary won't execute
- /usr
- /bin
- /lib
- /etc/ssl/certs

network_policies:
# CRITICAL: Do not remove this for Droplet environments
block_metadata:
action: deny
endpoints:
- host: 169.254.169.254
port: '*'

allowed_egress:
action: allow
endpoints:
- host: inference.do-ai.run
port: 443
- host: api.openai.com
port: 443
- host: api.anthropic.com
port: 443
- host: openrouter.ai
port: 443
- host: ghcr.io
port: 443
binaries:
- path: /usr/bin/python3
- path: /usr/bin/node
- path: /usr/local/bin/openclaw

# OpenShell locks down process privileges by default, but if you need to
# explicitly define them based on your JSON intent:
process_policy:
prevent_privilege_escalation: true
37 changes: 37 additions & 0 deletions openclaw-openshell-24-04/files/etc/dockerfile/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# syntax=docker/dockerfile:1.4

# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# OpenClaw sandbox image for OpenShell
#
# Builds on the community base sandbox and adds OpenClaw.
# Build: docker build -t openshell-openclaw --build-arg BASE_IMAGE=openshell-base .
# Run: openshell sandbox create --from openclaw

ARG BASE_IMAGE=ghcr.io/nvidia/openshell-community/sandboxes/base:latest
FROM ${BASE_IMAGE}

USER root

# Install OpenClaw CLI (pinned to fix GHSA-rchv-x836-w7xp, GHSA-6mgf-v5j7-45cr,
# GHSA-5wcw-8jjv-m286)
RUN npm install -g [email protected]

# Copy sandbox policy
COPY policy.yaml /etc/openshell/policy.yaml

# Create OpenClaw workspaces (Added /sandbox/openclaw here)
RUN mkdir -p /sandbox/openclaw /sandbox/openclaw/.openclaw && \
chown -R sandbox:sandbox /sandbox/openclaw /sandbox/openclaw/.openclaw

USER sandbox

# 1. Copy openclaw.json from local to container, assigning it to the sandbox user
COPY --chown=sandbox:sandbox openclaw.json /sandbox/openclaw/.openclaw/openclaw.json

# 2. Set the environment variable natively for the container
ENV OPENCLAW_HOME="/sandbox/openclaw"

# 3. Launch openclaw on container start (Using JSON array format so it runs as PID 1)
ENTRYPOINT ["openclaw", "gateway", "--port", "18789", "--allow-unconfigured"]
63 changes: 63 additions & 0 deletions openclaw-openshell-24-04/files/etc/dockerfile/openclaw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"models": {
"mode": "merge",
"providers": {
"openshell": {
"baseUrl": "https://inference.local/v1",
"apiKey": "sk-do-openshell-placeholder",
"api": "openai-completions",
"models": [
{
"id": "anthropic-claude-4.5-sonnet",
"name": "Claude 4.5 Sonnet",
"reasoning": false,
"input": [
"text"
],
"contextWindow": 200000,
"maxTokens": 64000,
"compat": {
"supportsStore": false,
"maxTokensField": "max_tokens"
},
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
}
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "openshell/anthropic-claude-4.5-sonnet"
},
"models": {
"openshell/anthropic-claude-4.5-sonnet": {
"params": {
"maxTokens": 64000
}
}
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
}
},
"gateway": {
"mode": "local",
"bind": "loopback",
"auth": {
"token": "test64"
},
"trustedProxies": ["127.0.0.1"],
"controlUi": {
"enabled": true
}
}
}
Loading