/ server / opensandbox_server / examples / example.config.toml
example.config.toml
 1  # Copyright 2025 Alibaba Group Holding Ltd.
 2  #
 3  # Licensed under the Apache License, Version 2.0 (the "License");
 4  # you may not use this file except in compliance with the License.
 5  # You may obtain a copy of the License at
 6  #
 7  #     http://www.apache.org/licenses/LICENSE-2.0
 8  #
 9  # Unless required by applicable law or agreed to in writing, software
10  # distributed under the License is distributed on an "AS IS" BASIS,
11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  # See the License for the specific language governing permissions and
13  # limitations under the License.
14  
15  # Example Docker Runtime Configuration for OpenSandbox Server
16  #
17  # Full configuration reference: https://github.com/alibaba/OpenSandbox/blob/main/server/configuration.md
18  
19  [server]
20  host = "127.0.0.1"
21  port = 8080
22  max_sandbox_timeout_seconds = 86400
23  
24  # Optional: Uncomment to enable API key authentication
25  # api_key = "your-secret-api-key"
26  # If api_key stays empty, startup requires explicit acknowledgment:
27  # - Interactive TTY: type YES when prompted
28  # - Non-interactive: set OPENSANDBOX_INSECURE_SERVER=YES
29  
30  [log]
31  level = "INFO"
32  
33  [runtime]
34  type = "docker"
35  execd_image = "opensandbox/execd:v1.0.13"
36  
37  [storage]
38  # Allowlist of host path prefixes permitted for bind mounts.
39  # If empty, all host paths are allowed (not recommended for production).
40  # Example: allowed_host_paths = ["/data/opensandbox", "/tmp/sandbox"]
41  allowed_host_paths = []
42  
43  # Default storage size for auto-created Kubernetes PVCs (when caller omits size).
44  volume_default_size = "1Gi"
45  
46  [docker]
47  network_mode = "bridge"
48  # Drop dangerous capabilities and block privilege escalation
49  drop_capabilities = ["AUDIT_WRITE", "MKNOD", "NET_ADMIN", "NET_RAW", "SYS_ADMIN", "SYS_MODULE", "SYS_PTRACE", "SYS_TIME", "SYS_TTY_CONFIG"]
50  no_new_privileges = true
51  # Optional: set an AppArmor profile name (e.g., "docker-default") when AppArmor is enabled
52  apparmor_profile = ""
53  # Limit process count to reduce host impact from fork bombs; set to null to disable
54  pids_limit = 4096
55  # Seccomp profile: empty string uses Docker default; set to an absolute path for a custom profile
56  seccomp_profile = ""
57  
58  [ingress]
59  mode = "direct"
60  
61  [egress]
62  image = "opensandbox/egress:v1.0.8"
63  mode = "dns"
64  
65  # 🧪 [EXPERIMENTAL] Renew-on-access. Off by default — see server/README.md.
66  [renew_intent]
67  enabled = false
68  min_interval_seconds = 60