arr-scripts icon indicating copy to clipboard operation
arr-scripts copied to clipboard

[FEATURE] - Lidarr - Add notifications

Open bonelifer opened this issue 1 year ago • 14 comments

Describe the solution you'd like Ability to have notifcations for various notifcation services like Gotify, NTFY.sh, and Pushover

bonelifer avatar Apr 20 '24 09:04 bonelifer

What would be the purpose of the notifications?

RandomNinjaAtk avatar Apr 20 '24 13:04 RandomNinjaAtk

I don't use Telegram... Should of specified for the ARL notification. It'd be nice to have other notifications, just to know that it is running and doing stuff, but ARL notification would be fine.

bonelifer avatar Apr 20 '24 13:04 bonelifer

I wouldn't be able to do Gotify as I'm on iOS. NTFY.sh looks interesting, and Pushover costs money to use...so eh.

So out of those 3, I can investigate NTFY.sh. Keep in mind, the Telegram functionality uses a bot, so you can set the new ARL token through the bot. Notification apps are a one-way street.

hockeygoalie35 avatar Apr 22 '24 18:04 hockeygoalie35

Pushover, is really just a curl command away from implementation. Should just work, so really no need for you to pay to implement it.

bonelifer avatar Apr 23 '24 05:04 bonelifer

Pushover, is really just a curl command away from implementation. Should just work, so really no need for you to pay to implement it.

I also see the python implementation is really simple. Looks like there' s a free trial too. I'll give it a shot. @RandomNinjaAtk would you be able to assign me?

hockeygoalie35 avatar Apr 24 '24 02:04 hockeygoalie35

Thanks!

@bonelifer I have something working for both ntfy (web version) and pushover. Is ntfy generally used in its web-hosted configuration, or self-hosted? Seems like the web-hosted version is really insecure since anyone can just subscribe to your topic.

hockeygoalie35 avatar Apr 24 '24 18:04 hockeygoalie35

I host it in docker.

bonelifer avatar Apr 24 '24 21:04 bonelifer

Gotcha...hmmm. I'm wondering, because you can have python's requests listen on the ntfy topic, I bet you could send a notif to the topic and use that to set a new token. That's a "nice to have" though.

Any chance you could send me an example docker-compose for ntfy, or is their documentation easy enough? To be honest, I think I'd like to use it lol.

hockeygoalie35 avatar Apr 24 '24 21:04 hockeygoalie35

NTFY_UPSTREAM_BASE_URL needs to stay as is if you are using IOS.

version: '3'
services:
  ntfy:
    image: binwiederhier/ntfy
    container_name: ntfy
    environment:
      NTFY_BASE_URL: http://192.168.1.80
      NTFY_AUTH_FILE: /etc/ntfy/auth.db
      NTFY_AUTH_DEFAULT_ACCESS: read-write
      NTFY_BEHIND_PROXY: true
      NTFY_ATTACHMENT_CACHE_DIR: /etc/ntfy/attachments
      NTFY_UPSTREAM_BASE_URL: https://ntfy.sh
      NTFY_ENABLE_LOGIN: true
     # NTFY_WEB_PUSH_PUBLIC_KEY: <public_key>
     # NTFY_WEB_PUSH_PRIVATE_KEY: <private_key>
     # NTFY_WEB_PUSH_FILE: /etc/ntfy/webpush.db
     # NTFY_WEB_PUSH_EMAIL_ADDRESS: <email>
    volumes:
      - ./data/:/etc/ntfy
    ports:
      - 9191:80
    command: serve

    healthcheck: # optional: remember to adapt the host:port to your environment
        test: ["CMD-SHELL", "wget -q --tries=1 http://localhost:80/v1/health -O - | grep -Eo '\"healthy\"\\s*:\\s*true' || exit 1"]
        interval: 60s
        timeout: 10s
        retries: 3
        start_period: 40s
    restart: unless-stopped

bonelifer avatar Apr 24 '24 22:04 bonelifer

Thanks, I'll get going on that.

hockeygoalie35 avatar Apr 24 '24 23:04 hockeygoalie35

Got it working in Pushover: image

And on self-hosted ntfy: image

@bonelifer Just out of curiosity, do you use Token Auth or Basic Auth? I suppose I could support both...but currently using token auth for ntfy.

hockeygoalie35 avatar Apr 26 '24 03:04 hockeygoalie35

Ok... token auth it is! PR #251 Created.

hockeygoalie35 avatar Apr 29 '24 16:04 hockeygoalie35

@bonelifer , can you verify that it works? I've got it working for both on my side, a 3rd party would be greatly appreciated before I close the issue.

hockeygoalie35 avatar Apr 30 '24 01:04 hockeygoalie35

I'll give it a try tomorrow.

bonelifer avatar Apr 30 '24 01:04 bonelifer

This looks to be resolved...

RandomNinjaAtk avatar Aug 01 '24 15:08 RandomNinjaAtk