Building Your Own Independent SMS Gateway #71
Replies: 18 comments 28 replies
-
@capcom6 Also, if nothing else, would adding static ip with mobile internet provider solve that issue with local server? |
Beta Was this translation helpful? Give feedback.
-
Hello! Currently, the project doesn't natively support private servers. For now, you can use the provided public cloud server If you're looking to connect to a local server over a connection with a dynamic IP, one workaround might be to set up a VPN from your device to a server that has a static public IP, along with the necessary routing configurations. However, instructions for setting up such a system are beyond the scope of this project. The more complex route involves running your own server instance on a VPS (Virtual Private Server) or a similar service with a public IP. While the server component of the project isn't open-source-ready, there is a Docker image available, albeit without documentation at the moment. You'd also need to rebuild the Android app with your server address and updated Firebase credentials. If you're leaning towards this option, I will need some time to prepare and provide you with the necessary documentation for the server part. Regarding your comment about a static IP: yes, having a static IP with your mobile internet provider could potentially resolve the issue with accessing your local server externally. However, that approach may have additional cost implications and would still require some network configuration. I hope this clarifies your options. Let me know which path seems most suitable for you, and I'll do my best to assist you further. |
Beta Was this translation helpful? Give feedback.
-
for starters, id like to go with a dynamic ip (i have an option with my provider) Can you please guide me what network configuration should be done here like you mentioned? I tried with the VPN before but could not manage it out of the box. VPN was active on my phone (through vpn app, not android vpn settings) but when trying to run sms gateway app locally it crashed (like it does when trying to run local server through my mobile internet). Any suggestion here maybe? In the future it would be awesome if you could also open source the server component / add option to add custom server inside app. |
Beta Was this translation helpful? Give feedback.
-
Actually, if you're considering using a dynamic IP, the most straightforward solution remains the public cloud server I previously mentioned. However, if you're referring to a Regarding the VPN issue, to successfully connect through a VPN, you'd typically need control over a server where you could adjust routing settings. Some VPN apps and services might offer such functionality, but I'm not aware of any specific ones to recommend at this time. As for the app crash, I've managed to reproduce the issue and am planning to address it in an upcoming update. I will keep you posted and provide feedback as soon as the new version is available. Thanks for your report. |
Beta Was this translation helpful? Give feedback.
-
Hello! I've released an update that should fix the crash on startup. Please download and try out version v1.2.3 and let me know how it goes. |
Beta Was this translation helpful? Give feedback.
-
@capcom6 +1 for private cloud, I have my own vps and it will be realy cool if you can provide any documentation on how to edit the app so I can use it with my own cloud.BTW great work here thank you for make in it public for us, many thanks |
Beta Was this translation helpful? Give feedback.
-
Hello! Thanks for your feedback. I've started writing instructions for running your own private server for the app, but I found that the current version of the server is not quite suitable for private use. Firstly, there are some not-so-clear steps:
And second, but more importantly, the current version of the backend is designed for public use. There are some publicly available endpoints that are inappropriate for private use. For example, anyone who knows your server address can register the app on the server. While I will still publish the high-level instruction in a few days, please note that running this version of the server is not recommended for private use due to these challenges. However, for the future, I plan to add one more mode to the application, in addition to "Local" and "Cloud" - "Private". For this mode, I'll be developing a simple server API-compatible with the Cloud mode, but for Push notifications, the Private server will leverage the Cloud server. Push notifications won't contain any information about the message (text or phones) for now, minimizing privacy impact. As for the mobile app, you'll set your own private server address in Private mode along with some credentials, so the mobile app will communicate only with your private server. With this architecture, there's no need to rebuild the mobile app or register your own project in Firebase. Just start a minimal backend on your side and activate Private mode in the mobile app. I'd appreciate any opinions about my architectural idea. PS: I'll be releasing end-to-end encryption support for the app soon. This feature will allow you to encrypt messages before sending them via API, and they will only be decrypted in the mobile app. So if you're concerned about accessing message text or phone numbers on the backend side, this feature will address those concerns. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Here is the quick start guide for deploying your own backend for the app. Before You StartAt the time of writing this document, the backend is not optimized for use as a private server. It contains public endpoints, and therefore, anyone who knows the server address can connect a mobile app to it and use the API. Please note that this is a simplified instruction that does not provide detailed security settings, such as firewall configuration and HTTPS setup. It is the user's responsibility to implement these security measures. Use at your own risk. Prerequisites
Server
http:
listen: ":3000" # HTTP__LISTEN
database:
dialect: "mysql" # DATABASE__DIALECT
host: "localhost" # DATABASE__HOST
port: 3306 # DATABASE__PORT
user: "sms" # DATABASE__USER
password: "sms" # DATABASE__PASSWORD
database: "sms" # DATABASE__DATABASE
timezone: "UTC" # DATABASE__TIMEZONE
fcm:
credentials_json: >
{
...
}
tasks:
hashing:
interval_seconds: 900
version: '3'
services:
backend:
image: capcom6/sms-gateway
environment:
- CONFIG_PATH=config.yml
- HTTP__LISTEN=0.0.0.0:3000
- DATABASE__HOST=db
- DATABASE__PORT=3306
- DATABASE__USER=sms
- DATABASE__PASSWORD=sms
- DATABASE__DATABASE=sms
ports:
- "3000:3000"
volumes:
- ./config.yml:/app/config.yml:ro
restart: unless-stopped
depends_on:
db:
condition: service_healthy
db:
image: mariadb:10.11
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=sms
- MYSQL_USER=sms
- MYSQL_PASSWORD=sms
volumes:
- mariadb-data:/var/lib/mysql
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"mysqladmin",
"ping",
"-proot",
"-h",
"127.0.0.1"
]
timeout: 5s
retries: 10
volumes:
mariadb-data:
ClientTo build a version of the Android application that will communicate with your own server, follow these steps:
|
Beta Was this translation helpful? Give feedback.
-
That would be awesome, I am looking into this option for sure ! You can use the concept of a pre-shared secret between the back end (self hosted) and the clients. |
Beta Was this translation helpful? Give feedback.
-
Hello, your manual is very good, I managed to install the server and the Android application, but I have a problem, the SMS arrive after 15, 20 or 30 minutes after being sent, I am not an Android expert, could you help me remove the delay? |
Beta Was this translation helpful? Give feedback.
-
Hello, @ApuRed Thank you for reaching out. Regarding the delay in SMS delivery, it does seem to be an issue related to Firebase Cloud Messaging (FCM). Here are a few things you can check to troubleshoot this issue:
Additionally, please check the I also wanted to share some good news: I plan to open source and release a server version with private mode support in a few weeks. With this upcoming release, there will be no need for you to rebuild the client and set up FCM on your own. I hope this helps, and please let me know if you have any further questions or issues. |
Beta Was this translation helpful? Give feedback.
-
You are an amazing person, thank you very much |
Beta Was this translation helpful? Give feedback.
-
is the documentation ready or still? |
Beta Was this translation helpful? Give feedback.
-
@IOAPP-IO , hello. I'm currently finishing up the first version of the documentation for setting up a private server. I expect this to be completed by the end of next week, after which I will post updated documentation to make working in private mode easier. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone! I'm excited to share that I've made significant progress with the app. The server component has now been open-sourced, and I've put together a quick start guide to facilitate running your app server in private mode. Please note that to use the private mode, you'll need version 1.10.0 or higher of the Android app. You can find the documentation for setting up a private server here: https://sms.capcom.me/getting-started/private-server/ The source code is also now available in the GitHub repository at: https://github.com/capcom6/sms-gateway Keep in mind that the private mode feature is still in the testing phase and may need further improvements. Your feedback during this phase would be incredibly valuable. Thank you all for your interest and patience. I'm marking this issue as closed, but if you encounter any problems or have any suggestions, please don't hesitate to open a new issue either here or in the server's repository, depending on where the issue lies. |
Beta Was this translation helpful? Give feedback.
-
Hello, first of all, great work here. I would like to use my firebase account (setup) and my own VPS. Steps mentioned on January 26 are still valid? I see that on the "Getting Started - Private Server" you're still mentioning the use of the public server and the native firebase account. With the steps mentioned on the 26, would it be still necessary? |
Beta Was this translation helpful? Give feedback.
-
Hello, @PointerSal Yes, the steps outlined on January 26 for setting up your own independent server are still applicable with a few minor modifications:
Note that the Private Server mode is designed to streamline the process of setting up your server without the need for rebuilding anything. It is a simplified approach as compared to the fully independent server setup described on January 26. |
Beta Was this translation helpful? Give feedback.
-
Thanks @capcom6 for your answer. If I understood correctly, with such a setup the private server will still query the public one for sending FCM notifications. I'd like to use my Firebase account: any change I need to do in the server code for pointing directly to my firebase project APIs? |
Beta Was this translation helpful? Give feedback.
-
Or at least tunnel the localhosted server somehow? I use 4g sim card internet with dynamic IP address and cannot access my local server from outside. Any solutions?
Beta Was this translation helpful? Give feedback.
All reactions