chore: format

This commit is contained in:
Timothy Jaeryang Baek
2025-03-04 00:32:27 -08:00
parent 8697f72068
commit 39ea59edc8
56 changed files with 449 additions and 112 deletions

View File

@@ -71,8 +71,9 @@ def override_static(path: str, content: str):
def get_license_data(app, key):
if key:
try:
# https://api.openwebui.com
res = requests.post(
"https://api.openwebui.com/api/v1/license",
"http://localhost:5555/api/v1/license",
json={"key": key, "version": "1"},
timeout=5,
)
@@ -83,11 +84,12 @@ def get_license_data(app, key):
if k == "resources":
for p, c in v.items():
globals().get("override_static", lambda a, b: None)(p, c)
elif k == "user_count":
elif k == "count":
setattr(app.state, "USER_COUNT", v)
elif k == "webui_name":
elif k == "name":
setattr(app.state, "WEBUI_NAME", v)
elif k == "info":
setattr(app.state, "LICENSE_INFO", v)
return True
else:
log.error(