mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 19:37:47 +01:00
enh: option to disable api auth
This commit is contained in:
@@ -74,7 +74,6 @@ from open_webui.config import (
|
||||
ENABLE_ADMIN_EXPORT,
|
||||
ENABLE_OLLAMA_API,
|
||||
ENABLE_OPENAI_API,
|
||||
ENABLE_API_KEY_AUTH,
|
||||
ENABLE_TAGS_GENERATION,
|
||||
ENV,
|
||||
FRONTEND_BUILD_DIR,
|
||||
@@ -941,6 +940,7 @@ async def commit_session_after_request(request: Request, call_next):
|
||||
@app.middleware("http")
|
||||
async def check_url(request: Request, call_next):
|
||||
start_time = int(time.time())
|
||||
request.state.enable_api_key = webui_app.state.config.ENABLE_API_KEY
|
||||
response = await call_next(request)
|
||||
process_time = int(time.time()) - start_time
|
||||
response.headers["X-Process-Time"] = str(process_time)
|
||||
@@ -2428,7 +2428,7 @@ async def get_app_config(request: Request):
|
||||
"auth": WEBUI_AUTH,
|
||||
"auth_trusted_header": bool(webui_app.state.AUTH_TRUSTED_EMAIL_HEADER),
|
||||
"enable_ldap": webui_app.state.config.ENABLE_LDAP,
|
||||
"enable_api_key_auth": ENABLE_API_KEY_AUTH,
|
||||
"enable_api_key": webui_app.state.config.ENABLE_API_KEY,
|
||||
"enable_signup": webui_app.state.config.ENABLE_SIGNUP,
|
||||
"enable_login_form": webui_app.state.config.ENABLE_LOGIN_FORM,
|
||||
**(
|
||||
|
||||
Reference in New Issue
Block a user