Add native chat background and guarded HA YAML access

This commit is contained in:
Mikei386
2026-08-22 22:12:14 +02:00
parent b338c91878
commit ced8d36a0c
11 changed files with 838 additions and 125 deletions
+14
View File
@@ -72,6 +72,16 @@ if not owner:
)
owner = admins[0][0]
# Use Open WebUI's native per-user chat background. Keeping the value in the
# user's normal settings means the built-in contrast overlay, mobile layout
# and future UI migrations continue to work; custom.css must not replace this
# layer.
row = con.execute("select settings from user where id=?", (owner,)).fetchone()
if not row:
raise SystemExit("OpenWebUI model owner does not exist in user table.")
user_settings = json.loads(row[0] or "{}")
user_settings.setdefault("ui", {})["backgroundImageUrl"] = "/static/midnight-aurora.svg"
now = int(time.time())
filter_ids = [
"reasoning_default_off",
@@ -226,6 +236,10 @@ def set_config(key, value):
)
with con:
con.execute(
"update user set settings=? where id=?",
(json.dumps(user_settings, ensure_ascii=False), owner),
)
router_api_key = os.environ.get("OPENWEBUI_ROUTER_API_KEY", "")
if router_api_key:
set_config("openai.enable", True)