Closed papamoose closed 6 months ago
yes please & more generaly more Debian tools should be apprise enabled, like apt-listchanges
and (*)cron
@papamoose I would really like to use your plugin to send web hooks, but I'm not familiar with python at all, or adding plugins to u-u. Is there a guide somewhere of how to add this plugin to u-u, and what needs to be edited in your script to get it working? Is there a list of variables to possibly add to the 51uu-apprise file? Thank you
I'll put something together for you this weekend and link it here.
That would be great, thank you!
I've rebased my branch.
@t-clarke91
apt-get install unattended-upgrades
sudo python3 -m pip install -U apprise
unattended-upgrade
script from my plugins-apprise branch
a. This is just 2x commits ahead of the official which includes @mvo5 patch to allow for plugins and my solution for POSTing the u-u result to a webhook using apprise (examples/plugins/apprise.py
)
b. The top of examples/plugins/apprise.py
contains the /etc/apt/apt.conf.d/51uu-apprise
file it looks for and default settings.unattended-upgrade
script from my plugins-apprise branch to wherever your distro put u-u (e.g. /usr/bin/unattended-upgrade
)examples/plugins/apprise.py
to /etc/unattended-upgrades/plugins/apprise.py
. If the directory doesn't exist, create it.apprise.py
to /etc/apt/apt.conf.d/51uu-apprise
.
a. Then follow Apprises instructions on creating a properly formatted URL to insert into the config file.Unattended-Upgrade::WebhookReport "always";
and then running u-u in verbose mode.
# unattended-upgrade --verbose
Starting unattended upgrades script
Allowed origins are: o=Ubuntu,a=jammy, o=Ubuntu,a=jammy-security, o=Ubuntu,a=jammy-updates,
Initial whitelist (not strict):
No packages found that can be upgraded unattended and no pending auto-removals
Sent Discord notification.
See attached script for a bash version of the above. u-u-apprise-install.sh.txt
@papamoose this is great, thank you for taking the time to make the instructions, the bash version of the instructions was very helpful too. I got it working and the notifications are sending as expected.
I finally managed to spent a bit of time on this again and I am quite happy with my current code in https://github.com/mvo5/unattended-upgrades/pull/355 - if someone could double check and test that would be super appreciated.
I tweaked the protptype a little bit and there are some tiny API changes, mostly cleanups like "result-str" -> "result" or "plugin-api" -> "plugin_api". It also can be accessed both as a dict (or easy json/webhook support) and as a python class (for pydoc support and mypy support). I can tweak the examples from this PR once the other is in :)
See https://github.com/mvo5/unattended-upgrades/pull/325
I've been running this plugin out of
/etc/unattended-upgrades/plugins/apprise.py
for the past year and it has been working great!