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
- 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
because `python-olm`'s build system is incompatible with modern CMake
@ -31,8 +32,8 @@ sudo apt install libolm3 python3-olm
```bash
git clone <repo>
cd matrix-paperless-ingest
python3 -m venv .venv --system-site-packages
.venv/bin/pip install -r requirements.txt
uv venv --system-site-packages
uv sync --no-install-package python-olm
```
### 2. Create a Matrix bot account
@ -95,37 +96,29 @@ PAPERLESS_INBOX_TAG_ID=1
### 7. Test
```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.
Press Ctrl-C to stop.
## Install as a systemd user service
## Install as a systemd service
```bash
# Enable lingering so the service starts at boot without requiring login
loginctl enable-linger
# Create a dedicated user
sudo useradd -r -s /bin/false matrix-paperless-ingest
# Install the service
mkdir -p ~/.config/systemd/user
cp matrix-paperless-ingest.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now matrix-paperless-ingest
# Copy the project
sudo cp -r . /opt/matrix-paperless-ingest
sudo chown -R matrix-paperless-ingest:matrix-paperless-ingest /opt/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
journalctl --user -u matrix-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
sudo journalctl -u paperless-ingest -f
```
## Viewing retry queue
@ -136,7 +129,7 @@ sqlite3 state.db "SELECT filename, status, retry_count, datetime(next_retry, 'un
## Moving to a new server
1. Copy the project directory to `~/matrix-paperless-ingest` (including `.env` and `state.db`)
2. Install `libolm3` and `python3-olm` via the system package manager
3. Run `python3 -m venv .venv --system-site-packages && .venv/bin/pip install -r requirements.txt`
4. Install the systemd user service as above
1. Copy the project directory (including `.env` and `state.db`)
2. Install `uv`, `libolm3`, and `python3-olm` on the new server
3. Run `uv venv --system-site-packages && uv sync --no-install-package python-olm`
4. Install the systemd service as above

View file

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

View file

@ -10,3 +10,6 @@ dependencies = [
"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