feat(mail): adapt M365 ETL loop for OO+Gmail bots.
Tests / Test (push) Skipped
Tests / OCR (tesseract fixture) (push) Skipped
Tests / Release (semver) (push) Skipped
Tests / Test (pull_request) Failing after 6s
Tests / OCR (tesseract fixture) (pull_request) Failing after 4s
Tests / Release (semver) (pull_request) Skipped

Default compose mail-sync to onlyoffice,gmail every 300s with import on new
mail; gate full --rebuild behind MAIL_SYNC_INDEX. Fix mail-build stage order
and add bin/stack/start-mail-sync.
This commit is contained in:
2026-08-14 17:59:02 +01:00
parent 5ccca2fac9
commit b612d3cc97
11 changed files with 112 additions and 37 deletions
+12 -7
View File
@@ -92,11 +92,13 @@ services:
tmpfs:
- /tmp
# mail-sync: pull M365 (and OnlyOffice/Gmail) mail every 10 s into the shared
# var volume, then rebuild the brain index. Runs on the index image so it can
# convert + index in-process. Needs ~/.config/brain/m365.env for the M365
# source; override MAIL_SYNC_SRC / MAIL_SYNC_ENV for other providers.
# mail-sync ETL: sync → import every 300s into shared var. Full brain rebuild
# only when MAIL_SYNC_INDEX=1 (expensive on large mail corpora). Default
# sources: onlyoffice,gmail. For M365 set MAIL_SYNC_SRC=m365 and put
# M365_TENANT/CLIENT_ID/CLIENT_SECRET/USERS in ~/.config/brain/mail.env
# (or m365.env + MAIL_SYNC_ENV). Gmail OAuth: mount ~/.gmail-mcp.
# docker compose up -d mail-sync
# bin/stack/start-mail-sync
mail-sync:
image: ghcr.io/eslider/2dph:index
build:
@@ -106,13 +108,16 @@ services:
environment:
HF_HOME: /data/hf
KB_PY: python3
MAIL_SYNC_SRC: m365
MAIL_SYNC_ENV: /secret/m365.env
MAIL_SYNC_SRC: onlyoffice,gmail
MAIL_SYNC_ENV: /secret/mail.env
MAIL_SYNC_INDEX: "0"
HOME: /home/2dph
volumes:
- kb-model:/data/hf
- kb-var:/app/var
- ~/.config/brain:/secret:ro
command: ["mail-sync", "10"]
- ~/.gmail-mcp:/home/2dph/.gmail-mcp:ro
command: ["mail-sync", "300"]
read_only: true
tmpfs:
- /tmp