public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Dominic Jäger" <d.jaeger@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH manager 2/2] Close #1295: Make apt notifications configurable
Date: Wed,  7 Apr 2021 10:30:45 +0200	[thread overview]
Message-ID: <20210407083045.62463-2-d.jaeger@proxmox.com> (raw)
In-Reply-To: <20210407083045.62463-1-d.jaeger@proxmox.com>

This way all users, including subscription users, can decide if they want to
receive notifications mails from pveupdate or not. Disabling notifications is
desirable if available updates are monitored externally, for example.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
---
 bin/pveupdate                 | 4 +---
 www/manager6/dc/OptionView.js | 5 +++++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/bin/pveupdate b/bin/pveupdate
index 99b52fe9..37e6e518 100755
--- a/bin/pveupdate
+++ b/bin/pveupdate
@@ -50,9 +50,7 @@ if (my $err = $@) {
 }
 
 my $info = PVE::INotify::read_file('subscription');
-# We assume that users with subscriptions want informations
-# about new packages.
-my $notify = ($info && $info->{status} eq 'Active') ? 1 : 0;
+my $notify = $dccfg->{notify_updates} // 1;
 eval { PVE::API2::APT->update_database({ node => $nodename, notify => $notify, quiet => 1 }); };
 if (my $err = $@) {
     syslog ('err', "update apt database failed: $err");
diff --git a/www/manager6/dc/OptionView.js b/www/manager6/dc/OptionView.js
index 0e783cf4..b36acd07 100644
--- a/www/manager6/dc/OptionView.js
+++ b/www/manager6/dc/OptionView.js
@@ -92,6 +92,11 @@ Ext.define('PVE.dc.OptionView', {
 	    vtype: 'proxmoxMail',
 	    defaultValue: 'root@$hostname',
 	});
+	me.add_boolean_row(
+	    'notify_updates',
+	    gettext('Notify about updates'),
+	    { defaultValue: 1 },
+	);
 	me.add_text_row('mac_prefix', gettext('MAC address prefix'), {
 	    deleteEmpty: true,
 	    vtype: 'MacPrefix',
-- 
2.20.1




  reply	other threads:[~2021-04-07  8:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07  8:30 [pve-devel] [PATCH pve-cluster 1/2] Close #1295: Add notify_updates to datacenter schema Dominic Jäger
2021-04-07  8:30 ` Dominic Jäger [this message]
2021-04-07  8:51   ` [pve-devel] [PATCH manager 2/2] Close #1295: Make apt notifications configurable Thomas Lamprecht
2021-04-08  9:21     ` Dominic Jäger
2021-04-08  9:28       ` Thomas Lamprecht
2021-04-08 10:02 Dietmar Maurer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210407083045.62463-2-d.jaeger@proxmox.com \
    --to=d.jaeger@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal