Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Feature Request] User Scripts as Notification Entities

Featured Replies

There are notification agents that aren't included in unRAID, ntfy.sh for example. It would be great if one of the notification agents could just be a user script, or multiple. This way you could write your own notification command and not have to wait for your preferred agent to be added officially.

Then you user script could be something along the lines of (for ntfy.sh):

curl \
  -H "Title: $UNRAID_NOTIF_SUBJECT" \
  -H "Priority: default" \
  -H "Tags: unRAID" \
  -d "$UNRAID_NOTIF_DESC" \
  ntfy.sh/unraid_notifs

where there are a defined list of environment variables passed to it such as:

  • UNRAID_NOTIF_SUBJECT
  • UNRAID_NOTIF_EVENT
  • UNRAID_NOTIF_TIMESTAMP
  • UNRAID_NOTIF_DESC
  • UNRAID_NOTIF_IMPORTANCE
  • UNRAID_NOTIF_CONTENT
  • UNRAID_NOTIF_LINK
  • ...

Edited by jlaning

  • jlaning changed the title to [Feature Request] User Scripts as Notification Entities
  • Author

After some initial investigation, it seems that at least maybe dropping a custom script into the directory

/boot/config/plugins/dynamix/notifications/agents/

would work based on the code in

/usr/local/emhttp/plugins/dynamix/scripts/notify

 

but I haven't tested this. However, a UI way of doing this would be preferred.

 

EDIT:

 

Creating a script

/boot/config/plugins/dynamix/notifications/agents/ntfy

 

worked (as a temp solution). Here's my example for ntfy.sh

 

#!/bin/bash
curl -u "user:pass" \
  -H "Title: ${SUBJECT}" \
  -H "Tags: unRAID" \
  -d "Event: ${EVENT}
Subject: ${SUBJECT}
Description: ${DESCRIPTION}
Importance: ${IMPORTANCE}
Time: $(date '+%Y-%m-%d %H:%M:%S')

${CONTENT}" \
  https://ntfy.domain.tld/unRAID

 

Edited by jlaning
added temporary solution

  • 2 weeks later...

+1 on this, want to use ntfy.

  • 3 months later...

+1 on adding nftfy.

+1 for this too. I'm dumping stuff into syslog at the moment, but UI pop-ups would be sweet.

On 10/4/2022 at 4:09 PM, jlaning said:

After some initial investigation, it seems that at least maybe dropping a custom script into the directory

/boot/config/plugins/dynamix/notifications/agents/

would work based on the code in

/usr/local/emhttp/plugins/dynamix/scripts/notify

 

but I haven't tested this. However, a UI way of doing this would be preferred.

 

EDIT:

 

Creating a script

/boot/config/plugins/dynamix/notifications/agents/ntfy

 

worked (as a temp solution). Here's my example for ntfy.sh

 

#!/bin/bash
curl -u "user:pass" \
  -H "Title: ${SUBJECT}" \
  -H "Tags: unRAID" \
  -d "Event: ${EVENT}
Subject: ${SUBJECT}
Description: ${DESCRIPTION}
Importance: ${IMPORTANCE}
Time: $(date '+%Y-%m-%d %H:%M:%S')

${CONTENT}" \
  https://ntfy.domain.tld/unRAID

 

Are you saying that you got it working with that script?

  • 2 weeks later...

Was anybody else able to make this work?

 

I do not have a folder notifications in dynamix, but I could potentially create one

So upon further review this totally works, if the folder does not exist just create it, you can also name the .sh file pretty much anything you want.  I also updated it a bit for nicer looking notifications

 

#!/bin/bash

ntfy_url="https://ntfy.sh/topic"
# Use ntfy_username and ntfy_password OR ntfy_token
ntfy_username=""
ntfy_password=""
ntfy_token=""
# Leave empty if you do not want an icon.
ntfy_icon="https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/png/unraid.png"

if [[ -n $ntfy_password && -n $ntfy_token ]]; then
  echo "Use ntfy_username and ntfy_password OR ntfy_token"
  exit 1
elif [ -n "$ntfy_password" ]; then
  ntfy_base64=$( echo -n "$ntfy_username:$ntfy_password" | base64 )
  ntfy_auth="Authorization: Basic $ntfy_base64"
