wrolpi/etc/raspberrypios/wrolpi-api-dev.service
2026-02-19 18:01:55 -07:00

23 lines
723 B
Desktop File

[Unit]
Description=WROLPi Python API (Development)
Wants=postgresql.service
PartOf=wrolpi.target
Conflicts=wrolpi-api.service
[Service]
Environment=PYTHONUNBUFFERED=1
# Sanic 25.x wants 'spawn' but our code uses 'fork' for multiprocessing.
Environment=SANIC_START_METHOD_SET=1
# Required for yt-dlp to access GNOME keyring for browser cookie decryption.
Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%U/bus
ExecStart=/opt/wrolpi/venv/bin/python -m sanic main:api_app --host 0.0.0.0 --port 8081 -w 2 --reload --debug
ExecReload=/bin/kill -HUP $MAINPID
Group=wrolpi
User=wrolpi
WorkingDirectory=/opt/wrolpi/
Restart=on-failure
# Higher than the App so the API can start.
Nice=4
[Install]
WantedBy=default.target