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}