diff --git a/backend/config.py b/backend/config.py index 7dd115a69..b6c642a9e 100644 --- a/backend/config.py +++ b/backend/config.py @@ -25,7 +25,7 @@ try: except ImportError: log.warning("dotenv not installed, skipping...") -WEBUI_NAME = "Open WebUI" +WEBUI_NAME = os.environ.get("WEBUI_NAME", "Open WebUI") WEBUI_FAVICON_URL = "https://openwebui.com/favicon.png" shutil.copyfile("../build/favicon.png", "./static/favicon.png") diff --git a/backend/main.py b/backend/main.py index f2d2a1546..f574e7bab 100644 --- a/backend/main.py +++ b/backend/main.py @@ -84,7 +84,6 @@ app.state.MODEL_FILTER_LIST = MODEL_FILTER_LIST app.state.WEBHOOK_URL = WEBHOOK_URL - origins = ["*"] @@ -284,6 +283,20 @@ async def get_app_latest_release_version(): ) +@app.get("/manifest.json") +async def get_manifest_json(): + return { + "name": WEBUI_NAME, + "short_name": WEBUI_NAME, + "start_url": "/", + "display": "standalone", + "background_color": "#343541", + "theme_color": "#343541", + "orientation": "portrait-primary", + "icons": [{"src": "/favicon.png", "type": "image/png", "sizes": "844x884"}], + } + + app.mount("/static", StaticFiles(directory="static"), name="static") app.mount("/cache", StaticFiles(directory="data/cache"), name="cache") diff --git a/static/manifest.json b/static/manifest.json deleted file mode 100644 index ee019bd90..000000000 --- a/static/manifest.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "Open WebUI", - "short_name": "Open WebUI", - "start_url": "/", - "display": "standalone", - "background_color": "#343541", - "theme_color": "#343541", - "orientation": "portrait-primary", - "icons": [ - { - "src": "/favicon.png", - "type": "image/png", - "sizes": "844x884" - } - ] -}