Skip to content

Commit d49ea96

Browse files
committed
changed default user to "user" as per @jakubno
1 parent 44c2a42 commit d49ea96

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

js/src/sandbox.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ export interface CreateCodeContextOpts {
8181
/**
8282
* User for the context.
8383
*
84-
* @default root
84+
* @default user
8585
*/
86-
user?: "root" | "user",
86+
user?: "user" | "root",
8787
/**
8888
* Timeout for the request in **milliseconds**.
8989
*

python/e2b_code_interpreter/code_interpreter_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,15 @@ async def create_code_context(
231231
self,
232232
cwd: Optional[str] = None,
233233
language: Optional[str] = None,
234-
user: Optional[Literal["root", "user"]] = None,
234+
user: Optional[Literal["user", "root"]] = None,
235235
request_timeout: Optional[float] = None,
236236
) -> Context:
237237
"""
238238
Creates a new context to run code in.
239239
240240
:param cwd: Set the current working directory for the context, defaults to `/home/user`
241241
:param language: Language of the context. If not specified, defaults to Python
242-
:param user: User of the context. If not specified, defaults to `root`
242+
:param user: User of the context. If not specified, defaults to `user`
243243
:param request_timeout: Timeout for the request in **milliseconds**
244244
245245
:return: Context object

template/server/api/models/create_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class CreateContext(BaseModel):
77
user: Optional[StrictStr] = Field(
8-
default="root",
8+
default="user",
99
description="User to run the context",
1010
)
1111
cwd: Optional[StrictStr] = Field(

template/server/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async def post_execute(request: ExecutionRequest):
9191
if not context_id:
9292
try:
9393
context = await create_context(
94-
client, websockets, language, "/home/user", "root"
94+
client, websockets, language, "/home/user", "user"
9595
)
9696
except Exception as e:
9797
return PlainTextResponse(str(e), status_code=500)
@@ -127,7 +127,7 @@ async def post_contexts(request: CreateContext) -> Context:
127127

128128
language = normalize_language(request.language)
129129
cwd = request.cwd or "/home/user"
130-
user = request.user or "root"
130+
user = request.user or "user"
131131

132132
try:
133133
return await create_context(client, websockets, language, cwd, user)

template/start-up.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function start_jupyter_server() {
3535
response=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:8888/api/status")
3636
done
3737

38-
response=$(curl -s -X POST "localhost:8888/api/sessions" -H "Content-Type: application/json" -d '{"path": "'$HOME'", "kernel": {"name": "python3_root"}, "type": "notebook", "name": "default"}')
38+
response=$(curl -s -X POST "localhost:8888/api/sessions" -H "Content-Type: application/json" -d '{"path": "'$HOME'", "kernel": {"name": "python3"}, "type": "notebook", "name": "default"}')
3939
status=$(echo "${response}" | jq -r '.kernel.execution_state')
4040
if [[ ${status} != "starting" ]]; then
4141
echo "Error creating kernel: ${response} ${status}"

0 commit comments

Comments
 (0)