From 41f35def036991c7df04feefcf6c542146ce20fc Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Sat, 10 Feb 2024 10:28:54 +0900 Subject: [PATCH 01/23] bump: 0.17.1-SNAPSHOT --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c18c67d4..132499cb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -743,7 +743,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piping-server" -version = "0.17.0" +version = "0.17.1-SNAPSHOT" dependencies = [ "anyhow", "auto_enums", diff --git a/Cargo.toml b/Cargo.toml index 239713180..5a4ad1f80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "piping-server" -version = "0.17.0" +version = "0.17.1-SNAPSHOT" authors = ["Ryo Ota "] edition = "2018" From 10a441c637329c8d2cc6270b8a1150250c456706 Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Sat, 10 Feb 2024 15:14:30 +0900 Subject: [PATCH 02/23] refactor: define index page string as static --- Cargo.lock | 1 + Cargo.toml | 1 + src/dynamic_resources.rs | 8 ++++---- src/piping_server.rs | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 132499cb3..2680aa617 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -762,6 +762,7 @@ dependencies = [ "mime", "mpart-async", "notify", + "once_cell", "pin-project-lite", "regex", "rustls", diff --git a/Cargo.toml b/Cargo.toml index 5a4ad1f80..9e00046eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ mpart-async = { version = "0.7", default-features = false } notify = "6.1" dashmap = "5.5" serde_urlencoded = "0.7" +once_cell = "1.19" pin-project-lite = "0.2" auto_enums = { version = "0.8", default-features = false, features = ["http_body1"] } seq-macro = "0.3" diff --git a/src/dynamic_resources.rs b/src/dynamic_resources.rs index ee07fd52a..a9ee7b664 100644 --- a/src/dynamic_resources.rs +++ b/src/dynamic_resources.rs @@ -11,10 +11,10 @@ fn escape_html_attribute(s: &str) -> String { .replace(">", ">") } -pub fn index() -> String { +pub static INDEX: once_cell::sync::Lazy = once_cell::sync::Lazy::new(|| { let version = env!("CARGO_PKG_VERSION"); let no_script_path = &piping_server::reserved_paths::NO_SCRIPT[1..]; - return std::format!( + format!( // language=html r#" @@ -128,8 +128,8 @@ pub fn index() -> String { "# - ); -} + ) +}); pub fn help(base_url: &Url) -> String { let version: &'static str = env!("CARGO_PKG_VERSION"); diff --git a/src/piping_server.rs b/src/piping_server.rs index 71abccdb7..771a8c2f2 100644 --- a/src/piping_server.rs +++ b/src/piping_server.rs @@ -135,7 +135,7 @@ impl PipingServer { .status(200) .header("Content-Type", "text/html") .header("Access-Control-Allow-Origin", "*") - .body(BodyEnum::FullBody(full_body(dynamic_resources::index()))) + .body(BodyEnum::FullBody(full_body(&**dynamic_resources::INDEX))) .unwrap()); } reserved_paths::NO_SCRIPT => { From 2ca0b273e70daabe000495a4fd5ee8d3fdbce3af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 18 Feb 2024 11:41:32 +0900 Subject: [PATCH 03/23] build(deps): bump rustls-pemfile from 2.0.0 to 2.1.0 (#538) Bumps [rustls-pemfile](https://github.com/rustls/pemfile) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/rustls/pemfile/releases) - [Commits](https://github.com/rustls/pemfile/compare/v/2.0.0...v/2.1.0) --- updated-dependencies: - dependency-name: rustls-pemfile dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2680aa617..5e8184b46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -941,9 +941,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +checksum = "3c333bb734fcdedcea57de1602543590f545f127dc8b533324318fd492c5c70b" dependencies = [ "base64", "rustls-pki-types", @@ -951,9 +951,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9d979b3ce68192e42760c7810125eb6cf2ea10efae545a156063e61f314e2a" +checksum = "048a63e5b3ac996d78d402940b5fa47973d2d080c6c6fffa1d0f19c4445310b7" [[package]] name = "rustls-webpki" diff --git a/Cargo.toml b/Cargo.toml index 9e00046eb..970bb95b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ http = "1.0" http-body = "1.0" http-body-util = "0.1" rustls = "0.22" -rustls-pemfile = "2.0" +rustls-pemfile = "2.1" tokio-rustls = "0.25" getrandom = { version = "0.2", default-features = false } base64 = "0.21" From 63f160fe603ce2c2282f5bfbde87a874a1f69223 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 18 Feb 2024 11:58:34 +0900 Subject: [PATCH 04/23] build(deps): bump rustix from 0.36.11 to 0.36.17 (#539) Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.36.11 to 0.36.17. - [Release notes](https://github.com/bytecodealliance/rustix/releases) - [Commits](https://github.com/bytecodealliance/rustix/compare/v0.36.11...v0.36.17) --- updated-dependencies: - dependency-name: rustix dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5e8184b46..2cbae1667 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -205,23 +205,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.2.8" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] @@ -913,9 +902,9 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustix" -version = "0.36.11" +version = "0.36.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" +checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" dependencies = [ "bitflags 1.3.2", "errno", From a3ee73bc404b5da7516f452efb5a01e019506b33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 18 Feb 2024 12:02:22 +0900 Subject: [PATCH 05/23] build(deps): bump h2 from 0.4.1 to 0.4.2 (#540) Bumps [h2](https://github.com/hyperium/h2) from 0.4.1 to 0.4.2. - [Release notes](https://github.com/hyperium/h2/releases) - [Changelog](https://github.com/hyperium/h2/blob/master/CHANGELOG.md) - [Commits](https://github.com/hyperium/h2/compare/v0.4.1...v0.4.2) --- updated-dependencies: - dependency-name: h2 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2cbae1667..6e087b7e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -357,9 +357,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "h2" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991910e35c615d8cab86b5ab04be67e6ad24d2bf5f4f11fdbbed26da999bbeab" +checksum = "31d030e59af851932b72ceebadf4a2b5986dba4c3b99dd2493f8273a0f151943" dependencies = [ "bytes", "fnv", From a77e6727e4d7b436ddcee1432ed4bf49a072988f Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Sun, 18 Feb 2024 12:18:15 +0900 Subject: [PATCH 06/23] deps: update --- Cargo.lock | 347 +++++++++++++++++++---------------------------------- 1 file changed, 124 insertions(+), 223 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e087b7e6..1db24cb85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.0.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -41,7 +41,7 @@ dependencies = [ "derive_utils", "proc-macro2", "quote", - "syn 2.0.9", + "syn 2.0.49", ] [[package]] @@ -52,9 +52,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -85,9 +85,9 @@ checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" @@ -134,31 +134,27 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" dependencies = [ "os_str_bytes", ] [[package]] name = "crossbeam-channel" -version = "0.5.7" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2b3e8478797446514c91ef04bafcb59faba183e621ad488df88983cc14128c" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c063cd8cc95f5c377ed0d4b49a4b21f632396ff690e8470c29b3359b346984b" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "dashmap" @@ -181,14 +177,14 @@ checksum = "61bb5a1014ce6dfc2a378578509abe775a5aa06bff584a547555d9efdb81b926" dependencies = [ "proc-macro2", "quote", - "syn 2.0.9", + "syn 2.0.49", ] [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -203,16 +199,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "filetime" version = "0.2.23" @@ -305,7 +291,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.9", + "syn 2.0.49", ] [[package]] @@ -351,9 +337,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "h2" @@ -388,9 +374,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "http" @@ -434,9 +420,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -492,9 +478,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown", @@ -520,40 +506,28 @@ dependencies = [ "libc", ] -[[package]] -name = "io-lifetimes" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.45.0", -] - [[package]] name = "is-terminal" -version = "0.4.5" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ "hermit-abi", - "io-lifetimes", - "rustix", - "windows-sys 0.45.0", + "libc", + "windows-sys 0.52.0", ] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "kqueue" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8fc60ba15bf51257aa9807a48a61013db043fcf3a78cb0d916e8e396dcad98" +checksum = "7447f1ca1b7b563588a205fe93dea8df60fd981423a768bc1c0ded35ed147d0c" dependencies = [ "kqueue-sys", "libc", @@ -561,9 +535,9 @@ dependencies = [ [[package]] name = "kqueue-sys" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" +checksum = "ed9625ffda8729b85e45cf04090035ac368927b8cebc34898e7c120f52e4838b" dependencies = [ "bitflags 1.3.2", "libc", @@ -571,15 +545,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" - -[[package]] -name = "linux-raw-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "lock_api" @@ -611,9 +579,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -680,9 +648,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.4" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -695,9 +663,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "os_str_bytes" -version = "6.5.0" +version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" [[package]] name = "parking_lot_core" @@ -709,7 +677,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -796,18 +764,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -900,20 +868,6 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustix" -version = "0.36.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305efbd14fde4139eb501df5f136994bb520b033fa9fbdce287507dc23b8c7ed" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys", - "windows-sys 0.45.0", -] - [[package]] name = "rustls" version = "0.22.2" @@ -946,9 +900,9 @@ checksum = "048a63e5b3ac996d78d402940b5fa47973d2d080c6c6fffa1d0f19c4445310b7" [[package]] name = "rustls-webpki" -version = "0.102.1" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ "ring", "rustls-pki-types", @@ -957,9 +911,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -972,9 +926,9 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "seq-macro" @@ -984,9 +938,23 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.185" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be9b6f69f1dfd54c3b568ffa45c310d6973a5e5148fd40cf515acaf38cf5bc31" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.49", +] [[package]] name = "serde_urlencoded" @@ -1002,18 +970,18 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" @@ -1067,9 +1035,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.9" +version = "2.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0da4a3c17e109f700685ec577c0f85efd9b19bcf15c913985f14dc1ac01775aa" +checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" dependencies = [ "proc-macro2", "quote", @@ -1078,31 +1046,31 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.9", + "syn 2.0.49", ] [[package]] @@ -1145,7 +1113,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.9", + "syn 2.0.49", ] [[package]] @@ -1161,9 +1129,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -1175,20 +1143,19 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -1201,15 +1168,15 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -1245,9 +1212,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -1286,9 +1253,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -1299,22 +1266,13 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -1328,32 +1286,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -1373,15 +1316,9 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" @@ -1391,15 +1328,9 @@ checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" @@ -1409,15 +1340,9 @@ checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" @@ -1427,15 +1352,9 @@ checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" @@ -1445,15 +1364,9 @@ checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" @@ -1463,15 +1376,9 @@ checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" @@ -1481,15 +1388,9 @@ checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" From ac9af40f9cdb4e2cae56a31e954d39dbeed50b40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 07:49:11 +0900 Subject: [PATCH 07/23] build(deps): bump anyhow from 1.0.79 to 1.0.80 (#542) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.79 to 1.0.80. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.79...1.0.80) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1db24cb85..f58e2938b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "auto_enums" From 2d0dbd92e08d14dcc3ee3773186232f3fee374ef Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Wed, 21 Feb 2024 09:53:55 +0900 Subject: [PATCH 08/23] docker: linux/arm64 --- Dockerfile | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4f580637f..669076050 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,24 @@ FROM rust:1.76.0 as build -# Install tini -ENV TINI_VERSION v0.19.0 -ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tmp/tini-static -RUN chmod +x /tmp/tini-static +ARG TARGETPLATFORM + +ENV TINI_STATIC_VERSION 0.19.0 RUN apt update && apt install -y musl-tools -RUN rustup target add x86_64-unknown-linux-musl + +RUN case $TARGETPLATFORM in\ + linux/amd64) rust_target="x86_64-unknown-linux-musl";\ + tini_static_arch="amd64";;\ + linux/arm64) rust_target="aarch64-unknown-linux-musl";\ + tini_static_arch="arm64";;\ + *) exit 1;;\ + esac &&\ + echo $rust_target > /tmp/rust_target.txt &&\ + # Install tini + curl -fL https://github.com/krallin/tini/releases/download/v${TINI_STATIC_VERSION}/tini-static-${tini_static_arch} > /tmp/tini-static &&\ + chmod +x /tmp/tini-static &&\ + rustup target add $rust_target # Copy to Cargo setting COPY Cargo.toml Cargo.lock /app/ @@ -16,17 +27,18 @@ COPY Cargo.toml Cargo.lock /app/ RUN cd /app && \ mkdir src && \ echo "fn main() {}" > src/main.rs && \ - cargo build --release --target=x86_64-unknown-linux-musl --locked && rm -r src + cargo build --release --target=$(cat /tmp/rust_target.txt) --locked && rm -r src COPY . /app/ # Build -RUN cd /app && cargo build --release --target=x86_64-unknown-linux-musl --locked +RUN cd /app && cargo build --release --target=$(cat /tmp/rust_target.txt) --locked +RUN cp -a /app/target/$(cat /tmp/rust_target.txt)/ /tmp/build/ FROM scratch LABEL maintainer="Ryo Ota " # Copy executables COPY --from=build /tmp/tini-static /tini-static -COPY --from=build /app/target/x86_64-unknown-linux-musl/release/piping-server /piping-server +COPY --from=build /tmp/build/release/piping-server /piping-server # Run a server ENTRYPOINT [ "/tini-static", "--", "/piping-server" ] From 51c69d40c1f4cf511210278f0f23a31010443bdc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 20:02:08 +0900 Subject: [PATCH 09/23] build(deps): bump hyper from 1.1.0 to 1.2.0 (#543) Bumps [hyper](https://github.com/hyperium/hyper) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/hyperium/hyper/releases) - [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md) - [Commits](https://github.com/hyperium/hyper/compare/v1.1.0...v1.2.0) --- updated-dependencies: - dependency-name: hyper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 5 +++-- Cargo.toml | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f58e2938b..b56c75e57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -432,9 +432,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" +checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" dependencies = [ "bytes", "futures-channel", @@ -446,6 +446,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", + "smallvec", "tokio", "want", ] diff --git a/Cargo.toml b/Cargo.toml index 970bb95b8..4a8499d25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ log = "0.4" env_logger = "0.10" futures = { version = "0.3", features = ["std"] } tokio = { version = "1.36", features = ["rt-multi-thread", "macros", "net"] } -hyper = { version = "1.1", default-features = false, features = ["server", "http1", "http2"] } +hyper = { version = "1.2", default-features = false, features = ["server", "http1", "http2"] } hyper-util = { version = "0.1", default-features = false, features = ["server-auto", "tokio"] } http = "1.0" http-body = "1.0" @@ -34,5 +34,5 @@ seq-macro = "0.3" [dev-dependencies] specit = {version = "0.4.0", features = ["tokio"] } -hyper = { version = "1.1", features = ["client"] } +hyper = { version = "1.2", features = ["client"] } regex = "1.10" From 01c4d7b102ee8dffec77e86f9d395d06e27bbfb5 Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Mon, 26 Feb 2024 17:18:14 +0900 Subject: [PATCH 10/23] chore: format Cargo.toml --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4a8499d25..c9c16c87a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,6 @@ auto_enums = { version = "0.8", default-features = false, features = ["http_body seq-macro = "0.3" [dev-dependencies] -specit = {version = "0.4.0", features = ["tokio"] } +specit = { version = "0.4.0", features = ["tokio"] } hyper = { version = "1.2", features = ["client"] } regex = "1.10" From e9083ca9497ae1b28e213c466af24dd15c7bc4b4 Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Mon, 26 Feb 2024 17:34:53 +0900 Subject: [PATCH 11/23] chore: Rust edition 2021 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c9c16c87a..1bdd59261 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "piping-server" version = "0.17.1-SNAPSHOT" authors = ["Ryo Ota "] -edition = "2018" +edition = "2021" [dependencies] clap = { version = "4.0.32", features = ["derive"] } From 601189fe7e937e753c144813806bbf84012daed3 Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Mon, 26 Feb 2024 18:41:50 +0900 Subject: [PATCH 12/23] refactor: flatten control flow in HTTPS serving --- src/main.rs | 89 +++++++++++++++++++++++++---------------------------- 1 file changed, 42 insertions(+), 47 deletions(-) diff --git a/src/main.rs b/src/main.rs index a2a2999cc..5542eaa73 100644 --- a/src/main.rs +++ b/src/main.rs @@ -70,59 +70,54 @@ async fn main() -> anyhow::Result<()> { }) }; - let serve_https = async move { - if args.enable_https { - if let (Some(https_port), Some(crt_path), Some(key_path)) = - (args.https_port, args.crt_path, args.key_path) - { - let piping_server = piping_server.clone(); + let serve_https = (|| async { + if !args.enable_https { + return Ok(()); + } + let (Some(https_port), Some(crt_path), Some(key_path)) = + (args.https_port, args.crt_path, args.key_path) + else { + anyhow::bail!("--https-port, --crt-path and --key-path should be specified"); + }; + let piping_server = piping_server.clone(); - let tokio_handle = tokio::runtime::Handle::current(); - let tls_cfg_rwlock_arc: Arc>> = - util::hot_reload_tls_cfg(tokio_handle, crt_path, key_path); + let tokio_handle = tokio::runtime::Handle::current(); + let tls_cfg_rwlock_arc: Arc>> = + util::hot_reload_tls_cfg(tokio_handle, crt_path, key_path); - let tcp_listener = - tokio::net::TcpListener::bind(SocketAddr::new(args.host, https_port)).await?; - log::info!("HTTPS server is listening on {https_port}..."); + let tcp_listener = + tokio::net::TcpListener::bind(SocketAddr::new(args.host, https_port)).await?; + log::info!("HTTPS server is listening on {https_port}..."); - let piping_server_service = - hyper::service::service_fn(move |req| piping_server.clone().handle(true, req)); + let piping_server_service = + hyper::service::service_fn(move |req| piping_server.clone().handle(true, req)); - loop { - let (stream, _) = tcp_listener.accept().await?; - let rustls_config = tls_cfg_rwlock_arc.clone().read().await.clone(); - let stream = match tokio_rustls::TlsAcceptor::from(rustls_config) - .accept(stream) - .await - { - Ok(stream) => stream, - Err(err) => { - log::error!("Failed to accept TLS connection: {err:?}"); - continue; - } - }; - let piping_server_service = piping_server_service.clone(); - tokio::task::spawn(async move { - if let Err(err) = hyper_util::server::conn::auto::Builder::new( - hyper_util::rt::tokio::TokioExecutor::new(), - ) - .serve_connection( - hyper_util::rt::TokioIo::new(stream), - piping_server_service, - ) - .await - { - log::error!("Failed to serve HTTPS connection: {err:?}"); - } - }); + loop { + let (stream, _) = tcp_listener.accept().await?; + let rustls_config = tls_cfg_rwlock_arc.clone().read().await.clone(); + let stream = match tokio_rustls::TlsAcceptor::from(rustls_config) + .accept(stream) + .await + { + Ok(stream) => stream, + Err(err) => { + log::error!("Failed to accept TLS connection: {err:?}"); + continue; } - } else { - anyhow::bail!("--https-port, --crt-path and --key-path should be specified"); - } - } else { - Ok(()) + }; + let piping_server_service = piping_server_service.clone(); + tokio::task::spawn(async move { + if let Err(err) = hyper_util::server::conn::auto::Builder::new( + hyper_util::rt::tokio::TokioExecutor::new(), + ) + .serve_connection(hyper_util::rt::TokioIo::new(stream), piping_server_service) + .await + { + log::error!("Failed to serve HTTPS connection: {err:?}"); + } + }); } - }; + })(); let _: ((), ()) = futures::try_join!(serve_http, serve_https)?; Ok(()) From 96c9b57ad70682bc27c55b7066e2de70d6bfa147 Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Mon, 26 Feb 2024 19:00:23 +0900 Subject: [PATCH 13/23] refactor: use let-else in piping_server.rs --- src/piping_server.rs | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/src/piping_server.rs b/src/piping_server.rs index 771a8c2f2..1e48fc842 100644 --- a/src/piping_server.rs +++ b/src/piping_server.rs @@ -223,13 +223,10 @@ impl PipingServer { } } let query_params = query_param_to_hash_map(req_parts.uri.query()); - let n_receivers: u32 = match get_n_receivers_result(&query_params) { - Ok(x) => x, - Err(_) => { - return Ok(rejection_response(BodyEnum::FullBody(full_body( - "[ERROR] Invalid \"n\" query parameter\n", - )))) - } + let Ok(n_receivers): Result = get_n_receivers_result(&query_params) else { + return Ok(rejection_response(BodyEnum::FullBody(full_body( + "[ERROR] Invalid \"n\" query parameter\n", + )))); }; if n_receivers <= 0 { return Ok(rejection_response(BodyEnum::FullBody(full_body(format!( @@ -303,13 +300,10 @@ impl PipingServer { )))); } let query_params = query_param_to_hash_map(req_parts.uri.query()); - let n_receivers: u32 = match get_n_receivers_result(&query_params) { - Ok(x) => x, - Err(_) => { - return Ok(rejection_response(BodyEnum::FullBody(full_body( - Bytes::from("[ERROR] Invalid \"n\" query parameter\n"), - )))); - } + let Ok(n_receivers): Result = get_n_receivers_result(&query_params) else { + return Ok(rejection_response(BodyEnum::FullBody(full_body( + Bytes::from("[ERROR] Invalid \"n\" query parameter\n"), + )))); }; if n_receivers <= 0 { return Ok(rejection_response(BodyEnum::FullBody(full_body(format!( @@ -461,17 +455,13 @@ async fn get_transfer_request( headers: &http::header::HeaderMap, body: hyper::body::Incoming, ) -> anyhow::Result { - let content_type = match headers.get("content-type") { - Some(x) => x, - None => return Ok(TransferRequest::from_hyper_incoming(headers, body)), + let Some(content_type) = headers.get("content-type") else { + return Ok(TransferRequest::from_hyper_incoming(headers, body)); }; let mime_type_result: Result = (|| Ok(content_type.to_str()?.parse()?))(); - let mime_type: mime::Mime = match mime_type_result { - Ok(x) => x, - Err(_) => { - return Ok(TransferRequest::from_hyper_incoming(headers, body)); - } + let Ok(mime_type): Result = mime_type_result else { + return Ok(TransferRequest::from_hyper_incoming(headers, body)); }; if mime_type.essence_str() != "multipart/form-data" { return Ok(TransferRequest::from_hyper_incoming(headers, body)); From 28887d5cdb12448f4c115a23964898ae8f8781bf Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Mon, 26 Feb 2024 19:27:26 +0900 Subject: [PATCH 14/23] fix: flatten control flow in hot_reload_tls_cfg() and fix error handling --- src/util.rs | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/src/util.rs b/src/util.rs index af0a86f18..2883efaac 100644 --- a/src/util.rs +++ b/src/util.rs @@ -172,20 +172,34 @@ pub fn hot_reload_tls_cfg( )?; loop { - match rx.recv() { - Ok(_event) => match load_tls_config(cert_path.deref(), key_path.deref()) { - Ok(tls_cfg) => { - let tls_cfg_rwlock = tls_cfg_rwlock.clone(); - tokio_handle.spawn(async move { - *(tls_cfg_rwlock.write().await) = Arc::new(tls_cfg); - log::info!("Successfully new certificates loaded"); - }); - } - Err(e) => log::error!("Failed to load new certificates: {e:?}"), - }, - Err(e) => log::error!("Watch certificates error: {e:?}"), - } + let received: Result<_, _> = match rx.recv() { + Ok(x) => x, + Err(e) => { + log::error!("Watch certificates error: {e:?}"); + break; + } + }; + let _event: notify::Event = match received { + Ok(x) => x, + Err(e) => { + log::error!("Watch certificates error: {e:?}"); + continue; + } + }; + let tls_cfg = match load_tls_config(cert_path.deref(), key_path.deref()) { + Ok(x) => x, + Err(e) => { + log::error!("Failed to load new certificates: {e:?}"); + continue; + } + }; + let tls_cfg_rwlock = tls_cfg_rwlock.clone(); + tokio_handle.spawn(async move { + *(tls_cfg_rwlock.write().await) = Arc::new(tls_cfg); + log::info!("Successfully new certificates loaded"); + }); } + Ok(()) } }); From aa2302be741031d9468545891d5cd949108d9bcc Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Tue, 27 Feb 2024 08:44:31 +0900 Subject: [PATCH 15/23] refactor: remove future_with_output_type() --- src/main.rs | 6 ++++-- src/util.rs | 6 ------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5542eaa73..2bc4ad03d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -46,7 +46,7 @@ async fn main() -> anyhow::Result<()> { let serve_http = { let piping_server = piping_server.clone(); let args = args.clone(); - util::future_with_output_type::, _>(async move { + async move { let tcp_listener = tokio::net::TcpListener::bind(SocketAddr::new(args.host, args.http_port)).await?; log::info!("HTTP server is listening on {}...", args.http_port); @@ -67,7 +67,9 @@ async fn main() -> anyhow::Result<()> { } }); } - }) + #[allow(unreachable_code)] + Ok::<_, anyhow::Error>(()) + } }; let serve_https = (|| async { diff --git a/src/util.rs b/src/util.rs index 2883efaac..ee3b5e40e 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,6 +1,5 @@ use core::convert::Infallible; use core::convert::TryFrom; -use core::future::Future; use core::ops::Deref as _; use core::pin::Pin; use core::task::{Context, Poll}; @@ -227,8 +226,3 @@ pub fn empty_body() -> impl http_body::Body { http_body_util::Empty::::new() .map_err(|_: Infallible| unreachable!("Error of Empty::new() should be Infallible")) } - -#[inline] -pub fn future_with_output_type>(fut: F) -> F { - fut -} From ce8d051256d665757d379717ef1524bbf8754fc0 Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Tue, 27 Feb 2024 09:27:39 +0900 Subject: [PATCH 16/23] deps: clap 4.1.14 --- Cargo.lock | 67 +++++++++++++++--------------------------------------- Cargo.toml | 2 +- README.md | 4 ++-- 3 files changed, 21 insertions(+), 52 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b56c75e57..e92632918 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,40 +106,45 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.0.32" +version = "4.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" +checksum = "906f7fe1da4185b7a282b2bc90172a496f9def1aca4545fe7526810741591e14" dependencies = [ - "bitflags 1.3.2", + "clap_builder", "clap_derive", + "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "351f9ad9688141ed83dfd8f5fb998a06225ef444b48ff4dc43de6d409b7fd10b" +dependencies = [ + "bitflags 1.3.2", "clap_lex", "is-terminal", - "once_cell", "strsim", "termcolor", ] [[package]] name = "clap_derive" -version = "4.0.21" +version = "4.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +checksum = "81d7dc0031c3a59a04fc2ba395c8e2dd463cba1859275f065d225f6122221b45" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.49", ] [[package]] name = "clap_lex" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" -dependencies = [ - "os_str_bytes", -] +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" [[package]] name = "crossbeam-channel" @@ -662,12 +667,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - [[package]] name = "parking_lot_core" version = "0.9.9" @@ -739,30 +738,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.78" @@ -1205,12 +1180,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - [[package]] name = "walkdir" version = "2.4.0" diff --git a/Cargo.toml b/Cargo.toml index 1bdd59261..215c9077e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Ryo Ota "] edition = "2021" [dependencies] -clap = { version = "4.0.32", features = ["derive"] } +clap = { version = "4.1", features = ["derive"] } anyhow = "1.0" log = "0.4" env_logger = "0.10" diff --git a/README.md b/README.md index 3d90ea3d8..6ae6c7adf 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,6 @@ Options: --https-port HTTPS port --crt-path Certification path --key-path Private key path - -h, --help Print help information - -V, --version Print version information + -h, --help Print help + -V, --version Print version ``` From d0d5a7e5b8e617b06b9ff19d40007ea6f928b8cd Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Wed, 28 Feb 2024 05:02:50 +0900 Subject: [PATCH 17/23] remove -V flag for compatibility with original piping-server --- README.md | 2 +- src/main.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6ae6c7adf..7f0421f00 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,6 @@ Options: --https-port HTTPS port --crt-path Certification path --key-path Private key path + --version Print version -h, --help Print help - -V, --version Print version ``` diff --git a/src/main.rs b/src/main.rs index 2bc4ad03d..41547e013 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,8 @@ use piping_server::util; /// Piping Server in Rust #[derive(clap::Parser, Debug, Clone)] #[clap(name = "piping-server")] -#[clap(about, version)] +#[clap(about)] +#[command(disable_version_flag = true, version = env!("CARGO_PKG_VERSION"))] struct Args { /// Bind address, either IPv4 or IPv6 (e.g. 127.0.0.1, ::1) #[clap(long, default_value = "0.0.0.0")] @@ -28,6 +29,10 @@ struct Args { /// Private key path #[clap(long)] key_path: Option, + + /// Print version + #[clap(long, action = clap::ArgAction::Version, value_parser = clap::value_parser!(bool))] + version: (), } #[tokio::main] From 7b714f3cbdacf09afbbbf5ab915eb97be038b083 Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Wed, 28 Feb 2024 14:52:50 +0900 Subject: [PATCH 18/23] deps: update --- Cargo.lock | 96 +++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e92632918..db100f491 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -41,7 +41,7 @@ dependencies = [ "derive_utils", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.51", ] [[package]] @@ -137,7 +137,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.51", ] [[package]] @@ -182,7 +182,7 @@ checksum = "61bb5a1014ce6dfc2a378578509abe775a5aa06bff584a547555d9efdb81b926" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.51", ] [[package]] @@ -296,7 +296,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.51", ] [[package]] @@ -379,9 +379,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" [[package]] name = "http" @@ -870,9 +870,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048a63e5b3ac996d78d402940b5fa47973d2d080c6c6fffa1d0f19c4445310b7" +checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" [[package]] name = "rustls-webpki" @@ -887,9 +887,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -914,22 +914,22 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.51", ] [[package]] @@ -961,12 +961,12 @@ checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1011,9 +1011,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.49" +version = "2.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" dependencies = [ "proc-macro2", "quote", @@ -1046,7 +1046,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.51", ] [[package]] @@ -1089,7 +1089,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.51", ] [[package]] @@ -1156,9 +1156,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -1251,7 +1251,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -1271,17 +1271,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.3", + "windows_aarch64_msvc 0.52.3", + "windows_i686_gnu 0.52.3", + "windows_i686_msvc 0.52.3", + "windows_x86_64_gnu 0.52.3", + "windows_x86_64_gnullvm 0.52.3", + "windows_x86_64_msvc 0.52.3", ] [[package]] @@ -1292,9 +1292,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" [[package]] name = "windows_aarch64_msvc" @@ -1304,9 +1304,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" [[package]] name = "windows_i686_gnu" @@ -1316,9 +1316,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" [[package]] name = "windows_i686_msvc" @@ -1328,9 +1328,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" [[package]] name = "windows_x86_64_gnu" @@ -1340,9 +1340,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" [[package]] name = "windows_x86_64_gnullvm" @@ -1352,9 +1352,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" [[package]] name = "windows_x86_64_msvc" @@ -1364,9 +1364,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" [[package]] name = "zeroize" From a6ab85a7db1366381bf6556e50f517015ebdb74f Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Wed, 28 Feb 2024 16:38:53 +0900 Subject: [PATCH 19/23] fix: log path and query instead of full URL in HTTPS --- src/piping_server.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/piping_server.rs b/src/piping_server.rs index 1e48fc842..20f22bd29 100644 --- a/src/piping_server.rs +++ b/src/piping_server.rs @@ -120,11 +120,16 @@ impl PipingServer { let (req_parts, req_body) = req.into_parts(); let path = req_parts.uri.path(); + let path_and_query: &str = req_parts + .uri + .path_and_query() + .map(|x| x.as_str()) + .unwrap_or_else(|| ""); log::info!( - "{} {:} {:?}", + "{} {} {:?}", req_parts.method, - req_parts.uri, + path_and_query, req_parts.version, ); From df392b9a4a5d7f2bedd8ed36026fe9adaca479ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 08:23:22 +0900 Subject: [PATCH 20/23] build(deps): bump log from 0.4.20 to 0.4.21 (#544) Bumps [log](https://github.com/rust-lang/log) from 0.4.20 to 0.4.21. - [Release notes](https://github.com/rust-lang/log/releases) - [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/log/compare/0.4.20...0.4.21) --- updated-dependencies: - dependency-name: log dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db100f491..9a6500c51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -567,9 +567,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "memchr" From eb612c8bc2ecaf1874975be44051d5f2d8a17fa8 Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Thu, 29 Feb 2024 08:24:20 +0900 Subject: [PATCH 21/23] deps: update --- Cargo.lock | 74 +++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9a6500c51..0c7a8beb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -41,7 +41,7 @@ dependencies = [ "derive_utils", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -137,7 +137,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -148,9 +148,9 @@ checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils", ] @@ -182,7 +182,7 @@ checksum = "61bb5a1014ce6dfc2a378578509abe775a5aa06bff584a547555d9efdb81b926" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -296,7 +296,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -379,9 +379,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "http" @@ -929,7 +929,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1011,9 +1011,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.51" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -1046,7 +1046,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1089,7 +1089,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.51", + "syn 2.0.52", ] [[package]] @@ -1251,7 +1251,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -1271,17 +1271,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -1292,9 +1292,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -1304,9 +1304,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -1316,9 +1316,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -1328,9 +1328,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -1340,9 +1340,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -1352,9 +1352,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -1364,9 +1364,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "zeroize" From ed8f95f6082d5789b9b63e3398ec4c34d7a5b253 Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Fri, 1 Mar 2024 08:31:16 +0900 Subject: [PATCH 22/23] deps: update --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c7a8beb9..c30380256 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -484,9 +484,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown", From 6e0558b03dafe3a25ddceb59f864f126f245219c Mon Sep 17 00:00:00 2001 From: Ryo Ota Date: Fri, 1 Mar 2024 08:46:49 +0900 Subject: [PATCH 23/23] bump: 0.18.0 --- CHANGELOG.md | 15 ++++++++++++++- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec76cf36e..90d2820fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ## [Unreleased] +## [0.18.0] - 2024-02-29 +### Changed +* Update dependencies +* (Docker) Dockerfile supports linux/arm64 but not published image +* (internal) Use Rust edition 2021 + +### Removed +* **Breaking:** remove -V flag for compatibility with the original piping-server + +### Fixed +* Log path and query instead of full URL in HTTPS + ## [0.17.0] - 2024-02-10 ### Changed * Update dependencies @@ -268,7 +280,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) ### Added * Implement basic Piping Server -[Unreleased]: https://github.com/nwtgck/piping-server-rust/compare/v0.17.0...HEAD +[Unreleased]: https://github.com/nwtgck/piping-server-rust/compare/v0.18.0...HEAD +[0.18.0]: https://github.com/nwtgck/piping-server-rust/compare/v0.17.0...v0.18.0 [0.17.0]: https://github.com/nwtgck/piping-server-rust/compare/v0.16.0...v0.17.0 [0.16.0]: https://github.com/nwtgck/piping-server-rust/compare/v0.15.0...v0.16.0 [0.15.0]: https://github.com/nwtgck/piping-server-rust/compare/v0.14.1...v0.15.0 diff --git a/Cargo.lock b/Cargo.lock index c30380256..9bfb0d07d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -700,7 +700,7 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piping-server" -version = "0.17.1-SNAPSHOT" +version = "0.18.0" dependencies = [ "anyhow", "auto_enums", diff --git a/Cargo.toml b/Cargo.toml index 215c9077e..dc08004b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "piping-server" -version = "0.17.1-SNAPSHOT" +version = "0.18.0" authors = ["Ryo Ota "] edition = "2021"