Conversation
…rust-plugins Converts rust-plugins/ into a Cargo workspace (existing SNMP plugin moved to snmp/, unchanged) and adds a new notification-email crate: a Rust port of notification::email::mode::alert (Perl). Ports the CLI option surface 1:1 (same flag names/defaults) so existing Centreon Engine notification commands keep working, the four host/service/BAM/meta-service message builders, the HTML/CSS templates (via a small TMPL_VAR/TMPL_IF renderer mirroring the subset of HTML::Template actually used), the generateImage.php graph fetch, and MIME assembly + SMTP send via lettre. Verified against a stub SMTP server: subject, plaintext and HTML parts match the Perl plugin's output. CI/packaging for the new crate is intentionally left for a follow-up so this change doesn't touch the release pipeline.
Adds .github/workflows/notification-email.yml (build + package jobs, mirroring generic-plugins.yml's structure) and its nfpm packaging config, producing centreon-plugin-notification-email-rs rpm/deb packages - named after the existing "-rs" convention used for other Rust companions to Perl plugins, so it can coexist with the current centreon-plugin-Notification-Email package during the transition. The new crate needs a C toolchain (ring, via lettre's rustls-tls) that the pure-Rust SNMP plugin never did, so the build job installs musl-tools and points cc-rs at musl-gcc explicitly. Verified locally: a full musl-cross release build produces a statically linked binary (no NEEDED entries, same check the SNMP job runs). Also scopes generic-plugins.yml's cargo invocations to the snmp/ member directory (cd rust-plugins/snmp instead of rust-plugins/) so the existing SNMP release pipeline can't be affected by changes to other workspace members going forward, and narrows its path triggers off the now-shared rust-plugins/** so the two plugins' CI runs stay independent. Verified the artifact still lands in the shared rust-plugins/target/release/ that the rest of the job expects, and that both crates' tests still pass when run this way from a clean target dir. Deliberately not included: a Robot Framework test job (none exist yet for this plugin) and the Artifactory/Pulp delivery jobs - publishing this first-pass port to production package repositories on every push to develop/master is a separate decision for once the port has been validated further.
Perl's q{...} string literal includes the newline immediately after the
opening brace, so notification::email::templates::{style,host,service,
bam,metaservice} all render with a leading blank line before their
content (before <!doctype html>, and before the <style> block injected
via dynamicCss). The extraction that produced this crate's templates/*
files started copying from the line after `return q{`, silently
dropping that leading newline.
Found by diffing the Rust and Perl plugins' actual SMTP output
byte-for-byte for all four notification types (host/service/BAM/meta-
service), via a stub SMTP server and a stub generateImage.php. Before
this fix, that was the only difference for host/service/meta-service
and the only difference for BAM was none. After it, all four are
identical except for JSON key order in the `?details=` query parameter
of the "More Information" link - which Perl's own hash key randomization
makes non-deterministic anyway, so there's nothing to match there.
Tpo76
requested review from
Nivoky,
mushroomempires and
omercier
and removed request for
a team
September 9, 2026 07:06
Tpo76
marked this pull request as draft
September 9, 2026 07:08
Aikido flagged CVE-2026-46428: an inverted-boolean bug in lettre's boring-tls integration silently disabled TLS hostname verification for versions 0.10.1 to <0.11.22. Fixed upstream in 0.11.22. This crate was already unaffected in practice - Cargo.lock already resolved lettre to 0.11.23, and the "rustls-tls" feature is the only TLS backend enabled here (boring-tls, the only backend the CVE affects, isn't). But Cargo.toml's open "0.11" range still technically permitted a vulnerable version, so tightening it to >=0.11.22 makes that a manifest-level guarantee rather than something that happens to hold today.
clippy::collapsible_if - the nested string-match check can only ever run once the UTF-8 decode succeeds, so it collapses into a single condition with no behavior change.
…otype REST API v2 chart rendering
…ency version mismatch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Converts rust-plugins/ into a Cargo workspace (existing SNMP plugin moved
to snmp/, unchanged) and adds a new notification-email crate: a Rust port
of notification::email::mode::alert (Perl).
Ports the CLI option surface 1:1 (same flag names/defaults) so existing
Centreon Engine notification commands keep working, the four
host/service/BAM/meta-service message builders, the HTML/CSS templates
(via a small TMPL_VAR/TMPL_IF renderer mirroring the subset of
HTML::Template actually used), the generateImage.php graph fetch, and
MIME assembly + SMTP send via lettre. Verified against a stub SMTP
server: subject, plaintext and HTML parts match the Perl plugin's output.
CI/packaging for the new crate is intentionally left for a follow-up so
this change doesn't touch the release pipeline.