From 34ddd629513bbba34bf8a9353212630e24d50e30 Mon Sep 17 00:00:00 2001 From: guenhter Date: Wed, 2 Jul 2025 14:43:57 +0200 Subject: [PATCH 1/2] feat: support suppressing version checks --- backend/open_webui/env.py | 5 ++++- backend/open_webui/main.py | 8 ++++---- src/lib/components/admin/Settings/General.svelte | 4 ++-- src/lib/components/chat/Settings/About.svelte | 4 ++-- src/lib/stores/index.ts | 1 + src/routes/(app)/+layout.svelte | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/backend/open_webui/env.py b/backend/open_webui/env.py index dafb7be13a..0bed0b2aa6 100644 --- a/backend/open_webui/env.py +++ b/backend/open_webui/env.py @@ -529,11 +529,14 @@ else: # OFFLINE_MODE #################################### +ENABLE_VERSION_UPDATE_CHECK = ( + os.environ.get("ENABLE_VERSION_UPDATE_CHECK", "true").lower() == "true" +) OFFLINE_MODE = os.environ.get("OFFLINE_MODE", "false").lower() == "true" if OFFLINE_MODE: os.environ["HF_HUB_OFFLINE"] = "1" - + ENABLE_VERSION_UPDATE_CHECK = False #################################### # AUDIT LOGGING diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 96b04aaed8..2940227012 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -418,7 +418,7 @@ from open_webui.env import ( ENABLE_WEBSOCKET_SUPPORT, BYPASS_MODEL_ACCESS_CONTROL, RESET_CONFIG_ON_START, - OFFLINE_MODE, + ENABLE_VERSION_UPDATE_CHECK, ENABLE_OTEL, EXTERNAL_PWA_MANIFEST_URL, AIOHTTP_CLIENT_SESSION_SSL, @@ -1546,7 +1546,6 @@ async def get_app_config(request: Request): "name": app.state.WEBUI_NAME, "version": VERSION, "default_locale": str(DEFAULT_LOCALE), - "offline_mode": OFFLINE_MODE, "oauth": { "providers": { name: config.get("name", name) @@ -1561,6 +1560,7 @@ async def get_app_config(request: Request): "enable_signup": app.state.config.ENABLE_SIGNUP, "enable_login_form": app.state.config.ENABLE_LOGIN_FORM, "enable_websocket": ENABLE_WEBSOCKET_SUPPORT, + "enable_version_update_check": ENABLE_VERSION_UPDATE_CHECK, **( { "enable_direct_connections": app.state.config.ENABLE_DIRECT_CONNECTIONS, @@ -1666,9 +1666,9 @@ async def get_app_version(): @app.get("/api/version/updates") async def get_app_latest_release_version(user=Depends(get_verified_user)): - if OFFLINE_MODE: + if not ENABLE_VERSION_UPDATE_CHECK: log.debug( - f"Offline mode is enabled, returning current version as latest version" + f"Version update check is disabled, returning current version as latest version" ) return {"current": VERSION, "latest": VERSION} try: diff --git a/src/lib/components/admin/Settings/General.svelte b/src/lib/components/admin/Settings/General.svelte index faad41d9b3..384a53db0f 100644 --- a/src/lib/components/admin/Settings/General.svelte +++ b/src/lib/components/admin/Settings/General.svelte @@ -90,7 +90,7 @@ }; onMount(async () => { - if (!$config?.offline_mode) { + if ($config?.features?.enable_version_update_check) { checkForVersionUpdates(); } @@ -162,7 +162,7 @@ - {#if !$config?.offline_mode} + {#if $config?.features?.enable_version_update_check}