Skip to content

The Unified and Autonomous Development Platform

docs: Clarify when sandbox jobs require sudo

Robin Shenb9b30f953dea
diff --git a/server-core/src/main/java/io/onedev/server/buildspec/job/Job.java b/server-core/src/main/java/io/onedev/server/buildspec/job/Job.java
index 8d5fbbb110..b04cce11d3 100644
--- a/server-core/src/main/java/io/onedev/server/buildspec/job/Job.java
+++ b/server-core/src/main/java/io/onedev/server/buildspec/job/Job.java
@@ -200,7 +200,7 @@ public class Job implements NamedElement, Validatable {
this.executeInSandbox = executeInSandbox;
}
- @Editable(order=220, description="Shell commands run as the template image's default user. A non-root default user must have passwordless sudo access.")
+ @Editable(order=220, description="Shell commands run as the template image's default user. Non-root users need passwordless sudo for containers, services, and protected caches. Opening a build terminal or resuming a paused job needs sudo only when the non-root template user does not own the build directory.")
@Interpolative(variableSuggester="suggestVariables")
@DependsOn(property="executeInSandbox")
@NotEmpty
diff --git a/server-plugin/server-plugin-executor-serversandbox/src/main/java/io/onedev/server/plugin/executor/serversandbox/ServerSandboxExecutor.java b/server-plugin/server-plugin-executor-serversandbox/src/main/java/io/onedev/server/plugin/executor/serversandbox/ServerSandboxExecutor.java
index 6fd2eb8f39..22e53dbb71 100644
--- a/server-plugin/server-plugin-executor-serversandbox/src/main/java/io/onedev/server/plugin/executor/serversandbox/ServerSandboxExecutor.java
+++ b/server-plugin/server-plugin-executor-serversandbox/src/main/java/io/onedev/server/plugin/executor/serversandbox/ServerSandboxExecutor.java
@@ -291,8 +291,8 @@ public class ServerSandboxExecutor extends JobExecutor implements SandboxAware,
@Editable(order=100, description="""
Specify a Docker sandbox shell template image to test against. This image should \
- contain Python 3 and Git, provide passwordless sudo for its default user, and be configured with a Docker daemon if you also want \
- to run container inside it""")
+ contain Python 3 and Git. To also test running a container, configure a Docker daemon \
+ and provide passwordless sudo if the default user is non-root""")
@NotEmpty
public String getTemplate() {
return template;