mirror of
https://github.com/open-webui/open-webui
synced 2025-05-24 06:44:24 +00:00
Merge pull request #12717 from Kheiden/progressive-webapp-enhancements
feat: Add PWA external manifest URL env var
This commit is contained in:
commit
4cbf16c456
@ -479,3 +479,10 @@ OTEL_TRACES_SAMPLER = os.environ.get(
|
|||||||
|
|
||||||
PIP_OPTIONS = os.getenv("PIP_OPTIONS", "").split()
|
PIP_OPTIONS = os.getenv("PIP_OPTIONS", "").split()
|
||||||
PIP_PACKAGE_INDEX_OPTIONS = os.getenv("PIP_PACKAGE_INDEX_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")
|
@ -342,6 +342,7 @@ from open_webui.env import (
|
|||||||
RESET_CONFIG_ON_START,
|
RESET_CONFIG_ON_START,
|
||||||
OFFLINE_MODE,
|
OFFLINE_MODE,
|
||||||
ENABLE_OTEL,
|
ENABLE_OTEL,
|
||||||
|
EXTERNAL_PWA_MANIFEST_URL,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -567,6 +568,7 @@ app.state.config.LDAP_CIPHERS = LDAP_CIPHERS
|
|||||||
|
|
||||||
app.state.AUTH_TRUSTED_EMAIL_HEADER = WEBUI_AUTH_TRUSTED_EMAIL_HEADER
|
app.state.AUTH_TRUSTED_EMAIL_HEADER = WEBUI_AUTH_TRUSTED_EMAIL_HEADER
|
||||||
app.state.AUTH_TRUSTED_NAME_HEADER = WEBUI_AUTH_TRUSTED_NAME_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.USER_COUNT = None
|
||||||
app.state.TOOLS = {}
|
app.state.TOOLS = {}
|
||||||
@ -1398,6 +1400,9 @@ async def oauth_callback(provider: str, request: Request, response: Response):
|
|||||||
|
|
||||||
@app.get("/manifest.json")
|
@app.get("/manifest.json")
|
||||||
async def get_manifest_json():
|
async def get_manifest_json():
|
||||||
|
if app.state.EXTERNAL_PWA_MANIFEST_URL:
|
||||||
|
return requests.get(app.state.EXTERNAL_PWA_MANIFEST_URL).json()
|
||||||
|
else:
|
||||||
return {
|
return {
|
||||||
"name": app.state.WEBUI_NAME,
|
"name": app.state.WEBUI_NAME,
|
||||||
"short_name": app.state.WEBUI_NAME,
|
"short_name": app.state.WEBUI_NAME,
|
||||||
|
Loading…
Reference in New Issue
Block a user