diff --git a/docker-compose.yml b/docker-compose.yml index ef63287d2..9fb799f12 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: postgres: - image: postgres:alpine + image: postgres:16-alpine environment: POSTGRES_DB: httpsms POSTGRES_PASSWORD: dbpassword diff --git a/history.md b/history.md new file mode 100644 index 000000000..d70594ec5 --- /dev/null +++ b/history.md @@ -0,0 +1,153 @@ +# History — Setup httpSMS Self-Host + +Riwayat lengkap proses setup httpSMS secara lokal menggunakan Docker. + +--- + +## 2026-07-24 (Jumat) + +### Analisis Awal + +- Review keseluruhan project httpSMS +- Identifikasi kebutuhan: PostgreSQL, Redis, Firebase, HP Android +- Buat file `langka.md` (panduan setup awal) + +### Setup Docker + +- Copy `.env.docker` → `.env` untuk `api/` dan `web/` +- Jalankan `docker compose up --build` + +### Fix #1: Web Dockerfile — Husky Error + +- **Error:** `husky: .git can't be found` saat `pnpm install` di Docker +- **Penyebab:** Script `prepare` di `package.json` jalankan `husky` yang butuh `.git` +- **Fix:** Ganti `RUN pnpm install` → `RUN HUSKY=0 pnpm install --ignore-scripts && pnpm run postinstall` + +### Fix #2: PostgreSQL Version + +- **Error:** `postgres:alpine` (v18+) container unhealthy +- **Penyebab:** PostgreSQL 18+ ubah format volume mount +- **Fix:** Pin ke `postgres:16-alpine` di `docker-compose.yml` + +### Fix #3: Firebase Credentials + +- **Error:** `could not find default credentials` — API exit +- **Penyebab:** `FIREBASE_CREDENTIALS` kosong di `api/.env` +- **Fix:** Isi dengan service account JSON dari Firebase Console (1 baris) + +### Fix #4: Firebase Project Mismatch + +- **Error:** `invalid 'aud' claim; expected "ilhamnrachman-project" but got "httpsms-docker"` +- **Penyebab:** `web/.env` masih pakai Firebase config `httpsms-docker`, tapi `api/.env` pakai `ilhamnrachman-project` +- **Fix:** Update `web/.env` dengan Firebase Web SDK config dari project `ilhamnrachman-project`, rebuild web container + +### Fix #5: Firebase Auth Not Enabled + +- **Error:** `Firebase: Error (auth/configuration-not-found)` +- **Penyebab:** Email/Password sign-in belum di-enable di Firebase +- **Fix:** Firebase Console → Authentication → Sign-in method → Enable Email/Password + +### Hasil Akhir (Hari 1) + +- ✅ PostgreSQL running (port 5435) +- ✅ Redis running (port 6379) +- ✅ API running (port 8000) +- ✅ Web UI running (port 3000) +- ✅ Register akun berhasil + +--- + +## 2026-07-25 (Sabtu) + +### Setup Android App + +#### Fix #6: google-services.json Package Name + +- **Error:** `No matching client found for package name 'com.httpsms'` +- **Penyebab:** Register Android app di Firebase pakai package name `sms.android`, seharusnya `com.httpsms` +- **Fix:** Edit `android/app/google-services.json` → ganti `package_name` ke `com.httpsms` + +#### Build APK + +- Build via Android Studio: `./gradlew assembleDebug` +- Hasil: `android/app/build/outputs/apk/debug/app-debug.apk` (86MB) +- Transfer ke HP dan install + +### Setup Ngrok + +- Install: `brew install ngrok` +- Daftar akun di https://dashboard.ngrok.com +- Setup authtoken: `ngrok config add-authtoken TOKEN` +- Jalankan: `ngrok http 8000` +- Dapat URL: `https://2f9e-xxxxx.ngrok-free.app` + +### Login HP Android + +- App httpSMS → Login dengan: + - Server URL: `https://2f9e-xxxxx.ngrok-free.app` + - API Key: dari Web UI Settings + - Phone Number: `+6241209319023` +- Login berhasil ✅ + +### Fix #7: Heartbeat 401 + +- **Error:** `phone API Key ID [xxx] is not authorized to store heartbeat for phone number [+6241209319023]` +- **Penyebab:** `phone_api_keys` table punya `phone_numbers = {}` (kosong) +- **Fix:** `UPDATE phone_api_keys SET phone_numbers = '{+6241209319023}' WHERE id = 'cc437765-...';` + +### Fix #8: System User Missing + +- **Error:** `user with api key [system-user-api-key] does not exist` → Events endpoint 401 +- **Penyebab:** System user belum dibuat di database (dibutuhkan untuk event processing async) +- **Fix:** + +```sql +INSERT INTO users (id, api_key, email, subscription_name, created_at, updated_at) +VALUES ('system-user-id', 'system-user-api-key', 'system@local.com', 'free', NOW(), NOW()); +``` + +- Restart API: `docker compose restart api` + +### Test Kirim SMS + +- Kirim ke `+6285574670786` → **GENERIC_FAILURE** + - Bukan bug httpSMS — error dari Android SMS API + - Kemungkinan: pulsa habis, nomor salah, atau no signal +- Kirim ke `+6587992239` (Singapore) → status `pending` + - HP belum ambil pesan atau butuh SMS internasional + +### Heartbeat Berhasil + +- HP sukses kirim heartbeat ke server +- Terlihat di database: 2 heartbeat records + +--- + +## File yang Dimodifikasi + +| File | Perubahan | +| ---------------------------------- | --------------------------------------------------------------------- | +| `web/Dockerfile` | Skip husky saat Docker build | +| `docker-compose.yml` | Pin PostgreSQL ke `16-alpine` | +| `api/.env` | Isi Firebase credentials, GCP project ID | +| `web/.env` | Update Firebase Web SDK config | +| `android/app/google-services.json` | Ganti dari project lama ke `ilhamnrachman-project` + fix package_name | + +## File yang Dibuat + +| File | Isi | +| -------------- | --------------------------------------------- | +| `langka.md` | Panduan setup step-by-step (Bahasa Indonesia) | +| `readme_id.md` | README lengkap (Bahasa Indonesia) | +| `history.md` | File ini — riwayat setup | + +--- + +## Catatan Penting + +1. **Ngrok URL berubah tiap restart** — gunakan fixed domain (`ngrok http 8000 --domain=xxx`) supaya tidak perlu update di HP +2. **Firebase project harus sama** — Web UI, API, dan Android app harus pakai Firebase project yang sama +3. **System user wajib ada** — tanpa ini, event processing (push notif ke HP) tidak jalan +4. **Phone API key harus punya phone_numbers** — kalau kosong, HP tidak bisa kirim heartbeat/events +5. **SMTP credentials opsional** — tanpa ini, email notifikasi gagal tapi SMS tetap jalan +6. **Axiom 401 di logs** — abaikan, itu observability service opsional diff --git a/langka.md b/langka.md new file mode 100644 index 000000000..efa8eca2d --- /dev/null +++ b/langka.md @@ -0,0 +1,778 @@ +# Langkah Setup httpSMS Self-Host (Docker) + +Panduan lengkap untuk menjalankan httpSMS secara lokal menggunakan Docker. + +## Prerequisites + +- [Docker](https://docs.docker.com/get-docker/) + Docker Compose +- Akun [Firebase](https://console.firebase.google.com/) (gratis) +- HP Android (untuk jadi gateway SMS) + +--- + +## Langkah 1: Setup Firebase Project + +### 1.1 Buat Project Firebase + +1. Buka https://console.firebase.google.com/ +2. Klik **"Add project"** → beri nama (misal: `ilhamnrachman-project`) +3. Ikuti wizard sampai selesai + +### 1.2 Enable Email/Password Authentication + +1. Di Firebase Console → pilih project +2. Sidebar kiri → **Authentication** +3. Tab **Sign-in method** +4. Klik **Email/Password** → **Enable** → **Save** + +### 1.3 (Opsional) Disable Email Enumeration Protection + +Jika mengalami error saat login, disable email enumeration protection: + +1. Buka https://console.cloud.google.com/customer-identity/settings?project=NAMA-PROJECT +2. Atau: Firebase Console → Authentication → Settings → User actions +3. Uncheck **Email enumeration protection** + +### 1.4 Register Web App + +1. Firebase Console → ⚙️ **Project Settings** → scroll ke bawah +2. Klik **Add app** → pilih icon **Web** (``) +3. Beri nama (misal: "httpSMS Web") → Register +4. **Catat** Firebase Web SDK config: + +```js +const firebaseConfig = { + apiKey: "AIzaSy...", + authDomain: "nama-project.firebaseapp.com", + projectId: "nama-project", + storageBucket: "nama-project.firebasestorage.app", + messagingSenderId: "123456789", + appId: "1:123456789:web:abc123", + measurementId: "G-XXXXXXX" +}; +``` + +### 1.5 Generate Service Account Credentials + +1. Firebase Console → ⚙️ **Project Settings** → tab **Service accounts** +2. Klik **"Generate new private key"** +3. Download file JSON-nya (ini untuk API backend) + +--- + +## Langkah 2: Clone Repository + +```bash +git clone https://github.com/NdoleStudio/httpsms.git +cd httpsms +``` + +--- + +## Langkah 3: Fix Docker Build Issues + +### 3.1 Fix web/Dockerfile (Husky Error) + +Edit `web/Dockerfile`, ganti baris: + +```dockerfile +RUN pnpm install +``` + +Menjadi: + +```dockerfile +RUN HUSKY=0 pnpm install --ignore-scripts && pnpm run postinstall +``` + +> **Kenapa?** Husky butuh `.git` directory yang tidak ada di dalam Docker container. + +### 3.2 Fix docker-compose.yml (PostgreSQL Version) + +Edit `docker-compose.yml`, ganti: + +```yaml +image: postgres:alpine +``` + +Menjadi: + +```yaml +image: postgres:16-alpine +``` + +> **Kenapa?** PostgreSQL 18+ punya format volume mount baru yang incompatible dengan konfigurasi default. + +--- + +## Langkah 4: Setup Environment Variables + +### 4.1 Web Frontend (.env) + +```bash +cp web/.env.docker web/.env +``` + +Edit `web/.env` — update dengan Firebase Web SDK config kamu: + +```dotenv +API_BASE_URL=http://localhost:8000 + +FIREBASE_API_KEY=AIzaSy... +FIREBASE_AUTH_DOMAIN=nama-project.firebaseapp.com +FIREBASE_PROJECT_ID=nama-project +FIREBASE_STORAGE_BUCKET=nama-project.firebasestorage.app +FIREBASE_MESSAGING_SENDER_ID=123456789 +FIREBASE_APP_ID=1:123456789:web:abc123 +FIREBASE_MEASUREMENT_ID=G-XXXXXXX +``` + +### 4.2 API Backend (.env) + +```bash +cp api/.env.docker api/.env +``` + +Edit `api/.env` — update field berikut: + +```dotenv +# Ganti dengan project ID Firebase kamu +GCP_PROJECT_ID=nama-project + +# Paste seluruh isi service account JSON dalam 1 BARIS +FIREBASE_CREDENTIALS={"type":"service_account","project_id":"nama-project","private_key_id":"...","private_key":"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n","client_email":"firebase-adminsdk-xxxxx@nama-project.iam.gserviceaccount.com","client_id":"123456789","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url":"https://www.googleapis.com/robot/v1/metadata/x509/..."} +``` + +> **Penting:** `FIREBASE_CREDENTIALS` harus dalam 1 baris! Gunakan command ini untuk convert: +> ```bash +> cat path/to/firebase-credentials.json | jq -c . +> ``` + +--- + +## Langkah 5: Build dan Jalankan + +```bash +docker compose up --build -d +``` + +Tunggu proses build selesai (pertama kali bisa 5-10 menit). + +### Verifikasi + +```bash +docker compose ps +``` + +Semua service harus **Up**: + +| Service | Port | Fungsi | +|---------|------|--------| +| postgres | localhost:5435 | Database | +| redis | localhost:6379 | Cache | +| api | localhost:8000 | Backend API | +| web | localhost:3000 | Frontend UI | + +--- + +## Langkah 6: Register Akun + +1. Buka http://localhost:3000 +2. Klik **Sign Up** +3. Masukkan email + password +4. Login → buka **Settings** untuk melihat API key + +--- + +## Langkah 7: Buat System User + +System user diperlukan untuk proses event async. Connect ke database: + +```bash +docker exec -it httpsms-postgres-1 psql -U dbusername -d httpsms +``` + +Jalankan SQL: + +```sql +INSERT INTO users (id, api_key, email, subscription_name, created_at, updated_at) +VALUES ( + 'system-user-id', + 'uk_system-user-api-key', + 'system@local.com', + 'free', + NOW(), + NOW() +); +``` + +Kemudian update `api/.env`: + +```dotenv +EVENTS_QUEUE_USER_API_KEY=uk_system-user-api-key +EVENTS_QUEUE_USER_ID=system-user-id +``` + +Restart API: + +```bash +docker compose restart api +``` + +--- + +## Langkah 8: Setup & Build Android App + +### 8.1 Register Android App di Firebase + +1. Buka https://console.firebase.google.com/ → project kamu +2. Klik ⚙️ **gear icon** (di sebelah "Project Overview") → **Project settings** +3. Scroll ke bawah → bagian **"Your apps"** → klik **"+ Add app"** → pilih **Android** +4. Isi **Package name**: `com.httpsms` (HARUS tepat ini, jangan yang lain) +5. Klik **Register app** +6. Download **`google-services.json`** +7. Langkah "Add Firebase SDK" dan "Next steps" → **Skip** (klik "Continue to console") + +> ⚠️ **Penting:** Package name HARUS `com.httpsms`. Kalau salah (misal `sms.android`), build akan gagal dengan error "No matching client found for package name". + +### 8.2 Replace google-services.json + +Copy file yang baru di-download ke project: + +```bash +# Ganti path sesuai lokasi download kamu +cp ~/Downloads/google-services.json android/app/google-services.json +``` + +### 8.3 Verifikasi google-services.json + +Pastikan isi file ada `"package_name": "com.httpsms"`: + +```bash +cat android/app/google-services.json | grep package_name +``` + +Harus output: `"package_name": "com.httpsms"` + +Kalau isinya beda (misal `sms.android`), edit manual: +```bash +# Di file android/app/google-services.json, ganti: +"package_name": "sms.android" +# Menjadi: +"package_name": "com.httpsms" +``` + +### 8.4 Build APK + +#### Via Android Studio (GUI) + +1. Buka Android Studio +2. **File** → **Open** → pilih folder `android/` di project httpsms +3. Tunggu Gradle sync selesai (pertama kali agak lama) +4. Menu **Build** → **Build Bundle(s) / APK(s)** → **Build APK(s)** +5. Tunggu build selesai +6. Klik **"locate"** di notifikasi bawah + +#### Via Command Line (Terminal) + +```bash +cd android +./gradlew assembleDebug +``` + +Hasil APK ada di: +``` +android/app/build/outputs/apk/debug/app-debug.apk +``` + +> File APK sekitar **86MB** + +### 8.5 Install APK di HP Android + +Beberapa cara transfer APK ke HP: + +| Cara | Langkah | +|------|---------| +| **ADB (USB)** | Colok HP via USB, aktifkan USB Debugging, lalu: `adb install android/app/build/outputs/apk/debug/app-debug.apk` | +| **Telegram/WhatsApp** | Kirim file APK ke chat sendiri (Saved Messages), buka di HP, install | +| **Google Drive** | Upload APK ke Drive, download di HP | +| **Kabel USB manual** | Copy file APK ke storage HP, buka via File Manager, install | + +> ⚠️ HP harus enable **"Install from unknown sources"** di Settings → Security + +--- + +## Alur Kirim SMS + +### Komponen Sistem + +``` +┌─────────────────────┬──────────────────────┬────────────────────────────────────────┐ +│ Komponen │ Lokasi │ Fungsi │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ httpSMS Server │ Docker di Mac kamu │ API server, terima request, kirim push │ +│ │ (port 8000) │ notification ke HP │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ httpSMS Android App │ HP Android kamu │ Terima push notif → kirim SMS pakai │ +│ │ │ SIM card │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ Ngrok │ Tunnel ke Docker │ Biar HP Android bisa reach server │ +│ │ │ Docker di Mac (HTTP → HTTPS) │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ Firebase FCM │ Cloud Google │ Relay push notification ke HP Android │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ PostgreSQL │ Docker di Mac kamu │ Database utama (simpan pesan, user, │ +│ │ (port 5435) │ phone, webhook, dll) │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ Redis │ Docker di Mac kamu │ Cache & queue │ +│ │ (port 6379) │ │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ Web UI (Nuxt) │ Docker di Mac kamu │ Dashboard web untuk kelola SMS │ +│ │ (port 3000) │ │ +└─────────────────────┴──────────────────────┴────────────────────────────────────────┘ +``` + +### Flow Kirim SMS (Lengkap) + +``` + MacBook/Laptop httpSMS Server (Docker) HP Android + │ │ │ + │ 1. POST /v1/messages/send │ │ + │ "kirim SMS ke +6287654321" │ │ + │───────────────────────────────────>│ │ + │ │ │ + │ │ 2. Simpan pesan di PostgreSQL + │ │ Status: "pending" │ + │ │ │ + │ │ 3. Push notification (FCM) │ + │ │ "ada SMS yang perlu dikirim"│ + │ │─────────────────────────────>│ + │ │ │ + │ │ 4. HP fetch message detail │ + │ │ GET /v1/messages/outstanding + │ │<─────────────────────────────│ + │ │ │ + │ │ 5. HP kirim SMS via SIM card│ + │ │ ──────────────> Penerima + │ │ │ + │ │ 6. HP report: "SMS sent" │ + │ │<─────────────────────────────│ + │ │ Status: "sent" │ + │ │ │ + │ │ 7. HP report: "delivered" │ + │ │<─────────────────────────────│ + │ │ Status: "delivered" │ + │ │ │ + │ 8. Cek status via API/Web UI │ │ + │ Status: "delivered" ✅ │ │ + │<───────────────────────────────────│ │ + │ │ │ +``` + +### Flow Terima SMS (Lengkap) + +``` + Pengirim httpSMS Server (Docker) HP Android + │ │ │ + │ SMS masuk ke HP ─────────────────────────────────────────────────>│ + │ │ │ + │ │ 1. App detect SMS baru │ + │ │ POST /v1/messages/receive│ + │ │<─────────────────────────────│ + │ │ │ + │ │ 2. Simpan di PostgreSQL │ + │ │ │ + │ │ 3. (Opsional) Trigger webhook + │ │ POST ke URL callback kamu│ + │ │───────────> Server kamu │ + │ │ │ + MacBook/Laptop │ │ + │ 4. Lihat di Web UI / API │ │ + │ "SMS dari +62xxx: isi pesan" │ │ + │<───────────────────────────────────│ │ + │ │ │ +``` + +--- + +## Troubleshooting + +| Error | Solusi | +|-------|--------| +| `husky: .git can't be found` | Fix Dockerfile (Langkah 3.1) | +| PostgreSQL unhealthy | Pin ke `postgres:16-alpine` (Langkah 3.2) | +| `could not find default credentials` | `FIREBASE_CREDENTIALS` kosong/salah di `api/.env` | +| `invalid 'aud' claim` | Firebase config di `web/.env` tidak match dengan `api/.env` — harus project yang sama | +| `auth/configuration-not-found` | Enable Email/Password di Firebase Authentication → Sign-in method | +| API container exit | Cek logs: `docker compose logs api` | +| "Cannot find FCM token" (di HP) | `google-services.json` salah — pastikan dari Firebase project yang sama dan `package_name` = `com.httpsms` | +| "No matching client found for package name" (build error) | Package name di `google-services.json` bukan `com.httpsms`. Edit file atau register ulang di Firebase Console | +| Axiom 401 error (di logs API) | Abaikan — itu observability service opsional yang tidak di-setup | +| Heartbeat 401 "not authorized to store heartbeat" | Phone number belum ditambahkan ke phone_api_keys. Fix: `UPDATE phone_api_keys SET phone_numbers = '{+62xxx}' WHERE id = 'xxx';` | +| Events 401 "user with api key [system-user-api-key] does not exist" | System user belum dibuat. Ikuti Langkah 7 (Buat System User) lalu restart API | +| Settings kena 500 di Web UI | Biasanya token Firebase expired. Logout → login ulang. Atau cek `docker compose logs api` untuk detail error | + +--- + +## Halaman Web UI (Routes) + +Setelah login di http://localhost:3000, berikut halaman-halaman yang tersedia: + +| URL | Halaman | Fungsi | +|-----|---------|--------| +| `http://localhost:3000/` | Home | Landing page / dashboard | +| `http://localhost:3000/threads` | Threads | **Lihat semua SMS (conversations)** | +| `http://localhost:3000/threads/[id]` | Thread Detail | Percakapan dengan 1 kontak | +| `http://localhost:3000/settings` | Settings | **API Key, Webhooks, Phones, Schedule** | +| `http://localhost:3000/messages` | Messages | Daftar semua pesan | +| `http://localhost:3000/bulk-messages` | Bulk Messages | Kirim SMS massal (CSV/Excel) | +| `http://localhost:3000/search-messages` | Search | Cari pesan (butuh Turnstile) | +| `http://localhost:3000/billing` | Billing | Info langganan & usage | +| `http://localhost:3000/heartbeats/[id]` | Heartbeats | Riwayat status online HP | +| `http://localhost:3000/phone-api-keys` | Phone API Keys | Kelola API keys per phone | + +### Halaman Settings (http://localhost:3000/settings) + +Di halaman ini ada beberapa section (scroll ke bawah): + +| Section | Fungsi | +|---------|--------| +| **Account** | Lihat API Key, email, QR code | +| **Phones** | Lihat HP yang terhubung + statusnya | +| **Webhooks** | Tambah URL webhook untuk terima notifikasi SMS masuk | +| **Send Schedule** | Atur jadwal & window waktu kirim SMS | +| **Notifications** | Setting email notifikasi | +| **Discord** | Integrasi dengan Discord bot | +| **Danger Zone** | Hapus akun, rotate API key | + +### Cara Akses Webhook + +1. Buka **http://localhost:3000/settings** +2. Scroll ke bawah sampai section **"Webhooks"** +3. Klik **"Add Webhook"** +4. Isi: + - **URL**: endpoint server kamu (harus HTTPS) + - **Events**: pilih event yang mau di-trigger (misal: `message.phone.received`) + - **Signing Key** (opsional): untuk verify webhook signature +5. Klik **Save** + +### Events Webhook yang Tersedia + +| Event | Kapan Trigger | +|-------|--------------| +| `message.phone.received` | SMS masuk ke HP | +| `message.phone.sent` | SMS berhasil terkirim | +| `message.send.failed` | SMS gagal terkirim | +| `message.phone.delivered` | SMS sudah sampai tujuan | +| `message.send.expired` | SMS expired (timeout) | +| `message.call.missed` | Missed call masuk | +| `phone.heartbeat.offline` | HP offline | +| `phone.heartbeat.online` | HP kembali online | + +--- + +## Langkah 9: Expose API ke Internet (Ngrok) + +App Android **wajib** pakai HTTPS untuk connect ke server. Karena local server cuma HTTP, kita pakai **ngrok** untuk bikin tunnel HTTPS gratis. + +### 9.1 Apa itu Ngrok? + +Ngrok membuat "terowongan" dari internet ke laptop kamu. Jadi HP Android bisa akses server local kamu dari mana saja lewat URL HTTPS. + +``` +Internet (HTTPS) Laptop kamu (HTTP) +https://xxx.ngrok-free.app → http://localhost:8000 +``` + +### 9.2 Install Ngrok + +```bash +# macOS +brew install ngrok + +# Atau download manual dari https://ngrok.com/download +``` + +### 9.3 Daftar Akun Ngrok (Gratis) + +1. Buka https://dashboard.ngrok.com/signup +2. Daftar gratis (bisa pakai akun Google/GitHub) +3. Setelah login, buka https://dashboard.ngrok.com/get-started/your-authtoken +4. Copy **authtoken** yang terlihat di halaman itu + +### 9.4 Setup Authtoken + +```bash +ngrok config add-authtoken 2abc123DEfgHIjkLMnoPQR_xxxxxxxxxxxxx +``` + +> Ini cuma perlu dilakukan **1 kali** saja. Token tersimpan di config ngrok. + +### 9.5 Jalankan Ngrok + +Pastikan Docker (API) sudah jalan, lalu buka **terminal baru** dan jalankan: + +```bash +ngrok http 8000 +``` + +Akan muncul tampilan seperti ini: + +``` +ngrok (Ctrl+C to quit) + +Session Status online +Account emailkamu@gmail.com (Plan: Free) +Version 3.x.x +Region Asia Pacific (ap) +Latency - +Web Interface http://127.0.0.1:4040 +Forwarding https://2f9e-xxxxx.ngrok-free.app -> http://localhost:8000 + +Connections ttl opn rt1 rt5 p50 p90 + 0 0 0.00 0.00 0.00 0.00 +``` + +**Yang penting:** Catat URL di baris `Forwarding` → `https://2f9e-xxxxx.ngrok-free.app` + +### 9.6 Cara Pakai URL Ngrok + +Setelah ngrok jalan, URL HTTPS tersebut bisa dipakai untuk: + +#### a) Login di App Android + +Di halaman login app httpSMS, isi **Server URL**: +``` +https://2f9e-xxxxx.ngrok-free.app +``` + +#### b) Akses API Documentation (Swagger) + +Buka di browser: +``` +https://2f9e-xxxxx.ngrok-free.app/index.html +``` + +#### c) Kirim SMS via API dari mana saja + +```bash +curl -X POST https://2f9e-xxxxx.ngrok-free.app/v1/messages/send \ + -H "x-api-key: API_KEY_KAMU" \ + -H "Content-Type: application/json" \ + -d '{ + "from": "+628123456789", + "to": "+628987654321", + "content": "Test SMS!" + }' +``` + +#### d) Monitor Traffic (Web Interface) + +Buka http://127.0.0.1:4040 di browser — bisa lihat semua request yang lewat ngrok secara real-time. + +### 9.7 Catatan Penting Ngrok + +| Hal | Keterangan | +|-----|-----------| +| URL berubah setiap restart | Setiap kali stop/start ngrok, URL-nya baru. Perlu update di app Android | +| Jangan tutup terminal | Ngrok harus tetap jalan selama kamu pakai. Kalau ditutup, tunnel mati | +| Free plan limit | 1 tunnel, random URL, ada bandwidth limit (cukup untuk development) | +| Ngrok warning page | Pertama kali akses dari browser, ngrok tampilkan halaman warning. Klik "Visit Site". Untuk API call dari app/curl ini tidak masalah | +| Jalankan bersamaan | Docker (`docker compose up -d`) di terminal 1, Ngrok (`ngrok http 8000`) di terminal 2 | + +### 9.8 Ringkasan: Terminal yang Harus Jalan + +``` +Terminal 1 (Docker): +$ cd httpsms +$ docker compose up -d +→ Jalankan API, DB, Redis, Web UI + +Terminal 2 (Ngrok): +$ ngrok http 8000 +→ Expose API ke internet via HTTPS +→ Biarkan jalan terus selama pakai + +Browser: +→ http://localhost:3000 (Web UI - kelola SMS) +→ http://127.0.0.1:4040 (Ngrok dashboard - monitor traffic) +``` + +--- + +## Langkah 10: Login di HP Android + +### 10.1 Sebelum Login — Pastikan Semua Jalan + +Checklist sebelum buka app di HP: + +- [x] Docker running (`docker compose ps` — semua UP) +- [x] Ngrok running (`ngrok http 8000` — ada URL HTTPS) +- [x] APK sudah terinstall di HP (dari Langkah 8) +- [x] HP terhubung ke internet (WiFi/data) + +### 10.2 Dapat API Key + +1. Buka **http://localhost:3000** di browser laptop +2. Login dengan akun yang sudah di-register +3. Buka halaman **Settings** (icon gear / menu Settings) +4. Di situ terlihat **API Key** kamu (format: `uk_xxxxx...`) +5. Ada juga **QR Code** yang bisa di-scan dari HP + +### 10.3 Login di App + +Buka app httpSMS di HP Android. Halaman login akan tampil: + +``` +┌─────────────────────────────┐ +│ │ +│ Server URL: │ +│ [https://xxx.ngrok-free.app] │ +│ │ +│ API Key: │ +│ [uk_xxxxx...] [📷 Scan] │ +│ │ +│ Phone Number (SIM 1): │ +│ [+628123456789] │ +│ │ +│ Phone Number (SIM 2): │ +│ [+628987654321] (opsional) │ +│ │ +│ [ LOGIN ] │ +│ │ +└─────────────────────────────┘ +``` + +| Field | Isi | Contoh | +|-------|-----|--------| +| **Server URL** | URL HTTPS dari ngrok | `https://2f9e-xxxxx.ngrok-free.app` | +| **API Key** | Copy dari Web UI Settings, atau klik 📷 Scan QR | `uk_abc123...` | +| **Phone Number SIM 1** | Nomor HP kamu (format internasional) | `+628123456789` | +| **Phone Number SIM 2** | Nomor SIM 2 (opsional, kalau Dual SIM) | `+628987654321` | + +Klik **Login**. + +### 10.4 Troubleshooting Login + +| Error | Penyebab | Solusi | +|-------|----------|--------| +| "Cannot find FCM token" | `google-services.json` salah project atau package name | Pastikan `package_name` = `com.httpsms` dan dari project Firebase yang sama | +| "Server URL must be HTTPS" | URL pakai `http://` | Harus pakai ngrok URL yang `https://` | +| "Server URL is invalid" | URL salah format | Pastikan URL lengkap termasuk `https://` | +| Connection timeout | Ngrok mati atau API down | Cek ngrok masih jalan + `docker compose ps` | +| 401 Unauthorized | API key salah | Copy ulang API key dari Web UI Settings | + +### 10.5 Verifikasi Koneksi Berhasil + +Setelah login berhasil: + +1. **Di HP** — app menampilkan halaman utama dengan status phone kamu +2. **Di Web UI** (http://localhost:3000) — sidebar kiri menunjukkan HP kamu **Online** (icon hijau) +3. **Di Ngrok dashboard** (http://127.0.0.1:4040) — terlihat request heartbeat dari HP + +### 10.6 Permission yang Diminta App + +Saat pertama kali login, app akan minta permission: + +| Permission | Fungsi | Wajib? | +|-----------|--------|--------| +| Send SMS | Untuk kirim SMS | ✅ Ya | +| Receive SMS | Untuk detect SMS masuk | ✅ Ya | +| Read Phone State | Detect nomor HP & SIM | ✅ Ya | +| Read SMS | Akses inbox SMS | ✅ Ya | +| Notifications | Terima push notification | ✅ Ya | + +**Allow semua** — tanpa permission ini app tidak bisa berfungsi. + +--- + +## Langkah 11: Kirim SMS Pertama + +### Via Web UI + +1. Buka http://localhost:3000 +2. Klik **New Message** atau **Compose** +3. Isi nomor tujuan + isi pesan +4. Klik **Send** + +### Via API (curl) + +```bash +curl -X POST http://localhost:8000/v1/messages/send \ + -H "x-api-key: API_KEY_KAMU" \ + -H "Content-Type: application/json" \ + -d '{ + "from": "+628123456789", + "to": "+628987654321", + "content": "Halo dari httpSMS!" + }' +``` + +### Via Ngrok URL (dari luar) + +```bash +curl -X POST https://abc123.ngrok-free.app/v1/messages/send \ + -H "x-api-key: API_KEY_KAMU" \ + -H "Content-Type: application/json" \ + -d '{ + "from": "+628123456789", + "to": "+628987654321", + "content": "Test SMS dari luar!" + }' +``` + +--- + +## Ringkasan Arsitektur Final + +``` +┌─────────────────────────────────────────────────┐ +│ LAPTOP / SERVER │ +│ │ +│ ┌────────┐ ┌───────┐ ┌─────┐ ┌─────────┐ │ +│ │Postgres│ │ Redis │ │ API │ │ Web UI │ │ +│ │ :5435 │ │ :6379 │ │:8000│ │ :3000 │ │ +│ └────────┘ └───────┘ └──┬──┘ └─────────┘ │ +│ │ │ +└─────────────────────────────┼───────────────────┘ + │ + ┌────┴─────┐ + │ Ngrok │ + │ (HTTPS) │ + └────┬─────┘ + │ + ┌─────────┴──────────┐ + │ │ + ┌─────▼─────┐ ┌──────▼──────┐ + │ HP Android│ │ External │ + │ (httpSMS) │ │ API Client │ + └───────────┘ └─────────────┘ +``` + +--- + +## Perintah Berguna + +```bash +# Lihat status containers +docker compose ps + +# Lihat logs +docker compose logs api --tail 50 +docker compose logs web --tail 50 + +# Restart service tertentu +docker compose restart api + +# Stop semua +docker compose down + +# Stop + hapus data (fresh start) +docker compose down -v + +# Rebuild setelah ubah .env atau code +docker compose up --build -d + +# Jalankan ngrok (di terminal terpisah) +ngrok http 8000 +``` diff --git a/readme_id.md b/readme_id.md new file mode 100644 index 000000000..9138e43a0 --- /dev/null +++ b/readme_id.md @@ -0,0 +1,468 @@ +# httpSMS - SMS Gateway via HP Android + +header + +## Apa itu httpSMS? + +**httpSMS** adalah layanan yang mengubah HP Android kamu menjadi **SMS Gateway**. Kamu bisa mengirim dan menerima SMS lewat HTTP API — tanpa perlu beli nomor virtual atau langganan layanan SMS mahal. + +Cukup install aplikasi httpSMS di HP Android, dan HP-mu akan menjadi "modem SMS" yang bisa dikontrol lewat API atau Web UI. + +--- + +## Kenapa Pakai httpSMS? + +- ✅ **Gratis** — pakai nomor HP sendiri, tidak perlu beli nomor virtual +- ✅ **Self-host** — semua data ada di server kamu sendiri +- ✅ **Open source** — kode sumber terbuka (AGPL-3.0) +- ✅ **API sederhana** — kirim SMS cukup 1 HTTP request +- ✅ **End-to-end encryption** — pesan bisa dienkripsi AES-256 +- ✅ **Webhook** — terima notifikasi saat SMS masuk +- ✅ **Rate limiting** — kontrol kecepatan pengiriman SMS +- ✅ **Multi-SIM** — support Dual SIM + +--- + +## Arsitektur Sistem + +``` +┌─────────────────────────────────────────────────────────────────┐ +│ INFRASTRUKTUR │ +│ │ +│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ +│ │PostgreSQL│ │ Redis │ │ API │ │ Web UI │ │ +│ │ Database │ │ Cache │ │ (Go) │ │ (Nuxt) │ │ +│ │ :5435 │ │ :6379 │ │ :8000 │ │ :3000 │ │ +│ └──────────┘ └──────────┘ └────┬─────┘ └──────────┘ │ +│ │ │ +└──────────────────────────────────────┼─────────────────────────┘ + │ + Firebase Cloud Messaging + │ + ▼ + ┌──────────────────┐ + │ HP Android │ + │ (App httpSMS) │ + │ │ + │ Kirim & Terima │ + │ SMS │ + └──────────────────┘ +``` + +### Komponen Sistem + +``` +┌─────────────────────┬──────────────────────┬────────────────────────────────────────┐ +│ Komponen │ Lokasi │ Fungsi │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ httpSMS Server │ Docker di Mac kamu │ API server, terima request, kirim push │ +│ │ (port 8000) │ notification ke HP │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ httpSMS Android App │ HP Android kamu │ Terima push notif → kirim SMS pakai │ +│ │ │ SIM card │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ Ngrok │ Tunnel ke Docker │ Biar HP Android bisa reach server │ +│ │ │ Docker di Mac (HTTP → HTTPS) │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ Firebase FCM │ Cloud Google │ Relay push notification ke HP Android │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ PostgreSQL │ Docker di Mac kamu │ Database utama (simpan pesan, user, │ +│ │ (port 5435) │ phone, webhook, dll) │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ Redis │ Docker di Mac kamu │ Cache & queue │ +│ │ (port 6379) │ │ +├─────────────────────┼──────────────────────┼────────────────────────────────────────┤ +│ Web UI (Nuxt) │ Docker di Mac kamu │ Dashboard web untuk kelola SMS │ +│ │ (port 3000) │ │ +└─────────────────────┴──────────────────────┴────────────────────────────────────────┘ +``` + +### Komponen + +| Komponen | Teknologi | Fungsi | +|----------|-----------|--------| +| **API** | Go + Fiber | Backend REST API | +| **Web UI** | Nuxt 3 + Vuetify | Dashboard web untuk kelola SMS | +| **Database** | PostgreSQL | Simpan data user, pesan, phone | +| **Cache** | Redis | Caching dan queue | +| **Push Notification** | Firebase Cloud Messaging | Kirim perintah ke HP Android | +| **Android App** | Kotlin | Eksekusi kirim/terima SMS | + +--- + +## Alur Kerja + +### Cara Kerja httpSMS (Flow Lengkap) + +``` + MacBook/Laptop httpSMS Server (Docker) HP Android + │ │ │ + │ 1. POST /v1/messages/send │ │ + │ "kirim SMS ke +6287654321" │ │ + │───────────────────────────────────>│ │ + │ │ │ + │ │ 2. Simpan pesan di PostgreSQL + │ │ Status: "pending" │ + │ │ │ + │ │ 3. Push notification (FCM) │ + │ │ "ada SMS yang perlu dikirim"│ + │ │─────────────────────────────>│ + │ │ │ + │ │ 4. HP fetch message detail │ + │ │ GET /v1/messages/outstanding + │ │<─────────────────────────────│ + │ │ │ + │ │ 5. HP kirim SMS via SIM card│ + │ │ ──────────────> Penerima + │ │ │ + │ │ 6. HP report: "SMS sent" │ + │ │ POST /v1/messages/events │ + │ │<─────────────────────────────│ + │ │ Status: "sent" │ + │ │ │ + │ │ 7. HP report: "delivered" │ + │ │ POST /v1/messages/events │ + │ │<─────────────────────────────│ + │ │ Status: "delivered" │ + │ │ │ + │ 8. Cek status via API/Web UI │ │ + │ Status: "delivered" ✅ │ │ + │<───────────────────────────────────│ │ + │ │ │ +``` + +### Alur Terima SMS (Flow Lengkap) + +``` + Pengirim httpSMS Server (Docker) HP Android + │ │ │ + │ SMS masuk ke HP ─────────────────────────────────────────────────>│ + │ │ │ + │ │ 1. App detect SMS baru │ + │ │ POST /v1/messages/receive│ + │ │<─────────────────────────────│ + │ │ │ + │ │ 2. Simpan di PostgreSQL │ + │ │ Type: "mobile-originated"│ + │ │ │ + │ │ 3. (Opsional) Trigger webhook + │ │ POST ke URL callback kamu│ + │ │───────────> Server kamu │ + │ │ │ + MacBook/Laptop │ │ + │ 4. Lihat di Web UI / API │ │ + │ "SMS dari +62xxx: isi pesan" │ │ + │<───────────────────────────────────│ │ + │ │ │ +``` + +### Status Pesan + +| Status | Artinya | +|--------|---------| +| `pending` | Pesan dibuat, menunggu HP ambil | +| `sending` | HP sedang proses kirim | +| `sent` | HP sudah kirim SMS (tapi belum konfirmasi sampai) | +| `delivered` | SMS sudah sampai ke penerima ✅ | +| `failed` | Gagal kirim (no signal, nomor salah, dll) | +| `expired` | HP tidak kirim dalam waktu timeout | + +--- + +## Fitur Utama + +### 🔐 End-to-End Encryption + +Pesan dienkripsi menggunakan **AES-256**. Encryption key tersimpan hanya di HP Android-mu — server tidak bisa baca isi pesan. + +### 🔔 Webhook + +Terima notifikasi real-time saat ada SMS masuk. API akan POST ke URL callback yang kamu tentukan. + +### ⏱️ Rate Limiting (Back Pressure) + +Atur kecepatan kirim SMS (misal: 3 pesan/menit). Meskipun kamu request kirim ke 100 orang sekaligus, SMS dikirim secara bertahap. + +### ⏰ Message Expiration + +Set timeout untuk pesan. Kalau HP tidak berhasil kirim dalam waktu tertentu, pesan expired dan kamu dapat notifikasi. + +### 📱 Dual SIM Support + +Pilih SIM mana yang dipakai untuk kirim SMS — SIM 1 atau SIM 2. + +--- + +## Cara Pakai API + +### Kirim SMS + +```bash +curl -X POST http://localhost:8000/v1/messages/send \ + -H "x-api-key: API_KEY_KAMU" \ + -H "Content-Type: application/json" \ + -d '{ + "from": "+628123456789", + "to": "+628987654321", + "content": "Halo dari httpSMS!" + }' +``` + +### Kirim SMS (Go) + +```go +client := httpsms.New(httpsms.WithAPIKey("API_KEY_KAMU")) + +client.Messages.Send(context.Background(), &httpsms.MessageSendParams{ + Content: "Halo dari httpSMS!", + From: "+628123456789", + To: "+628987654321", +}) +``` + +### Kirim SMS (JavaScript) + +```javascript +import HttpSms from 'httpsms' + +const client = new HttpSms('API_KEY_KAMU') + +await client.messages.postSend({ + content: 'Halo dari httpSMS!', + from: '+628123456789', + to: '+628987654321', +}) +``` + +### Lihat Daftar Pesan + +```bash +curl http://localhost:8000/v1/messages?from=%2B628123456789 \ + -H "x-api-key: API_KEY_KAMU" +``` + +### Setup Webhook + +```bash +curl -X POST http://localhost:8000/v1/webhooks \ + -H "x-api-key: API_KEY_KAMU" \ + -H "Content-Type: application/json" \ + -d '{ + "url": "https://yourserver.com/webhook", + "events": ["message.phone.received"], + "signing_key": "secret-key-kamu" + }' +``` + +--- + +## Setup Self-Host (Docker) + +> Panduan lengkap step-by-step ada di [langka.md](./langka.md) + +### Quick Start + +```bash +# 1. Clone +git clone https://github.com/NdoleStudio/httpsms.git +cd httpsms + +# 2. Setup env +cp web/.env.docker web/.env +cp api/.env.docker api/.env +# Edit kedua .env file dengan Firebase config kamu + +# 3. Fix Dockerfile (lihat langka.md untuk detail) +# - web/Dockerfile: skip husky +# - docker-compose.yml: pin postgres:16-alpine + +# 4. Build & Run +docker compose up --build -d + +# 5. Buka http://localhost:3000 +``` + +### Yang Dibutuhkan + +| Komponen | Wajib? | Keterangan | +|----------|--------|-----------| +| Docker | ✅ Ya | Untuk jalankan semua service | +| Firebase project | ✅ Ya | Untuk auth + push notification | +| HP Android | ✅ Ya | Sebagai SMS gateway | +| SMTP server | ❌ Opsional | Untuk email notifikasi | +| Cloudflare Turnstile | ❌ Opsional | Untuk captcha di fitur search | + +--- + +## Struktur Project + +``` +httpsms/ +├── api/ # Backend API (Go + Fiber) +│ ├── pkg/ +│ │ ├── handlers/ # HTTP route handlers +│ │ ├── services/ # Business logic +│ │ ├── repositories/ # Database queries +│ │ ├── entities/ # Data models +│ │ ├── events/ # Event definitions +│ │ ├── listeners/ # Event handlers +│ │ ├── validators/ # Request validation +│ │ ├── middlewares/ # Auth, logging +│ │ ├── emails/ # Email templates +│ │ ├── di/ # Dependency injection +│ │ └── cache/ # Redis cache layer +│ ├── docs/ # Swagger API docs +│ ├── main.go # Entry point +│ └── Dockerfile +│ +├── web/ # Frontend (Nuxt 3 + Vuetify) +│ ├── app/ +│ │ ├── stores/ # Pinia state management +│ │ ├── composables/ # Vue composables +│ │ ├── middleware/ # Route middleware +│ │ ├── plugins/ # Firebase, chart.js +│ │ └── utils/ # Helper functions +│ ├── shared/types/ # TypeScript types (dari Swagger) +│ ├── nuxt.config.ts +│ └── Dockerfile +│ +├── android/ # Android App (Kotlin) +│ └── app/src/main/java/com/httpsms/ +│ ├── MainActivity.kt +│ ├── FirebaseMessagingService.kt # Handle FCM push +│ ├── SmsManagerService.kt # Kirim SMS +│ ├── ReceivedReceiver.kt # Terima SMS +│ ├── HttpSmsApiService.kt # HTTP client ke API +│ └── Settings.kt # App settings +│ +├── tests/ # Integration tests +│ ├── emulator/ # Phone emulator (untuk testing) +│ ├── docker-compose.yml +│ └── integration_test.go +│ +├── docker-compose.yml # Production docker setup +├── langka.md # Panduan setup (Bahasa Indonesia) +└── README.md # English README +``` + +--- + +## API Documentation + +Setelah server berjalan, buka Swagger UI: + +``` +http://localhost:8000/index.html +``` + +### Endpoint Utama + +| Method | Endpoint | Fungsi | +|--------|----------|--------| +| `POST` | `/v1/messages/send` | Kirim SMS | +| `POST` | `/v1/messages/receive` | Terima SMS (dari HP) | +| `GET` | `/v1/messages` | List pesan | +| `GET` | `/v1/messages/:id` | Detail pesan | +| `DELETE` | `/v1/messages/:id` | Hapus pesan | +| `POST` | `/v1/messages/bulk-send` | Kirim SMS massal (CSV/Excel) | +| `GET` | `/v1/heartbeats` | Status HP online/offline | +| `POST` | `/v1/webhooks` | Buat webhook | +| `GET` | `/v1/users/me` | Info user + API key | + +--- + +## API Clients (SDK) + +Library resmi untuk integrasi: + +- **Go**: https://github.com/NdoleStudio/httpsms-go +- **JavaScript/TypeScript**: https://github.com/NdoleStudio/httpsms-node + +--- + +## Keamanan + +| Aspek | Detail | +|-------|--------| +| Authentication | Firebase Auth (JWT) + API Key | +| Encryption | AES-256 end-to-end (opsional) | +| Input Validation | Semua request di-validate + sanitize | +| Rate Limiting | Configurable per phone | +| Captcha | Cloudflare Turnstile di endpoint search | +| API Key Format | Prefix `uk_` + 64 char random base64 | + +### Tips Keamanan untuk Self-Host + +1. Jangan expose port database (5435) ke public +2. Gunakan HTTPS di production (pasang reverse proxy seperti Nginx/Caddy) +3. Aktifkan E2E encryption untuk pesan sensitif +4. Rotate API key secara berkala (bisa via Settings) +5. Set firewall untuk hanya allow traffic yang diperlukan + +--- + +## Troubleshooting + +| Masalah | Solusi | +|---------|--------| +| `husky: .git can't be found` | Fix `web/Dockerfile`: `RUN HUSKY=0 pnpm install --ignore-scripts && pnpm run postinstall` | +| PostgreSQL unhealthy | Ganti `postgres:alpine` → `postgres:16-alpine` di `docker-compose.yml` | +| `could not find default credentials` | Isi `FIREBASE_CREDENTIALS` di `api/.env` (1 baris JSON) | +| `invalid 'aud' claim` | Firebase config di `web/.env` harus dari project yang sama dengan `api/.env` | +| `auth/configuration-not-found` | Enable Email/Password di Firebase Console → Authentication → Sign-in method | +| API container exit | Cek: `docker compose logs api` | +| Axiom 401 error (di logs) | Abaikan — itu observability service opsional yang tidak di-setup | + +--- + +## Perintah Docker + +```bash +# Jalankan semua service +docker compose up --build -d + +# Lihat status +docker compose ps + +# Lihat logs API +docker compose logs api --tail 50 -f + +# Restart API setelah ubah .env +docker compose restart api + +# Stop semua +docker compose down + +# Reset total (hapus database + cache) +docker compose down -v + +# Connect ke database +docker exec -it httpsms-postgres-1 psql -U dbusername -d httpsms +``` + +--- + +## Use Cases + +- **Notifikasi OTP** — kirim kode verifikasi ke customer +- **Reminder** — kirim pengingat jadwal/appointment +- **Marketing SMS** — blast SMS promo (dengan rate limiting) +- **Monitoring** — terima alert via SMS dari sistem +- **2-Way SMS** — terima balasan customer via webhook +- **Integrasi Discord** — forward SMS ke Discord channel + +--- + +## Lisensi + +GNU Affero General Public License v3.0 — lihat [LICENSE](LICENSE) + +--- + +## Link + +- 📖 Dokumentasi: https://docs.httpsms.com +- 🌐 Website: https://httpsms.com +- 💬 Discord: https://discord.gg/kGk8HVqeEZ +- 🐛 Issues: https://github.com/NdoleStudio/httpsms/issues +- 📱 Download APK: https://github.com/NdoleStudio/httpsms/releases diff --git a/web/Dockerfile b/web/Dockerfile index f283fd32a..2cf155723 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -8,7 +8,7 @@ COPY package.json pnpm-lock.yaml ./ # Install pnpm RUN npm install -g pnpm -RUN pnpm install +RUN HUSKY=0 pnpm install --ignore-scripts && pnpm run postinstall COPY . . RUN pnpm run generate