diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index 8e922dff7..48c623bef 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -847,6 +847,12 @@ USER_PERMISSIONS = PersistentConfig( }, ) +ENABLE_CHANNELS = PersistentConfig( + "ENABLE_CHANNELS", + "channels.enable", + os.environ.get("ENABLE_CHANNELS", "False").lower() == "true", +) + ENABLE_EVALUATION_ARENA_MODELS = PersistentConfig( "ENABLE_EVALUATION_ARENA_MODELS", diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index a5f349278..d1cca2ac4 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -199,6 +199,7 @@ from open_webui.config import ( ENABLE_SIGNUP, ENABLE_LOGIN_FORM, ENABLE_API_KEY, + ENABLE_CHANNELS, ENABLE_COMMUNITY_SHARING, ENABLE_MESSAGE_RATING, ENABLE_EVALUATION_ARENA_MODELS, @@ -407,6 +408,8 @@ app.state.config.WEBHOOK_URL = WEBHOOK_URL app.state.config.BANNERS = WEBUI_BANNERS app.state.config.MODEL_ORDER_LIST = MODEL_ORDER_LIST + +app.state.config.ENABLE_CHANNELS = ENABLE_CHANNELS app.state.config.ENABLE_COMMUNITY_SHARING = ENABLE_COMMUNITY_SHARING app.state.config.ENABLE_MESSAGE_RATING = ENABLE_MESSAGE_RATING @@ -972,6 +975,7 @@ async def get_app_config(request: Request): "enable_websocket": ENABLE_WEBSOCKET_SUPPORT, **( { + "enable_channels": app.state.config.ENABLE_CHANNELS, "enable_web_search": app.state.config.ENABLE_RAG_WEB_SEARCH, "enable_google_drive_integration": app.state.config.ENABLE_GOOGLE_DRIVE_INTEGRATION, "enable_image_generation": app.state.config.ENABLE_IMAGE_GENERATION, diff --git a/backend/open_webui/routers/auths.py b/backend/open_webui/routers/auths.py index 0b1f42edf..26b909376 100644 --- a/backend/open_webui/routers/auths.py +++ b/backend/open_webui/routers/auths.py @@ -616,6 +616,7 @@ async def get_admin_config(request: Request, user=Depends(get_admin_user)): "SHOW_ADMIN_DETAILS": request.app.state.config.SHOW_ADMIN_DETAILS, "ENABLE_SIGNUP": request.app.state.config.ENABLE_SIGNUP, "ENABLE_API_KEY": request.app.state.config.ENABLE_API_KEY, + "ENABLE_CHANNELS": request.app.state.config.ENABLE_CHANNELS, "DEFAULT_USER_ROLE": request.app.state.config.DEFAULT_USER_ROLE, "JWT_EXPIRES_IN": request.app.state.config.JWT_EXPIRES_IN, "ENABLE_COMMUNITY_SHARING": request.app.state.config.ENABLE_COMMUNITY_SHARING, @@ -627,6 +628,7 @@ class AdminConfig(BaseModel): SHOW_ADMIN_DETAILS: bool ENABLE_SIGNUP: bool ENABLE_API_KEY: bool + ENABLE_CHANNELS: bool DEFAULT_USER_ROLE: str JWT_EXPIRES_IN: str ENABLE_COMMUNITY_SHARING: bool @@ -640,6 +642,7 @@ async def update_admin_config( request.app.state.config.SHOW_ADMIN_DETAILS = form_data.SHOW_ADMIN_DETAILS request.app.state.config.ENABLE_SIGNUP = form_data.ENABLE_SIGNUP request.app.state.config.ENABLE_API_KEY = form_data.ENABLE_API_KEY + request.app.state.config.ENABLE_CHANNELS = form_data.ENABLE_CHANNELS if form_data.DEFAULT_USER_ROLE in ["pending", "user", "admin"]: request.app.state.config.DEFAULT_USER_ROLE = form_data.DEFAULT_USER_ROLE diff --git a/src/lib/components/admin/Settings/General.svelte b/src/lib/components/admin/Settings/General.svelte index 8fabe5bce..ce3cfec26 100644 --- a/src/lib/components/admin/Settings/General.svelte +++ b/src/lib/components/admin/Settings/General.svelte @@ -112,7 +112,7 @@ -