diff --git a/palladium-monitor.service b/palladium-monitor.service new file mode 100644 index 0000000..f8b3ab2 --- /dev/null +++ b/palladium-monitor.service @@ -0,0 +1,30 @@ +[Unit] +Description=Palladium Monitor +After=network.target + +[Service] +Type=simple +WorkingDirectory=/root/palladium-monitor +ExecStart=/usr/bin/python3 /root/palladium-monitor/app.py +Restart=on-failure +RestartSec=5 +Environment=PYTHONUNBUFFERED=1 + +# 安全加固 +NoNewPrivileges=yes +PrivateTmp=yes + +# 邮件相关环境变量(按需取消注释并修改) +# Environment="SMTP_HOST=smtp.example.com" +# Environment="SMTP_PORT=587" +# Environment="SMTP_USE_TLS=true" +# Environment="SMTP_USER=your@email.com" +# Environment="SMTP_PASSWORD=yourpassword" +# Environment="MAIL_FROM=your@email.com" +# Environment="MAIL_TO=admin@example.com" +# Environment="MAIL_ENABLED=true" +# Environment="MAIL_SEND_HOUR=9" +# Environment="ALLOW_EMAIL_TRIGGER=true" + +[Install] +WantedBy=multi-user.target \ No newline at end of file