mirror of
https://github.com/open-webui/open-webui
synced 2025-01-29 13:58:09 +00:00
Merge pull request #6003 from saravanan30erd/dev
add offline_mode and disable version check
This commit is contained in:
commit
89a29653b8
@ -355,3 +355,9 @@ else:
|
|||||||
AIOHTTP_CLIENT_TIMEOUT = int(AIOHTTP_CLIENT_TIMEOUT)
|
AIOHTTP_CLIENT_TIMEOUT = int(AIOHTTP_CLIENT_TIMEOUT)
|
||||||
except Exception:
|
except Exception:
|
||||||
AIOHTTP_CLIENT_TIMEOUT = 300
|
AIOHTTP_CLIENT_TIMEOUT = 300
|
||||||
|
|
||||||
|
####################################
|
||||||
|
# OFFLINE_MODE
|
||||||
|
####################################
|
||||||
|
|
||||||
|
OFFLINE_MODE = os.environ.get("OFFLINE_MODE", "false").lower() == "true"
|
||||||
|
@ -102,6 +102,7 @@ from open_webui.env import (
|
|||||||
WEBUI_SESSION_COOKIE_SECURE,
|
WEBUI_SESSION_COOKIE_SECURE,
|
||||||
WEBUI_URL,
|
WEBUI_URL,
|
||||||
RESET_CONFIG_ON_START,
|
RESET_CONFIG_ON_START,
|
||||||
|
OFFLINE_MODE,
|
||||||
)
|
)
|
||||||
from fastapi import (
|
from fastapi import (
|
||||||
Depends,
|
Depends,
|
||||||
@ -178,14 +179,14 @@ class SPAStaticFiles(StaticFiles):
|
|||||||
|
|
||||||
print(
|
print(
|
||||||
rf"""
|
rf"""
|
||||||
___ __ __ _ _ _ ___
|
___ __ __ _ _ _ ___
|
||||||
/ _ \ _ __ ___ _ __ \ \ / /__| |__ | | | |_ _|
|
/ _ \ _ __ ___ _ __ \ \ / /__| |__ | | | |_ _|
|
||||||
| | | | '_ \ / _ \ '_ \ \ \ /\ / / _ \ '_ \| | | || |
|
| | | | '_ \ / _ \ '_ \ \ \ /\ / / _ \ '_ \| | | || |
|
||||||
| |_| | |_) | __/ | | | \ V V / __/ |_) | |_| || |
|
| |_| | |_) | __/ | | | \ V V / __/ |_) | |_| || |
|
||||||
\___/| .__/ \___|_| |_| \_/\_/ \___|_.__/ \___/|___|
|
\___/| .__/ \___|_| |_| \_/\_/ \___|_.__/ \___/|___|
|
||||||
|_|
|
|_|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
v{VERSION} - building the best open-source AI user interface.
|
v{VERSION} - building the best open-source AI user interface.
|
||||||
{f"Commit: {WEBUI_BUILD_HASH}" if WEBUI_BUILD_HASH != "dev-build" else ""}
|
{f"Commit: {WEBUI_BUILD_HASH}" if WEBUI_BUILD_HASH != "dev-build" else ""}
|
||||||
https://github.com/open-webui/open-webui
|
https://github.com/open-webui/open-webui
|
||||||
@ -2207,6 +2208,11 @@ async def get_app_changelog():
|
|||||||
|
|
||||||
@app.get("/api/version/updates")
|
@app.get("/api/version/updates")
|
||||||
async def get_app_latest_release_version():
|
async def get_app_latest_release_version():
|
||||||
|
if OFFLINE_MODE:
|
||||||
|
log.debug(
|
||||||
|
f"Offline mode is enabled, returning current version as latest version"
|
||||||
|
)
|
||||||
|
return {"current": VERSION, "latest": VERSION}
|
||||||
try:
|
try:
|
||||||
timeout = aiohttp.ClientTimeout(total=1)
|
timeout = aiohttp.ClientTimeout(total=1)
|
||||||
async with aiohttp.ClientSession(timeout=timeout, trust_env=True) as session:
|
async with aiohttp.ClientSession(timeout=timeout, trust_env=True) as session:
|
||||||
|
Loading…
Reference in New Issue
Block a user