b164b8826f052b724428f90fb1235d53df992b4b
- routes: GET / teruskan headers ke shouldHandleS3; OPTIONS jawab
204 CORS generik bila bukan S3, handleS3Direct bila S3; komentar
bypass rate-limit S3 dipertahankan (registry abort pada 429)
- auth-controller: readLoginBody via LoginBodySchema; handleMe sederhanakan
(getAuthSession sudah cek bearer); import AuthSession dari dto
- swagger: pindah src/routes -> src/interfaces/http/swagger; tambah path
auth, /api/v1, /{bucket}, /{bucket}/{key}; version dari config.appVersion
- index: unref ketiga setInterval agar tak menahan process
- env: PORT fail-fast via PositiveIntSchema (default 4000 bila tak diset);
log config turun ke debug
- metrics: dokumentasikan uploadThroughput/queueSize/botUtilization
- test baru test/s3-routing.test.ts (GET / S3 vs home, OPTIONS 204 CORS)
Telegram Bot Uploader Backend
Backend production-ready untuk upload file ke Telegram yang tersimpan di private channel.
Setup
- Siapkan PostgreSQL database (produksi: database
uploadervia PgBouncer pool di100.121.180.82:6432) - Setup environment:
cp .env.example .env - Edit
.envdengan nilai yang sesuai (lihatDATABASE_URL,PORT=4000) - 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
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 .#teleuploader→nix copy→systemctl restart teleuploader - CI:
.github/workflows/deploy.yml(Gitea Actions / GitHub Actions) - Port:
4000(PORTenv) - 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.ymlbersifat legacy — jangan dipakai untuk deploy produksi.
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://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.
Versioning
This repository uses auto semantic versioning via semantic-release:
fix(...)commits → patch bump (v1.1.1 → v1.1.2)feat(...)commits → minor bump (v1.2.0)- breaking changes → major bump (v2.0.0)
chore/ci/docs/refactor/testcommits → no release
On every release, prepare.mjs syncs the version across package.json and
flake.nix, guaranteeing a fresh Nix store path and true auto-deploy via
the Build & Deploy (Nix) workflow.
Languages
TypeScript
93%
HTML
3.8%
Shell
1.7%
JavaScript
0.7%
Nix
0.6%
Other
0.2%