Add systemd service configuration

This commit is contained in:
Michaël
2025-12-25 15:30:31 -03:00
parent 19e2824538
commit ae281ead03
2 changed files with 103 additions and 0 deletions

29
buttonrefreshbot.service Normal file
View File

@@ -0,0 +1,29 @@
[Unit]
Description=Button Refresh Bot - Telegram bot that removes reply keyboard buttons
After=network.target
[Service]
Type=simple
# Update these to match your system user and group
User=YOUR_USERNAME
Group=YOUR_GROUP
# Update this to the absolute path of your project directory
WorkingDirectory=/path/to/Buttonrefreshbot
Environment="NODE_ENV=production"
# Update this path to point to your .env file
EnvironmentFile=/path/to/Buttonrefreshbot/.env
# Update this path to your node executable (use 'which node' to find it)
ExecStart=/usr/bin/node /path/to/Buttonrefreshbot/bot.js
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=buttonrefreshbot
# Security settings
NoNewPrivileges=true
PrivateTmp=true
[Install]
WantedBy=multi-user.target