mirror of
https://github.com/open-webui/open-terminal.git
synced 2026-11-05 01:27:28 +00:00
[PR #141] fix: preserve custom env vars in multi-user mode via sudo -E #134
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/open-terminal#134
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-terminal/pull/141
Author: @Blumlaut
Created: 7/21/2026
Status: 🔄 Open
Base:
main← Head:fix/preserve-env-multi-user-sudo📝 Commits (1)
169c237fix: preserve custom env vars in multi-user mode via sudo -E📊 Changes
1 file changed (+4 additions, -1 deletions)
View changed files
📝
open_terminal/utils/runner.py(+4 -1)📄 Description
Problem
In multi-user mode (
OPEN_TERMINAL_MULTI_USER=true), custom environment variables passed via theenvfield inPOST /executeare silently dropped.PtyRunnerwraps commands withsudo -u <user> -- bash -c "...", butsudoresets the environment by default for security. Theenvdict is passed tosubprocess.Popen, but never reaches the actual subprocess.This breaks any workflow that relies on injecting env vars (e.g.
GH_TOKENfor GitHub CLI authentication, API keys, custom config).Solution
Add
-Eflag tosudoto preserve the environment through the user switch.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.