Skip to content

feat: remove legacy direct-send uploader - #2

Closed
babico wants to merge 827 commits into
amjadlle:mainfrom
babico:main
Closed

babico wants to merge 827 commits into
amjadlle:mainfrom
babico:main

Conversation

@babico

@babico babico commented Oct 20, 2026

Copy link
Copy Markdown

Removes the legacy Telethon direct-send scanner/uploader CLI. Unified upload path (REST/S3/local-file → durable job queue → Telethon transport) remains. Legacy auto-bucket scheduler removed. 1085 tests pass.

babico added 30 commits October 14, 2026 02:58
…e matrix [p0-live-multipart] [p1-live-soak] [p1-live-size]
babico and others added 26 commits October 15, 2026 23:50
refactor(layout): regroup tests and scripts; fix release packaging
…jobs

The first real runs of the converted multiworker E2E failed inside the
worker phase. Three workers must never hold concurrent MTProto connections
to one StringSession, so each job now runs inside an inter-process flock
with a fresh short-lived client (connect, claim/process, disconnect), and
worker failures print their traceback to stderr for CI diagnosis.
…guard

The worker script embedded in the USER multiworker E2E test used 'await' in a
class body, which fails at compile time, so every worker died before the
start gate. Compute the peer chat id before the class, and add a compile()
regression test for the embedded script plus stderr diagnostics on early
worker exit.
…egression

The embedded worker referenced its argv account via a class body, which
cannot see function locals (NameError at runtime). Use a SimpleNamespace
runtime instead, and add a subprocess regression test that runs the worker
against the real SQL jobs engine with a stubbed telethon package: ready
gate, claim, connect, journal, upload, ack and done-state are verified
without live Telegram.
The live workers hit a real GetDialogs FloodWaitError with the fail-fast
flood threshold; Telethon now auto-sleeps waits up to 60 seconds in the
worker and parent clients. The fake-telethon regression subprocess no
longer inherits TELEDRIVE_E2E_CHANNEL_NAME/TARGET from the live workflow
env, so it always resolves by the numeric target.
The previous patch only changed the parent's client; the worker kept
flood_sleep_threshold=0 and died on the real 4s GetDialogs flood-wait.
The worker now auto-sleeps waits up to 60s like the parent.
A connected Telethon client is bound to its event loop; the parent used
separate asyncio.run calls and failed with 'event loop must not change'.
The whole readback/verification/cleanup phase now runs in one async
scenario under a single asyncio.run.
…plate

Credentials move from env comma-lists to a tidy config.yaml storage:
section holding the dedicated channel, round_robin/failover strategy and an
apis: list of {api_id, api_hash, session_file, account} sets. The config
section is authoritative; env vars remain a legacy fallback. A
config.example.yaml template lives at the repo root; examples/ is gone and
README/TELETHON_STORAGE/.env.example document the new layout.
feat(config): tidy storage config with apis list + docs refresh
…rategy; SSL; compose hardening

Owner directive: nothing configured via env except TZ and the config path.
- teledrive/settings.py central loader; web/app.py + web/s3.py + unified.py
  read web:/jobs:/state:/storage:/paths: sections only (env vars removed).
- TELEDRIVE_STORAGE_TRANSPORT deleted; transport is always Telethon USER.
- storage.strategy supports single | round_robin | failover | parallel;
  parallel uploads chunks concurrently across credential sets
  (parallel_degree + batched gather in the engine; per-label intents).
- config.example.yaml is the tidy template (accounts/phone block dropped:
  sessions are pre-authorized); .env.example reduced to PUID/PGID/TZ/ports;
  docker-compose keeps only TELEDRIVE_CONFIG+TZ, adds healthcheck and
  json-file log rotation; service binds 0.0.0.0 in-container.
- state.db_extra_packages installs drivers into /data/site-packages at
  startup (oracledb example).
- scripts/ops/generate_ssl.py (openssl self-signed certs, config snippet,
  --test HTTPS verification) + web.ssl_certfile/keyfile TLS support.
