teldrive / README.md
mmnosratii's picture
Upgrade Teldrive to v2.0.12
764c47b
|
Raw History Blame Contribute Delete
2.04 kB
---
sdk: docker
app_port: 8080
---
# Teldrive v2 (2.0.12)
Docker deployment of [Teldrive](https://github.com/tgdrive/teldrive) v2.0.12.
All configuration is passed through environment variables / Secrets. No secret is stored in this repository.
## Required secrets
| Secret | Notes |
| --- | --- |
| `DB_DATA_SOURCE` | Existing PostgreSQL URL. Use Supabase **session mode (port 5432)**; transaction mode (6543) breaks LISTEN/NOTIFY used by v2. Unchanged from v1. |
| `JWT_SECRET` | Unchanged from v1. Reused as v2 `security.signing-key` (min 32 chars). |
| `TG_UPLOADS_ENCRYPTION_KEY` | Unchanged from v1. Kept as v2 content-encryption key, version 1. Must not contain `:`. |
| `ALLOWED_USERS` | Unchanged. Telegram usernames, comma separated. |
| `TELDRIVE_SECURITY_DATA_KEY` | **New in v2.** Base64 of exactly 32 bytes (`openssl rand -base64 32`). Encrypts Telegram credentials stored in PostgreSQL. Generate once, back it up, never change it. |
## Optional settings
| Variable | Default | Purpose |
| --- | --- | --- |
| `TELDRIVE_DATABASE_AUTO_MIGRATE_LEGACY` | `false` | One-way v1 -> v2 migration. Keep `false` until a verified backup exists and migration is approved. |
| `TELDRIVE_MODE` | `run` | `check` validates configuration/DB initialization instead of serving. |
| `TELDRIVE_HTTP_ADDRESS` | `0.0.0.0:8080` | Listen address. |
## Upgrade from v1
1. Take and verify PostgreSQL backups (schema, data, roles) and keep all keys.
2. Stop v1 writes.
3. Set `TELDRIVE_DATABASE_AUTO_MIGRATE_LEGACY=true` and start (or run with `TELDRIVE_MODE=check`).
The migrator stages the data, validates counts, then swaps schemas; the old schema is kept as `teldrive_legacy_backup_<timestamp>`.
4. Verify users, channels, bots, folders, files and downloads, then set the flag back to `false`.
The migration is one-way. Rollback = restore the pre-migration PostgreSQL backup and the old v1 image/configuration.
## Backup the following
- PostgreSQL backup
- `TELDRIVE_SECURITY_DATA_KEY`, `JWT_SECRET`, `TG_UPLOADS_ENCRYPTION_KEY`