Originally created by @tjbck on GitHub (Mar 3, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/1022
Originally assigned to: @tjbck on GitHub.
Related #981 #988 #900
I don't have a clear idea yet on how to persist settings to the backend, but may I ask if you would welcome me to create a workaround PR for #988 in the meantime?
Here's my idea: Even though there is no documentation mentioning it, I observed that users can set DEFAULT_USER_ROLE in the environment variables and have it read by :
<!-- gh-comment-id:1992061479 -->
@changchiyou commented on GitHub (Mar 12, 2024):
I don't have a clear idea yet on how to persist settings to the backend, but may I ask if you would welcome me to create a workaround PR for #988 in the meantime?
Here's my idea: Even though there is no documentation mentioning it, I observed that users can set `DEFAULT_USER_ROLE` in the environment variables and have it read by :
https://github.com/open-webui/open-webui/blob/7ae4669f350ad30b44594c5e76759db445d9bf5d/backend/config.py#L290
Then assigned to `app.state.DEFAULT_USER_ROLE` in:
https://github.com/open-webui/open-webui/blob/7ae4669f350ad30b44594c5e76759db445d9bf5d/backend/apps/web/main.py#L33
Could I apply a similar logic to handle `USER_PERMISSIONS` as well? For example:
https://github.com/open-webui/open-webui/blob/7ae4669f350ad30b44594c5e76759db445d9bf5d/backend/config.py#L291
```diff
+ import ast
- USER_PERMISSIONS = {"chat": {"deletion": True}}
+ USER_PERMISSIONS = ast.literal_eval(os.environ.get("USER_PERMISSIONS", '{"chat": {"deletion": True}}'))
```
This also applies to the OpenAI API key. It gets lost every container restart, even with a volume present.
<!-- gh-comment-id:2061729845 -->
@Fusseldieb commented on GitHub (Apr 17, 2024):
This also applies to the OpenAI API key. It gets lost every container restart, even with a volume present.
For me also the "Enable New Sign Ups" setting resets to "Enable" every time the container is restarted.
Especially this setting should persist, and honestly this looks more like a bug than a missing feature.
(I don't want bots to flood my server with pending accounts)
<!-- gh-comment-id:2067965353 -->
@ChaoticByte commented on GitHub (Apr 21, 2024):
For me also the "Enable New Sign Ups" setting resets to "Enable" every time the container is restarted.
Especially this setting should persist, and honestly this looks more like a bug than a missing feature.
(I don't want bots to flood my server with pending accounts)
Chiming in to point out that Embedding Model Engine (in Document Settings) set to OpenAI does not persist either. Also, OPENAI_API_BASE_URL & OPENAI_API_KEY do not seem to reflect there. However, Embedding Model can be updated by setting RAG_EMBEDDING_MODEL var.
<!-- gh-comment-id:2084596813 -->
@frost19k commented on GitHub (Apr 30, 2024):
Chiming in to point out that `Embedding Model Engine` (in Document Settings) set to `OpenAI` does not persist either. Also, `OPENAI_API_BASE_URL` & `OPENAI_API_KEY` do not seem to reflect there. However, `Embedding Model` can be updated by setting `RAG_EMBEDDING_MODEL` var.
Edit: Found the relevant env vars
```
RAG_EMBEDDING_ENGINE=openai
RAG_OPENAI_API_BASE_URL=''
RAG_OPENAI_API_KEY=''
RAG_EMBEDDING_MODEL=''
CHUNK_SIZE=1000
CHUNK_OVERLAP=20
```
<!-- gh-comment-id:2108098076 -->
@changchiyou commented on GitHub (May 13, 2024):
@JTHesse It's already possible to make `Default User Role` persistent:
According to
https://github.com/open-webui/open-webui/blob/90503be2edef1a1f7ce2074286b6316d5cb8868a/backend/config.py#L411
, create your own enviroment at
https://github.com/open-webui/open-webui/blob/90503be2edef1a1f7ce2074286b6316d5cb8868a/docker-compose.yaml#L27-L29
. For example:
```diff
environment:
- 'OLLAMA_BASE_URL=http://ollama:11434'
- 'WEBUI_SECRET_KEY='
+ - 'DEFAULT_USER_ROLE=user'
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @tjbck on GitHub (Mar 3, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/1022
Originally assigned to: @tjbck on GitHub.
Related #981 #988 #900
@changchiyou commented on GitHub (Mar 12, 2024):
I don't have a clear idea yet on how to persist settings to the backend, but may I ask if you would welcome me to create a workaround PR for #988 in the meantime?
Here's my idea: Even though there is no documentation mentioning it, I observed that users can set
DEFAULT_USER_ROLEin the environment variables and have it read by :https://github.com/open-webui/open-webui/blob/7ae4669f350ad30b44594c5e76759db445d9bf5d/backend/config.py#L290
Then assigned to
app.state.DEFAULT_USER_ROLEin:https://github.com/open-webui/open-webui/blob/7ae4669f350ad30b44594c5e76759db445d9bf5d/backend/apps/web/main.py#L33
Could I apply a similar logic to handle
USER_PERMISSIONSas well? For example:https://github.com/open-webui/open-webui/blob/7ae4669f350ad30b44594c5e76759db445d9bf5d/backend/config.py#L291
@Fusseldieb commented on GitHub (Apr 17, 2024):
This also applies to the OpenAI API key. It gets lost every container restart, even with a volume present.
@ChaoticByte commented on GitHub (Apr 21, 2024):
For me also the "Enable New Sign Ups" setting resets to "Enable" every time the container is restarted.
Especially this setting should persist, and honestly this looks more like a bug than a missing feature.
(I don't want bots to flood my server with pending accounts)
@frost19k commented on GitHub (Apr 30, 2024):
Chiming in to point out that
Embedding Model Engine(in Document Settings) set toOpenAIdoes not persist either. Also,OPENAI_API_BASE_URL&OPENAI_API_KEYdo not seem to reflect there. However,Embedding Modelcan be updated by settingRAG_EMBEDDING_MODELvar.Edit: Found the relevant env vars
@JTHesse commented on GitHub (May 13, 2024):
Please make
Default User Rolepersistent as well 🙃@changchiyou commented on GitHub (May 13, 2024):
@JTHesse It's already possible to make
Default User Rolepersistent:According to
https://github.com/open-webui/open-webui/blob/90503be2edef1a1f7ce2074286b6316d5cb8868a/backend/config.py#L411
, create your own enviroment at
https://github.com/open-webui/open-webui/blob/90503be2edef1a1f7ce2074286b6316d5cb8868a/docker-compose.yaml#L27-L29
. For example:
@mmmmmmmgo commented on GitHub (May 19, 2024):
https://github.com/open-webui/open-webui/discussions/1876
ENABLE_SIGNUP