dockcheck icon indicating copy to clipboard operation
dockcheck copied to clipboard

How to use Tags with Appriser?

Open shurushetr opened this issue 8 months ago • 6 comments

Hi, can't seem to figure out how to not spam all the channels configured in appriser when using the

NOTIFY_CHANNELS="apprise"
APPRISE_URL="http://apprise.mydomain.tld:1234/notify/apprise"

It would send the notification to every tag available.

But when using with

NOTIFY_CHANNELS="apprise"
APPRISE_PAYLOAD='tgram://payload+URL"

it says line 30: no match: tgram://payload+URL

I tried adding the tag to APPRISE_URL like so APPRISE_URL="http://apprise.mydomain.tld:1234/notify/apprise/?tag=TAG_NAME" but this results in line 45: no match: http://apprise.mydomain.tld:1234/notify/apprise/?tag=TAG_NAME

How do we use tags?

shurushetr avatar Mar 22 '26 17:03 shurushetr

I don't have Apprise set up currently, I'll try get it running for testing some day soon.

But please double check so there's no typo in the quotations and payload syntax.

Should be:

APPRISE_PAYLOAD='tgram://{bot_token}/{chat_id}/'

But if you're using the API you might need another syntax.

mag37 avatar Mar 24 '26 14:03 mag37

As per my previous comment - using the APPRISE_PAYLOAD variable requires you to use the apprise CLI if I remember correctly. While using the API you should indeed use the syntax as you've specified in your example

I tried adding the tag to APPRISE_URL like so APPRISE_URL="http://apprise.mydomain.tld:1234/notify/apprise/?tag=TAG_NAME"

But that was an error in the template - not quoting the URL. I'll patch that in a bit - but until then you could test it:

  • Copy the notify_templates/notify_apprise.sh to alongside dockcheck.sh.
  • Edit it at line 45, the last variable is $AppriseURL , change it to "$AppriseURL" (added quotes).
  • Try running it again.

mag37 avatar Mar 24 '26 19:03 mag37

I think I figured it out, thank you for your reply, it was very helpful. The error does come from the missing quotes around the $AppriseURL variable. Adding those - takes care of the Line-45 problem.

However, I noticed that the curl -S -o /dev/null ${CurlArgs} -X POST -F "title=$MessageTitle" -F "body=$MessageBody" -F "tags=all" "$AppriseURL" # e.g. APPRISE_URL=http://apprise.mydomain.tld:1234/notify/apprise in the notify_templates/notify_apprise.sh (line 45 again) has explicit -F "tags=all" which forces the appraiser to send notifications to all tags. I thought I did something wrong on my end.

Adding APPRISER_TAG="SOME_TAG,SOME_OTHER_TAG" to dockcheck.config and then changing the -F "tags=all" to -F "tags=${APPRISE_TAG:-all}" enables sending notification to a specific tag only.

I can do a PR if you'd like, but it will probably take you way less time to update the code than it will take me to create a PR :) I don't mind it , though; just let me know if it will be helpful.

shurushetr avatar Mar 24 '26 20:03 shurushetr

Great find! I should've spotted that explicit argument, sorry.

The addition to the config (and template change) seems very reasonable! I'll also look into how tags are used in the payload variant too. Looks like it could be added as --tag=${APPRISE_TAG:-all} at line 30, but I've not tested it (as I don't have the apprise CLI setup anywhere).

It's up to you really, I'll attribute the change to you otherwise and there's no rush either way. I'll see if I can get apprise CLI setup to test that too some day.

mag37 avatar Mar 24 '26 20:03 mag37

I re-opened until we've merged this :)

Anyway, I did a quick test with the Apprise CLI and it seems that tags are only supported if used with a apprise config file, which is currently not supported in the template, so we can just skip that for now - the CLI "payload" alternative is to manually declare exactly what notification methods to push to.

mag37 avatar Mar 25 '26 10:03 mag37

Got a branch for the changes, will merge later (gotta see if I've got any more related fixes to squeeze in).

https://github.com/mag37/dockcheck/tree/notification_fixes

mag37 avatar Mar 28 '26 07:03 mag37