Connecting a relay
A gateway client receives the SMS that people send and relays each payload to the Publisher’s POST /v1/publications. Pick one:
| Gateway client | Runs on | Use it for |
|---|---|---|
| Deku SMS | An Android phone with a SIM card | A local number, with no SMS provider |
| RelaySMS-GatewayClient-Twilio | A server, behind a Twilio number | A number that doesn’t depend on a phone staying online |
Requirements
- The Publisher’s REST API reachable over HTTPS, behind the reverse proxy
- The number registered as a gateway client, so the RelaySMS app lists it
Deku SMS on Android
- Install Deku SMS on the phone and make it the default SMS app.
- In its gateway settings, forward incoming SMS to
https://<HOST>/v1/publications. - Keep the phone powered, with mobile data or Wi-Fi.
Twilio
- Install RelaySMS-GatewayClient-Twilio as its README describes. It can run on the Publisher’s server, on its own subdomain such as
twilio.example.com. SetTWILIO_AUTH_TOKENfrom the Twilio console, and keep a copy of the generatedSENDER_HASH_KEY: a new key gives every sender a new address. - In its
.env, setFORWARD_URLS_JSON=https://<HOST>/v1/publications. - If the Publisher allows offline publishing over
https, setFORWARD_TAGto itsOFFLINE_PUBLISH_SHARED_SECRET. - In the Twilio console, under the number’s Messaging > A message comes in, set
https://<RELAY_HOST>/twilio-smswithHTTP POST.
Check it
Send an SMS from the RelaySMS app to the number, then follow the worker’s log on the Publisher:
sudo ./manage.sh logs --unit worker
You should see Published via '<PLATFORM>'. To test without a phone, the reference client posts a payload the way a gateway client does.
Next steps
- Back up
.envanddata/. - Harden the install before announcing the number.