lukefx / hubot-telegram

Hubot adapter for Telegram
MIT License
160 stars 42 forks source link

Change Webhook endpoint to a secret one #38

Closed nspacestd closed 8 years ago

nspacestd commented 8 years ago

Make the robot listen on TELEGRAM_WEBHOOK/TELEGRAM_TOKEN (e.g. https://example.com/123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11) for security reasons.

Fixes #30

arcturial commented 8 years ago

Do you think the user should even be allowed to specify the URL with TELEGRAM_WEBHOOK. Perhaps this setting should just change to a "true" or "false" setting and then we specify the URL internally and provide the user with it once the bot starts?

In what scenario would you need to specify the listening URL manually to something different than the internal HTTP endpoint that hubot will register?

nspacestd commented 8 years ago

The bot needs to know the host name and port to register the webhook. Changing TELEGRAM_WEBHOOK to a boolean value wouldn't work. With these changes the bot registers TELEGRAM_WEBHOOK/TELEGRAM_TOKEN as the webhook endpoint so TELEGRAM_WEBHOOK should be set to something like 'https://domainname.com:port'.