airbillion Posted August 11, 2016 Share Posted August 11, 2016 Hello, I think it would be awesome if Join and Telegram could be added to the notification providers. I use Pushbullet, but they have been turning me off with their recent changes... Join & Telegram are both free and should be easy to implement... What do you think? Thanks! Sent from my Nexus 6P using Tapatalk Quote Link to comment
bonienl Posted October 15, 2016 Share Posted October 15, 2016 Any references to URLs of these applications and in particular their API? Quote Link to comment
airbillion Posted October 15, 2016 Author Share Posted October 15, 2016 Join API: https://joaoapps.com/join/api/ Sent from my Nexus 6P using Tapatalk Quote Link to comment
bonienl Posted October 16, 2016 Share Posted October 16, 2016 I have added the "Join" agent. Need to figure out how telegram works, seems to be designed more for user message exchanges, not notifications. Ps. Join is not free. You need to subscribe (+ fee) after the trial period. Quote Link to comment
kode54 Posted October 17, 2016 Share Posted October 17, 2016 Telegram would require either: 1) User creates a bot under their own Telegram account, using a unique user name for the bot, and registers their API key with unRAID. unRAID uses bot to send notices to the user. 2) Lime Technology registers their own bot, under their own Telegram account, and generates their own API key, and runs a central bot on their own servers. Lime Technology requires unRAID users to: 2a) Verify with the official unRAID Telegram bot that they control the Telegram account they are electing as the target for the notifications. This stops maliciously or accidentally sending messages to arbitrary users without their permission. 2b) Verify with the Lime Technology bot service that they have a valid unRAID license, by the unRAID software identifying its trial or paid license serial to the service. This hopefully stops just anyone from uncovering the protocol of your server API and abusing it to flood users with notifications, or causing your bot to abuse the Telegram service. 2c) Official unRAID bot then sends them any notifications pushed with the semi-permanent session access keys granted to their unRAID instance. I kind of like the latter, since while it is more work for Lime Technology, it requires little work or setup by the users who wish to employ it, and it should scale to hundreds or even thousands of users. Technically, you could support both. The first in the interrim, the latter as a more permanent solution. Both methods would require a Telegram bot daemon, the former requires it to be run by the user, the latter requires you to run it yourselves. Quote Link to comment
bonienl Posted October 17, 2016 Share Posted October 17, 2016 Approach (1) is what is done for every other notification agent. User needs to create his/her own account at the respective service to receive notifications. Approach (2) requires Limetech to facilitate the service, not sure if they want to do that (Telegram is just one of the available options). Quote Link to comment
kode54 Posted October 17, 2016 Share Posted October 17, 2016 Limetech will still need to create the service for (1), but the user will host it themselves. Or Limetech will need to support any one of a number of possible open source generic Telegram bots, as there are probably lots of them, and they're probably not compatible with each other. Most of the time, people will acquire one or another bot, hand edit it to their needs, and employ it. So I guess you can look to one of your many community developers, maybe the LinuxServer team would be interested in creating a Telegram bot Docker container specifically for this notification system, since it will likely be some Python or TCL or Go or even PHP concoction, and won't be able to run directly on the unRAID server. Quote Link to comment
airbillion Posted October 18, 2016 Author Share Posted October 18, 2016 I have added the "Join" agent. Need to figure out how telegram works, seems to be designed more for user message exchanges, not notifications. Ps. Join is not free. You need to subscribe (+ fee) after the trial period. Awesome... Thanks!! Can't wait to try it out... Join the service is free...the app is a one time purchase..from the play store: 30 day trial - one time $4.99 payment to unlock Try the app for free for a month, then unlock it with a one time payment to continue using it Sent from my Nexus 6P using Tapatalk Quote Link to comment
bonienl Posted October 18, 2016 Share Posted October 18, 2016 I have added the "Join" agent. Need to figure out how telegram works, seems to be designed more for user message exchanges, not notifications. Ps. Join is not free. You need to subscribe (+ fee) after the trial period. Awesome... Thanks!! Can't wait to try it out... Join the service is free...the app is a one time purchase..from the play store: 30 day trial - one time $4.99 payment to unlock Try the app for free for a month, then unlock it with a one time payment to continue using it Sent from my Nexus 6P using Tapatalk You can install the Dynamix Bleeding Edge plugin and try the new agent. Quote Link to comment
airbillion Posted October 20, 2016 Author Share Posted October 20, 2016 I have added the "Join" agent. Need to figure out how telegram works, seems to be designed more for user message exchanges, not notifications. Ps. Join is not free. You need to subscribe (+ fee) after the trial period. Awesome... Thanks!! Can't wait to try it out... Join the service is free...the app is a one time purchase..from the play store: 30 day trial - one time $4.99 payment to unlock Try the app for free for a month, then unlock it with a one time payment to continue using it Sent from my Nexus 6P using Tapatalk You can install the Dynamix Bleeding Edge plugin and try the new agent. Installed and working perfectly!! Thank you!!! Sent from my Nexus 6P using Tapatalk Quote Link to comment
ezhik Posted June 26, 2017 Share Posted June 26, 2017 Telegram for sure! I am already using it for all sorts of things!Telegram Quote Link to comment
Bokonon Posted August 31, 2017 Share Posted August 31, 2017 (edited) Adding the following to NotificationAgents.xml allows Telegram to work for notifications. Not the easiest process to setup though. First you have to send @BotFather a message '/newbot', after a few steps it sends you back your HTTP API. Then you need to start a conversation with your bot in order to get the Chat ID to send to. Not sure there is an easy way to integrate this into the settings page, I manually queried the API to get the chat ID. <Agent> <Name>Telegram</Name> <Variables> <Variable Help="The API key can be found [a href='https://core.telegram.org/bots/api' target='_blank'] [u]here[/u].[/a]" Desc="API key" Default="">API_KEY</Variable> <Variable Help="Chat ID [a href='https://core.telegram.org/bots/api' target='_blank'] [u]here[/u].[/a]" Desc="Chat ID" Default="">CHAT_ID</Variable> <Variable Help="Specify the fields which are included in the message body of the notification." Desc="Notification Message" Default="$DESCRIPTION">MESSAGE</Variable> </Variables> <Script> <![CDATA[ #!/bin/bash ########## {0} ########## MESSAGE=$(echo -e "$MESSAGE") URL=https://api.telegram.org/bot$(echo -e "$API_KEY") CHATID=$(echo -e "$CHAT_ID") curl -s -k -G \ --data-urlencode "text=$MESSAGE" \ $URL/sendMessage?chat_id=$CHATID ]]> </Script> </Agent> Edit: While looking for something else I noticed theres another way to get the chatid. Send '/getid' to IDBot @myidbot (https://telegram.me/myidbot) and it will reply with your chat id Edited September 1, 2017 by Bokonon 4 Quote Link to comment
1activegeek Posted February 15, 2018 Share Posted February 15, 2018 Any chance this is being considered to add in Telegram? While it's aimed at message communication, if it's bene figured out (as Bokonon has indicated) it shouldn't be much difficulty in adding into the notification agents? I personally have centralized on Telegram as it's lightweight and easy enough to get notifications and be used for secure messaging. Quote Link to comment
Trasrik Posted March 27, 2018 Share Posted March 27, 2018 I also want to push this topic. I´m using Telegram for multiple notification purposes (my webserver, FHEM, ...) as well as my personal communication. It would be great to integrate my unRAID server into this environment. The solution provided by Bokonon above (thanks a lot!) is ready to run, so it should be no effort at all for you to integrate this into the unRAID release. Here a step-by-step description on how to get this running (user perspective): Log into your unRAID server´s shell (e.g. using Putty, the IP address and the credentials of your root user). Add Bokonon´s code to "/usr/local/emhttp/webGui/include/NotificationAgents.xml" (just above the last line "<Agents>"), e.g. using the commandline editor "vi". Unfortunately, this file seems to be replaced during updates (at least it was replaced by version 6.5), so this manual step can be necessary repeatedly. So it would be really awesome if this could be integrated in the next unRAID release. Contact @Botfather in Telegram and create a new bot with the command "/newbot". You cann access / edit your bot(s) with the command "/mybots". Copy the bot´s API key. Contact @myidbot in Telegram and request your chat id with the command "/getid". Copy your chat id. Reload the notification app and add API key and chat id to the Telegram settings at the bottom of the page. These will still be saved even if the NotificationAgents.xml was replaced and will be available again after you restored the code. Select which information should be sent by agents. Thats it, you´re done. It really is as easy as this. So please, developers, add these few lines of code as a standard to unRAID. Thanks a lot! Joachim 1 Quote Link to comment
trurl Posted March 27, 2018 Share Posted March 27, 2018 7 hours ago, Trasrik said: Unfortunately, this file seems to be replaced during updates Not just updates, reboots. The unRAID OS is loaded into RAMfs clean and fresh from the archives on the flash drive at each boot, then settings saved from the webUI are applied. Changes to any of the usual linux folders such as /usr do not persist after reboot. Only files on /boot (the flash drive) and things mounted in /mnt (actual storage) are persistent. To automatically reapply changes after reboot, see the User Scripts plugin. Quote Link to comment
endiz Posted June 21, 2018 Share Posted June 21, 2018 Can this be part of the main release? Quote Link to comment
RoldGold Posted March 13, 2019 Share Posted March 13, 2019 (edited) I realize this is an old post, but this is the first Google result for "unRAID Telegram", and I found @Bokonon's post above remarkably helpful, and I'd like to contribute a bit more. As noted above, upon restart, the changes made to NotificationAgents.xml are erased. To get around that, we can use a brittle, but functioning shell script: # Rename current NotificationAgents.xml. mv /usr/local/emhttp/webGui/include/NotificationAgents.xml /usr/local/emhttp/webGui/include/NotificationAgents.old # Insert Telegram chunk and redirect out to new NotificationAgents.xml file. sed '/<\/Agents>/{ r /boot/customAgents/telegram.xml a \</Agents> d }' /usr/local/emhttp/webGui/include/NotificationAgents.old > /usr/local/emhttp/webGui/include/NotificationAgents.xml Instructions: Add the above script to the bottom of your /boot/config/go file. Create a directory called "customAgents" in the /boot folder (flash drive). Create a file in customAgents called "telegram.xml" and put the contents of @Bokonon's post into that new file. Then, upon restart, the Telegram agent xml stuff should get shoved into the NotificationAgents.xml. It's not the best solution, but it does work for now. Edited March 13, 2019 by RoldGold Wrong username Quote Link to comment
Kewjoe Posted March 14, 2019 Share Posted March 14, 2019 I'm on 6.7 RC5 and Telegram is listed. Quote Link to comment
piratx Posted April 5, 2019 Share Posted April 5, 2019 On 3/13/2019 at 10:55 PM, RoldGold said: I realize this is an old post, but this is the first Google result for "unRAID Telegram", and I found @Bokonon's post above remarkably helpful, and I'd like to contribute a bit more. As noted above, upon restart, the changes made to NotificationAgents.xml are erased. To get around that, we can use a brittle, but functioning shell script: # Rename current NotificationAgents.xml. mv /usr/local/emhttp/webGui/include/NotificationAgents.xml /usr/local/emhttp/webGui/include/NotificationAgents.old # Insert Telegram chunk and redirect out to new NotificationAgents.xml file. sed '/<\/Agents>/{ r /boot/customAgents/telegram.xml a \</Agents> d }' /usr/local/emhttp/webGui/include/NotificationAgents.old > /usr/local/emhttp/webGui/include/NotificationAgents.xml Instructions: Add the above script to the bottom of your /boot/config/go file. Create a directory called "customAgents" in the /boot folder (flash drive). Create a file in customAgents called "telegram.xml" and put the contents of @Bokonon's post into that new file. Then, upon restart, the Telegram agent xml stuff should get shoved into the NotificationAgents.xml. It's not the best solution, but it does work for now. I have done everything and again stuck on how to get my chat ID. I found a link https://api.telegram.org/bot**-token-here**/getUpdates but it does now work for me, after bot goes the full token. Also to be sure <Variable Help="The API key can be found [a href='https://core.telegram.org/bots/api' target='_blank'] here.[/a]" Desc="API key" Default="">API_KEY</Variable> <Variable Help="Chat ID [a href='https://core.telegram.org/bots/api' target='_blank'] here.[/a]" Desc="Chat ID" Default="">CHAT_ID</Variable> <Variable Help="Specify the fields which are included in the message body of the notification." Desc="Notification Message" Default="$DESCRIPTION">MESSAGE</Variable> What I need to enter on MESSAGE? Thanks in advance! Quote Link to comment
RoldGold Posted April 6, 2019 Share Posted April 6, 2019 @piratx Unfortunately, while my fix above does cause Telegram to show up in the list of providers for notifications, I don't actually get any notifications. I'm not sure what's wrong. Quote Link to comment
Sn3akyP3t3 Posted April 14, 2019 Share Posted April 14, 2019 @BRiT I'm interested in native Telegram notification agent support vice an SMTP workaround. There is only one given SMTP setting for email in UnRaid and its already involved in a notification workflow and I'd rather not disturb that for the sake of enabling another agent that is already potentially inbound for support within UnRaid if what was said above is true by @Kewjoe. Quote Link to comment
RoldGold Posted April 29, 2019 Share Posted April 29, 2019 @Sn3akyP3t3 I've also decided to wait until 6.7 is stable and released. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.