mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-11 13:27:33 +01:00
The systemd service runs as root with no User=, so _run_as_user() had no SUDO_USER/USER to drop privileges to and launched Steam as bare root with no DISPLAY/XAUTHORITY/DBUS session - its CDP port never opened. Add an explicit STEAM_ENFORCER_DESKTOP_USER env var (set in the unit, substituted by install.sh) so the enforcer always knows which desktop user owns the Steam session, regardless of how it was launched. Also fix a hardcoded _CDP_PORT=8080 colliding with an already-running local service bound to 0.0.0.0:8080: requests to 127.0.0.1:8080 always hit that service instead of steamwebhelper (which only bound [::1]:8080), so CDP detection could never succeed even with the user fix. Move to 9222, the conventional Chrome DevTools port. Verified live: journalctl shows CDP ready and games hidden within ~7s of a service restart, Steam running as the desktop user (not root).
22 lines
557 B
Desktop File
22 lines
557 B
Desktop File
[Unit]
|
|
Description=Steam Backlog Enforcer
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
WorkingDirectory=/opt/steam-backlog-enforcer
|
|
ExecStart=/usr/bin/python3 -m steam_backlog_enforcer.main enforce
|
|
Restart=always
|
|
RestartSec=5
|
|
Environment=PYTHONUNBUFFERED=1
|
|
Environment=PYTHONPATH=/opt/steam-backlog-enforcer
|
|
Environment=HOME=/home/kuhy
|
|
Environment=STEAM_ENFORCER_DESKTOP_USER=__DESKTOP_USER__
|
|
Environment=DISPLAY=:0
|
|
# Hardening: enforcer must not be easily killed.
|
|
OOMScoreAdjust=-900
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|