Improve Telegram formatting and web synthesis

This commit is contained in:
hbrain 2026-05-27 13:47:28 +00:00
parent 605c135b08
commit 0675f9a441
8 changed files with 425 additions and 508 deletions

31
deploy/README.md Normal file
View file

@ -0,0 +1,31 @@
# 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.

18
deploy/marvin.service Normal file
View file

@ -0,0 +1,18 @@
[Unit]
Description=Marvin Telegram Bot
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=marvin
Group=marvin
WorkingDirectory=/home/marvin/marvin
EnvironmentFile=/home/marvin/marvin/.env
ExecStart=/usr/bin/node --no-warnings src/bot.js
Restart=always
RestartSec=5
NoNewPrivileges=true
[Install]
WantedBy=multi-user.target