https://github.com/optimalstrategy/sms_forwarder_bot
https://github.com/optimalstrategy/sms_forwarder_bot
django telegram telegram-bot
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/optimalstrategy/sms_forwarder_bot
- Owner: optimalstrategy
- License: mit
- Created: 2018-11-06T01:38:45.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-01-17T03:53:27.000Z (6 months ago)
- Last Synced: 2025-06-20T08:05:04.656Z (17 days ago)
- Topics: django, telegram, telegram-bot
- Language: Rust
- Size: 137 KB
- Stars: 5
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SMS forwarder bot
A bot/broker that forwards SMS messages to telegram. Intended to work with the [app](https://github.com/optimalstrategy/sms_forwarder_app).
The deployed bot is running at https://forwarder.whatever.team and is accessible via https://t.me/smsforwarderrobot.## Development
1. Copy `.env.example` and add your telegram token. If you don't want to set up a webhook with something like ngrok, set `FWD_LONG_POLLING` to `true`.
2. Spin up a postgres container with the command below.```bash
$ docker-compose -f docker-compose-dev.yml up -d
```3. Run the app with with `just dev` or `cargo run` (you have to manually set the env variables).
## Production
1. Copy `.env.example` and add your telegram token and database password. Set `DB_HOST=db`. Set `FWD_USE_LONG_POLLING=false` to use webhooks. Note that you _can_ use long polling in production if you want, but it's not recommended.
2. If you care about rate limiting, set `FWD_IP_SOURCE` to an appropriate value for your hosting service instead of the default `ConnectInfo`. For example, if you use an exposed nginx, you can set it to `X-Real-IP` after binding `X-Real-IP` to `$remote_addr` in the nginx config.
3. Run docker-compose to build and start the app:```bash
$ docker-compose -f docker-compose.yml up -d
```The container will be exposed at `127.0.0.1:6336` by default.
## Python Implementation
Archived in the [`python`](https://github.com/optimalstrategy/sms_forwarder_bot/tree/python) branch. Migrating an existing deployment to rust should be seamless, just correctly convert `configs/production.env` to `.env`.