From ac9a060b4659918d5f13792b0acc1b8fe69363de Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 8 Jul 2026 14:48:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=20systemd=20service?= =?UTF-8?q?=20=E6=96=87=E4=BB=B6=20(palladium-monitor.service)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- palladium-monitor.service | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 palladium-monitor.service 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