From 93ca5efddb5059311b527fda289dcc19b32a4fd0 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Fri, 1 Dec 2023 18:31:26 +0000 Subject: [PATCH] chore: Allow to build with rustls ring 0.17 supports RISC-V, so building Pulsar with rustls instead of OpenSSL is possible. Choice of the TLS library is exposed by the following features in the `smtp-notifier` crate: * `native-tls` - uses the native TLS library in the system, usually OpenSSL. Enabled by default. * `boring-tls` - uses BoringSSL. Disabled by default. * `rustls-tls` - uses rustls. Disabled by default. When building Pulsar with Cargo, the native TLS is going to be used. However, for binary builds for Github releases, rustls is being used, since it's always statically built and doesn't require any runtime dependencies from the users. --- .github/workflows/build.yaml | 11 +- .github/workflows/quality.yaml | 6 +- .github/workflows/release.yaml | 10 +- Cargo.lock | 379 +++++++++++++++++++----- Cargo.toml | 12 +- crates/modules/smtp-notifier/Cargo.toml | 15 +- src/lib.rs | 4 +- 7 files changed, 334 insertions(+), 103 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 7f557db2..943e6760 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -19,20 +19,19 @@ jobs: - target: x86_64-unknown-linux-gnu args: "--features full" - # For `musl` builds openssl must be vendored + # For `musl` builds, we need to use rustls - target: x86_64-unknown-linux-musl - args: "--features full --features openssl-vendored" + args: "--no-default-features --features full --features rustls-tls" - target: aarch64-unknown-linux-gnu args: "--features full" - # For `musl` builds openssl must be vendored + # For `musl` builds, we need to use rustls - target: aarch64-unknown-linux-musl - args: "--features full --features openssl-vendored" + args: "--no-default-features --features full --features rustls-tls" - # Dependencies of `xtask` might fail to build on riscv64. - target: riscv64gc-unknown-linux-gnu - args: "--features full --exclude xtask" + args: "--features full" steps: - name: Code checkout diff --git a/.github/workflows/quality.yaml b/.github/workflows/quality.yaml index e33f061e..47912d7d 100644 --- a/.github/workflows/quality.yaml +++ b/.github/workflows/quality.yaml @@ -52,16 +52,14 @@ jobs: - target: x86_64-unknown-linux-gnu args: "--features full" - # For `musl` builds openssl must be vendored - target: x86_64-unknown-linux-musl - args: "--features full --features openssl-vendored" + args: "--features full" - target: aarch64-unknown-linux-gnu args: "--features full" - # For `musl` builds openssl must be vendored - target: aarch64-unknown-linux-musl - args: "--features full --features openssl-vendored" + args: "--features full" # Dependencies of `xtask` might fail to build on riscv64. - target: riscv64gc-unknown-linux-gnu diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index cc8122d7..be4ae9ef 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -53,25 +53,25 @@ jobs: matrix: platform: - target: x86_64-unknown-linux-gnu - args: "--features full --features openssl-vendored" + args: "--no-default-features --features smtp-notifier/rustls-tls" docker: base-image: debian:bookworm platform: linux/amd64 - target: x86_64-unknown-linux-musl - args: "--features full --features openssl-vendored" + args: "--no-default-features --features smtp-notifier/rustls-tls" - target: aarch64-unknown-linux-gnu - args: "--features full --features openssl-vendored" + args: "--no-default-features --features smtp-notifier/rustls-tls" docker: base-image: debian:bookworm platform: linux/arm64 - target: aarch64-unknown-linux-musl - args: "--features full --features openssl-vendored" + args: "--no-default-features --features smtp-notifier/rustls-tls" - target: riscv64gc-unknown-linux-gnu - args: "--features full --features openssl-vendored" + args: "--no-default-features --features smtp-notifier/rustls-tls" docker: base-image: debian:sid platform: linux/riscv64 diff --git a/Cargo.lock b/Cargo.lock index d6ed48ef..46f5de23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,13 +10,14 @@ checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] @@ -212,7 +213,7 @@ source = "git+https://github.com/aya-rs/aya?rev=33b2e45ad313f7468a7d11667f13d9c3 dependencies = [ "bytes", "core-error", - "hashbrown 0.14.0", + "hashbrown 0.14.3", "log", "object", "thiserror", @@ -224,6 +225,26 @@ version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +[[package]] +name = "bindgen" +version = "0.68.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078" +dependencies = [ + "bitflags 2.4.0", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.33", +] + [[package]] name = "bit-set" version = "0.5.3" @@ -260,6 +281,31 @@ dependencies = [ "generic-array", ] +[[package]] +name = "boring" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fed6dc629997e8c3c4d1dbd59cf748512b9b0e0fbc509cf9b0e2edca9d24d1a" +dependencies = [ + "bitflags 2.4.0", + "boring-sys", + "foreign-types 0.5.0", + "libc", + "once_cell", +] + +[[package]] +name = "boring-sys" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91102749c3c99028f344c3bce1dc54b1aac49d52d03c60c75996f81ebdeaa41c" +dependencies = [ + "bindgen", + "cmake", + "fs_extra", + "fslock", +] + [[package]] name = "bpf-builder" version = "0.6.0" @@ -340,6 +386,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -373,6 +428,27 @@ dependencies = [ "windows-targets 0.48.0", ] +[[package]] +name = "chumsky" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eebd66744a15ded14960ab4ccdbfb51ad3b81f51f3f04a80adac98c985396c9" +dependencies = [ + "hashbrown 0.14.3", + "stacker", +] + +[[package]] +name = "clang-sys" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" version = "4.2.4" @@ -415,6 +491,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + [[package]] name = "colorchoice" version = "1.0.0" @@ -697,12 +782,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "file-system-monitor" @@ -734,7 +816,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.33", ] [[package]] @@ -743,6 +846,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.0" @@ -752,6 +861,22 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + +[[package]] +name = "fslock" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04412b8935272e3a9bae6f48c7bfff74c2911f60525404edfdd28e49884c3bfb" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "futures" version = "0.3.25" @@ -863,9 +988,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", @@ -914,11 +1039,11 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.3", + "ahash 0.8.6", "allocator-api2", ] @@ -1006,7 +1131,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.7", "tokio", "tower-service", "tracing", @@ -1065,9 +1190,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1075,9 +1200,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1093,15 +1218,6 @@ dependencies = [ "hashbrown 0.12.3", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "io-lifetimes" version = "1.0.4" @@ -1191,6 +1307,12 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "leon" version = "2.0.1" @@ -1203,34 +1325,52 @@ dependencies = [ [[package]] name = "lettre" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bd09637ae3ec7bd605b8e135e757980b3968430ff2b1a4a94fb7769e50166d" +checksum = "a48c2e9831b370bc2d7233c2620298c45f3a158ed6b4b8d7416b2ada5a268fd8" dependencies = [ "async-trait", "base64", + "boring", + "chumsky", "email-encoding", "email_address", "fastrand", "futures-io", "futures-util", "httpdate", - "idna 0.3.0", + "idna 0.5.0", "mime", "native-tls", "nom", "once_cell", "quoted_printable", - "socket2", + "rustls", + "rustls-pemfile", + "socket2 0.5.5", "tokio", + "tokio-boring", "tokio-native-tls", + "tokio-rustls", + "url", + "webpki-roots", ] [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] [[package]] name = "libtest-mimic" @@ -1255,6 +1395,12 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b085a4f2cde5781fc4b1717f2e86c62f5cda49de7ba99a7c2eae02b61c9064c" +[[package]] +name = "linux-raw-sys" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" + [[package]] name = "lock_api" version = "0.4.9" @@ -1461,13 +1607,13 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" dependencies = [ "bitflags 2.4.0", "cfg-if", - "foreign-types", + "foreign-types 0.3.2", "libc", "once_cell", "openssl-macros", @@ -1491,24 +1637,14 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-src" -version = "300.1.3+3.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd2c101a165fff9935e34def4669595ab1c7847943c42be86e21503e482be107" -dependencies = [ - "cc", -] - [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" dependencies = [ "cc", "libc", - "openssl-src", "pkg-config", "vcpkg", ] @@ -1546,6 +1682,12 @@ dependencies = [ "windows-sys 0.42.0", ] +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + [[package]] name = "percent-encoding" version = "2.3.0" @@ -1659,6 +1801,15 @@ dependencies = [ "rustix 0.36.7", ] +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + [[package]] name = "pulsar" version = "0.6.0" @@ -1721,9 +1872,9 @@ dependencies = [ [[package]] name = "quoted_printable" -version = "0.4.8" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3866219251662ec3b26fc217e3e05bf9c4f84325234dfb96bf0bf840889e49" +checksum = "79ec282e887b434b68c18fe5c121d38e72a5cf35119b59e54ec5b992ea9c8eb0" [[package]] name = "rand" @@ -1766,9 +1917,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] @@ -1860,17 +2011,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.20" +version = "0.17.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -1900,6 +2050,12 @@ dependencies = [ "ordered-multimap", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustix" version = "0.36.7" @@ -1928,11 +2084,24 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "rustix" +version = "0.38.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" +dependencies = [ + "bitflags 2.4.0", + "errno 0.3.1", + "libc", + "linux-raw-sys 0.4.12", + "windows-sys 0.48.0", +] + [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ "log", "ring", @@ -1951,9 +2120,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", "untrusted", @@ -1988,9 +2157,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", @@ -2104,6 +2273,12 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" + [[package]] name = "signal-hook" version = "0.3.14" @@ -2175,7 +2350,6 @@ dependencies = [ "gethostname", "leon", "lettre", - "openssl", "pulsar-core", "rand", "tokio", @@ -2191,11 +2365,34 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stacker" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "winapi", +] [[package]] name = "static_assertions" @@ -2306,15 +2503,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.5.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", - "rustix 0.37.3", - "windows-sys 0.45.0", + "redox_syscall 0.4.1", + "rustix 0.38.25", + "windows-sys 0.48.0", ] [[package]] @@ -2421,11 +2618,23 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.4.7", "tokio-macros", "windows-sys 0.45.0", ] +[[package]] +name = "tokio-boring" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806b3972e90cd4633771ba91ec25f312a97192010fe4470061700f289524ae57" +dependencies = [ + "boring", + "boring-sys", + "once_cell", + "tokio", +] + [[package]] name = "tokio-fd" version = "0.3.0" @@ -2654,9 +2863,9 @@ checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" @@ -3055,3 +3264,23 @@ dependencies = [ "uuid", "xshell", ] + +[[package]] +name = "zerocopy" +version = "0.7.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d6f15f7ade05d2a4935e34a457b936c23dc70a05cc1d97133dc99e7a3fe0f0e" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbbad221e3f78500350ecbd7dfa4e63ef945c05f4c61cb7f4d3f84cd0bba649b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.33", +] diff --git a/Cargo.toml b/Cargo.toml index 7d6bb02a..7655b805 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,11 +40,18 @@ semver = { workspace = true, features = ["serde"] } tokio = { workspace = true, features = ["full"] } [features] +# default = ["full", "native-tls"] default = ["full"] + +# Pulsar modules full = ["core", "extra"] core = ["logger", "process-monitor", "network-monitor", "file-system-monitor"] extra = ["rules-engine", "desktop-notifier", "smtp-notifier"] -openssl-vendored = ["smtp-notifier?/openssl-vendored"] + +# TLS +# boring-tls = ["smtp-notifier/boring-tls"] +# native-tls = ["smtp-notifier/native-tls"] +# rustls-tls = ["smtp-notifier/rustls-tls"] [workspace] members = [ @@ -108,13 +115,12 @@ lalrpop = "0.19.9" lalrpop-util = { version="0.19.9", features=["lexer"] } lazy_static = "1.4" leon = "2.0.1" -lettre = { version = "0.10.4", default-features = false, features = ["smtp-transport", "tokio1-native-tls", "tokio1", "builder"] } +lettre = { version = "0.11", default-features = false, features = ["smtp-transport", "builder"] } libc = "0.2" libtest-mimic = "0.6.0" log = "0.4" nix = { version = "0.26.2", features = ["fs"] } num_cpus = "1.16" -openssl = { version = "0.10.57" } proc-macro2 = "1.0" procfs = { version = "0.14.2", default-features = false } quote = "1.0" diff --git a/crates/modules/smtp-notifier/Cargo.toml b/crates/modules/smtp-notifier/Cargo.toml index 3a7e4cf5..f88cb344 100644 --- a/crates/modules/smtp-notifier/Cargo.toml +++ b/crates/modules/smtp-notifier/Cargo.toml @@ -10,17 +10,16 @@ pulsar-core = { workspace = true } tokio = { workspace = true, features = ["full"] } anyhow = { workspace = true } -lettre = { workspace = true, features = [ - "smtp-transport", - "tokio1-native-tls", - "tokio1", - "builder", -] } -openssl = { workspace = true } +lettre = { workspace = true } leon = { workspace = true } gethostname = { workspace = true } chrono = { workspace = true } rand = { workspace = true } [features] -openssl-vendored = ["openssl/vendored"] +default = ["native-tls"] + +# TLS +boring-tls = ["lettre/tokio1-boring-tls"] +native-tls = ["lettre/tokio1-native-tls"] +rustls-tls = ["lettre/tokio1-rustls-tls"] diff --git a/src/lib.rs b/src/lib.rs index 5fc6efa0..83990293 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,7 +61,7 @@ use std::env; use anyhow::Result; use std::sync::OnceLock; -pub use pulsar_core::pdk::TaskLauncher; +pub use pulsar_core::pdk::{PulsarModule, TaskLauncher}; use cli::PulsarExecOpts; @@ -98,7 +98,7 @@ pub fn modules() -> Vec> { smtp_notifier::module(), ] .into_iter() - .map(|x| Box::new(x) as Box) + .map(|x: PulsarModule| Box::new(x) as Box) .collect() }