Compare commits
2 commits
d5a3528cde
...
025228b83c
| Author | SHA1 | Date | |
|---|---|---|---|
| 025228b83c | |||
| b2646222f8 |
5 changed files with 123 additions and 1118 deletions
47
README.md
47
README.md
|
|
@ -11,7 +11,6 @@ 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
|
||||||
|
|
||||||
|
|
@ -32,8 +31,8 @@ sudo apt install libolm3 python3-olm
|
||||||
```bash
|
```bash
|
||||||
git clone <repo>
|
git clone <repo>
|
||||||
cd matrix-paperless-ingest
|
cd matrix-paperless-ingest
|
||||||
uv venv --system-site-packages
|
python3 -m venv .venv --system-site-packages
|
||||||
uv sync --no-install-package python-olm
|
.venv/bin/pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Create a Matrix bot account
|
### 2. Create a Matrix bot account
|
||||||
|
|
@ -96,29 +95,37 @@ PAPERLESS_INBOX_TAG_ID=1
|
||||||
### 7. Test
|
### 7. Test
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
uv run --no-sync python ingest.py
|
.venv/bin/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 service
|
## Install as a systemd user service
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Create a dedicated user
|
# Enable lingering so the service starts at boot without requiring login
|
||||||
sudo useradd -r -s /bin/false matrix-paperless-ingest
|
loginctl enable-linger
|
||||||
|
|
||||||
# Copy the project
|
# Install the service
|
||||||
sudo cp -r . /opt/matrix-paperless-ingest
|
mkdir -p ~/.config/systemd/user
|
||||||
sudo chown -R matrix-paperless-ingest:matrix-paperless-ingest /opt/matrix-paperless-ingest
|
cp matrix-paperless-ingest.service ~/.config/systemd/user/
|
||||||
|
systemctl --user daemon-reload
|
||||||
# Install and start the service
|
systemctl --user enable --now matrix-paperless-ingest
|
||||||
sudo cp paperless-ingest.service /etc/systemd/system/
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
sudo systemctl enable --now paperless-ingest
|
|
||||||
|
|
||||||
# Check logs
|
# Check logs
|
||||||
sudo journalctl -u paperless-ingest -f
|
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
|
||||||
```
|
```
|
||||||
|
|
||||||
## Viewing retry queue
|
## Viewing retry queue
|
||||||
|
|
@ -129,7 +136,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 (including `.env` and `state.db`)
|
1. Copy the project directory to `~/matrix-paperless-ingest` (including `.env` and `state.db`)
|
||||||
2. Install `uv`, `libolm3`, and `python3-olm` on the new server
|
2. Install `libolm3` and `python3-olm` via the system package manager
|
||||||
3. Run `uv venv --system-site-packages && uv sync --no-install-package python-olm`
|
3. Run `python3 -m venv .venv --system-site-packages && .venv/bin/pip install -r requirements.txt`
|
||||||
4. Install the systemd service as above
|
4. Install the systemd user service as above
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,13 @@ Wants=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
User=matrix-paperless-ingest
|
WorkingDirectory=%h/matrix-paperless-ingest
|
||||||
WorkingDirectory=/opt/matrix-paperless-ingest
|
EnvironmentFile=%h/matrix-paperless-ingest/.env
|
||||||
EnvironmentFile=/opt/matrix-paperless-ingest/.env
|
ExecStart=%h/matrix-paperless-ingest/.venv/bin/python ingest.py
|
||||||
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=multi-user.target
|
WantedBy=default.target
|
||||||
|
|
@ -10,6 +10,3 @@ dependencies = [
|
||||||
"aiosqlite>=0.20",
|
"aiosqlite>=0.20",
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.uv]
|
|
||||||
package = false
|
|
||||||
|
|
||||||
|
|
|
||||||
92
requirements.txt
Normal file
92
requirements.txt
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue