ingest: Initial implementation

Bot that monitors a Matrix room for PDF and JPEG files and uploads
them to Paperless-ngx. Supports E2E encrypted attachments via inline
AES keys, historical catchup on startup, exponential backoff retries
with a permanent give-up after max attempts, file format validation
via magic bytes, Uptime Kuma heartbeat monitoring, and email alerts
on errors via SMTP SSL.
This commit is contained in:
Jeena 2026-03-11 13:43:48 +00:00
commit d5a3528cde
7 changed files with 1844 additions and 0 deletions

24
.env.example Normal file
View file

@ -0,0 +1,24 @@
MATRIX_HOMESERVER=https://jeena.net
MATRIX_USER=@bot:jeena.net
MATRIX_ACCESS_TOKEN=syt_...
MATRIX_DEVICE_ID=ABCDEFGH
MATRIX_ROOM_ID=!roomid:jeena.net
PAPERLESS_URL=https://paperless.jeena.net
PAPERLESS_TOKEN=your_paperless_api_token
PAPERLESS_INBOX_TAG_ID=1
# Optional: path to the SQLite state database (default: state.db next to the script)
DB_PATH=state.db
# Optional: Uptime Kuma push monitor URL for heartbeat monitoring
# Create a Push monitor in Uptime Kuma and paste the URL here.
# UPTIME_KUMA_PUSH_URL=https://uptime.example.com/api/push/xxxx?status=up&msg=OK&ping=
# Optional: email alerts on errors
# SMTP_HOST=mail.jeena.net
# SMTP_PORT=465
# SMTP_USER=user@jeena.net
# SMTP_PASSWORD=yourpassword
# ALERT_FROM=paperless-ingest@jeena.net
# ALERT_TO=you@jeena.net