elif [ -n "$ntfy_token" ]; then
  ntfy_auth="Authorization: Bearer $ntfy_token"
else
  ntfy_auth=""
fi

ntfy_title="Unraid: ${SUBJECT}"
ntfy_message="${DESCRIPTION}"

if [ "${IMPORTANCE}" == "alert" ]; then
  ntfy_tag=rotating_light
  ntfy_priority="urgent"
  ntfy_xpriority=5
elif [ "${IMPORTANCE}" == "warning" ]; then
  ntfy_tag=warning
  ntfy_priority="high"
  ntfy_xpriority=4
else
  ntfy_tag=information_source
  ntfy_priority="default"
  ntfy_xpriority=3
fi

curl $ntfy_url \
-H "$ntfy_auth" \
-H "tags:"$ntfy_tag \
-H "X-Title: $ntfy_title" \
-H "X-Icon: $ntfy_icon" \
-H "Priority: $ntfy_priority" \
-H "X-Priority: $ntfy_xpriority" \
-d "$ntfy_message" \

 

Edited by semaj4712

  • 4 months later...

+1 for official ntfy.sh notifications :)

Edited by steff94

  • 2 months later...

+1 for ntfy notifications as well as it's been promoted as a great self-hosted notification solution.
I currently use it and would love for it to be integrated into Unraid notifications.

I hope this is what you where after:
grafik.thumb.png.ca0aebd207f67fb6442ac13c034fb280.png

 

grafik.png.3818459e6fe80dc4508b015251b6dadb.png

 

Already created a PR and will be hopefully included in one of the next releases. ;)

  • 2 months later...

I just want to add a note that may help keep anyone else from going down the Rabbit-hole that caught me.

 

The file path to install the NTFY agent that is on this page is correct. But the one in the built-in help of the Notifications settings page is incorrect (as of 2023-1221 v 6.12.6) 

 

This page has - /boot/config/plugins/dynamix/notifications/agents/

 

Help on notifications page has - /boot/config/plugins/dynamix/notification/agents/

 

The only difference is that the correct value is plural while the Help doc has singular "notifications" vs "notification"

 

That one little letter drove me crazy for a while.   :-) 

22 minutes ago, macronin said:

The file path to install the NTFY agent that is on this page is correct. But the one in the built-in help of the Notifications settings page is incorrect (as of 2023-1221 v 6.12.6) 

NTFY should be an agent by default and you don't have to do anything as the post above yours imply.

8 minutes ago, ich777 said:

NTFY should be an agent by default and you don't have to do anything as the post above yours imply.

The post above mine talks about a submitted update that has not gone live yet (as far as I can tell).

 

I had checked all the options on myidentifier.myunraid.net/Settings/Notifications page and NTFY is not listed as of yet. It might be in the nightly version (for future public release) but I am running Stable 6.12.6 which is the latest general usage version.

 

Umm, just realized tat you are the author of the post above me. :-)  Is this maybe in a diff location that I may haver missed?

I haven't seen it natively in the options yet either.

20 minutes ago, macronin said:

Umm, just realized tat you are the author of the post above me. 🙂 Is this maybe in a diff location that I may haver missed?

10 minutes ago, nlz said:

I haven't seen it natively in the options yet either.

Oh sorry, I've pushed that against master that should be 6.13.0 and not 6.12.x

13 minutes ago, ich777 said:

Oh sorry, I've pushed that against master that should be 6.13.0 and not 6.12.x

No problem. I'll keep an eye out for it.

I appreciate you adding it.  

  • 1 month later...
On 10/17/2023 at 4:26 AM, ich777 said:

I hope this is what you where after:
grafik.thumb.png.ca0aebd207f67fb6442ac13c034fb280.png

 

grafik.png.3818459e6fe80dc4508b015251b6dadb.png

 

Already created a PR and will be hopefully included in one of the next releases. ;)

I can't seem to get this to appear.  I followed all the steps.  Is a reboot required to read the script from: /boot/config/plugins/dynamix/notifications/agents

 

EDIT: just noticed the version is 6.13 and i'm on 6.12.6  

Edited by MP715

9 minutes ago, MP715 said:

just noticed the version is 6.13 and i'm on 6.12.6  

This is included in the next stable release.

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.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.