mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #21861] feat: docker secrets _FILE variables
#35125
Reference in New Issue
Block a user
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?
Originally created by @antoninoLorenzo on GitHub (Feb 25, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21861
Check Existing Issues
Verify Feature Scope
Problem Description
Currently the configuration is handled through environment variables, it would be desirable to support docker secrets for Open WebUI in order to reduce the attack surface. For example any user with enough privileges to run
docker inspect --format='{{.Config.Env}}' open-webuicould read sensitive variables such asOPENAI_API_KEYand so on.This feature was already requested for some specific variables, for example
WEBUI_SECRET_KEY(#14754) andOAUTH_CLIENT_SECRET(#18515) but it was never addressed; I think the reason for that is the amount of environment variables would make hard to keep track of what variables should be updated.Desired Solution you'd like
My proposal is to wrap the
os.environ.get(...)function that is used inside backend/open_webui/env.py inside a more convenient one that checks whether there is a_FILEvariable available that points to a path (ex./run/secrets/whatever); this simple change would allow more secure deployments of owui and also comes with enhanced flexibility in the overall management of environment variables, it would look something like this:Applied to the codebase:
Alternatives Considered
No response
Additional Context
No response
@kimberlyeet commented on GitHub (Mar 15, 2026):
Hi, I would love to see this implemented too.
@kimberlyeet commented on GitHub (Mar 15, 2026):
It looks like #18657 attempted to address this but was closed as well.
Since there’s still interest in this feature, could you elaborate on the decision not to implement it? @tjbck