-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgithub-notify-bot.service
More file actions
33 lines (30 loc) · 1.25 KB
/
Copy pathgithub-notify-bot.service
File metadata and controls
33 lines (30 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[Unit]
Description=GitHub Fork & Star Notification Bot
Documentation=https://github.com/dorokuma/github-notify-bot
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/root/github-notify-bot
# ========== 环境变量文件 ==========
# 敏感配置(GITHUB_TOKEN, TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID 等)
# 放在 .env 文件中,不要直接写在 service 文件里
# 文件格式要求:
# - 纯 KEY=value 格式(不要加 export 前缀)
# - 不支持行内变量展开,不支持引号嵌套
# - 值前后不要加引号(除非引号是你想要的内容的一部分)
# 创建方式:cp .env.example /root/github-notify-bot/.env
# 然后编辑填入真实值
# 务必设置权限:chmod 600 /root/github-notify-bot/.env
# 修改 .env 后需要重启服务:systemctl daemon-reload && systemctl restart github-notify-bot
# 注意:文件不存在时静默忽略,config.py 的校验会给出明确错误提示
EnvironmentFile=-/root/github-notify-bot/.env
ExecStart=/usr/bin/python3 /root/github-notify-bot/main.py
Restart=always
RestartSec=10
# 日志输出(可用 journalctl -u github-notify-bot -f 查看)
StandardOutput=journal
StandardError=journal
SyslogIdentifier=github-notify-bot
[Install]
WantedBy=multi-user.target