- WebUI Settings page gains a Storage card (channel, strategy, apis list
  editor) persisting to config.yaml.
- Runtime tests now build config.yaml fixtures; env-based settings tests
  rewritten; full suite green (1083 passed / 61 skipped / 0 failed).
…tions

The disposable fault harness now generates config.yaml with the web/storage/
jobs sections (the runner's disposable password and web-a/web-b hosts) and
the compose fixture carries only TELEDRIVE_CONFIG. The intentional
0.0.0.0 in-container binds are marked nosec B104 with justification.
TrustedHostMiddleware captured the import-time default; a config-reloaded
allowed_hosts change never applied. Replace it with a per-request middleware
reading the live ALLOWED_HOSTS. ensure_config accepts an existing mounted
config when chmod fails for a foreign uid but the file is already private.
The CI smoke runs the container as the host uid and mounts a 0600 config.
load_config created a default legacy account whenever accounts was falsy,
including explicit 'accounts: []' configs, which then failed the unified
service's storage-path validation. A default account now only appears for
a legacy telegram: section without an accounts key; empty accounts and
absent telegram sections mean no legacy accounts.
parallel degree is exposed to the engine for concurrent chunk uploads;
single strategy pins every send to the first set. Added regression tests
for both strategies.
feat(config-only): all settings from config.yaml; parallel strategy; SSL; compose hardening
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 218 files, which is 118 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4851e321-0da8-4f28-98f6-03c2226e3424
📥 Commits

Reviewing files that changed from the base of the PR and between 4d9dbe7 and 59af1cb.

⛔ Files ignored due to path filters: 13
  • TeleDrive Logo.png is excluded by !**/*.png
  • images/dashboard.png is excluded by !**/*.png
  • images/settings.png is excluded by !**/*.png
  • images/upload-queue.png is excluded by !**/*.png
  • installer/TeleDrive.ico is excluded by !**/*.ico
  • website/package-lock.json is excluded by !**/package-lock.json
  • website/public/favicon.ico is excluded by !**/*.ico
  • website/public/favicon.svg is excluded by !**/*.svg
  • website/public/images/dashboard.png is excluded by !**/*.png
  • website/public/images/settings.png is excluded by !**/*.png
  • website/public/images/upload-queue.png is excluded by !**/*.png
  • website/public/logo.png is excluded by !**/*.png
  • website/public/og-image.png is excluded by !**/*.png
📒 Files selected for processing: 218
  • .dockerignore
  • .env.example
  • .github/ci/fault-injection/Dockerfile
  • .github/ci/fault-injection/Dockerfile.dockerignore
  • .github/ci/fault-injection/compose.yml
  • .github/dependabot.yml
  • .github/workflows/delivery-release.yml
  • .github/workflows/endurance-capacity.yml
  • .github/workflows/integration-databases.yml
  • .github/workflows/integration-storage.yml
  • .github/workflows/live-telegram-multiworker.yml
  • .github/workflows/live-telegram-user.yml
  • .github/workflows/quality-security.yml
  • .github/workflows/release.yml
  • .github/workflows/resilience-docker.yml
  • .gitignore
  • CONTRIBUTING.md
  • Dockerfile
  • README.md
  • SECURITY.md
  • TODO.md
  • app/__init__.py
  • app/main.py
  • app/paths.py
  • app/window.py
  • build-installer.ps1
  • build-linux.sh
  • build.ps1
  • config.example.yaml
  • desktop.py
  • docker-compose.yml
  • docs/BACKUP_RESTORE.md
  • docs/CI_WORKFLOWS.md
  • docs/IMPLEMENTATION_STATUS.md
  • docs/LOCAL_AGENT_ACCEPTANCE.md
  • docs/S3_SPECS.md
  • docs/SECURITY.md
  • docs/TELETHON_STORAGE.md
  • installer/TelegramAutoUpload.iss
  • pyproject.toml
  • requirements.txt
  • scripts/dev/create_storage_user_session.py
  • scripts/dev/docker_fault_scenarios.py
  • scripts/dev/run_docker_fault_injection.sh
  • scripts/dev/setup_telegram_e2e.py
  • scripts/ops/acceptance.py
  • scripts/ops/backup_metadata.py
  • scripts/ops/capacity_probe.py
  • scripts/ops/check_release_matrix.py
  • scripts/ops/cleanup_merged_branches.py
  • scripts/ops/gc_dry_run.py
  • scripts/ops/generate_ssl.py
  • scripts/ops/inventory_telegram_history.py
  • scripts/ops/monitor_host_soak.py
  • scripts/ops/rebuild_from_telegram.py
  • scripts/ops/reconcile_mtproto_receipt.py
  • scripts/ops/rehearse_native_database_restore.py
  • scripts/ops/rehearse_telegram_dr.py
  • scripts/ops/s3_large_roundtrip.py
  • scripts/ops/verify_legacy_cutover.py
  • scripts/ops/verify_metadata_backup.py
  • scripts/ops/verify_production_bundle.py
  • teledrive/__init__.py
  • teledrive/api_keys.py
  • teledrive/db.py
  • teledrive/s3/__init__.py
  • teledrive/s3/batch_delete.py
  • teledrive/s3/bucket_listing.py
  • teledrive/s3/checksums.py
  • teledrive/s3/conditions.py
  • teledrive/s3/cors.py
  • teledrive/s3/credentials.py
  • teledrive/s3/lifecycle.py
  • teledrive/s3/multipart.py
  • teledrive/s3/object_metadata.py
  • teledrive/s3/operation_manifest.json
  • teledrive/s3/post_policy.py
  • teledrive/s3/public_access.py
  • teledrive/s3/route_guard.py
  • teledrive/s3/sigv4.py
  • teledrive/s3/tagging.py
  • teledrive/s3/versioning.py
  • teledrive/s3/write_conditions.py
  • teledrive/settings.py
  • teledrive/storage/__init__.py
  • teledrive/storage/catalog.py
  • teledrive/storage/copy.py
  • teledrive/storage/cutover_acceptance.py
  • teledrive/storage/engine.py
  • teledrive/storage/gc.py
  • teledrive/storage/gc_safety.py
  • teledrive/storage/history_inventory.py
  • teledrive/storage/jobs.py
  • teledrive/storage/legacy_bridge.py
  • teledrive/storage/manifest.py
  • teledrive/storage/mtproto_rate_guard.py
  • teledrive/storage/rebuild.py
  • teledrive/storage/reconcile_inventory.py
  • teledrive/storage/recovery.py
  • teledrive/storage/target_resolver.py
  • teledrive/storage/telethon_adapter.py
  • teledrive/storage/user_mode.py
  • teledrive/uploader.py
  • tests/__init__.py
  • tests/e2e/__init__.py
  • tests/e2e/test_database_live.py
  • tests/e2e/test_telegram_history_live_e2e.py
  • tests/e2e/test_telegram_multiworker_e2e.py
  • tests/e2e/test_telegram_storage_e2e.py
  • tests/meta/__init__.py
  • tests/meta/test_acceptance_cli.py
  • tests/meta/test_capacity_probe.py
  • tests/meta/test_ci_workflows.py
  • tests/meta/test_host_soak.py
  • tests/meta/test_production_bundle.py
  • tests/meta/test_release_matrix.py
  • tests/s3/__init__.py
  • tests/s3/test_s3_additional_checksums.py
  • tests/s3/test_s3_admin.py
  • tests/s3/test_s3_batch_delete.py
  • tests/s3/test_s3_bucket_listing.py
  • tests/s3/test_s3_bucket_location.py
  • tests/s3/test_s3_bucket_versioning.py
  • tests/s3/test_s3_cli_compat.py
  • tests/s3/test_s3_conditional_writes.py
  • tests/s3/test_s3_conditions.py
  • tests/s3/test_s3_contract.py
  • tests/s3/test_s3_copy.py
  • tests/s3/test_s3_cors.py
  • tests/s3/test_s3_credentials.py
  • tests/s3/test_s3_delete_markers.py
  • tests/s3/test_s3_fail_closed.py
  • tests/s3/test_s3_gateway.py
  • tests/s3/test_s3_lifecycle.py
  • tests/s3/test_s3_listing_v1.py
  • tests/s3/test_s3_metadata.py
  • tests/s3/test_s3_multipart.py
  • tests/s3/test_s3_multipart_preconditions.py
  • tests/s3/test_s3_object_attributes.py
  • tests/s3/test_s3_permissions.py
  • tests/s3/test_s3_policy_status.py
  • tests/s3/test_s3_post_policy.py
  • tests/s3/test_s3_presigned.py
  • tests/s3/test_s3_presigned_complete.py
  • tests/s3/test_s3_public_access_block.py
  • tests/s3/test_s3_recovery.py
  • tests/s3/test_s3_route_guard.py
  • tests/s3/test_s3_sigv4_defense.py
  • tests/s3/test_s3_tagging.py
  • tests/s3/test_s3_version_copy.py
  • tests/s3/test_s3_version_listing.py
  • tests/s3/test_s3_version_reads.py
  • tests/s3/test_s3_version_tagging.py
  • tests/s3/test_s3_vhost.py
  • tests/storage/__init__.py
  • tests/storage/test_gc_reference_planner.py
  • tests/storage/test_legacy_bridge.py
  • tests/storage/test_legacy_cutover_acceptance.py
  • tests/storage/test_legacy_import_admin.py
  • tests/storage/test_metadata_backup.py
  • tests/storage/test_metadata_snapshot_rehearsal.py
  • tests/storage/test_mtproto_multi_credentials.py
  • tests/storage/test_mtproto_rate_guard.py
  • tests/storage/test_storage_catalog.py
  • tests/storage/test_storage_engine.py
  • tests/storage/test_storage_gc_admin.py
  • tests/storage/test_storage_gc_audit.py
  • tests/storage/test_storage_gc_retention.py
  • tests/storage/test_storage_jobs.py
  • tests/storage/test_storage_multiworker.py
  • tests/storage/test_storage_ops_health.py
  • tests/storage/test_storage_pending_admin.py
  • tests/storage/test_storage_rebuild.py
  • tests/storage/test_storage_recovery.py
  • tests/storage/test_storage_sigkill.py
  • tests/storage/test_storage_user_mode.py
  • tests/storage/test_storage_versions.py
  • tests/storage/test_telegram_dr_rehearsal.py
  • tests/storage/test_telegram_history_inventory.py
  • tests/storage/test_telegram_inventory_reconcile.py
  • tests/storage/test_telegram_target_resolution.py
  • tests/web/__init__.py
  • tests/web/test_api_keys.py
  • tests/web/test_openapi.py
  • tests/web/test_rest_api.py
  • tests/web/test_rest_transfer.py
  • tests/web/test_security.py
  • tests/web/test_unified_service.py
  • uploader.py
  • web/__init__.py
  • web/app.py
  • web/s3.py
  • web/static/app.js
  • web/static/index.html
  • web/unified.py
  • website/.gitignore
  • website/.vscode/extensions.json
  • website/.vscode/launch.json
  • website/AGENTS.md
  • website/CLAUDE.md
  • website/README.md
  • website/astro.config.mjs
  • website/package.json
  • website/public/knowledge.md
  • website/src/components/Author.astro
  • website/src/components/Faq.astro
  • website/src/components/Features.astro
  • website/src/components/Footer.astro
  • website/src/components/Hero.astro
  • website/src/components/InstallGuide.astro
  • website/src/components/Navbar.astro
  • website/src/components/SettingsGuide.astro
  • website/src/components/Showcase.astro
  • website/src/components/TimingSimulator.astro
  • website/src/layouts/Layout.astro
  • website/src/pages/index.astro
  • website/src/styles/global.css
  • website/tsconfig.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@babico

babico commented Oct 20, 2026

Copy link
Copy Markdown
Author

Closing; work will be kept on the fork (babico/TeleDrive) only.

@babico babico closed this Oct 20, 2026
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