Custom Gateway Setup 🛠️
Please consider the Private Server mode first. It offers additional privacy features and is not significantly different from a self-built solution—with far fewer setup operations required.
Please note
- Custom builds are not officially supported
- No troubleshooting assistance provided
Before You Begin ⚠️
Secure Your Deployment
Default configuration exposes public endpoints. You must implement:
- Firewall rules
- HTTPS encryption
- Additional authentication mechanisms if necessary
Use at your own risk
Prerequisites 📋
-
📱 Android Development
- Android Studio 2023.2+
- SDK API Level 33
-
🔥 Firebase Setup
- Google Cloud account
- FCM-enabled project
- Service account credentials
-
🗄️ Database
- MySQL 8.0+ / MariaDB 10.6+
- 2GB+ storage allocated
-
☁️ Server Infrastructure
- VPS with public IP
- Reverse proxy (Nginx/Traefik)
- Valid SSL certificate
-
⚙️ Build Tools
- Go 1.23+
- Docker 24.0+
Backend Configuration ⚙️
gateway:
mode: public
fcm:
credentials_json: |
{
"type": "service_account",
"project_id": "your-project"
}
- Follow Private Server Guide
- Set
gateway.mode: public
- Update FCM credentials
- const BASE_URL = "https://api.sms-gate.app/upstream/v1"
+ const BASE_URL = "https://your-main-server.com/upstream/v1"
Architecture Requirement
Private servers require at least one public server
Communication flow: Device ↔ Private Server ↔ Public Server ↔ FCM
Android App Customization 📱
-
Clone Repository
-
Configure Endpoints
Editapp/src/main/java/me/capcom/smsgateway/modules/gateway/GatewaySettings.kt
by replacingPUBLIC_URL
with your main server URL (including path): -
Set Unique Application ID
Modifyapp/build.gradle
by replacingapplicationId
value with your unique application ID: -
Firebase Integration
Follow the Firebase Android Setup Guide to get thegoogle-services.json
file and add it toapp/google-services.json
. -
Build & Deploy
Security Checklist 🔐
- Implement IP whitelisting
- Configure HTTPS with HSTS
- Set up rate limiting
- Enable audit logging
- Rotate API keys quarterly