[Unit]
Description=Pi Car Companion
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=pi-companion
Group=pi-companion
WorkingDirectory=/opt/pi-car-companion/current
EnvironmentFile=/etc/pi-car-companion/companion.env
Environment=HOME=/var/lib/pi-car-companion
ExecStart=/usr/bin/node /opt/pi-car-companion/current/server/dist/index.js
Restart=on-failure
RestartSec=5s
TimeoutStopSec=20s
KillSignal=SIGTERM
UMask=0027
StateDirectory=pi-car-companion
NoNewPrivileges=false
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictRealtime=true
LockPersonality=true
SystemCallArchitectures=native
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
ReadWritePaths=/var/lib/pi-car-companion

[Install]
WantedBy=multi-user.target
