R2 Mirror

Hybrid file sync to Cloudflare R2 with intelligent CDN bypass and multi-source acceleration

Features

๐Ÿ“‹
Manifest-Driven
Simple sync.txt file controls everything. Human-readable, git-friendly.
๐Ÿ›ก๏ธ
CDN Bypass
Routes Discord CDN through VPS proxy with aria2 multi-connection acceleration.
๐ŸŒ
Browser Downloads
Headless Chromium for JS-heavy sites like Proton Drive and Google Drive.
๐Ÿ“ฑ
Phone Uploads
Share links from mobile to upload directly to R2 via iOS Shortcuts or Android.
โšก
Parallel Downloads
Use Worker + VPS simultaneously for maximum throughput on large files.
๐Ÿ‘€
Watch Mode
Auto-sync on manifest changes with intelligent debouncing.

Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ Control Plane (Local) โ”‚ โ”‚ โ”‚ โ”‚ sync.txt โ”€โ”€โ”€โ”€โ–ถ SyncService โ”€โ”€โ”€โ”€โ–ถ R2Client โ”€โ”€โ”€โ”€โ–ถ R2 Bucket โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ–ผ โ–ผ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ Worker โ”‚ โ”‚ VPS Proxy โ”‚ โ”‚ โ”‚ โ”‚ (edge) โ”‚ โ”‚ (aria2) โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Usage

terminal
# One-time sync python run.py sync # Watch mode (auto-sync on changes) python run.py sync --watch # Pull remote changes from phone uploads python run.py pull # Parallel download (Worker + VPS combined) python run.py parallel "https://example.com/file.mp4" "file.mp4"

Performance

Source
Method
Speed
Discord CDN
VPS + aria2
400-600 Mbps
Fast CDNs
Cloudflare Worker
100-200 Mbps
Throttled hosts
aria2 (16 connections)
3-5ร— faster
Large files
Parallel mode
Combined BW

Cost

~โ‚ฌ4/month
Hetzner VPS + Cloudflare R2 & Workers free tier

Stack

Python
Local client + VPS services
FastAPI
VPS proxy + browser API
Playwright
Headless browser
Workers
Edge compute