diff --git a/systemd/shelly-animator.service b/systemd/shelly-animator.service new file mode 100644 index 0000000..fa0ba37 --- /dev/null +++ b/systemd/shelly-animator.service @@ -0,0 +1,31 @@ +[Unit] +Description=Shelly RGBW2 Animator Service +After=network-online.target mosquitto.service +Wants=network-online.target + +[Service] +Type=simple +User=pi +WorkingDirectory=/opt/shelly-animator +ExecStart=/opt/shelly-animator/venv/bin/python app/main.py +Restart=on-failure +RestartSec=5 + +# Environment (or use EnvironmentFile=) +Environment=SHELLY_HOST=192.168.178.151 +Environment=SHELLY_USER=shelly@till.immers.ch +Environment=SHELLY_PASS=sh3llyTi33* +Environment=MQTT_HOST=localhost +Environment=MQTT_PORT=1884 +Environment=MQTT_PREFIX=shelly-animator +Environment=LOG_LEVEL=INFO +Environment=PYTHONUNBUFFERED=1 + +# Hardening +NoNewPrivileges=true +ProtectSystem=strict +ProtectHome=true +ReadWritePaths=/opt/shelly-animator + +[Install] +WantedBy=multi-user.target