OpenWebUI integration

This commit is contained in:
2025-09-07 10:42:27 +02:00
parent bb0c5cc8ff
commit e3478fb77e
12 changed files with 362 additions and 71 deletions

View File

@@ -5,7 +5,7 @@ from bs4 import BeautifulSoup
import requests
MEILI_URL = os.getenv("MEILI_URL","http://localhost:7700")
MEILI_KEY = os.getenv("MEILI_KEY","devkey")
MEILI_KEY = os.getenv("MEILI_KEY","change_me")
def post(doc):
r = requests.post(f"{MEILI_URL}/indexes/library/documents",
@@ -26,7 +26,7 @@ for path in sys.argv[1:]:
doc = {
"id": hashlib.sha1((path+item.get_name()).encode()).hexdigest(),
"type": "epub",
"title": f"{title} {item.get_name()}",
"title": f"{title} - {item.get_name()}",
"source": f"file://{os.path.abspath(path)}",
"date": "",
"text": text,

View File

@@ -2,7 +2,7 @@
set -euo pipefail
ZIM="$1"
BASE_URL=${MEILI_URL:-http://localhost:7700}
KEY=${MEILI_KEY:-devkey}
KEY=${MEILI_KEY:-change_me}
zimdump list "$ZIM" --json | jq -rc '.[] | select(.mimetype=="text/html") | .path' | while read -r path; do
html="$(zimdump dump "$ZIM" "$path" 2>/dev/null || true)"

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
BASE_URL=${MEILI_URL:-http://localhost:7700}
KEY=${MEILI_KEY:-devkey}
KEY=${MEILI_KEY:-change_me}
for pdf in "$@"; do
title="$(basename "$pdf")"