Closed daredoes closed 3 years ago
Thanks alot, I will merge this into the readme asap.
Reading your changes I noticed that you turn off SSL in the config assuming that you are inside an environment where some reverse proxy takes care of it.... I guess this is only one way how you can do it. I am thinking about moving that webhook stuff to a separate readme to keep the readme.md short and to have the webhook documentation in a separate place....
Yeah, SSL is handled by SWAG, a docker app for Unraid that handles the reverse proxy. It gets the certificate for subdomains specified in it's settings, and then maps those subdomains to a local IP address and port. They could be self-signed... but I don't know, everything works, and I don't want to break anything.
Instead of an additional README, maybe the Wiki on the git repo could be a good place?
@daredoes maybe you can review the changes after I created the file and maybethen it would be helpful to have some more screenshots…
Sure, happy to help with a review
integrated your changes in 10.0.9
Hello,
I am opening this issue as a substitute for opening a fork and submitting a pull request to the README.
I have been trying to use this library for a... LONG... time and could not figure out how to get from polling to webhook.
Well, now I've figured it out, so I want to share this information with you, the reader.
Node Red
You'll want to set the Bot Settings to the following:
Update Mode - Webhook
- Setting this value toWebhook
will be necessary for receiving our updates via webhook... duhBot Host - telebot.yourdomain.com
- Obviously, hopefully,yourdomain.com
is a filler that you should replace with your domain. We're going to usetelebot
in this example though.Bot Path - blank
- We're going to leave this blank, best not to break anything.Public Bot Port - 443
- We're setting this to 443, the SSL public port for a website, because we're assuming we have setup a reverse-proxy with certs through something like DuckDNS and SWAGLocal Bot Port - 8443
- This is the default value, but take note of it as we'll be using it soon. Don't set this to 1880 or whatever port Node-Red is running on, or you're gonna have a bad time. Like everything crashes, restart node red in safe mode and change the port bad time.Certificate is Self-Signed - Unchecked
- I'm pretty sure it's not self-signed through DuckDNS, so...SSL Terminated By Reverse Proxy - Checked
- By enabling this, we skip the need to do all that complex stuff involving certificate signing and whatever. Woo!Node Red + Docker/Unraid
If you're like me, you're running this on something like HomeAssistant or Unraid. I'm running it on Unraid. Well, to make sure Telegram can send webhooks to our bot, we need to make sure our bot, running at port
8443
can be reached from our reverse-proxy.Let's edit our node-red docker instance, and
Add another Path, Port, Variable, Label, or Device
, then fill in the modal with the following values:Apply the changes, and you should see the following on your docker status page.
SWAG Proxy Conf
If you're also like me, you're running SWAG to do a reverse-proxy. Create a new subdomain proxy for
telebot
, our previously noted subdomain.My configuration looks like this.
Last But Not Least
Add your domain to your SWAG instance subdomains so it gets certified. Add the subdomain to your DNS records as a CNAME, or however you handle that stuff.
Once all of this is done, messages should come back from nodes pretty rapidly!
Hope this helps.