asepharyana 77340f63ae test: expand unit test coverage to all S3 edge cases; fix stale tests
Add comprehensive unit tests and repair stale tests that referenced the
old (pre-refactor) src/utils/* layout which no longer exists:

- s3-range: expand to 25 cases (suffix, clamping, malformed, zero-size,
  invalid totals, content-range formatting)
- s3-object-stream: rewrite against the real interfaces/s3 module; add
  multi-part ordering, ranges spanning parts, S3/CORS headers, fetch-error
  propagation
- s3-helpers-edge (new): compress heuristics, virtual-host bucket parsing,
  S3 route detection, client-IP/trustProxy, S3 response headers
- s3-auth-edge (new): verifyBodyHash, isS3Request, canonical-query-string
  encoding/sorting
- chunked-storage: rewrite against the real ChunkedStorage class (was
  importing deleted src/utils/chunked-storage) — chunk split, hashing,
  compression, size-limit guards, forwarding
- zip: fix stale import + add path-traversal/duplicate sanitization,
  locateZipEntry, empty-name fallback
- s3-docker-registry: fix stale src/config import; correct the rate-limit
  test to assert S3 routes INTENTIONALLY bypass rate limiting
- temp-stream (new): streamToTemp hashing, MD5, signature bytes, empty and
  oversized streams
- package.json: add the S3/unit files to test and test:s3 scripts

All new unit tests pass when run per-file (the project's documented mode to
avoid cross-file mock pollution). s3-sdk.test.ts (live E2E against a running
server) is deliberately excluded from test:s3.
2026-08-27 15:48:14 +07:00

Telegram Bot Uploader Backend

Backend production-ready untuk upload file ke Telegram yang tersimpan di private channel.

Setup

  1. Siapkan PostgreSQL database (produksi: database uploader via PgBouncer pool di 100.121.180.82:6432)
  2. Setup environment: cp .env.example .env
  3. Edit .env dengan nilai yang sesuai (lihat DATABASE_URL, PORT=4000)
  4. Create table: bun run db:migrate
  5. Install dependencies: bun install

Telegram Private Channel Setup

  1. Buat private channel Telegram
  2. Tambah bot sebagai admin di channel
  3. Dapatkan STORAGE_CHANNEL_ID (misalnya -1001234567890)

Running

bun run dev      # Development mode
bun run start    # Production mode

Deployment (Produksi — Nix + systemd)

Infra lama berbasis Docker + Traefik sudah dihapus dari orangevps (2026-08-02).

  • Host: orangevps
  • Service: systemd unit teleuploader (env via /etc/teleuploader/env / BWS secrets)
  • Build: Nix flake (flake.nix) — nix build .#teleuploadernix copysystemctl restart teleuploader
  • CI: .github/workflows/deploy.yml (Gitea Actions / GitHub Actions)
  • Port: 4000 (PORT env)
  • Domain: https://upload.asepharyana.my.id
  • Reverse proxy: Caddy (bukan Traefik/Docker)
  • Database: postgresql://asephs:***@100.121.180.82:6432/uploader (PgBouncer pool di imrnes, bukan 5432/localhost)
  • deploy.sh & Dockerfile & docker-compose.yml bersifat legacy — jangan dipakai untuk deploy produksi.

API Endpoints

  • POST /api/upload - Upload file
  • GET /f/:public_id - Download redirect
  • GET /file/:public_id/info - File metadata
  • GET /health - Health check

FAQ

URL permanen maksudnya apa? URL backend tetap permanen: https://upload.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.

S
Description
FileDrop Telegram-backed S3-compatible uploader
Readme
1.1 MiB
Languages
TypeScript 90.1%
HTML 7.6%
Shell 1.7%
Nix 0.5%
Dockerfile 0.1%