title: MardisOpsBot description: Telegram ops bot for monitoring and controlling mardisbot.service host: tg_bots-vm status: active last_reviewed: 2026-09-10 owner: gmikcon confidence: 100 review_interval: 90
Telegram ops bot for monitoring and controlling mardisbot.service (see 10-systems/bots/mardisbot.md).
Naming warning: there are TWO similarly named hosts. This bot lives on the VM
tg_bots(192.168.1.254, hostnametgbots) — NOT on the external VPStgbots(192.168.1.178, hostnamevmk).
tg_bots, 192.168.1.254 (libvirt on bserv 192.168.1.130)ubuntu (password in gnexus-creds secret "tgbots"; sudo uses the same password)/home/ubuntu/bots/MardisOpsBotbot.py v2 (venv: /home/ubuntu/bots/MardisOpsBot/venv, Python 3.10).env in project dir (bot token, not documented here)/backup command: creates a timestamped ZIP backup of /home/ubuntu/bots/MardisBot code files (excludes venv/, __pycache__/, .env) into the project dir.bot.py at root or single top-level subdir), extracts code files, preserves .env and venv/, and keeps a rollback copy of the previous bot.py.test_sandbox.py — 18/18 passed on 2026-09-10 (run in /tmp/mardisops_sandbox, do not touch the live MardisBot dir).mardisops.service — active (running), enabled/etc/systemd/system/mardisops.servicePrivateTmp=true, ProtectSystem=full, ProtectHome=read-only, ReadWritePaths=/home/ubuntu/bots/MardisOpsBot /home/ubuntu/bots/MardisBot (the MardisBot path is required for /backup and ZIP-update writes).NoNewPrivileges=true was removed from the unit on 2026-09-10 07:12 UTC — it blocked sudo inside the service ("no new privileges" error, rc=1 on /status). Do not re-add it while the bot relies on sudo for systemctl/journalctl./etc/sudoers.d/99-mardisops-sudoers (root:root, 0440, visudo -c OK, updated 2026-09-10 07:32 UTC) allows user ubuntu NOPASSWD for: systemctl status/is-active/is-enabled/show mardisbot.service, systemctl restart/stop/start mardisbot.service, and journalctl -u mardisbot.service *./start become admins; user_ids are persisted in /home/ubuntu/bots/MardisOpsBot/admins.json (survives restarts). Everyone else is silently ignored.sudo systemctl status mardisops.service sudo journalctl -u mardisops.service -f sudo systemctl restart mardisops.service
ops bot starting; admins=[78389352] (max 3)polling started