diff --git a/10-systems/bots/mardisbot.md b/10-systems/bots/mardisbot.md index 6abc632..b9cafb6 100644 --- a/10-systems/bots/mardisbot.md +++ b/10-systems/bots/mardisbot.md @@ -1,69 +1,55 @@ --- title: MardisBot description: Telegram bot for Mardis group -host: tgbots -status: missing +host: tg_bots-vm +status: active last_reviewed: 2026-09-10 owner: gmikcon -confidence: 95 +confidence: 100 review_interval: 90 source_of_truth: live_system --- # MardisBot -Telegram bot for the Mardis group, previously deployed on the `tgbots` VPS. +Telegram bot for the Mardis group. -> **STATUS 2026-09-10: NOT DEPLOYED.** An exhaustive read-only audit of -> `tgbots` (192.168.1.178) on 2026-09-10 found **no Telegram bot running or -> installed anywhere on the host**. The host was rebuilt around 2026-08-27 -> (system directories re-created, uptime reset) and MardisBot was not -> redeployed afterwards. The deployment details below are historical and no -> longer match the live system. +> **STATUS 2026-09-10: ACTIVE** on VM `tg_bots` (192.168.1.254, libvirt VM on +> hypervisor bserv 192.168.1.130). Verified live via SSH: process running +> since 2026-08-13, systemd service active. +> +> **Naming warning:** there are TWO similarly named hosts. The bot lives on +> the **VM `tg_bots` (192.168.1.254, hostname `tgbots`)** — NOT on the +> external VPS `tgbots` (192.168.1.178, hostname `vmk`), which hosts only the +> marginator web stack. Earlier documentation wrongly placed the bot on the +> VPS; after the VPS was rebuilt ~2026-08-27 the bot was believed missing, +> but it had actually been (re)deployed to the VM. -## Historical deployment details (no longer present) -- **Host**: `tgbots` (192.168.1.178) -- **User**: `ubuntu` -- **Project Path**: `/home/ubuntu/bots/MardisBot` — directory does not exist -- **Virtual Environment**: `/home/ubuntu/bots/MardisBot/venv` — does not exist -- **Main Script**: `bot.py` +## Live deployment (verified 2026-09-10) +- **Host**: VM `tg_bots`, 192.168.1.254 (libvirt on bserv, disk + /mnt/main/vm_main/tg_bots, bridge br0, MAC 52:54:00:94:4b:e0) +- **User**: `ubuntu` (password in gnexus-creds secret "tgbots") +- **Project Path**: `/home/ubuntu/bots/MardisBot` +- **Main Script**: `bot.py` (venv: `/home/ubuntu/bots/MardisBot/venv`, + Python 3.10) +- **Config**: `.env` in project dir (bot token, not documented here) +- **Dependencies**: python-telegram-bot[job-queue], python-dotenv + (requirements.txt) -## Historical systemd service -- **Service Name**: `mardisbot.service` — unit does not exist - (`systemctl status mardisbot.service` → "could not be found"; no journal - history for the unit) -- **Unit File**: `/etc/systemd/system/mardisbot.service` — absent -- **Restart Policy**: `always`, interval 30 seconds +## systemd service +- **Service Name**: `mardisbot.service` — active (running), enabled +- **Unit File**: `/etc/systemd/system/mardisbot.service` +- **Running since**: 2026-08-13 08:51:30 UTC +- **Memory**: ~40 MB -### Service management (if redeployed) +### Service management ```bash -# Check status sudo systemctl status mardisbot.service - -# View logs sudo journalctl -u mardisbot.service -f - -# Restart service sudo systemctl restart mardisbot.service ``` -## Dependencies (historical) -Installed via `pip` in the local venv: -- `python-telegram-bot[job-queue]` -- `python-dotenv` - -## 2026-09-10 audit evidence (tgbots) -- No bot-like processes in `ps auxww` (only system daemons, postgres, and the - marginator gunicorn on port 5001). -- No bot systemd units; only `marginator.service` exists in - `/etc/systemd/system/`. -- Docker: only `marginator-caddy-1`, `marginator-backend-1`, - `marginator-db-1` (all Up). No bot containers or images. -- No cron jobs, no tmux/screen sessions, no bot project directories. -- Filesystem-wide token search (`bot[0-9]{6,10}:...` pattern) over - /home /opt /srv /etc /usr/local /var: zero matches. -- Listening ports: 22 (sshd), 443/8080 (caddy), 5001 (marginator backend), - 53 (resolved), 46831 (containerd). No bot listener. -- No outbound connections to Telegram API IP ranges (149.154.x, 91.108.x). -- No python-telegram-bot/aiogram/telebot/pyrogram packages on host or in the - marginator backend container; no telegram mentions in apt history. +## Health notes (2026-09-10) +- Occasional `telegram.error.NetworkError: Bad Gateway` in journal + (transient Telegram API/network blips; network_retry_loop recovers + automatically). No error handlers registered in bot.py — cosmetic only. diff --git a/90-maintenance/pending-changes/20260910015945-2ccf303c.json b/90-maintenance/pending-changes/20260910015945-2ccf303c.json new file mode 100644 index 0000000..3898f48 --- /dev/null +++ b/90-maintenance/pending-changes/20260910015945-2ccf303c.json @@ -0,0 +1,19 @@ +{ + "id": "20260910015945-2ccf303c", + "kind": "doc", + "target": "10-systems/bots/mardisbot.md", + "summary": "MardisBot is ACTIVE on VM tg_bots (192.168.1.254); correct host and status", + "reason": "Live verification 2026-09-10: MardisBot is running on VM tg_bots (192.168.1.254), not on the tgbots VPS (192.168.1.178). Previous 'missing' status was wrong — the bot was redeployed to the VM after the VPS rebuild.", + "payload": { + "content": "---\ntitle: MardisBot\ndescription: Telegram bot for Mardis group\nhost: tg_bots-vm\nstatus: active\nlast_reviewed: 2026-09-10\nowner: gmikcon\nconfidence: 100\nreview_interval: 90\nsource_of_truth: live_system\n---\n\n# MardisBot\n\nTelegram bot for the Mardis group.\n\n> **STATUS 2026-09-10: ACTIVE** on VM `tg_bots` (192.168.1.254, libvirt VM on\n> hypervisor bserv 192.168.1.130). Verified live via SSH: process running\n> since 2026-08-13, systemd service active.\n>\n> **Naming warning:** there are TWO similarly named hosts. The bot lives on\n> the **VM `tg_bots` (192.168.1.254, hostname `tgbots`)** — NOT on the\n> external VPS `tgbots` (192.168.1.178, hostname `vmk`), which hosts only the\n> marginator web stack. Earlier documentation wrongly placed the bot on the\n> VPS; after the VPS was rebuilt ~2026-08-27 the bot was believed missing,\n> but it had actually been (re)deployed to the VM.\n\n## Live deployment (verified 2026-09-10)\n- **Host**: VM `tg_bots`, 192.168.1.254 (libvirt on bserv, disk\n /mnt/main/vm_main/tg_bots, bridge br0, MAC 52:54:00:94:4b:e0)\n- **User**: `ubuntu` (password in gnexus-creds secret \"tgbots\")\n- **Project Path**: `/home/ubuntu/bots/MardisBot`\n- **Main Script**: `bot.py` (venv: `/home/ubuntu/bots/MardisBot/venv`,\n Python 3.10)\n- **Config**: `.env` in project dir (bot token, not documented here)\n- **Dependencies**: python-telegram-bot[job-queue], python-dotenv\n (requirements.txt)\n\n## systemd service\n- **Service Name**: `mardisbot.service` — active (running), enabled\n- **Unit File**: `/etc/systemd/system/mardisbot.service`\n- **Running since**: 2026-08-13 08:51:30 UTC\n- **Memory**: ~40 MB\n\n### Service management\n```bash\nsudo systemctl status mardisbot.service\nsudo journalctl -u mardisbot.service -f\nsudo systemctl restart mardisbot.service\n```\n\n## Health notes (2026-09-10)\n- Occasional `telegram.error.NetworkError: Bad Gateway` in journal\n (transient Telegram API/network blips; network_retry_loop recovers\n automatically). No error handlers registered in bot.py — cosmetic only." + }, + "status": "applied", + "created_at": "2026-09-10T01:59:45Z", + "updated_at": "2026-09-10T01:59:46Z", + "applied_at": "2026-09-10T01:59:46Z", + "validation": { + "status": "ok", + "issue_count": 0, + "issues": [] + } +}