Re: [pve-devel] [PATCH pve-manager] website: update external links to www.proxmox.com
Okay, thanks for the clarification. > On 30.09.2023 10:07 CEST Thomas Lamprecht wrote: > > > Am 11/08/2023 um 12:46 schrieb Christian Ebner: > > During the redesign of www.proxmox.com the menu structure and therefore > > some url changed. Update the external link in order to avoid an > > unneccessary redirect > > > > Signed-off-by: Christian Ebner > > --- > > PVE/API2/Subscription.pm | 2 +- > > aplinfo/aplinfo.dat | 4 ++-- > > www/manager6/Utils.js| 2 +- > > www/manager6/dc/Summary.js | 2 +- > > www/mobile/WidgetToolkitUtils.js | 1 - > > 5 files changed, 5 insertions(+), 6 deletions(-) > > > > diff --git a/PVE/API2/Subscription.pm b/PVE/API2/Subscription.pm > > index c7b81ee9..96fcd4e5 100644 > > --- a/PVE/API2/Subscription.pm > > +++ b/PVE/API2/Subscription.pm > > @@ -128,7 +128,7 @@ __PACKAGE__->register_method ({ > > my $has_permission = $rpcenv->check($authuser, "/nodes/$node", > > ['Sys.Audit'], 1); > > > > my $server_id = PVE::API2Tools::get_hwaddress(); > > - my $url = "https://www.proxmox.com/proxmox-ve/pricing";; > > + my $url = > > "https://www.proxmox.com/en/proxmox-virtual-environment/pricing";; > > > > my $info = read_etc_subscription(); > > if (!$info) { > > diff --git a/aplinfo/aplinfo.dat b/aplinfo/aplinfo.dat > > index 95a8be5a..8382bd7d 100644 > > --- a/aplinfo/aplinfo.dat > > +++ b/aplinfo/aplinfo.dat > > @@ -135,7 +135,7 @@ Architecture: amd64 > > Location: mail/proxmox-mailgateway-7.3-standard_7.3-1_amd64.tar.zst > > md5sum: 6c130003f9880ae66dca0603d7b7ca87 > > sha512sum: > > 2fdf1dc24306bbaa2ef9a0f322416ca15b97b7d19f84b83743c7afc896095c398241fbc2eb41a33a69f3f275ce4c4cb6425edc5538831b4650d39a5e44fdbc25 > > -Infopage: https://www.proxmox.com/de/proxmox-mail-gateway > > +Infopage: https://www.proxmox.com/en/proxmox-mail-gateway/overview > > Description: Proxmox Mailgateway 7.3 > > A full featured mail proxy for spam and virus filtering, optimized for > > container environment. > > > > @@ -149,7 +149,7 @@ Architecture: amd64 > > Location: mail/proxmox-mailgateway-8.0-standard_8.0-1_amd64.tar.zst > > md5sum: 7d321e5dfc6e1005231586d1871e3625 > > sha512sum: > > be5efcb8ee97f2bb1c638360191eda19f49e2063acb88da55c948c90c091063972cc9ea29e6aeaa4a85733e0fb2c99ea905d665ac693cb2bf06b091c4baf781f > > -Infopage: https://www.proxmox.com/de/proxmox-mail-gateway > > +Infopage: https://www.proxmox.com/en/proxmox-mail-gateway/overview > > Description: Proxmox Mailgateway 8.0 > > A full featured mail proxy for spam and virus filtering, optimized for > > container environment. > > > > yeah no, those are only tracked here to provide an initial list of available > templates after installation, i.e., before the daily update service does the > equivalent of `pveam update` and overrides these again. > > The next dab appliance update will "fix" these, but it shouldn't matter, > those links are not easily accessible by users and we (hopefully) keep > old URLs reachable for a long time.. ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH proxmox-perl-rs] notify context: fix 'default_sendmail_from' context method
The name of the configuration option in datacenter.cfg is `email_from` and not `mail_from`. Signed-off-by: Lukas Wagner --- Reported in our forum: https://forum.proxmox.com/threads/mail-alerts-not-sent-with-datacenter-default.134305/ pve-rs/src/notify_context.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pve-rs/src/notify_context.rs b/pve-rs/src/notify_context.rs index 48623fd..3cf3e18 100644 --- a/pve-rs/src/notify_context.rs +++ b/pve-rs/src/notify_context.rs @@ -58,7 +58,7 @@ impl Context for PVEContext { fn default_sendmail_from(&self) -> String { let content = attempt_file_read("/etc/pve/datacenter.cfg"); content -.and_then(|content| lookup_datacenter_config_key(&content, "mail_from")) +.and_then(|content| lookup_datacenter_config_key(&content, "email_from")) .unwrap_or_else(|| String::from("root")) } -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH v2 proxmox 03/11] notify: introduce Error::Generic
... as leaf error-type for anything for which we do not necessarily want a separate enum variant. Signed-off-by: Lukas Wagner --- proxmox-notify/src/lib.rs | 11 +++ 1 file changed, 11 insertions(+) diff --git a/proxmox-notify/src/lib.rs b/proxmox-notify/src/lib.rs index 7500778..f7d480c 100644 --- a/proxmox-notify/src/lib.rs +++ b/proxmox-notify/src/lib.rs @@ -25,13 +25,22 @@ mod config; #[derive(Debug)] pub enum Error { +/// There was an error serializing the config ConfigSerialization(Box), +/// There was an error deserializing the config ConfigDeserialization(Box), +/// An endpoint failed to send a notification NotifyFailed(String, Box), +/// A target does not exist TargetDoesNotExist(String), +/// Testing one or more notification targets failed TargetTestFailed(Vec>), +/// A filter could not be applied FilterFailed(String), +/// The notification's template string could not be rendered RenderError(Box), +/// Generic error for anything else +Generic(String), } impl Display for Error { @@ -60,6 +69,7 @@ impl Display for Error { write!(f, "could not apply filter: {message}") } Error::RenderError(err) => write!(f, "could not render notification template: {err}"), +Error::Generic(message) => f.write_str(message), } } } @@ -74,6 +84,7 @@ impl StdError for Error { Error::TargetTestFailed(errs) => Some(&*errs[0]), Error::FilterFailed(_) => None, Error::RenderError(err) => Some(&**err), +Error::Generic(_) => None, } } } -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH v2 proxmox 02/11] sys: email: add `forward`
This new function forwards an email to new recipients. Signed-off-by: Lukas Wagner --- proxmox-sys/src/email.rs | 52 +++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/proxmox-sys/src/email.rs b/proxmox-sys/src/email.rs index 8b3a1b6..c94f634 100644 --- a/proxmox-sys/src/email.rs +++ b/proxmox-sys/src/email.rs @@ -3,7 +3,7 @@ use std::io::Write; use std::process::{Command, Stdio}; -use anyhow::{bail, Error}; +use anyhow::{bail, format_err, Error}; /// Sends multi-part mail with text and/or html to a list of recipients /// @@ -110,6 +110,56 @@ pub fn sendmail( Ok(()) } +/// Forwards an email message to a given list of recipients. +/// +/// ``sendmail`` is used for sending the mail, thus `message` must be +/// compatible with that (the message is piped into stdin unmodified). +pub fn forward( +mailto: &[&str], +mailfrom: &str, +message: &[u8], +uid: Option, +) -> Result<(), Error> { +use std::os::unix::process::CommandExt; + +if mailto.is_empty() { +bail!("At least one recipient has to be specified!") +} + +let mut builder = Command::new("/usr/sbin/sendmail"); + +builder +.args([ +"-N", "never", // never send DSN (avoid mail loops) +"-f", mailfrom, "--", +]) +.args(mailto) +.stdin(Stdio::piped()) +.stdout(Stdio::null()) +.stderr(Stdio::null()); + +if let Some(uid) = uid { +builder.uid(uid); +} + +let mut process = builder +.spawn() +.map_err(|err| format_err!("could not spawn sendmail process: {err}"))?; + +process +.stdin +.take() +.unwrap() +.write_all(message) +.map_err(|err| format_err!("couldn't write to sendmail stdin: {err}"))?; + +process +.wait() +.map_err(|err| format_err!("sendmail did not exit successfully: {err}"))?; + +Ok(()) +} + #[cfg(test)] mod test { use crate::email::sendmail; -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH v2 pve-docs 11/11] notification: add docs for system mail forwarding
Signed-off-by: Lukas Wagner --- notifications.adoc | 28 +--- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/notifications.adoc b/notifications.adoc index c4d2931..0b00b1e 100644 --- a/notifications.adoc +++ b/notifications.adoc @@ -19,9 +19,10 @@ such as: | `fencing` | The {pve} HA manager has fenced a node | `error` | `replication` | A storage replication job has failed| `error` | `vzdump` | vzdump backup finished | `info` (`error` on failure) +| `system-mail` | An email was sent to the local root user| `error` |=== -In the 'Notification' panel of the datacenter view, the system's behavior can be +In the 'Notifications' panel of the datacenter view, the system's behavior can be configured for all events except backup jobs. For backup jobs, the settings can be found in the respective backup job configuration. For every notification event there is an option to configure the notification @@ -151,9 +152,22 @@ included in the group. If a group/endpoint is configured to use a filter, the user must have the `Mapping.Use` permission for the filter as well. - - - - - - +System Mail Forwarding +- + +Certain local system daemons, such as `smartd`, generate notification emails +that are initially directed to the local `root` user. {pve} will +forward these emails to a customizable notification target. + +By default, these emails are sent to the email address that is configured for +the `root@pam` user using the predefined `mail-to-root` notification target. +However, similar to any other notification event, this behavior can be +adjusted within the 'Notifications' panel by making changes to the +'System Mail' setting. + +When the forwarding process involves an email-based target +(like `sendmail` or `smtp`), the email is forwarded exactly as received, with all +original mail headers remaining intact. For all other targets, +the system tries to extract both a subject line and the main text body +from the email content. In instances where emails solely consist of HTML +content, they will be transformed into plain text format during this process. -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH v2 many 00/11] notifications: feed system mails into proxmox_notify
The aim of this patch series is to adapt `proxmox-mail-forward` so that it forwards emails that were sent to the local root user through the `proxmox_notify` crate. A short summary of the status quo: Any mail that is sent to the local `root` user is forwarded by postfix to the `proxmox-mail-forward` binary, which receives the mail via STDIN. `proxmox-mail-forward` looks up the email address configured for the `root@pam` user in /etc/{proxmox-backup,pve}/user.cfg and then forwards the mail to this address by calling `sendmail` This patch series modifies `proxmox-mail-forward` in the following way: `proxmox-mail-forward` instantiates the configuration for `proxmox_notify` by reading `/etc/{proxmox-backup,pve}/notifications.cfg. Also, it looks up the policy for system mail (target/if to forward at all) in `node.cfg/datacenter.cfg`. Following that, the mail is passed to `proxmox_notify`, which sends it to the specified target(s). If no target is configured/configuration files do not exist, then the mail is forwarded using the `mail-to-root` target, which always exists. In this way the changes should be 100% backwards compatible. One small change in behavior can occur if PBS is co-installed on a PVE host. Here it could happen that a mail is forwarded twice: Once for for notification configuration for PVE, and once for the config for PBS. Unfortunately there is no easy way to perform any useful 'deduplication' there (by target name does not really work, since they could have different configuration/recipients; by 'mail-address' would work for mail-based targets, however this involves some pretty invasive changes and still does not work for targets that are not mail-based). Personally I feel that we should just add a section about this behavior in the docs (once proxmox_notify is fully integrated in PBS), instructing the user to set `system-mail` to `never` in `node.cfg` (don't forward mails). Alternatively we could try to detect co-installations and only forward for the target of one of both products. However, I prefer the first option. `proxmox-notify` now depends on a new crate `mail-parser` to parse email headers (something I *really* don't want to implement myself from scratch). The new dependency is not packaged yet, the necessary debcargo-conf changes are included in the first patch. @TESTERS: I can provide a pre-built deb for `mail-parser`. Changelog: - v1 -> v2: - Rebased - Apply the same fix for the PVE context as in [1] [1] https://lists.proxmox.com/pipermail/pve-devel/2023-October/059294.html debcargo-conf: Lukas Wagner (1): package mail-parser 0.8.2 src/mail-parser/debian/changelog | 6 ++ src/mail-parser/debian/copyright | 49 .../debian/copyright.debcargo.hint| 77 +++ src/mail-parser/debian/debcargo.toml | 2 + 4 files changed, 134 insertions(+) create mode 100644 src/mail-parser/debian/changelog create mode 100644 src/mail-parser/debian/copyright create mode 100644 src/mail-parser/debian/copyright.debcargo.hint create mode 100644 src/mail-parser/debian/debcargo.toml proxmox: Lukas Wagner (4): sys: email: add `forward` notify: introduce Error::Generic notify: add mechanisms for email message forwarding notify: add PVE/PBS context Cargo.toml| 1 + proxmox-notify/Cargo.toml | 5 +- proxmox-notify/src/context/common.rs | 27 .../src/{context.rs => context/mod.rs}| 14 +- proxmox-notify/src/context/pbs.rs | 130 ++ proxmox-notify/src/context/pve.rs | 82 +++ proxmox-notify/src/endpoints/gotify.rs| 21 +-- proxmox-notify/src/endpoints/sendmail.rs | 62 + proxmox-notify/src/filter.rs | 8 +- proxmox-notify/src/lib.rs | 109 +-- proxmox-sys/src/email.rs | 52 ++- 11 files changed, 451 insertions(+), 60 deletions(-) create mode 100644 proxmox-notify/src/context/common.rs rename proxmox-notify/src/{context.rs => context/mod.rs} (54%) create mode 100644 proxmox-notify/src/context/pbs.rs create mode 100644 proxmox-notify/src/context/pve.rs proxmox-perl-rs: Lukas Wagner (2): notify: construct Notification via constructor pve-rs: notify: remove notify_context for PVE common/src/notify.rs | 8 +-- pve-rs/Cargo.toml| 2 +- pve-rs/src/lib.rs| 7 ++- pve-rs/src/notify_context.rs | 117 --- 4 files changed, 6 insertions(+), 128 deletions(-) delete mode 100644 pve-rs/src/notify_context.rs pve-cluster: Lukas Wagner (1): datacenter config: add new parameters for system mail forwarding src/PVE/DataCenterConfig.pm | 22 ++ 1 file changed, 22 insertions(+) pve-manager: Lukas Wagner (1): ui: notify: add system-mail settings, configuring mail forw
[pve-devel] [PATCH v2 pve-manager 09/11] ui: notify: add system-mail settings, configuring mail forwarding
The 'Notifications' panel in Datacenter view now features a new entry 'System mail', allowing the user to configure target and policy for mails sent to the local root user. Signed-off-by: Lukas Wagner --- www/manager6/dc/NotificationEvents.js | 27 +++ 1 file changed, 27 insertions(+) diff --git a/www/manager6/dc/NotificationEvents.js b/www/manager6/dc/NotificationEvents.js index 18816290..40e9a65f 100644 --- a/www/manager6/dc/NotificationEvents.js +++ b/www/manager6/dc/NotificationEvents.js @@ -240,6 +240,33 @@ Ext.define('PVE.dc.NotificationEvents', { ], }); + me.addInputPanelRow('system-mail', 'notify', gettext('System Mail'), { + renderer: (value, metaData, record, rowIndex, colIndex, store) => + render_value(store, 'target-system-mail', 'system-mail', gettext('Always')), + url: "/api2/extjs/cluster/options", + items: [ + { + xtype: 'pveNotificationEventsPolicySelector', + name: 'system-mail', + fieldLabel: gettext('Notify'), + comboItems: [ + ['__default__', `${Proxmox.Utils.defaultText} (${gettext('Always')})`], + ['always', gettext('Always')], + ['never', gettext('Never')], + ], + warningRef: 'warning', + warnIfValIs: 'never', + }, + { + xtype: 'pveNotificationEventsTargetSelector', + name: 'target-system-mail', + }, + { + xtype: 'pveNotificationEventDisabledWarning', + reference: 'warning', + }, + ], + }); // Hack: Also load the notify property to make it accessible // for our render functions. me.rows.notify = { -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH v2 pve-cluster 08/11] datacenter config: add new parameters for system mail forwarding
This commit adds two new paramters to the 'notify' property string: - 'system-mail': Determine whether mails to root should be forwarded by the notification system - 'system-mail-target': Determine the target to which the notification should be forwarded to. Signed-off-by: Lukas Wagner --- src/PVE/DataCenterConfig.pm | 22 ++ 1 file changed, 22 insertions(+) diff --git a/src/PVE/DataCenterConfig.pm b/src/PVE/DataCenterConfig.pm index 09be6eb..e2619c5 100644 --- a/src/PVE/DataCenterConfig.pm +++ b/src/PVE/DataCenterConfig.pm @@ -116,6 +116,28 @@ my $notification_format = { . " to root via a 'sendmail' notification endpoint.", optional => 1, }, +'system-mail' => { + type => 'string', + enum => ['always', 'never'], + description => "Control if mails to the 'root' user should be forwarded.", + verbose_description => "Control if mails to the 'root' user should be forwarded.\n" + . "* 'always' forward always\n" + . "* 'never' forward never.\n" + . "For production systems, turning off mail forwarding is not" + . "recommended!\n", + default => 'always', + optional => 1, +}, +'target-system-mail' => { + type => 'string', + format_description => 'TARGET', + description => "Control where mails to the 'root' user should be forwarded to.", + verbose_description => "Control where mails to the 'root' user should be forwarded to." + . " Has to be the name of a notification target (endpoint or notification group)." + . " If the 'target-system-mail' parameter is not set, the system will send mails" + . " to root via a 'sendmail' notification endpoint.", + optional => 1, +}, }; register_standard_option('pve-ha-shutdown-policy', { -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH v2 proxmox 04/11] notify: add mechanisms for email message forwarding
As preparation for the integration of `proxmox-mail-foward` into the notification system, this commit makes a few changes that allow us to forward raw email messages (as passed from postfix). For mail-based notification targets, the email will be forwarded as-is, including all headers. The only thing that changes is the message envelope. For other notification targets, the mail is parsed using the `mail-parser` crate, which allows us to extract a subject and a body. As a body we use the plain-text version of the mail. If an email is HTML-only, the `mail-parser` crate will automatically attempt to transform the HTML into readable plain text. Signed-off-by: Lukas Wagner --- Cargo.toml | 1 + proxmox-notify/Cargo.toml| 2 + proxmox-notify/src/endpoints/gotify.rs | 21 +++-- proxmox-notify/src/endpoints/sendmail.rs | 62 --- proxmox-notify/src/filter.rs | 8 +- proxmox-notify/src/lib.rs| 98 6 files changed, 138 insertions(+), 54 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e334ac1..9adfe59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,6 +61,7 @@ lazy_static = "1.4" ldap3 = { version = "0.11", default-features = false } libc = "0.2.107" log = "0.4.17" +mail-parser = "0.8.2" native-tls = "0.2" nix = "0.26.1" once_cell = "1.3.1" diff --git a/proxmox-notify/Cargo.toml b/proxmox-notify/Cargo.toml index 1541b8b..441b6e1 100644 --- a/proxmox-notify/Cargo.toml +++ b/proxmox-notify/Cargo.toml @@ -11,6 +11,7 @@ exclude.workspace = true handlebars = { workspace = true } lazy_static.workspace = true log.workspace = true +mail-parser = { workspace = true, optional = true } once_cell.workspace = true openssl.workspace = true proxmox-http = { workspace = true, features = ["client-sync"], optional = true } @@ -26,5 +27,6 @@ serde_json.workspace = true [features] default = ["sendmail", "gotify"] +mail-forwarder = ["dep:mail-parser"] sendmail = ["dep:proxmox-sys"] gotify = ["dep:proxmox-http"] diff --git a/proxmox-notify/src/endpoints/gotify.rs b/proxmox-notify/src/endpoints/gotify.rs index 83df41f..261573b 100644 --- a/proxmox-notify/src/endpoints/gotify.rs +++ b/proxmox-notify/src/endpoints/gotify.rs @@ -11,7 +11,7 @@ use proxmox_schema::{api, Updater}; use crate::context::context; use crate::renderer::TemplateRenderer; use crate::schema::ENTITY_NAME_SCHEMA; -use crate::{renderer, Endpoint, Error, Notification, Severity}; +use crate::{renderer, Content, Endpoint, Error, Notification, Severity}; fn severity_to_priority(level: Severity) -> u32 { match level { @@ -87,13 +87,18 @@ impl Endpoint for GotifyEndpoint { fn send(&self, notification: &Notification) -> Result<(), Error> { let properties = notification.properties.as_ref(); -let title = renderer::render_template( -TemplateRenderer::Plaintext, -¬ification.title, -properties, -)?; -let message = -renderer::render_template(TemplateRenderer::Plaintext, ¬ification.body, properties)?; +let (title, message) = match ¬ification.content { +Content::Template { title, body } => { +let rendered_title = +renderer::render_template(TemplateRenderer::Plaintext, title, properties)?; +let rendered_message = +renderer::render_template(TemplateRenderer::Plaintext, body, properties)?; + +(rendered_title, rendered_message) +} +#[cfg(feature = "mail-forwarder")] +Content::ForwardedMail { title, body, .. } => (title.clone(), body.clone()), +}; // We don't have a TemplateRenderer::Markdown yet, so simply put everything // in code tags. Otherwise tables etc. are not formatted properly diff --git a/proxmox-notify/src/endpoints/sendmail.rs b/proxmox-notify/src/endpoints/sendmail.rs index 26e2a17..9cc3f31 100644 --- a/proxmox-notify/src/endpoints/sendmail.rs +++ b/proxmox-notify/src/endpoints/sendmail.rs @@ -8,7 +8,7 @@ use proxmox_schema::{api, Updater}; use crate::context::context; use crate::renderer::TemplateRenderer; use crate::schema::{EMAIL_SCHEMA, ENTITY_NAME_SCHEMA, USER_SCHEMA}; -use crate::{renderer, Endpoint, Error, Notification}; +use crate::{renderer, Content, Endpoint, Error, Notification}; pub(crate) const SENDMAIL_TYPENAME: &str = "sendmail"; @@ -103,40 +103,44 @@ impl Endpoint for SendmailEndpoint { } let properties = notification.properties.as_ref(); - -let subject = renderer::render_template( -TemplateRenderer::Plaintext, -¬ification.title, -properties, -)?; -let html_part = -renderer::render_template(TemplateRenderer::Html, ¬ification.body, properties)?; -let text_part = -renderer::render_template(TemplateRenderer::Plaintext, ¬ification.b
[pve-devel] [PATCH v2 debcargo-conf 01/11] package mail-parser 0.8.2
Signed-off-by: Lukas Wagner --- src/mail-parser/debian/changelog | 6 ++ src/mail-parser/debian/copyright | 49 .../debian/copyright.debcargo.hint| 77 +++ src/mail-parser/debian/debcargo.toml | 2 + 4 files changed, 134 insertions(+) create mode 100644 src/mail-parser/debian/changelog create mode 100644 src/mail-parser/debian/copyright create mode 100644 src/mail-parser/debian/copyright.debcargo.hint create mode 100644 src/mail-parser/debian/debcargo.toml diff --git a/src/mail-parser/debian/changelog b/src/mail-parser/debian/changelog new file mode 100644 index 0..2ed51934d --- /dev/null +++ b/src/mail-parser/debian/changelog @@ -0,0 +1,6 @@ +rust-mail-parser (0.8.2-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium + + * Team upload. + * Package mail-parser 0.8.2 from crates.io using debcargo 2.6.0 + + -- Lukas Wagner Fri, 25 Aug 2023 14:10:10 +0200 diff --git a/src/mail-parser/debian/copyright b/src/mail-parser/debian/copyright new file mode 100644 index 0..28fc2722c --- /dev/null +++ b/src/mail-parser/debian/copyright @@ -0,0 +1,49 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: mail-parser +Upstream-Contact: Stalwart Labs +Source: https://github.com/stalwartlabs/mail-parser + +Files: * +Copyright: 2020-2022 Stalwart Labs +License: Apache-2.0 or MIT + +Files: tests/legacy/* +Copyright: 2010 Hunny Software, Inc. +License: UNKNOWN-LICENSE; + +Files: tests/malformed/* +Copyright: 2003-2018 Dovecot authors, licensed under MIT. +License: MIT + +Files: tests/thirdparty/* +Copyright: 2003-2018 Dovecot authors, licensed under MIT. +License: MIT + +Files: debian/* +Copyright: + 2023 Debian Rust Maintainers + 2023 Lukas Wagner +License: Apache-2.0 or MIT + +License: Apache-2.0 + Debian systems provide the Apache 2.0 license in + /usr/share/common-licenses/Apache-2.0 + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/src/mail-parser/debian/copyright.debcargo.hint b/src/mail-parser/debian/copyright.debcargo.hint new file mode 100644 index 0..f0379206a --- /dev/null +++ b/src/mail-parser/debian/copyright.debcargo.hint @@ -0,0 +1,77 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: mail-parser +Upstream-Contact: Stalwart Labs +Source: https://github.com/stalwartlabs/mail-parser + +Files: * +Copyright: FIXME (overlay) UNKNOWN-YEARS Stalwart Labs +License: Apache-2.0 or MIT +Comment: + FIXME (overlay): Since upstream copyright years are not available in + Cargo.toml, they were extracted from the upstream Git repository. This may not + be correct information so you should review and fix this before uploading to + the archive. + +Files: README.md +Copyright: 2020-2022, Stalwart Labs Ltd. +License: UNKNOWN-LICENSE; FIXME (overlay) +Comment: + FIXME (overlay): These notices are extracted from files. Please review them + before uploading to the archive. + +Files: src/decoders/base64.rs +Copyright: 2005, 2006, 2007 Nick Galbreath -- nickg [at] modp [dot] com +License: UNKNOWN-LICENSE; FIXME (overlay) +Comment: + FIXME (overlay): These notices are extracted from files. Please review them + before uploading to the archive. + +Files: tests/legacy/COPYING +Copyright: 2010 Hunny Software, Inc. +License: UNKNOWN-LICENSE; FIXME (overlay) +Comment: + FIXME (overlay): These notices are extracted from files. Please review them + before uploading to the archive. + +Files: tests/malformed/COPYING +Copyright: 2003-2018 Dovecot authors, licensed under MIT. +License: UNKNOWN-LICENSE; FIXME (overlay) +Comment: + FIXME (overlay): These notices are extracted from files. Please review them + before uploading to the archive. + +Files: tests/thirdparty/COPYING +Copyright: 2003-2018 Dovecot authors, licensed under MIT. +License: UNKNOWN-LICENSE; FIXME (overlay) +Comment: + FIXME (overlay): These notices are ext
[pve-devel] [PATCH v2 proxmox-perl-rs 06/11] notify: construct Notification via constructor
This keeps us isolated from any further changes in the proxmox_notify::Notification struct. Signed-off-by: Lukas Wagner --- common/src/notify.rs | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/common/src/notify.rs b/common/src/notify.rs index 9f44225..203acca 100644 --- a/common/src/notify.rs +++ b/common/src/notify.rs @@ -94,13 +94,7 @@ mod export { properties: Option, ) -> Result<(), HttpError> { let config = this.config.lock().unwrap(); - -let notification = Notification { -severity, -title, -body, -properties, -}; +let notification = Notification::new_templated(severity, title, body, properties); api::common::send(&config, channel, ¬ification) } -- 2.39.2 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH v2 proxmox-perl-rs 07/11] pve-rs: notify: remove notify_context for PVE
The context has now been moved to `proxmox-notify` due to the fact that we also need it in `proxmox-mail-forward` now. Signed-off-by: Lukas Wagner --- pve-rs/Cargo.toml| 2 +- pve-rs/src/lib.rs| 7 ++- pve-rs/src/notify_context.rs | 117 --- 3 files changed, 5 insertions(+), 121 deletions(-) delete mode 100644 pve-rs/src/notify_context.rs diff --git a/pve-rs/Cargo.toml b/pve-rs/Cargo.toml index f9e3291..f734b3b 100644 --- a/pve-rs/Cargo.toml +++ b/pve-rs/Cargo.toml @@ -36,7 +36,7 @@ perlmod = { version = "0.13", features = [ "exporter" ] } proxmox-apt = "0.10.6" proxmox-http = { version = "0.9", features = ["client-sync", "client-trait"] } proxmox-http-error = "0.1.0" -proxmox-notify = "0.2" +proxmox-notify = { version = "0.2", features = ["pve-context"] } proxmox-openid = "0.10" proxmox-resource-scheduling = "0.3.0" proxmox-subscription = "0.4" diff --git a/pve-rs/src/lib.rs b/pve-rs/src/lib.rs index d1915c9..42be39e 100644 --- a/pve-rs/src/lib.rs +++ b/pve-rs/src/lib.rs @@ -4,18 +4,19 @@ pub mod common; pub mod apt; -pub mod notify_context; pub mod openid; pub mod resource_scheduling; pub mod tfa; #[perlmod::package(name = "Proxmox::Lib::PVE", lib = "pve_rs")] mod export { -use crate::{common, notify_context}; +use proxmox_notify::context::pve::PVE_CONTEXT; + +use crate::common; #[export] pub fn init() { common::logger::init("PVE_LOG", "info"); -notify_context::init(); +proxmox_notify::context::set_context(&PVE_CONTEXT) } } diff --git a/pve-rs/src/notify_context.rs b/pve-rs/src/notify_context.rs deleted file mode 100644 index 48623fd..000 --- a/pve-rs/src/notify_context.rs +++ /dev/null @@ -1,117 +0,0 @@ -use log; -use std::path::Path; - -use proxmox_notify::context::Context; - -// Some helpers borrowed and slightly adapted from `proxmox-mail-forward` - -fn normalize_for_return(s: Option<&str>) -> Option { -match s?.trim() { -"" => None, -s => Some(s.to_string()), -} -} - -fn attempt_file_read>(path: P) -> Option { -match proxmox_sys::fs::file_read_optional_string(path) { -Ok(contents) => contents, -Err(err) => { -log::error!("{err}"); -None -} -} -} - -fn lookup_mail_address(content: &str, user: &str) -> Option { -normalize_for_return(content.lines().find_map(|line| { -let fields: Vec<&str> = line.split(':').collect(); -#[allow(clippy::get_first)] // to keep expression style consistent -match fields.get(0)?.trim() == "user" && fields.get(1)?.trim() == user { -true => fields.get(6).copied(), -false => None, -} -})) -} - -fn lookup_datacenter_config_key(content: &str, key: &str) -> Option { -let key_prefix = format!("{key}:"); -normalize_for_return( -content -.lines() -.find_map(|line| line.strip_prefix(&key_prefix)), -) -} - -#[derive(Debug)] -struct PVEContext; - -impl Context for PVEContext { -fn lookup_email_for_user(&self, user: &str) -> Option { -let content = attempt_file_read("/etc/pve/user.cfg"); -content.and_then(|content| lookup_mail_address(&content, user)) -} - -fn default_sendmail_author(&self) -> String { -"Proxmox VE".into() -} - -fn default_sendmail_from(&self) -> String { -let content = attempt_file_read("/etc/pve/datacenter.cfg"); -content -.and_then(|content| lookup_datacenter_config_key(&content, "mail_from")) -.unwrap_or_else(|| String::from("root")) -} - -fn http_proxy_config(&self) -> Option { -let content = attempt_file_read("/etc/pve/datacenter.cfg"); -content.and_then(|content| lookup_datacenter_config_key(&content, "http_proxy")) -} -} - -#[cfg(test)] -mod tests { -use super::*; - -const USER_CONFIG: &str = " -user:root@pam:1:0:::r...@example.com::: -user:test@pve:1:0:::t...@example.com::: -user:no-mail@pve:1:0:: -"; - -#[test] -fn test_parse_mail() { -assert_eq!( -lookup_mail_address(USER_CONFIG, "root@pam"), -Some("r...@example.com".to_string()) -); -assert_eq!( -lookup_mail_address(USER_CONFIG, "test@pve"), -Some("t...@example.com".to_string()) -); -assert_eq!(lookup_mail_address(USER_CONFIG, "no-mail@pve"), None); -} - -const DC_CONFIG: &str = " -email_from: u...@example.com -http_proxy: http://localhost:1234 -keyboard: en-us -"; -#[test] -fn test_parse_dc_config() { -assert_eq!( -lookup_datacenter_config_key(DC_CONFIG, "email_from"), -Some("u...@example.com".to_string()) -); -assert_eq!( -lookup_datacenter_config_key(DC_CONFIG, "http_proxy"), -Some("http://localhost:1234".to_string()) -); -assert_eq!(lookup_datacenter_config_
[pve-devel] [PATCH v2 proxmox 05/11] notify: add PVE/PBS context
This commit moves PVEContext from `proxmox-perl-rs` into the `proxmox-notify` crate, since we now also need to access it from `promxox-mail-forward`. The context is now hidden behind a feature flag `pve-context`, ensuring that we only compile it when needed. This commit adds PBSContext, since we now require it for `proxmox-mail-forward`. This commit also changes the global context from being stored in a `once_cell` to a regular `Mutex`, since we now need to set/reset the context in `proxmox-mail-forward`. Signed-off-by: Lukas Wagner --- proxmox-notify/Cargo.toml | 3 +- proxmox-notify/src/context/common.rs | 27 .../src/{context.rs => context/mod.rs}| 14 +- proxmox-notify/src/context/pbs.rs | 130 ++ proxmox-notify/src/context/pve.rs | 82 +++ 5 files changed, 251 insertions(+), 5 deletions(-) create mode 100644 proxmox-notify/src/context/common.rs rename proxmox-notify/src/{context.rs => context/mod.rs} (54%) create mode 100644 proxmox-notify/src/context/pbs.rs create mode 100644 proxmox-notify/src/context/pve.rs diff --git a/proxmox-notify/Cargo.toml b/proxmox-notify/Cargo.toml index 441b6e1..8d8caaf 100644 --- a/proxmox-notify/Cargo.toml +++ b/proxmox-notify/Cargo.toml @@ -12,7 +12,6 @@ handlebars = { workspace = true } lazy_static.workspace = true log.workspace = true mail-parser = { workspace = true, optional = true } -once_cell.workspace = true openssl.workspace = true proxmox-http = { workspace = true, features = ["client-sync"], optional = true } proxmox-http-error.workspace = true @@ -30,3 +29,5 @@ default = ["sendmail", "gotify"] mail-forwarder = ["dep:mail-parser"] sendmail = ["dep:proxmox-sys"] gotify = ["dep:proxmox-http"] +pve-context = ["dep:proxmox-sys"] +pbs-context = ["dep:proxmox-sys"] diff --git a/proxmox-notify/src/context/common.rs b/proxmox-notify/src/context/common.rs new file mode 100644 index 000..7580bd1 --- /dev/null +++ b/proxmox-notify/src/context/common.rs @@ -0,0 +1,27 @@ +use std::path::Path; + +pub(crate) fn attempt_file_read>(path: P) -> Option { +match proxmox_sys::fs::file_read_optional_string(path) { +Ok(contents) => contents, +Err(err) => { +log::error!("{err}"); +None +} +} +} + +pub(crate) fn lookup_datacenter_config_key(content: &str, key: &str) -> Option { +let key_prefix = format!("{key}:"); +normalize_for_return( +content +.lines() +.find_map(|line| line.strip_prefix(&key_prefix)), +) +} + +pub(crate) fn normalize_for_return(s: Option<&str>) -> Option { +match s?.trim() { +"" => None, +s => Some(s.to_string()), +} +} diff --git a/proxmox-notify/src/context.rs b/proxmox-notify/src/context/mod.rs similarity index 54% rename from proxmox-notify/src/context.rs rename to proxmox-notify/src/context/mod.rs index 370c7ee..00de2b0 100644 --- a/proxmox-notify/src/context.rs +++ b/proxmox-notify/src/context/mod.rs @@ -1,6 +1,12 @@ use std::fmt::Debug; +use std::sync::Mutex; -use once_cell::sync::OnceCell; +#[cfg(any(feature = "pve-context", feature = "pbs-context"))] +pub mod common; +#[cfg(feature = "pbs-context")] +pub mod pbs; +#[cfg(feature = "pve-context")] +pub mod pve; pub trait Context: Send + Sync + Debug { fn lookup_email_for_user(&self, user: &str) -> Option; @@ -9,13 +15,13 @@ pub trait Context: Send + Sync + Debug { fn http_proxy_config(&self) -> Option; } -static CONTEXT: OnceCell<&'static dyn Context> = OnceCell::new(); +static CONTEXT: Mutex> = Mutex::new(None); pub fn set_context(context: &'static dyn Context) { -CONTEXT.set(context).expect("context has already been set"); +*CONTEXT.lock().unwrap() = Some(context); } #[allow(unused)] // context is not used if all endpoint features are disabled pub(crate) fn context() -> &'static dyn Context { -*CONTEXT.get().expect("context has not been yet") +(*CONTEXT.lock().unwrap()).expect("context for proxmox-notify has not been set yet") } diff --git a/proxmox-notify/src/context/pbs.rs b/proxmox-notify/src/context/pbs.rs new file mode 100644 index 000..1e79566 --- /dev/null +++ b/proxmox-notify/src/context/pbs.rs @@ -0,0 +1,130 @@ +use serde::Deserialize; + +use proxmox_schema::{ObjectSchema, Schema, StringSchema}; +use proxmox_section_config::{SectionConfig, SectionConfigPlugin}; + +use crate::context::{common, Context}; + +const PBS_USER_CFG_FILENAME: &str = "/etc/proxmox-backup/user.cfg"; +const PBS_NODE_CFG_FILENAME: &str = "/etc/proxmox-backup/node.cfg"; + +// FIXME: Switch to the actual schema when possible in terms of dependency. +// It's safe to assume that the config was written with the actual schema restrictions, so parsing +// it with the less restrictive schema should be enough for the purpose of getting the mail address. +const DUMMY_ID_SCHEMA: Schema = StringSchema::new("dummy ID").min_length(3).schema(); +co
[pve-devel] [PATCH v2 proxmox-mail-forward 10/11] feed forwarded mails into proxmox_notify
This allows us to send notifications for events from daemons that are not under our control, e.g. zed, smartd, cron. etc... For mail-based notification targets (sendmail, soon smtp) the mail is forwarded as is, including all headers. All other target types will try to parse the email to extra subject and text body. On PBS, where proxmox-notify is not yet fully integrated, we also use proxmox-notify. There, we simply fall back to the default target/policy (mail-to-root, which looks up root@pam's mail address). Once notification support is built into PBS, proxmox-mail-forward should automatically work in the same way as for PVE. Signed-off-by: Lukas Wagner --- Cargo.toml | 8 +- src/main.rs | 348 +++- 2 files changed, 238 insertions(+), 118 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c68e802..64f8d47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "proxmox-mail-forward" version = "0.2.0" authors = [ "Fiona Ebner ", +"Lukas Wagner ", "Proxmox Support Team ", ] edition = "2021" @@ -17,9 +18,10 @@ anyhow = "1.0" log = "0.4.17" nix = "0.26" serde = { version = "1.0", features = ["derive"] } -#serde_json = "1.0" +serde_json = "1.0" syslog = "6.0" -proxmox-schema = "1.3" -proxmox-section-config = "1.0.2" +proxmox-schema = { version = "2.0", features = ["api-macro"] } +proxmox-section-config = "2.0" proxmox-sys = "0.5" +proxmox-notify = {version = "0.2", features = ["mail-forwarder", "pve-context", "pbs-context"] } diff --git a/src/main.rs b/src/main.rs index f3d4193..d3b7b6a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,39 +1,58 @@ +use std::io::Read; use std::path::Path; -use std::process::Command; -use anyhow::{bail, format_err, Error}; +use anyhow::Error; use serde::Deserialize; -use proxmox_schema::{ObjectSchema, Schema, StringSchema}; -use proxmox_section_config::{SectionConfig, SectionConfigPlugin}; +use proxmox_notify::context::pbs::PBS_CONTEXT; +use proxmox_notify::context::pve::PVE_CONTEXT; +use proxmox_notify::endpoints::sendmail::SendmailConfig; +use proxmox_notify::Config; +use proxmox_schema::{api, ApiType}; use proxmox_sys::fs; -const PBS_USER_CFG_FILENAME: &str = "/etc/proxmox-backup/user.cfg"; -const PBS_ROOT_USER: &str = "root@pam"; - -// FIXME: Switch to the actual schema when possible in terms of dependency. -// It's safe to assume that the config was written with the actual schema restrictions, so parsing -// it with the less restrictive schema should be enough for the purpose of getting the mail address. -const DUMMY_ID_SCHEMA: Schema = StringSchema::new("dummy ID").min_length(3).schema(); -const DUMMY_EMAIL_SCHEMA: Schema = StringSchema::new("dummy email").schema(); -const DUMMY_USER_SCHEMA: ObjectSchema = ObjectSchema { -description: "minimal PBS user", -properties: &[ -("userid", false, &DUMMY_ID_SCHEMA), -("email", true, &DUMMY_EMAIL_SCHEMA), -], -additional_properties: true, -default_key: None, -}; +const PVE_CFG_PATH: &str = "/etc/pve"; +const PVE_DATACENTER_CFG_FILENAME: &str = "/etc/pve/datacenter.cfg"; +const PVE_PUB_NOTIFICATION_CFG_FILENAME: &str = "/etc/pve/notifications.cfg"; +const PVE_PRIV_NOTIFICATION_CFG_FILENAME: &str = "/etc/pve/priv/notifications.cfg"; + +const PBS_CFG_PATH: &str = "/etc/proxmox-backup"; +const PBS_NODE_CFG_FILENAME: &str = "/etc/proxmox-backup/node.cfg"; +const PBS_PUB_NOTIFICATION_CFG_FILENAME: &str = "/etc/proxmox-backup/notifications.cfg"; +const PBS_PRIV_NOTIFICATION_CFG_FILENAME: &str = "/etc/proxmox-backup/notifications-priv.cfg"; -#[derive(Deserialize)] -struct DummyPbsUser { -pub email: Option, +#[api] +#[derive(Deserialize, Default, Debug, PartialEq)] +#[serde(rename_all = "kebab-case")] +enum Policy { +#[default] +/// Always send a notification. +Always, +/// Never send a notification. +Never, } -const PVE_USER_CFG_FILENAME: &str = "/etc/pve/user.cfg"; -const PVE_DATACENTER_CFG_FILENAME: &str = "/etc/pve/datacenter.cfg"; -const PVE_ROOT_USER: &str = "root@pam"; +#[api( +properties: {}, +additional_properties: true, +)] +#[derive(Deserialize, Default, Debug)] +#[serde(rename_all = "kebab-case")] +/// Parsed property string for the `notify` key in `datacenter.cfg` +struct NotifyPropertyString { +/// Target for redirected system mails. +target_system_mail: Option, +/// Notification policy for system mails +system_mail: Option, +} + +/// Forwarding policy for system mail +struct NotificationPolicy { +/// Target for redirected system mails. +target: String, +/// Notification policy for system mails +policy: Policy, +} /// Convenience helper to get the trimmed contents of an optional &str, mapping blank ones to `None` /// and creating a String from it for returning. @@ -44,89 +63,143 @@ fn normalize_for_return(s: Option<&str>) -> Option { } } -/// Extract the root user's email address from the PBS user confi
[pve-devel] Watchdog hardware vor VMS
--- Begin Message --- Hi, i have the whish to use watchdog inside of VMs. I also want to develop this feature for Proxmox. Can i go with this or is there a pro / con for? best regards sascha --- End Message --- ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
[pve-devel] [PATCH manager v5] ui: ceph: improve discoverability of warning details
by * replacing the info button with expandable rows that contain the details of the warning * adding two action buttons to copy the summary and details * making the text selectable The row expander works like the one in the mail gateway tracking center -> doubleclick only opens it. The height of the warning grid is limited to not grow too large. A Diffstore is used to avoid expanded rows being collapsed on an update. The rowexpander cannot hide the toggle out of the box. Therefore, if there is no detailed message for a warning, we show a placeholder text. We could consider extending it in the future to only show the toggle if a defined condition is met. Signed-off-by: Aaron Lauterer --- changes since v4: * rebased so the patch applies again v3: * change the whole approach from tooltips and info window to integrating it into the grid itself www/css/ext6-pve.css| 6 +++ www/manager6/ceph/Status.js | 89 + 2 files changed, 67 insertions(+), 28 deletions(-) diff --git a/www/css/ext6-pve.css b/www/css/ext6-pve.css index edae462b..837b2210 100644 --- a/www/css/ext6-pve.css +++ b/www/css/ext6-pve.css @@ -709,3 +709,9 @@ table.osds td:first-of-type { opacity: 0.0; cursor: default; } + +.pve-ceph-warning-detail { +overflow: auto; +margin: 0; +padding-bottom: 10px; +} diff --git a/www/manager6/ceph/Status.js b/www/manager6/ceph/Status.js index 46338b4a..6bbe33b4 100644 --- a/www/manager6/ceph/Status.js +++ b/www/manager6/ceph/Status.js @@ -1,3 +1,10 @@ +Ext.define('pve-ceph-warnings', { +extend: 'Ext.data.Model', +fields: ['id', 'summary', 'detail', 'severity'], +idProperty: 'id', +}); + + Ext.define('PVE.node.CephStatus', { extend: 'Ext.panel.Panel', alias: 'widget.pveNodeCephStatus', @@ -70,35 +77,51 @@ Ext.define('PVE.node.CephStatus', { xtype: 'grid', itemId: 'warnings', flex: 2, + maxHeight: 430, stateful: true, stateId: 'ceph-status-warnings', + viewConfig: { + enableTextSelection: true, + }, // we load the store manually, to show an emptyText specify an empty intermediate store store: { + type: 'diff', trackRemoved: false, data: [], + rstore: { + storeid: 'pve-ceph-warnings', + type: 'update', + model: 'pve-ceph-warnings', + }, }, updateHealth: function(health) { let checks = health.checks || {}; let checkRecords = Object.keys(checks).sort().map(key => { let check = checks[key]; - return { + let data = { id: key, summary: check.summary.message, - detail: check.detail.reduce((acc, v) => `${acc}\n${v.message}`, ''), + detail: check.detail.reduce((acc, v) => `${acc}\n${v.message}`, '').trimStart(), severity: check.severity, }; + if (data.detail.length === 0) { + data.detail = "no additional data"; + } + return data; }); - this.getStore().loadRawData(checkRecords, false); + let rstore = this.getStore().rstore; + rstore.loadData(checkRecords, false); + rstore.fireEvent('load', rstore, checkRecords, true); }, emptyText: gettext('No Warnings/Errors'), columns: [ { dataIndex: 'severity', - header: gettext('Severity'), + tooltip: gettext('Severity'), align: 'center', - width: 70, + width: 38, renderer: function(value) { let health = PVE.Utils.map_ceph_health[value]; let icon = PVE.Utils.get_health_icon(health); @@ -118,38 +141,48 @@ Ext.define('PVE.node.CephStatus', { }, { xtype: 'actioncolumn', - width: 40, + width: 50, align: 'center', - tooltip: gettext('Detail'), + tooltip: gettext('Actions'),
[pve-devel] applied: [PATCH proxmox-perl-rs] notify context: fix 'default_sendmail_from' context method
Am 02/10/2023 um 09:40 schrieb Lukas Wagner: > The name of the configuration option in datacenter.cfg is `email_from` > and not `mail_from`. > > Signed-off-by: Lukas Wagner > --- > Reported in our forum: > https://forum.proxmox.com/threads/mail-alerts-not-sent-with-datacenter-default.134305/ > > pve-rs/src/notify_context.rs | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > applied, thanks! ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
Re: [pve-devel] [PATCH installer] install: install correct grub metapackage for the current boot-mode
Tested-by: Friedrich Weber Tested patched ISO provided by Stoiko: * installed in legacy VM ** checked that `grub-pc` is installed ** re-installing it prints "Installing for i386-pc platform" * installed in UEFI VM ** checked that `grub-efi-amd64` is installed ** re-installing it prints "Installing for x86_64-efi platform" and updates the mtime of /boot/efi/EFI/proxmox/grubx64.efi On 28/09/2023 16:05, Stoiko Ivanov wrote: > grub packages in debian split between: > * meta-packages, which handles (among other things) the reinstalling > grub to the actual device/ESP in case of a version upgrade (grub-pc, > grub-efi-amd64) > * bin-packages, which contain the actual boot-loaders > The bin-packages can coexist on a system, but the meta-package > conflict with each other (didn't check why, but I don't see a hard > conflict on a quick glance) > > Currently our ISO installs grub-pc unconditionally (and both bin > packages, since we install the legacy bootloader also on uefi-booted > systems). This results in uefi-systems not getting a new grub > installed automatically upon upgrade. > > Reported in our community-forum from users who upgraded to PVE 8.0, > and still run into an issue fixed in grub for bookworm: > https://forum.proxmox.com/threads/.123512/ > > Reproduced and analyzed by Friedrich. > > This patch changes the installer, to install the meta-package fitting > for the boot-mode. > > We do not set the debconf variable install_devices, because in my > tests a plain debian installed in uefi mode has this set, and a > `grep -ri install_devices /var/lib/dpkg/info` yields only results with > grub-pc. > > Reported-by: Friedrich Weber > Signed-off-by: Stoiko Ivanov > --- > quickly tested by building an ISO (with the necessary modifications to > ship both packages as .deb) and installing in legacy mode and uefi mode > once. > Proxmox/Install.pm | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/Proxmox/Install.pm b/Proxmox/Install.pm > index 1117fc4..d775ac0 100644 > --- a/Proxmox/Install.pm > +++ b/Proxmox/Install.pm > @@ -1057,6 +1057,12 @@ _EOD > chomp; > my $path = $_; > my ($deb) = $path =~ m/${proxmox_pkgdir}\/(.*\.deb)/; > + > + # the grub-pc/grub-efi-amd64 packages (w/o -bin) are the ones > actually updating grub > + # upon upgrade - and conflict with each other - install the fitting > one only > + next if ($deb =~ /grub-pc_/ && $run_env->{boot_type} ne 'bios'); > + next if ($deb =~ /grub-efi-amd64_/ && $run_env->{boot_type} ne > 'efi'); > + > update_progress($count/$pkg_count, 0.5, 0.75, "extracting $deb"); > print STDERR "extracting: $deb\n"; > syscmd("chroot $targetdir dpkg $dpkg_opts --force-depends > --no-triggers --unpack /tmp/pkg/$deb") == 0 ___ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel