feat(PROJ-35): OCR & Anhang-Volltext-Indexierung

Asynchrone OCR fuer PDF- und Bild-Anhaenge via tesseract + poppler-utils.
Extrahierter Text wird in Manticore (attachment_text) gespeichert und ist
ueber die normale Volltextsuche auffindbar.

- internal/ocr: ExtractText + Worker (queue + drain)
- internal/storage/ocr.go: SetOCRStatus, OCREnabled, GetMailsByOCRStatus
- emails.ocr_status (pending|done|failed|skipped|disabled)
- tenants.ocr_enabled (Default TRUE, opt-out)
- Manticore: attachment_text-Feld + UpdateAttachmentText
- Boot-resume: pending Jobs nach Restart automatisch in die Queue
- CLI: archivmail ocr-reprocess --tenant N --status pending|failed|all
- update.sh: tesseract-ocr + poppler-utils optional installieren
This commit is contained in:
sysops
2026-05-08 22:11:17 +02:00
parent 2a91f6e249
commit 0bda21033e
11 changed files with 926 additions and 25 deletions
+11
View File
@@ -77,6 +77,17 @@ if systemctl list-unit-files manticore.service >/dev/null 2>&1; then
systemctl is-active --quiet manticore && log "Manticore Search läuft"
fi
# ── OCR-Tools (PROJ-35: tesseract + poppler) ──────────────────────────────
# Optional: ohne diese Tools fällt OCR auf "deaktiviert" zurück, kein Abbruch.
if ! command -v tesseract >/dev/null 2>&1 || ! command -v pdftotext >/dev/null 2>&1; then
info "Installiere OCR-Tools (tesseract, poppler-utils)..."
apt-get install -y tesseract-ocr tesseract-ocr-deu poppler-utils 2>/dev/null || \
warn "OCR-Tools konnten nicht installiert werden — OCR wird deaktiviert"
fi
if command -v tesseract >/dev/null 2>&1 && command -v pdftotext >/dev/null 2>&1; then
log "OCR-Tools verfügbar (tesseract $(tesseract --version 2>&1 | head -1 | awk '{print $2}'))"
fi
# ── Quellcode holen ───────────────────────────────────────────────────────
if [[ -d "$BUILD_DIR/.git" ]]; then