31 lines
818 B
Markdown
31 lines
818 B
Markdown
# Marvin deployment (systemd)
|
|
|
|
This project is intended to run as a systemd service using polling, a `.env` file for configuration, and a dedicated unprivileged user.
|
|
|
|
## Recommended setup
|
|
|
|
- Create a dedicated user: `marvin`
|
|
- Place the project at: `/home/marvin/marvin`
|
|
- Store secrets in: `/home/marvin/marvin/.env`
|
|
- Run the bot with systemd
|
|
- View logs with:
|
|
|
|
```bash
|
|
journalctl -u marvin -f
|
|
```
|
|
|
|
## Service file
|
|
|
|
Install the provided service file:
|
|
|
|
```bash
|
|
sudo cp deploy/marvin.service /etc/systemd/system/marvin.service
|
|
sudo systemctl daemon-reload
|
|
sudo systemctl enable --now marvin
|
|
```
|
|
|
|
## Notes
|
|
|
|
- The bot uses Telegram polling (`getUpdates`), so only one instance should run at a time.
|
|
- If another copy is running, you may see a Telegram 409 conflict.
|
|
- Use `journalctl -u marvin -f` to follow logs live.
|