WeKnora/internal/sandbox
wizardchen c920a00918 fix(sandbox): shell_exec 降权到沙箱账号并修复 exec 取消时的数据竞争
shell_exec 承载的是模型自己写的命令行,此前未指定 User。Docker 适配器把空
User 解析为 root,envd 系后端解析为沙箱账号,同一个工具在不同后端拿到的权限
并不一致。改为显式指定 DefaultSandboxExecUser,并把空 User 的语义收窄为仅供
manager 自身的 bootstrap 使用——chown artifact 目录必须以 root 执行,不能以
被授权的那个账号执行。

取消 exec 时原先直接读取输出缓冲区,而 StdCopy 协程仍在向同一块内存写入。改
为先关闭流让 StdCopy 解除阻塞,等它收敛后再读;超出宽限期则丢弃部分输出,而
不是从仍在写入的协程手里读走。

Docker 守护进程地址此前只校验管理员填写的字符串,而空值会在其后由 DOCKER_HOST
或 docker context 填充,真正拨号的是填充后的值。这让 DOCKER_HOST 指向明文
tcp:// 守护进程的部署能存下一份必然失败的配置。校验改到解析之后、
RequireCompleteConfig 之后,缺镜像这类表单里看得见的问题仍然优先报告。
2026-08-24 12:22:58 +08:00
..
capabilities.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
check_client_guard_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
config_identity.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
config_identity_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
config_required.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
config_sandboxes.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
config_sandboxes_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
cube_integration_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
cube_mock_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
cube_remote_client.go feat(sandbox): enhance logging for sandbox operations and error diagnostics 2026-08-12 10:53:46 +08:00
cube_remote_client_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
cube_template_catalog_test.go feat(sandbox): unify remote sandbox on E2B protocol with self-hosted support (#2655) 2026-08-11 20:14:19 +08:00
docker_engine.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
docker_host.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
docker_host_test.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
docker_idle_sweeper.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
docker_idle_sweeper_test.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
docker_integration_test.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
docker_remote_client.go fix(sandbox): shell_exec 降权到沙箱账号并修复 exec 取消时的数据竞争 2026-08-24 12:22:58 +08:00
docker_remote_client_test.go fix(sandbox): shell_exec 降权到沙箱账号并修复 exec 取消时的数据竞争 2026-08-24 12:22:58 +08:00
docker_rpc_timeout.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
docker_template_catalog.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
e2b_compatible_integration_test.go feat(sandbox): unify remote sandbox on E2B protocol with self-hosted support (#2655) 2026-08-11 20:14:19 +08:00
e2b_integration_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
e2b_remote_client.go feat(sandbox): unify remote sandbox on E2B protocol with self-hosted support (#2655) 2026-08-11 20:14:19 +08:00
e2b_remote_client_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
envd_compat_transport.go feat(sandbox): unify remote sandbox on E2B protocol with self-hosted support (#2655) 2026-08-11 20:14:19 +08:00
envd_compat_transport_test.go feat(sandbox): unify remote sandbox on E2B protocol with self-hosted support (#2655) 2026-08-11 20:14:19 +08:00
gateway_transport.go feat(sandbox): unify remote sandbox on E2B protocol with self-hosted support (#2655) 2026-08-11 20:14:19 +08:00
gateway_transport_test.go feat(sandbox): unify remote sandbox on E2B protocol with self-hosted support (#2655) 2026-08-11 20:14:19 +08:00
local.go 增加sandbox对windows编译支持,现在默认是linux的实现,windows直接编译报错 2026-05-25 16:57:56 +08:00
local_unix.go 增加sandbox对windows编译支持,现在默认是linux的实现,windows直接编译报错 2026-05-25 16:57:56 +08:00
local_windows.go 增加sandbox对windows编译支持,现在默认是linux的实现,windows直接编译报错 2026-05-25 16:57:56 +08:00
manager.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
orphan_reaper.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
orphan_reaper_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
remote_client.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
remote_client_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
remote_errors.go feat(sandbox): enhance logging for sandbox operations and error diagnostics 2026-08-12 10:53:46 +08:00
remote_errors_test.go feat(sandbox): enhance logging for sandbox operations and error diagnostics 2026-08-12 10:53:46 +08:00
remote_fake_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
remote_sandbox.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
runtime_defaults.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
sandbox.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
sandbox_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
session_binding.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
session_binding_redis.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_binding_redis_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_binding_tenant_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_binding_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_lifecycle.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_lifecycle_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00
session_manager.go fix(sandbox): shell_exec 降权到沙箱账号并修复 exec 取消时的数据竞争 2026-08-24 12:22:58 +08:00
session_manager_test.go fix(sandbox): shell_exec 降权到沙箱账号并修复 exec 取消时的数据竞争 2026-08-24 12:22:58 +08:00
template_catalog.go feat(sandbox): unify remote sandbox on E2B protocol with self-hosted support (#2655) 2026-08-11 20:14:19 +08:00
template_catalog_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
tenant_config.go fix(sandbox): shell_exec 降权到沙箱账号并修复 exec 取消时的数据竞争 2026-08-24 12:22:58 +08:00
tenant_config_test.go fix(sandbox): shell_exec 降权到沙箱账号并修复 exec 取消时的数据竞争 2026-08-24 12:22:58 +08:00
tenant_resolver.go feat(sandbox): Docker 后端支持会话级长驻容器与远程守护进程 2026-08-24 12:22:58 +08:00
tenant_resolver_test.go fix(sandbox): shell_exec 降权到沙箱账号并修复 exec 取消时的数据竞争 2026-08-24 12:22:58 +08:00
url_guard.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
url_guard_test.go feat(sandbox): 沙箱后端改为按空间配置,并补齐 E2B 模板与检测诊断 2026-08-11 15:42:02 +08:00
validator.go perf(sandbox): compile command-substitution regexps once 2026-06-16 19:51:32 +08:00
validator_test.go feat(sandbox) (#2301) 2026-08-10 21:28:20 +08:00