Sign inSign up

antoninocanta/mysmsproject

By antoninocanta

‱Updated about 1 year ago

Image
0

316

antoninocanta/mysmsproject repository overview

⁠📹 OVH SMS Gateway (Docker)

Cette image Docker fournit une API HTTP GET ultra-lĂ©gĂšre, sans authentification ni TLS, qui sert de passerelle locale vers l’API sĂ©curisĂ©e d’envoi de SMS d’OVH.
IdĂ©ale dans un rĂ©seau domestique de confiance (LAN) pour des Ă©quipements incapables de gĂ©rer HTTPS ou OAuth : Arduino, ESP32, centrale d’alarme, box domotique, etc.

⚠ Ne pas exposer ce service sur Internet : pas de HTTPS, pas d’authentification.


⁠🚀 FonctionnalitĂ©s

  • ImplĂ©mentation Flask servie par Gunicorn (WORKERS parallĂšles).
  • Appel unique en GET : /<endpoint>?to=<num>&message=<texte>
  • Traduit cet appel en requĂȘte HTTPS vers l’API OVH (http2sms.cgi).
  • RĂ©ponse HTML simplifiĂ©e : rappel des paramĂštres + retour OVH.

⁠🛠 DĂ©ploiement rapide

version: '3'
services:
  ovhsms:
    image: antoninocanta/mysmsproject:latest
    volumes:
      - ./myproject:/app/myproject
    container_name: ovhsms
    ports:
      - "8123:8000"        # hĂŽte:conteneur
    environment:
      OVH_ACCOUNT: "monCompteOVH"
      OVH_LOGIN:   "apiLogin"
      OVH_PASSWORD:"apiPassword"
      OVH_FROM:    "MyHome"
      WORKERS:     "2"     # (optionnel) workers gunicorn
docker compose up -d

⁠🌐 Utilisation

  1. RequĂȘte HTTP GET
GET http://<IP-serveur>:8123/ovhsmsapp?to=0033612345678&message=Capteur%20porte%20ouvert
to : numĂ©ro au format international (+33...) – URL-encodĂ©
message : texte du SMS – URL-encodĂ©
  1. Exemple curl
curl "http://192.168.1.50:8123/ovhsmsapp?to=0033612345678&message=Test%20depuis%20curl"
  1. Exemple Arduino / ESP32 (pseudocode)
WiFiClient client;
if (client.connect("192.168.1.50", 8123)) {
  String url = "/ovhsmsapp?to=0033612345678&message=Temp%20haute%21";
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: 192.168.1.50\r\n" +
               "Connection: close\r\n\r\n");
}

⁠📋 Variables d’environnement

⁠Variable Obligatoire Description OVH_ACCOUNT oui Identifiant de compte OVH OVH_LOGIN oui Login API OVH (appKey) OVH_PASSWORD oui Mot de passe / clé secrÚte (appSecret) OVH_FROM oui Expéditeur alphanumérique du SMS WORKERS non Processus Gunicorn (défaut : 1)

⁠🏗 Architecture interne

Gunicorn lance WORKERS processus et expose Flask sur 0.0.0.0:8000.

Route GET /ovhsmsapp ↳ extrait to, message → dĂ©code → prĂ©pare requĂȘte OVH ↳ appelle https://www.ovh.com/cgi-bin/sms/http2sms.cgi⁠ (timeout 5 s).

Retourne la réponse OVH, utile pour debug.

Tag summary

Content type

Image

Digest

sha256:10418a1b5


Size

49.7 MB

Last updated

about 1 year ago

docker pull antoninocanta/mysmsproject