Compare commits

..

No commits in common. "025228b83cea2921f375126ef1c53bee573965de" and "d5a3528cdedd0bff9ec6b43725d0eae62540d650" have entirely different histories.

5 changed files with 1118 additions and 123 deletions

View file

@ -11,6 +11,7 @@ Designed for rooms bridged from WhatsApp via mautrix-whatsapp.
## Requirements ## Requirements
- Python 3.11+ - Python 3.11+
- [uv](https://docs.astral.sh/uv/) (`curl -LsSf https://astral.sh/uv/install.sh | sh`)
- `libolm` + `python-olm` — must be installed via the system package manager - `libolm` + `python-olm` — must be installed via the system package manager
because `python-olm`'s build system is incompatible with modern CMake because `python-olm`'s build system is incompatible with modern CMake
@ -31,8 +32,8 @@ sudo apt install libolm3 python3-olm
```bash ```bash
git clone <repo> git clone <repo>
cd matrix-paperless-ingest cd matrix-paperless-ingest
python3 -m venv .venv --system-site-packages uv venv --system-site-packages
.venv/bin/pip install -r requirements.txt uv sync --no-install-package python-olm
``` ```
### 2. Create a Matrix bot account ### 2. Create a Matrix bot account
@ -95,37 +96,29 @@ PAPERLESS_INBOX_TAG_ID=1
### 7. Test ### 7. Test
```bash ```bash
.venv/bin/python ingest.py uv run --no-sync python ingest.py
``` ```
Watch the logs. It will process all historical messages, then listen for new ones. Watch the logs. It will process all historical messages, then listen for new ones.
Press Ctrl-C to stop. Press Ctrl-C to stop.
## Install as a systemd user service ## Install as a systemd service
```bash ```bash
# Enable lingering so the service starts at boot without requiring login # Create a dedicated user
loginctl enable-linger sudo useradd -r -s /bin/false matrix-paperless-ingest
# Install the service # Copy the project
mkdir -p ~/.config/systemd/user sudo cp -r . /opt/matrix-paperless-ingest
cp matrix-paperless-ingest.service ~/.config/systemd/user/ sudo chown -R matrix-paperless-ingest:matrix-paperless-ingest /opt/matrix-paperless-ingest
systemctl --user daemon-reload
systemctl --user enable --now matrix-paperless-ingest # Install and start the service
sudo cp paperless-ingest.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now paperless-ingest
# Check logs # Check logs
journalctl --user -u matrix-paperless-ingest -f sudo journalctl -u paperless-ingest -f
```
## Updating dependencies
If you need to add or update a dependency, edit `pyproject.toml` and regenerate
the locked `requirements.txt`:
```bash
.venv/bin/pip install pip-tools
.venv/bin/pip-compile pyproject.toml
.venv/bin/pip install -r requirements.txt
``` ```
## Viewing retry queue ## Viewing retry queue
@ -136,7 +129,7 @@ sqlite3 state.db "SELECT filename, status, retry_count, datetime(next_retry, 'un
## Moving to a new server ## Moving to a new server
1. Copy the project directory to `~/matrix-paperless-ingest` (including `.env` and `state.db`) 1. Copy the project directory (including `.env` and `state.db`)
2. Install `libolm3` and `python3-olm` via the system package manager 2. Install `uv`, `libolm3`, and `python3-olm` on the new server
3. Run `python3 -m venv .venv --system-site-packages && .venv/bin/pip install -r requirements.txt` 3. Run `uv venv --system-site-packages && uv sync --no-install-package python-olm`
4. Install the systemd user service as above 4. Install the systemd service as above

View file

@ -5,13 +5,14 @@ Wants=network-online.target
[Service] [Service]
Type=simple Type=simple
WorkingDirectory=%h/matrix-paperless-ingest User=matrix-paperless-ingest
EnvironmentFile=%h/matrix-paperless-ingest/.env WorkingDirectory=/opt/matrix-paperless-ingest
ExecStart=%h/matrix-paperless-ingest/.venv/bin/python ingest.py EnvironmentFile=/opt/matrix-paperless-ingest/.env
ExecStart=uv run --no-sync python ingest.py
Restart=on-failure Restart=on-failure
RestartSec=10 RestartSec=10
StandardOutput=journal StandardOutput=journal
StandardError=journal StandardError=journal
[Install] [Install]
WantedBy=default.target WantedBy=multi-user.target

View file

@ -10,3 +10,6 @@ dependencies = [
"aiosqlite>=0.20", "aiosqlite>=0.20",
] ]
[tool.uv]
package = false

View file

@ -1,92 +0,0 @@
aiofiles==24.1.0
# via matrix-nio
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.13.3
# via
# aiohttp-socks
# matrix-nio
aiohttp-socks==0.11.0
# via matrix-nio
aiosignal==1.4.0
# via aiohttp
aiosqlite==0.22.1
# via matrix-paperless-ingest (pyproject.toml)
anyio==4.12.1
# via httpx
atomicwrites==1.4.1
# via matrix-nio
attrs==25.4.0
# via
# aiohttp
# jsonschema
# referencing
cachetools==5.5.2
# via matrix-nio
certifi==2026.2.25
# via
# httpcore
# httpx
cffi==2.0.0
# via python-olm
frozenlist==1.8.0
# via
# aiohttp
# aiosignal
h11==0.16.0
# via
# httpcore
# matrix-nio
h2==4.3.0
# via matrix-nio
hpack==4.1.0
# via h2
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via matrix-paperless-ingest (pyproject.toml)
hyperframe==6.1.0
# via h2
idna==3.11
# via
# anyio
# httpx
# yarl
jsonschema==4.26.0
# via matrix-nio
jsonschema-specifications==2025.9.1
# via jsonschema
matrix-nio[e2e]==0.25.2
# via matrix-paperless-ingest (pyproject.toml)
multidict==6.7.1
# via
# aiohttp
# yarl
peewee==3.19.0
# via matrix-nio
propcache==0.4.1
# via
# aiohttp
# yarl
pycparser==3.0
# via cffi
pycryptodome==3.23.0
# via matrix-nio
python-dotenv==1.2.2
# via matrix-paperless-ingest (pyproject.toml)
python-olm==3.2.16
# via matrix-nio
python-socks[asyncio]==2.8.1
# via aiohttp-socks
referencing==0.37.0
# via
# jsonschema
# jsonschema-specifications
rpds-py==0.30.0
# via
# jsonschema
# referencing
unpaddedbase64==2.1.0
# via matrix-nio
yarl==1.23.0
# via aiohttp

1090
uv.lock generated Normal file

File diff suppressed because it is too large Load diff