Telegram bot that fetches Tor bridge lines (obfs4/webtunnel for IPv4/IPv6), de-duplicates them per type, saves history, and posts updates to Telegram.
- GitHub Actions (cron-driven)
- Node.js HTTP server with
/run,/health, built-in scheduler, and a web control panel (server-only)
- Automatic bridge fetching on schedule.
- obfs4/webtunnel, IPv4/IPv6 support.
- Telegram posting with HTML formatting.
- De-duplication per bridge type.
- Fetch: The bot scrapes the official Tor Project bridges website.
- Parse: It extracts all the bridge lines from the website's HTML.
- Compare: It compares the fetched bridges against a local history of already-sent bridges.
- Notify: It sends any new, unique bridges to your Telegram channel.
- Save: It saves the new bridges to the history to prevent future duplicates.
Run this on a vanilla Linux server to install and run the Node HTTP server under systemd:
bash <(curl -Ls https://raw.githubusercontent.com/YrustPd/AutoBridgeBot/main/scripts/install.sh)
The installer will (idempotent):
- Install/upgrade Node.js LTS, curl, and Git
- Clone or update the repo in
/opt/AutoBridgeBot - Prompt for
TELEGRAM_BOT_TOKENandTELEGRAM_CHAT_ID - Pick a random free port if you leave
PORTblank - Generate admin credentials for the control panel and a JWT secret
- Install or update npm dependencies
- Create/update and start systemd service
autobridgebot - Write or preserve
.env(schedule + settings) - Print real URLs (health, panel, run) using your server’s IP
HTTP endpoints after install:
GET /health→ returns JSON{ ok, running, lastRun, nextRun, version }GET/POST /run→ triggers a fetch + post cycle, returns JSON reportGET /panel/→ control panel (login required)
Upgrade only (already installed):
sudo bash /opt/AutoBridgeBot/scripts/update.sh
or just re-run the one-liner installer; it will pull latest and restart.
The Node HTTP server can run the bot on a schedule, controlled by .env:
CRON_SCHEDULE— a standard cron string (e.g."0 */12 * * *"). If set, it takes precedence.INTERVAL_HOURS— integer hours interval (default12). Used only ifCRON_SCHEDULEis blank.DISABLE_INTERNAL_CRON— set totrueto disable the internal schedule and use manual triggers only.
Defaults: if neither CRON_SCHEDULE nor INTERVAL_HOURS is set, the server runs every 12 hours.
Examples:
- Every 6 hours:
CRON_SCHEDULE="0 */6 * * *" - Every 12 hours (default):
INTERVAL_HOURS=12 - Disable schedule:
DISABLE_INTERNAL_CRON=true
Trigger a run manually while the scheduler is active:
curl -X POST http://127.0.0.1:3000/run
- URL:
http://<server-ip>:<port>/panel/ - Login:
ADMIN_USER/ADMIN_PASS(generated by installer; stored in/opt/AutoBridgeBot/.env) - Features:
- Dashboard (status, last run, next run, Run Now)
- Schedule (daily at HH:MM or every N hours; live reload without restart)
- Secrets (update Telegram token/chat)
- Settings (bind host, port shown; disable internal cron)
- Health & Logs (recent in-memory logs + download)
- About (version/links)
- After install, use the CLI menu:
atb-cli
- Options include: show status, run now, change schedule, edit secrets, update, uninstall, and show control panel URL.
Prerequisites:
- Node.js 18+
- A Bot Token from @BotFather and a target chat ID
Install dependencies:
npm install
Run once (same as GitHub Actions behavior):
TELEGRAM_BOT_TOKEN=... TELEGRAM_CHAT_ID=... npm run once
Run HTTP server:
PORT=3000 TELEGRAM_BOT_TOKEN=... TELEGRAM_CHAT_ID=... npm run server
- Workflow file:
.github/workflows/main.yml - Secrets required:
TELEGRAM_BOT_TOKENTELEGRAM_CHAT_ID
- By default runs twice a day (
0 0,13 * * *).
CI behavior:
- Actions invokes
node bin/cli.js, which runs one cycle and exits. - No server or panel is started in CI. Panel is only available in server mode.
- De-duplication is within each type (exact trimmed match).
- Local persistence uses JSON files in
config/(same format as before):{ bridges: BridgeData[] }.
- To tidy and re-sort local JSON files deterministically:
node update_bridges.js