Skip to content

feat(destination): native Telegram cloud storage via compiled MTProto binary - #10

Open
ash-iir wants to merge 4 commits into
VD171:mainfrom
ash-iir:feature/telegram-cloud-storage
Open

ash-iir wants to merge 4 commits into
VD171:mainfrom
ash-iir:feature/telegram-cloud-storage

Conversation

@ash-iir

@ash-iir ash-iir commented Nov 12, 2026

Copy link
Copy Markdown

Summary

Addresses feedback from #3 regarding file count and runtime dependencies:

"The main problem here is the high number of files. It would be easier for using some compiled binary for mtproto."

This PR implements native Telegram Cloud Storage using a single self-contained, compiled Go MTProto binary (telegram-vdb), completely eliminating Python, external runtimes, and hundreds of vendored script files.

Key Highlights & Changes

  • Zero Python Runtime & Minimal Footprint:
    • Only 4 source files added to the repository (tools/telegram-vdb/main.go, go.mod, go.sum, and module/scripts/telegram.sh).
    • Single standalone binary compiled for device architecture (telegram-vdb).
    • Integrated into GitHub Actions CI to automatically cross-compile for all supported ABIs (arm64-v8a, armeabi-v7a, x86_64, x86) and package directly into release zips alongside existing binaries.
  • Architectural Parity with Existing Destinations:
    • Telegram behaves identically to standard VD-Backup cloud backends (Rclone, Google Drive, Restic).
    • Uses standard destination actions: test connection (dest-test), upload backup (telegram.sh upload), list backups (telegram.sh ls), download archive (telegram.sh download), and browse/restore.
    • Channel name auto-discovery: creates or reuses private storage channels (VD_Backup_<hex>).
  • Official Telegram Desktop Emulation:
    • Uses Obfuscated2 MTProto transport with official Telegram Desktop client credentials, preventing session logout / conflict issues with mobile clients.
    • Interactive login modal via WebUI (Phone number -> Telegram OTP code -> optional 2FA password).
  • Operation Cancellation & UI Responsiveness:
    • Integrated in-progress operation cancellation (SIGTERM/SIGKILL process tree management via helper.sh cancel).
    • Zero-latency local session caching: eliminates blocking MTProto network calls on WebUI boot and destination tab switches.

Verification

  • Tested on Android 14 (arm64-v8a, Magisk):
    • WebUI login & 2FA authentication
    • Full backup upload & archive integrity verification
    • Destination listing and remote backup browsing
    • Full backup download and app restoration
    • In-flight operation cancellation

VD171 Contributor added 4 commits November 12, 2026 03:54
- Replaced Python/Telethon dependencies with a lightweight, standalone native Go MTProto 2.0 client (tools/telegram-vdb)
- Cross-compiled as pure static binaries for arm64-v8a, armeabi-v7a, x86, and x86_64
- Integrated binary cross-compilation into .github/scripts/build_bin.sh and CI workflows
- Zero Python runtime or vendor libraries required
- Supported phone authentication with OTP and 2FA passwords
- Configured official Telegram Desktop emulation (DeviceTDesktopWindows & TDesktopResolver) with Obfuscated2 transport to protect active sessions on other devices
- Fixed channel argument parsing for negative channel IDs (-100...) during uploads and downloads
- Automatic detection of existing backup channels ending in _VDB to prevent spamreport restrictions
- Full backup, list, and restore integration with helper and worker
- Automatically prune dead operation PIDs to prevent UI getting stuck on reattach
- Rebased on upstream v1.06
…chitecture

- Remove custom non-standard cloud backups modal (#tg-backups-modal) and toolbar button
- Remove custom download verbs and unused CSS styles
- Treat Telegram strictly as a first-class native destination in #destlist and #d-type
- Retain MTProto upload transfer and standard destination testing
- Replace bulky card container in trackOp with clean .op-head and .op-cancel-btn
- Immediate responsive cancellation without blocking modal overlay
- Reduce finished operations auto-dismiss delay from 4000ms to 1500ms
- Remove blocking Telegram network status check on general destinations load
- Fast-path session file existence check in telegram-vdb check-auth (0ms if no session)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant