diff --git a/CHANGELOG.md b/CHANGELOG.md index abb1a1dbc..666fdb53d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.5.7] - 2025-01-23 + +### Added + +- **🌍 Enhanced Internationalization (i18n)**: Refined and expanded translations for greater global accessibility and a smoother experience for international users. + +### Fixed + +- **🔗 Connection Model ID Resolution**: Resolved an issue preventing model IDs from registering in connections. +- **💡 Prefix ID for Ollama Connections**: Fixed a bug where prefix IDs in Ollama connections were non-functional. +- **🔧 Ollama Model Enable/Disable Functionality**: Addressed the issue of enable/disable toggles not working for Ollama base models. +- **🔒 RBAC Permissions for Tools and Models**: Corrected incorrect Role-Based Access Control (RBAC) permissions for tools and models, ensuring that users now only access features according to their assigned privileges, enhancing security and role clarity. + ## [0.5.6] - 2025-01-22 ### Added diff --git a/backend/open_webui/routers/models.py b/backend/open_webui/routers/models.py index db981a913..6c8519b2c 100644 --- a/backend/open_webui/routers/models.py +++ b/backend/open_webui/routers/models.py @@ -155,6 +155,16 @@ async def update_model_by_id( detail=ERROR_MESSAGES.NOT_FOUND, ) + if ( + model.user_id != user.id + and not has_access(user.id, "write", model.access_control) + and user.role != "admin" + ): + raise HTTPException( + status_code=status.HTTP_400_BAD_REQUEST, + detail=ERROR_MESSAGES.ACCESS_PROHIBITED, + ) + model = Models.update_model_by_id(id, form_data) return model diff --git a/backend/open_webui/routers/ollama.py b/backend/open_webui/routers/ollama.py index 370e9ecec..261cd5ba3 100644 --- a/backend/open_webui/routers/ollama.py +++ b/backend/open_webui/routers/ollama.py @@ -962,7 +962,7 @@ async def get_ollama_url(request: Request, model: str, url_idx: Optional[int] = ) url_idx = random.choice(models[model].get("urls", [])) url = request.app.state.config.OLLAMA_BASE_URLS[url_idx] - return url + return url, url_idx @router.post("/api/chat") @@ -1030,7 +1030,7 @@ async def generate_chat_completion( if ":" not in payload["model"]: payload["model"] = f"{payload['model']}:latest" - url = await get_ollama_url(request, payload["model"], url_idx) + url, url_idx = await get_ollama_url(request, payload["model"], url_idx) api_config = request.app.state.config.OLLAMA_API_CONFIGS.get( str(url_idx), request.app.state.config.OLLAMA_API_CONFIGS.get(url, {}), # Legacy support @@ -1132,7 +1132,7 @@ async def generate_openai_completion( if ":" not in payload["model"]: payload["model"] = f"{payload['model']}:latest" - url = await get_ollama_url(request, payload["model"], url_idx) + url, url_idx = await get_ollama_url(request, payload["model"], url_idx) api_config = request.app.state.config.OLLAMA_API_CONFIGS.get( str(url_idx), request.app.state.config.OLLAMA_API_CONFIGS.get(url, {}), # Legacy support @@ -1209,7 +1209,7 @@ async def generate_openai_chat_completion( if ":" not in payload["model"]: payload["model"] = f"{payload['model']}:latest" - url = await get_ollama_url(request, payload["model"], url_idx) + url, url_idx = await get_ollama_url(request, payload["model"], url_idx) api_config = request.app.state.config.OLLAMA_API_CONFIGS.get( str(url_idx), request.app.state.config.OLLAMA_API_CONFIGS.get(url, {}), # Legacy support diff --git a/backend/open_webui/routers/tools.py b/backend/open_webui/routers/tools.py index bb19c6f3b..7b9144b4c 100644 --- a/backend/open_webui/routers/tools.py +++ b/backend/open_webui/routers/tools.py @@ -309,6 +309,17 @@ async def update_tools_valves_by_id( status_code=status.HTTP_401_UNAUTHORIZED, detail=ERROR_MESSAGES.NOT_FOUND, ) + + if ( + tools.user_id != user.id + and not has_access(user.id, "write", tools.access_control) + and user.role != "admin" + ): + raise HTTPException( + status_code=status.HTTP_400_BAD_REQUEST, + detail=ERROR_MESSAGES.ACCESS_PROHIBITED, + ) + if id in request.app.state.TOOLS: tools_module = request.app.state.TOOLS[id] else: diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index e256a8f82..6b2329be1 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -1078,7 +1078,7 @@ async def process_chat_response( # We might want to disable this by default detect_reasoning = True - reasoning_tags = ["think", "reason", "reasoning", "thought"] + reasoning_tags = ["think", "reason", "reasoning", "thought", "Thought"] current_tag = None reasoning_start_time = None @@ -1170,7 +1170,7 @@ async def process_chat_response( ) # Format reasoning with
tag - content = f'{ongoing_content}
\nThought for {reasoning_duration} seconds\n{reasoning_display_content}\n
\n' + content = f'{ongoing_content}
\nThought for {reasoning_duration} seconds\n{reasoning_display_content}\n
\n' else: content = "" diff --git a/package-lock.json b/package-lock.json index dd56f3348..c98e814d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "open-webui", - "version": "0.5.6", + "version": "0.5.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "open-webui", - "version": "0.5.6", + "version": "0.5.7", "dependencies": { "@codemirror/lang-javascript": "^6.2.2", "@codemirror/lang-python": "^6.1.6", diff --git a/package.json b/package.json index a89b1e416..a2463d9e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "open-webui", - "version": "0.5.6", + "version": "0.5.7", "private": true, "scripts": { "dev": "npm run pyodide:fetch && vite dev --host", diff --git a/src/lib/components/common/Collapsible.svelte b/src/lib/components/common/Collapsible.svelte index e6e980ea4..0e0c0a4df 100644 --- a/src/lib/components/common/Collapsible.svelte +++ b/src/lib/components/common/Collapsible.svelte @@ -1,5 +1,27 @@