MLTB (mirror-leech-telegram-bot)¶
mirror-leech-telegram-bot (fork of anasty17/mltb) - mirrors/leeches files from the internet to Telegram or any rclone remote. Runs on obox only.
Configuration¶
- Packaged as a flake (
github:semi710/mirror-leech-telegram-bot) - Python env built fromuv.lockvia uv2nix, bot source shipped in the package - Runs as root by design: the bot's daemon startup chain hardcodes
/root/.netrc; non-root silently breaks aria2/qbittorrent/sabnzbd downloads /appis a tmpfiles symlink to the data dir (docker heritage -DOWNLOAD_DIRis hardcoded to/app/downloads/)config.pyandrclone.confare re-installed from sops on every service start; runtime edits via bot commands persist in the bot's database and are overwritten on restart- Daemon helpers (aria2c, qbittorrent-nox, sabnzbd) are started by the bot itself via
aria-nox-nzb.shand stay in the service cgroup - systemd reaps them on stop - Uploads go to
gdrive:Botvia rclone
Module¶
hosts/nixos/obox/mltb.nix imports mltb.nixosModules.mltb from the flake input:
services.mltb = {
enable = true;
configFile = config.sops.secrets."mltb/config.py".path;
rcloneConfigFile = config.sops.secrets."mltb/rclone.conf".path;
};
| Option | Default | Description |
|---|---|---|
enable |
- | Enable the service |
package |
flake package | The mltb derivation |
dataDir |
/var/lib/mltb |
Mutable state: config, downloads, daemon profiles |
user/group |
root |
Service user (see note above) |
configFile |
- | Path to a config.py, installed into dataDir each start |
rcloneConfigFile |
null |
Optional rclone.conf, installed into dataDir each start |
environment |
{} |
Extra env vars |
Secrets¶
Stored in secrets/server.yaml (mltb group):
mltb.config.py- full bot config (BOT_TOKEN, TELEGRAM_API/HASH, etc.)mltb.rclone.conf- gdrive remote with OAuth tokens
Update with: sops edit secrets/server.yaml
State¶
Everything mutable lives in /var/lib/mltb:
downloads/- in-flight downloadssabnzbd/,qBittorrent/- daemon profiles (seeded from the package, never overwritten)token.pickle,accounts/,.netrc- optional private files, managed manually if needed
Troubleshooting¶
After changing sops secrets: sudo systemctl restart mltb (config is only read at start).