af160e0f33bdde7b8739fb0a957ce16c590ab147
Deploy FileDrop / deploy (push) Successful in 43s
HIGH severity fixes: - H1: Bot token leak via 302 redirect — always proxy S3 GETs - H2: PUT TOCTOU race — add unique partial index (bucket_id, s3_key) WHERE NOT deleted - H3: GET/HEAD ignore conditional headers (If-Match, If-None-Match, etc.) - H4: Body payload hash not verified — add verifyBodyHash() post-stream check - H5: Header-based auth has no expiry check — add 15-min clock skew window - H7: Multipart abort does not delete parts — DELETE before UPDATE status - H8: CompleteMultipartUpload skips part number & etag verification - H9: XML regex fails on keys containing < — use non-greedy [\s\S]*? - H10: Path-style vs virtual-hosted key decode mismatch MEDIUM severity fixes: - M1: Add Date header fallback for x-amz-date - M2/M3: Validate service/termination in credential scope - M4: Temp file leak when forwardToStorage throws in handleUploadPart - M5: Multipart key consistency check (s3Key matches URL) - M7: Use stored content-type from multipart initiate - M9: Copy conditional headers skip when fileHash is null - M11: Add 1000-key limit on DeleteObjects - M13: Stricter bucket name validation (no .., no IP format) - M14: NaN partNumber bypasses validation LOW fixes: - normalizeUri: dot-segment removal per RFC 3986 - localeCompare -> byte-order comparison in canonical query string - Validate host in signed headers - Server: AmazonS3 header on all responses - x-amz-id-2 separate from x-amz-request-id - IPv6 handling in stripPort - Quiet element whitespace tolerance in XML parser - content-type: application/xml on empty 2xx responses - Duplicate interfaces/s3/ -> re-exports from utils/s3/ Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Telegram Bot Uploader Backend
Backend production-ready untuk upload file ke Telegram yang tersimpan di private channel.
Setup
- Install PostgreSQL database
- Buat database:
createdb telegram_uploader - Setup environment:
cp .env.example .env - Edit
.envdengan nilai yang sesuai - Create table:
bun run db:migrate - Install dependencies:
bun install
Telegram Private Channel Setup
- Buat private channel Telegram
- Tambah bot sebagai admin di channel
- Dapatkan
STORAGE_CHANNEL_ID(misalnya -1001234567890)
Running
bun run dev # Development mode
bun run start # Production mode
API Endpoints
POST /api/upload- Upload fileGET /f/:public_id- Download redirectGET /file/:public_id/info- File metadataGET /health- Health check
FAQ
URL permanen maksudnya apa?
URL backend tetap permanen: https://tele.asepharyana.my.id/f/{public_id}
Ini berarti URL service Anda fix, bukan jaminan file Telegram abadi.
Testing
Gunakan bot Telegram untuk upload, atau upload API langsung via HTTP.
Languages
TypeScript
89.5%
HTML
8%
Shell
1.8%
Nix
0.5%
Dockerfile
0.2%