mirror of
https://github.com/open-webui/open-webui
synced 2025-05-03 04:21:46 +00:00
Add PWA external manifest URL env var
This commit is contained in:
parent
38d5b03685
commit
c12f8d28b9
@ -474,3 +474,10 @@ OTEL_TRACES_SAMPLER = os.environ.get(
|
||||
|
||||
PIP_OPTIONS = os.getenv("PIP_OPTIONS", "").split()
|
||||
PIP_PACKAGE_INDEX_OPTIONS = os.getenv("PIP_PACKAGE_INDEX_OPTIONS", "").split()
|
||||
|
||||
|
||||
####################################
|
||||
# PROGRESSIVE WEB APP OPTIONS
|
||||
####################################
|
||||
|
||||
EXTERNAL_PWA_MANIFEST_URL = os.environ.get("EXTERNAL_PWA_MANIFEST_URL")
|
@ -340,6 +340,7 @@ from open_webui.env import (
|
||||
RESET_CONFIG_ON_START,
|
||||
OFFLINE_MODE,
|
||||
ENABLE_OTEL,
|
||||
EXTERNAL_PWA_MANIFEST_URL,
|
||||
)
|
||||
|
||||
|
||||
@ -564,6 +565,7 @@ app.state.config.LDAP_CIPHERS = LDAP_CIPHERS
|
||||
|
||||
app.state.AUTH_TRUSTED_EMAIL_HEADER = WEBUI_AUTH_TRUSTED_EMAIL_HEADER
|
||||
app.state.AUTH_TRUSTED_NAME_HEADER = WEBUI_AUTH_TRUSTED_NAME_HEADER
|
||||
app.state.EXTERNAL_PWA_MANIFEST_URL = EXTERNAL_PWA_MANIFEST_URL
|
||||
|
||||
app.state.USER_COUNT = None
|
||||
app.state.TOOLS = {}
|
||||
@ -1393,29 +1395,32 @@ async def oauth_callback(provider: str, request: Request, response: Response):
|
||||
|
||||
@app.get("/manifest.json")
|
||||
async def get_manifest_json():
|
||||
return {
|
||||
"name": app.state.WEBUI_NAME,
|
||||
"short_name": app.state.WEBUI_NAME,
|
||||
"description": "Open WebUI is an open, extensible, user-friendly interface for AI that adapts to your workflow.",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#343541",
|
||||
"orientation": "natural",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/static/logo.png",
|
||||
"type": "image/png",
|
||||
"sizes": "500x500",
|
||||
"purpose": "any",
|
||||
},
|
||||
{
|
||||
"src": "/static/logo.png",
|
||||
"type": "image/png",
|
||||
"sizes": "500x500",
|
||||
"purpose": "maskable",
|
||||
},
|
||||
],
|
||||
}
|
||||
if app.state.EXTERNAL_PWA_MANIFEST_URL:
|
||||
return requests.get(app.state.EXTERNAL_PWA_MANIFEST_URL).json()
|
||||
else:
|
||||
return {
|
||||
"name": app.state.WEBUI_NAME,
|
||||
"short_name": app.state.WEBUI_NAME,
|
||||
"description": "Open WebUI is an open, extensible, user-friendly interface for AI that adapts to your workflow.",
|
||||
"start_url": "/",
|
||||
"display": "standalone",
|
||||
"background_color": "#343541",
|
||||
"orientation": "natural",
|
||||
"icons": [
|
||||
{
|
||||
"src": "/static/logo.png",
|
||||
"type": "image/png",
|
||||
"sizes": "500x500",
|
||||
"purpose": "any",
|
||||
},
|
||||
{
|
||||
"src": "/static/logo.png",
|
||||
"type": "image/png",
|
||||
"sizes": "500x500",
|
||||
"purpose": "maskable",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
|
||||
@app.get("/opensearch.xml")
|
||||
|
Loading…
Reference in New Issue
Block a user