docker-borgmatic icon indicating copy to clipboard operation
docker-borgmatic copied to clipboard

ntfy

Open modem7 opened this issue 2 years ago • 10 comments

This is more for discussion rather than anything else.

Issue 1:

ntfy hasn't released their latest version to pypi. The latest version it installs is from 2018 (2.7.0 instead of 2.7,1).

A temporary workaround currently is to run:

Step 1: Install latest version: python3 -m pip install git+https://github.com/dschep/ntfy.git@master --upgrade

Step 2: Install additional dependencies: python3 -m pip install ntfy[pid,emoji,xmpp,telegram,instapush,slack,rocketchat]


Issue 2:

sleekxmpp has been sunset, the replacement is Slixmpp. Unforfunately I don't know if this is a drop-in replacement, but I'm unsure how we'd get ntfy to utilise this.

Note that sleekxmpp will not install on python 3.10, so we'll have issues there.

Would it be easier to drop XMPP given these issues?

Or maybe investigate apprise instead? This would have the added benefit of replacing both ntfy and msmtp containers in favour of a single apprise container leading to less management.

modem7 avatar Jun 24 '22 07:06 modem7

I vote to sunset ntfy and migrate to using apprise, good spot bud 👍🏽

grantbevis avatar Jun 24 '22 09:06 grantbevis

Just had a quick look at Apprise, and it looks pretty simple to migrate to:

https://github.com/caronc/apprise#command-line

# Send a notification to as many servers as you want
# as you can easily chain one after another (the -vv provides some
# additional verbosity to help let you know what is going on):
apprise -vv -t 'my title' -b 'my notification body' \
   'mailto://myemail:[email protected]' \
   'pbul://o.gn5kj6nfhv736I7jC3cj3QLRiyhgl98b'

# If you don't specify a --body (-b) then stdin is used allowing
# you to use the tool as part of your every day administration:
cat /proc/cpuinfo | apprise -vv -t 'cpu info' \
   'mailto://myemail:[email protected]'

# The title field is totally optional
uptime | apprise -vv \
   'discord:///4174216298/JHMHI8qBe7bk2ZwO5U711o3dV_js'

Also, easy enough to install with python3 -m pip install apprise, so I can add any required packages to the index to speed things up too.

I've just tried it with:

bash-5.1# borgmatic --stats -v 1 --files 2>&1 | apprise -vv -t 'Borgmatic Backup' 'mailto://user:[email protected]'
2022-06-24 13:44:54,111 - INFO - Applying Google Mail Defaults
2022-06-24 13:46:48,035 - INFO - Notifying 1 service(s) asynchronously.
2022-06-24 13:46:49,750 - INFO - Sent Email notification to "[email protected]".

And it worked quite nicely - haven't tried it in a hook, but I suspect the output will be much nicer and human-readable (not to mention......easier to configure without having to mount any additional config files).

Would you be able to double-check as I know you use the notification system more than I (I purely rely on healthchecks.io), and if you're happy, we can sunset both of the notification containers in favour of a new apprise one.

modem7 avatar Jun 24 '22 12:06 modem7

I've just added apprise and its supporting packages to the index.

modem7 avatar Jun 24 '22 13:06 modem7

@modem7

Would you be able to double-check as I know you use the notification system more than I (I purely rely on healthchecks.io), and if you're happy, we can sunset both of the notification containers in favour of a new apprise one.

I don't use it anymore bud if you're happy, I'm happy

grantbevis avatar Jul 03 '22 20:07 grantbevis

@modem7

Would you be able to double-check as I know you use the notification system more than I (I purely rely on healthchecks.io), and if you're happy, we can sunset both of the notification containers in favour of a new apprise one.

I don't use it anymore bud if you're happy, I'm happy

Yupper, definitely happy this end, the quick test I did was successful - we just need to think of how to word the documentation as we'd be introducing a breaking feature.

modem7 avatar Jul 03 '22 20:07 modem7

Hi just a quick user-feedback: just switched from ntfy to apprise with the newest base release and it´s working perfectly fine. Just getting two log lines when starting the container:

/scripts/msmtprc.sh: source: line 3: can't open '/etc/borgmatic.d/msmtp.env': No such file or directory /scripts/env.sh: source: line 3: can't open '/etc/borgmatic.d/msmtp.env': No such file or directory

Thank you very much & pls keep up the good work!

Mario

Edit: If I specify the tag 1.6 everything is working fine. If using the tag :latest I end up with both ntfy and msmtp available in the container, which explains the above log lines.

Skydiver84de avatar Jul 22 '22 05:07 Skydiver84de

Hi just a quick user-feedback: just switched from ntfy to apprise with the newest base release and it´s working perfectly fine. Just getting two log lines when starting the container:

/scripts/msmtprc.sh: source: line 3: can't open '/etc/borgmatic.d/msmtp.env': No such file or directory /scripts/env.sh: source: line 3: can't open '/etc/borgmatic.d/msmtp.env': No such file or directory

Thank you very much & pls keep up the good work!

Mario

Edit: If I specify the tag 1.6 everything is working fine. If using the tag :latest I end up with both ntfy and msmtp available in the container, which explains the above log lines.

Heya,

Could you post your compose snippet so we can see your config?

Cheers!

modem7 avatar Jul 23 '22 00:07 modem7

Hi just a quick user-feedback: just switched from ntfy to apprise with the newest base release and it´s working perfectly fine. Just getting two log lines when starting the container: /scripts/msmtprc.sh: source: line 3: can't open '/etc/borgmatic.d/msmtp.env': No such file or directory /scripts/env.sh: source: line 3: can't open '/etc/borgmatic.d/msmtp.env': No such file or directory Thank you very much & pls keep up the good work! Mario Edit: If I specify the tag 1.6 everything is working fine. If using the tag :latest I end up with both ntfy and msmtp available in the container, which explains the above log lines.

Heya,

Could you post your compose snippet so we can see your config?

Cheers!

Hi, I´m using it on Unraid so no docker-compose. But it was pulling the :latest tag with default settings. I think the :latest tag is pointing to the ntfy container on docker hub? As I am now pulling the :1.6 tag everything is working perfectly fine.

Skydiver84de avatar Jul 23 '22 09:07 Skydiver84de

@grantbevis might be one for you

modem7 avatar Jul 25 '22 22:07 modem7

as a side note: the issue about sourcing msmtp.env in the wrong image should by solved #152.

Knapoc avatar Aug 25 '22 15:08 Knapoc