refac
This commit is contained in:
@@ -483,6 +483,9 @@ app.state.oauth_client_manager = oauth_client_manager
|
||||
app.state.instance_id = None
|
||||
app.state.redis = None
|
||||
|
||||
# LICENSE covers this Open WebUI name/logo/identifier.
|
||||
# Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
# https://docs.openwebui.com/license.
|
||||
app.state.WEBUI_NAME = WEBUI_NAME
|
||||
app.state.LICENSE_METADATA = None
|
||||
app.state.USER_COUNT = None
|
||||
@@ -2688,6 +2691,9 @@ async def oauth_backchannel_logout(
|
||||
async def get_manifest_json():
|
||||
external_pwa_manifest_url = getattr(app.state, 'EXTERNAL_PWA_MANIFEST_URL', None)
|
||||
if external_pwa_manifest_url:
|
||||
# LICENSE covers install-time Open WebUI branding.
|
||||
# Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
# https://docs.openwebui.com/license.
|
||||
session = await get_session()
|
||||
async with session.get(
|
||||
external_pwa_manifest_url,
|
||||
@@ -2696,6 +2702,9 @@ async def get_manifest_json():
|
||||
r.raise_for_status()
|
||||
return await r.json()
|
||||
else:
|
||||
# LICENSE covers generated Open WebUI install branding.
|
||||
# Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
# https://docs.openwebui.com/license.
|
||||
return {
|
||||
'name': app.state.WEBUI_NAME,
|
||||
'short_name': app.state.WEBUI_NAME,
|
||||
@@ -2704,6 +2713,9 @@ async def get_manifest_json():
|
||||
'display': 'standalone',
|
||||
'background_color': '#343541',
|
||||
'icons': [
|
||||
# LICENSE covers this Open WebUI install icon.
|
||||
# Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
# https://docs.openwebui.com/license.
|
||||
{
|
||||
'src': '/static/logo.png',
|
||||
'type': 'image/png',
|
||||
@@ -2728,6 +2740,9 @@ async def get_manifest_json():
|
||||
@app.get('/opensearch.xml')
|
||||
async def get_opensearch_xml():
|
||||
webui_url = await Config.get('webui.url')
|
||||
# LICENSE covers this Open WebUI search identifier.
|
||||
# Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
# https://docs.openwebui.com/license.
|
||||
xml_content = rf"""
|
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
|
||||
<ShortName>{app.state.WEBUI_NAME}</ShortName>
|
||||
|
||||
Reference in New Issue
Block a user