Update sentry-rust monorepo to 0.35.0 #6
11 changed files with 7681 additions and 15083 deletions
179
Cargo.lock
generated
179
Cargo.lock
generated
|
@ -875,9 +875,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.2"
|
||||
version = "1.2.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc"
|
||||
checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d"
|
||||
dependencies = [
|
||||
"jobserver",
|
||||
"libc",
|
||||
|
@ -977,7 +977,7 @@ name = "chir-rs-config"
|
|||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"eyre",
|
||||
"sentry-core",
|
||||
"sentry-core 0.35.0",
|
||||
"serde",
|
||||
"toml",
|
||||
]
|
||||
|
@ -1011,7 +1011,7 @@ dependencies = [
|
|||
"eyre",
|
||||
"rustls 0.23.19",
|
||||
"tokio",
|
||||
"tokio-rustls 0.26.0",
|
||||
"tokio-rustls 0.26.1",
|
||||
"tracing",
|
||||
"url",
|
||||
]
|
||||
|
@ -1036,7 +1036,6 @@ dependencies = [
|
|||
"mime",
|
||||
"rusty_paseto",
|
||||
"sentry-tower",
|
||||
"serde",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"tower-http 0.6.2",
|
||||
|
@ -1058,7 +1057,7 @@ dependencies = [
|
|||
"http 1.2.0",
|
||||
"mime",
|
||||
"serde",
|
||||
"thiserror 2.0.4",
|
||||
"thiserror 2.0.6",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
|
@ -1108,9 +1107,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap"
|
||||
version = "4.5.22"
|
||||
version = "4.5.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "69371e34337c4c984bbe322360c2547210bf632eb2814bbe78a6e87a2935bd2b"
|
||||
checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84"
|
||||
dependencies = [
|
||||
"clap_builder",
|
||||
"clap_derive",
|
||||
|
@ -1118,9 +1117,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap_builder"
|
||||
version = "4.5.22"
|
||||
version = "4.5.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e24c1b4099818523236a8ca881d2b45db98dadfb4625cf6608c12069fcbbde1"
|
||||
checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838"
|
||||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
|
@ -1142,9 +1141,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "clap_lex"
|
||||
version = "0.7.3"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7"
|
||||
checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"
|
||||
|
||||
[[package]]
|
||||
name = "cmake"
|
||||
|
@ -1564,9 +1563,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "fastrand"
|
||||
version = "2.2.0"
|
||||
version = "2.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4"
|
||||
checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
||||
|
||||
[[package]]
|
||||
name = "ff"
|
||||
|
@ -2056,7 +2055,7 @@ dependencies = [
|
|||
"rustls 0.23.19",
|
||||
"rustls-pki-types",
|
||||
"tokio",
|
||||
"tokio-rustls 0.26.0",
|
||||
"tokio-rustls 0.26.1",
|
||||
"tower-service",
|
||||
"webpki-roots",
|
||||
]
|
||||
|
@ -2314,9 +2313,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "js-sys"
|
||||
version = "0.3.74"
|
||||
version = "0.3.76"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705"
|
||||
checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"wasm-bindgen",
|
||||
|
@ -2891,7 +2890,7 @@ dependencies = [
|
|||
"rustc-hash 2.1.0",
|
||||
"rustls 0.23.19",
|
||||
"socket2",
|
||||
"thiserror 2.0.4",
|
||||
"thiserror 2.0.6",
|
||||
"tokio",
|
||||
"tracing",
|
||||
]
|
||||
|
@ -2910,7 +2909,7 @@ dependencies = [
|
|||
"rustls 0.23.19",
|
||||
"rustls-pki-types",
|
||||
"slab",
|
||||
"thiserror 2.0.4",
|
||||
"thiserror 2.0.6",
|
||||
"tinyvec",
|
||||
"tracing",
|
||||
"web-time",
|
||||
|
@ -3058,6 +3057,7 @@ dependencies = [
|
|||
"futures-channel",
|
||||
"futures-core",
|
||||
"futures-util",
|
||||
"h2 0.4.7",
|
||||
"http 1.2.0",
|
||||
"http-body 1.0.1",
|
||||
"http-body-util",
|
||||
|
@ -3080,7 +3080,7 @@ dependencies = [
|
|||
"serde_urlencoded",
|
||||
"sync_wrapper 1.0.2",
|
||||
"tokio",
|
||||
"tokio-rustls 0.26.0",
|
||||
"tokio-rustls 0.26.1",
|
||||
"tokio-util",
|
||||
"tower-service",
|
||||
"url",
|
||||
|
@ -3190,20 +3190,6 @@ dependencies = [
|
|||
"sct",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.22.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432"
|
||||
dependencies = [
|
||||
"log",
|
||||
"ring",
|
||||
"rustls-pki-types",
|
||||
"rustls-webpki 0.102.8",
|
||||
"subtle",
|
||||
"zeroize",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rustls"
|
||||
version = "0.23.19"
|
||||
|
@ -3391,16 +3377,16 @@ checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
|
|||
|
||||
[[package]]
|
||||
name = "sentry"
|
||||
version = "0.34.0"
|
||||
version = "0.35.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5484316556650182f03b43d4c746ce0e3e48074a21e2f51244b648b6542e1066"
|
||||
checksum = "016958f51b96861dead7c1e02290f138411d05e94fad175c8636a835dee6e51e"
|
||||
dependencies = [
|
||||
"httpdate",
|
||||
"reqwest",
|
||||
"rustls 0.22.4",
|
||||
"rustls 0.23.19",
|
||||
"sentry-backtrace",
|
||||
"sentry-contexts",
|
||||
"sentry-core",
|
||||
"sentry-core 0.35.0",
|
||||
"sentry-debug-images",
|
||||
"sentry-panic",
|
||||
"sentry-tracing",
|
||||
|
@ -3411,27 +3397,27 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sentry-backtrace"
|
||||
version = "0.34.0"
|
||||
version = "0.35.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "40aa225bb41e2ec9d7c90886834367f560efc1af028f1c5478a6cce6a59c463a"
|
||||
checksum = "e57712c24e99252ef175b4b06c485294f10ad6bc5b5e1567ff3803ee7a0b7d3f"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"once_cell",
|
||||
"regex",
|
||||
"sentry-core",
|
||||
"sentry-core 0.35.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sentry-contexts"
|
||||
version = "0.34.0"
|
||||
version = "0.35.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1a8dd746da3d16cb8c39751619cefd4fcdbd6df9610f3310fd646b55f6e39910"
|
||||
checksum = "eba8754ec3b9279e00aa6d64916f211d44202370a1699afde1db2c16cbada089"
|
||||
dependencies = [
|
||||
"hostname",
|
||||
"libc",
|
||||
"os_info",
|
||||
"rustc_version",
|
||||
"sentry-core",
|
||||
"sentry-core 0.35.0",
|
||||
"uname",
|
||||
]
|
||||
|
||||
|
@ -3440,25 +3426,37 @@ name = "sentry-core"
|
|||
version = "0.34.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "161283cfe8e99c8f6f236a402b9ccf726b201f365988b5bb637ebca0abbd4a30"
|
||||
dependencies = [
|
||||
"once_cell",
|
||||
"sentry-types 0.34.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sentry-core"
|
||||
version = "0.35.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f9f8b6dcd4fbae1e3e22b447f32670360b27e31b62ab040f7fb04e0f80c04d92"
|
||||
dependencies = [
|
||||
"crc32fast",
|
||||
"once_cell",
|
||||
"rand",
|
||||
"regex",
|
||||
"sentry-types",
|
||||
"sentry-types 0.35.0",
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sentry-debug-images"
|
||||
version = "0.34.0"
|
||||
version = "0.35.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8fc6b25e945fcaa5e97c43faee0267eebda9f18d4b09a251775d8fef1086238a"
|
||||
checksum = "8982a69133d3f5e4efdbfa0776937fca43c3a2e275a8fe184f50b1b0aa92e07c"
|
||||
dependencies = [
|
||||
"findshlibs",
|
||||
"once_cell",
|
||||
"sentry-core",
|
||||
"sentry-core 0.35.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -3468,29 +3466,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "3ba221106f53abf085db8871c53cd325ba14f50b2ba18819d5e6db0f782ddc3f"
|
||||
dependencies = [
|
||||
"eyre",
|
||||
"sentry-core",
|
||||
"sentry-core 0.34.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sentry-panic"
|
||||
version = "0.34.0"
|
||||
version = "0.35.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bc74f229c7186dd971a9491ffcbe7883544aa064d1589bd30b83fb856cd22d63"
|
||||
checksum = "de296dae6f01e931b65071ee5fe28d66a27909857f744018f107ed15fd1f6b25"
|
||||
dependencies = [
|
||||
"sentry-backtrace",
|
||||
"sentry-core",
|
||||
"sentry-core 0.35.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sentry-tower"
|
||||
version = "0.34.0"
|
||||
version = "0.35.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c90802b38c899a2c9e557dff25ad186362eddf755d5f5244001b172dd03bead"
|
||||
checksum = "fcdaf9b1939589476bd57751d12a9653bbfe356610fc476d03d7683189183ab7"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"http 1.2.0",
|
||||
"pin-project",
|
||||
"sentry-core",
|
||||
"sentry-core 0.35.0",
|
||||
"tower-layer",
|
||||
"tower-service",
|
||||
"url",
|
||||
|
@ -3498,12 +3496,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "sentry-tracing"
|
||||
version = "0.34.0"
|
||||
version = "0.35.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cd3c5faf2103cd01eeda779ea439b68c4ee15adcdb16600836e97feafab362ec"
|
||||
checksum = "263f73c757ed7915d3e1e34625eae18cad498a95b4261603d4ce3f87b159a6f0"
|
||||
dependencies = [
|
||||
"sentry-backtrace",
|
||||
"sentry-core",
|
||||
"sentry-core 0.35.0",
|
||||
"tracing-core",
|
||||
"tracing-subscriber",
|
||||
]
|
||||
|
@ -3525,6 +3523,23 @@ dependencies = [
|
|||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sentry-types"
|
||||
version = "0.35.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a71ed3a389948a6a6d92b98e997a2723ca22f09660c5a7b7388ecd509a70a527"
|
||||
dependencies = [
|
||||
"debugid",
|
||||
"hex",
|
||||
"rand",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 1.0.69",
|
||||
"time",
|
||||
"url",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.215"
|
||||
|
@ -4032,11 +4047,11 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "2.0.4"
|
||||
version = "2.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490"
|
||||
checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47"
|
||||
dependencies = [
|
||||
"thiserror-impl 2.0.4",
|
||||
"thiserror-impl 2.0.6",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
@ -4052,9 +4067,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "2.0.4"
|
||||
version = "2.0.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061"
|
||||
checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -4167,20 +4182,19 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tokio-rustls"
|
||||
version = "0.26.0"
|
||||
version = "0.26.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4"
|
||||
checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37"
|
||||
dependencies = [
|
||||
"rustls 0.23.19",
|
||||
"rustls-pki-types",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tokio-stream"
|
||||
version = "0.1.16"
|
||||
version = "0.1.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1"
|
||||
checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"pin-project-lite",
|
||||
|
@ -4586,9 +4600,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b"
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen"
|
||||
version = "0.2.97"
|
||||
version = "0.2.99"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c"
|
||||
checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"once_cell",
|
||||
|
@ -4597,13 +4611,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-backend"
|
||||
version = "0.2.97"
|
||||
version = "0.2.99"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd"
|
||||
checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79"
|
||||
dependencies = [
|
||||
"bumpalo",
|
||||
"log",
|
||||
"once_cell",
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn",
|
||||
|
@ -4612,9 +4625,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-futures"
|
||||
version = "0.4.47"
|
||||
version = "0.4.49"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d"
|
||||
checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2"
|
||||
dependencies = [
|
||||
"cfg-if",
|
||||
"js-sys",
|
||||
|
@ -4625,9 +4638,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro"
|
||||
version = "0.2.97"
|
||||
version = "0.2.99"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051"
|
||||
checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe"
|
||||
dependencies = [
|
||||
"quote",
|
||||
"wasm-bindgen-macro-support",
|
||||
|
@ -4635,9 +4648,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-macro-support"
|
||||
version = "0.2.97"
|
||||
version = "0.2.99"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d"
|
||||
checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
|
@ -4648,9 +4661,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "wasm-bindgen-shared"
|
||||
version = "0.2.97"
|
||||
version = "0.2.99"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49"
|
||||
checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6"
|
||||
|
||||
[[package]]
|
||||
name = "wasm-streams"
|
||||
|
@ -4667,9 +4680,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "web-sys"
|
||||
version = "0.3.74"
|
||||
version = "0.3.76"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c"
|
||||
checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"wasm-bindgen",
|
||||
|
|
|
@ -24,7 +24,7 @@ chir-rs-http = { version = "0.1.0", path = "chir-rs-http" }
|
|||
color-eyre = { version = "0.6.3", features = ["issue-url"] }
|
||||
dotenvy = "0.15.7"
|
||||
eyre = "0.6.12"
|
||||
sentry = { version = "0.34.0", default-features = false, features = [
|
||||
sentry = { version = "0.35.0", default-features = false, features = [
|
||||
"backtrace",
|
||||
"contexts",
|
||||
"debug-images",
|
||||
|
@ -34,7 +34,7 @@ sentry = { version = "0.34.0", default-features = false, features = [
|
|||
"rustls",
|
||||
] }
|
||||
sentry-eyre = "0.2.0"
|
||||
sentry-tracing = { version = "0.34.0", features = ["backtrace"] }
|
||||
sentry-tracing = { version = "0.35.0", features = ["backtrace"] }
|
||||
tokio = { version = "1.41.1", features = ["macros", "rt-multi-thread", "signal"] }
|
||||
tracing = "0.1.41"
|
||||
tracing-error = "0.2.0"
|
||||
|
|
|
@ -97,94 +97,100 @@ impl CaStore {
|
|||
let string_id = lexicographic_base64::encode(id.to_be_bytes());
|
||||
let source_fname = format!("temp/{string_id}");
|
||||
|
||||
/*info!("Starting multipart upload {id}");
|
||||
let multipart_result = self
|
||||
.client
|
||||
.create_multipart_upload()
|
||||
.bucket(&*self.bucket)
|
||||
.key(&source_fname)
|
||||
.send()
|
||||
.await
|
||||
.with_context(|| format!("Creating multipart request for Request ID{id}"))?;
|
||||
|
||||
let mut buf = BytesMut::with_capacity(16 * 1024 * 1024); // 16MiB byte buffer for the file
|
||||
let mut buf = BytesMut::with_capacity(5_000_000);
|
||||
reader.read_buf(&mut buf).await?;
|
||||
let hasher = Arc::new(Mutex::new(Hasher::new()));
|
||||
|
||||
let mut i = 1;
|
||||
let mut completed_multipart_upload_builder = CompletedMultipartUpload::builder();
|
||||
|
||||
loop {
|
||||
buf.clear();
|
||||
reader.read_buf(&mut buf).await.context("Reading chunk")?;
|
||||
if buf.is_empty() {
|
||||
break;
|
||||
}
|
||||
|
||||
debug!("Uploading part {i} for multipart upload {id}");
|
||||
|
||||
let buf2 = buf.clone();
|
||||
let hasher = Arc::clone(&hasher);
|
||||
let hasher_job = spawn_blocking(move || {
|
||||
hasher.blocking_lock().update_rayon(&buf2);
|
||||
});
|
||||
|
||||
let part_upload_fut = self
|
||||
let hash = if buf.len() >= 5_000_000 {
|
||||
info!("Starting multipart upload {id}");
|
||||
let multipart_result = self
|
||||
.client
|
||||
.upload_part()
|
||||
.create_multipart_upload()
|
||||
.bucket(&*self.bucket)
|
||||
.key(&source_fname)
|
||||
.set_upload_id(multipart_result.upload_id.clone())
|
||||
.body(ByteStream::from(buf.to_vec()))
|
||||
.part_number(i)
|
||||
.send();
|
||||
.send()
|
||||
.await
|
||||
.with_context(|| format!("Creating multipart request for Request ID{id}"))?;
|
||||
|
||||
let ((), part_upload_result) = try_join!(
|
||||
async { hasher_job.await.context("Awaiting hasher job") },
|
||||
async { part_upload_fut.await.context("Awaiting uploader job") }
|
||||
)
|
||||
.context("Awaiting job for chunk")?;
|
||||
completed_multipart_upload_builder = completed_multipart_upload_builder.parts(
|
||||
CompletedPart::builder()
|
||||
.e_tag(part_upload_result.e_tag.unwrap_or_default())
|
||||
let mut reader = buf.chain(reader);
|
||||
|
||||
let mut buf = BytesMut::with_capacity(16 * 1024 * 1024); // 16MiB byte buffer for the file
|
||||
let hasher = Arc::new(Mutex::new(Hasher::new()));
|
||||
|
||||
let mut i = 1;
|
||||
let mut completed_multipart_upload_builder = CompletedMultipartUpload::builder();
|
||||
|
||||
loop {
|
||||
buf.clear();
|
||||
reader.read_buf(&mut buf).await.context("Reading chunk")?;
|
||||
if buf.is_empty() {
|
||||
break;
|
||||
}
|
||||
|
||||
debug!("Uploading part {i} for multipart upload {id}");
|
||||
|
||||
let buf2 = buf.clone();
|
||||
let hasher = Arc::clone(&hasher);
|
||||
let hasher_job = spawn_blocking(move || {
|
||||
hasher.blocking_lock().update_rayon(&buf2);
|
||||
});
|
||||
|
||||
let part_upload_fut = self
|
||||
.client
|
||||
.upload_part()
|
||||
.bucket(&*self.bucket)
|
||||
.key(&source_fname)
|
||||
.set_upload_id(multipart_result.upload_id.clone())
|
||||
.body(ByteStream::from(buf.to_vec()))
|
||||
.part_number(i)
|
||||
.build(),
|
||||
);
|
||||
i += 1;
|
||||
}
|
||||
.send();
|
||||
|
||||
debug!("Finalizing Multipart Upload {id}");
|
||||
let ((), part_upload_result) = try_join!(
|
||||
async { hasher_job.await.context("Awaiting hasher job") },
|
||||
async { part_upload_fut.await.context("Awaiting uploader job") }
|
||||
)
|
||||
.context("Awaiting job for chunk")?;
|
||||
completed_multipart_upload_builder = completed_multipart_upload_builder.parts(
|
||||
CompletedPart::builder()
|
||||
.e_tag(part_upload_result.e_tag.unwrap_or_default())
|
||||
.part_number(i)
|
||||
.build(),
|
||||
);
|
||||
i += 1;
|
||||
}
|
||||
|
||||
let hash = hasher.lock().await.finalize();
|
||||
self.client
|
||||
.complete_multipart_upload()
|
||||
.bucket(&*self.bucket)
|
||||
.key(&source_fname)
|
||||
.multipart_upload(completed_multipart_upload_builder.build())
|
||||
.set_upload_id(multipart_result.upload_id)
|
||||
.send()
|
||||
.await
|
||||
.context("Completing multipart upload")?;*/
|
||||
debug!("Finalizing Multipart Upload {id}");
|
||||
|
||||
let hasher = Arc::new(Mutex::new(Hasher::new()));
|
||||
let mut buf = Vec::new();
|
||||
reader.read_to_end(&mut buf).await?;
|
||||
let buf = Bytes::from(buf);
|
||||
let buf2 = buf.clone();
|
||||
let hasher2 = Arc::clone(&hasher);
|
||||
spawn_blocking(move || {
|
||||
hasher2.blocking_lock().update_rayon(&buf2);
|
||||
})
|
||||
.await?;
|
||||
self.client
|
||||
.put_object()
|
||||
.bucket(&*self.bucket)
|
||||
.key(&source_fname)
|
||||
.body(ByteStream::from(buf.to_vec()))
|
||||
.send()
|
||||
.await
|
||||
.context("Uploading file")?;
|
||||
let hash = hasher.lock().await.finalize();
|
||||
self.client
|
||||
.complete_multipart_upload()
|
||||
.bucket(&*self.bucket)
|
||||
.key(&source_fname)
|
||||
.multipart_upload(completed_multipart_upload_builder.build())
|
||||
.set_upload_id(multipart_result.upload_id)
|
||||
.send()
|
||||
.await
|
||||
.context("Completing multipart upload")?;
|
||||
hash
|
||||
} else {
|
||||
let buf = Bytes::from(buf);
|
||||
let buf2 = buf.clone();
|
||||
let hasher2 = Arc::clone(&hasher);
|
||||
spawn_blocking(move || {
|
||||
hasher2.blocking_lock().update_rayon(&buf2);
|
||||
})
|
||||
.await?;
|
||||
self.client
|
||||
.put_object()
|
||||
.bucket(&*self.bucket)
|
||||
.key(&source_fname)
|
||||
.body(ByteStream::from(buf.to_vec()))
|
||||
.send()
|
||||
.await
|
||||
.context("Uploading file")?;
|
||||
|
||||
let hash = hasher.lock().await.finalize();
|
||||
hasher.lock().await.finalize()
|
||||
};
|
||||
|
||||
let target_fname = lexicographic_base64::encode(hash.as_bytes());
|
||||
|
||||
|
|
|
@ -12,7 +12,11 @@ dotenvy = "0.15.7"
|
|||
eyre = "0.6.12"
|
||||
mime = "0.3.17"
|
||||
mime_guess = "2.0.5"
|
||||
reqwest = { version = "0.12.9", default-features = false, features = ["rustls-tls", "stream"] }
|
||||
reqwest = { version = "0.12.9", default-features = false, features = [
|
||||
"http2",
|
||||
"rustls-tls",
|
||||
"stream",
|
||||
] }
|
||||
tokio = { version = "1.41.1", features = ["fs", "macros", "rt-multi-thread"] }
|
||||
tracing = "0.1.41"
|
||||
tracing-subscriber = "0.3.19"
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
use std::{collections::HashSet, future::Future, path::Path, pin::Pin};
|
||||
use std::{
|
||||
collections::HashSet, future::Future, path::PathBuf, pin::Pin, sync::Arc, time::Duration,
|
||||
};
|
||||
|
||||
use chir_rs_http_api::{
|
||||
auth::{LoginRequest, PasetoToken, Scope},
|
||||
errors::APIError,
|
||||
};
|
||||
use clap::{arg, Parser, Subcommand};
|
||||
use eyre::{eyre, Context as _, OptionExt as _, Result};
|
||||
use mime_guess::{Mime, MimeGuess};
|
||||
use eyre::{eyre, Context as _, Result};
|
||||
use mime_guess::MimeGuess;
|
||||
use reqwest::Body;
|
||||
use tokio::join;
|
||||
use tracing::instrument;
|
||||
use tokio::{sync::Mutex, task::JoinSet};
|
||||
use tracing::{info, instrument};
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
#[command(version, about, long_about = None)]
|
||||
struct Args {
|
||||
#[arg(short, long, default_value = "http://localhost:5621/")]
|
||||
#[arg(short, long, default_value = "https://lotte.chir.rs/")]
|
||||
url: String,
|
||||
#[command(subcommand)]
|
||||
command: Command,
|
||||
|
@ -42,14 +44,18 @@ enum Command {
|
|||
},
|
||||
}
|
||||
|
||||
async fn login(url: String, username: String, password: String) -> Result<()> {
|
||||
async fn login(
|
||||
client: Arc<reqwest::Client>,
|
||||
url: String,
|
||||
username: String,
|
||||
password: String,
|
||||
) -> Result<()> {
|
||||
let request = LoginRequest {
|
||||
username,
|
||||
password,
|
||||
scopes: HashSet::from([Scope::Full]),
|
||||
};
|
||||
let request = bincode::encode_to_vec(request, bincode::config::standard())?;
|
||||
let client = reqwest::Client::new();
|
||||
let res = client
|
||||
.post(format!("{url}.api/auth/login"))
|
||||
.header("Content-Type", "application/x+bincode")
|
||||
|
@ -74,9 +80,13 @@ async fn login(url: String, username: String, password: String) -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[instrument(skip(source))]
|
||||
async fn upload(url: String, source: impl AsRef<Path>, dest: String) -> Result<()> {
|
||||
let client = reqwest::Client::new();
|
||||
#[instrument(skip(client))]
|
||||
async fn upload_inner(
|
||||
client: Arc<reqwest::Client>,
|
||||
url: String,
|
||||
source: PathBuf,
|
||||
dest: String,
|
||||
) -> Result<bool> {
|
||||
let token = std::env::var("CHIR_RS_TOKEN")?;
|
||||
let file = tokio::fs::File::open(&source).await?;
|
||||
let res = client
|
||||
|
@ -92,17 +102,55 @@ async fn upload(url: String, source: impl AsRef<Path>, dest: String) -> Result<(
|
|||
.body(Body::from(file))
|
||||
.send()
|
||||
.await?;
|
||||
if !res.status().is_success() {
|
||||
let status = res.status();
|
||||
if status.is_client_error() {
|
||||
let response = res.bytes().await?;
|
||||
let response: APIError =
|
||||
bincode::decode_from_slice(&response, bincode::config::standard())?.0;
|
||||
Err(response).with_context(|| format!("Uploading to {dest}"))?;
|
||||
} else if status.is_server_error() {
|
||||
let response = res.bytes().await?;
|
||||
let response: APIError =
|
||||
bincode::decode_from_slice(&response, bincode::config::standard())?.0;
|
||||
println!("Server error updating {dest}: {response:?}");
|
||||
return Ok(false);
|
||||
}
|
||||
info!("Updated {dest}.");
|
||||
Ok(true)
|
||||
}
|
||||
|
||||
#[instrument(skip(client))]
|
||||
async fn upload(
|
||||
client: Arc<reqwest::Client>,
|
||||
url: String,
|
||||
source: PathBuf,
|
||||
dest: String,
|
||||
) -> Result<()> {
|
||||
loop {
|
||||
if upload_inner(
|
||||
Arc::clone(&client),
|
||||
url.clone(),
|
||||
source.clone(),
|
||||
dest.clone(),
|
||||
)
|
||||
.await?
|
||||
{
|
||||
break;
|
||||
}
|
||||
println!("Uploading to {dest} failed. waiting 5s");
|
||||
tokio::time::sleep(Duration::from_secs(5)).await;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[instrument(skip(source))]
|
||||
async fn upload_dir(url: String, source: impl AsRef<Path>, dest: String) -> Result<()> {
|
||||
#[instrument(skip(client))]
|
||||
async fn upload_dir(
|
||||
client: Arc<reqwest::Client>,
|
||||
futs: Arc<Mutex<JoinSet<Result<()>>>>,
|
||||
url: String,
|
||||
source: PathBuf,
|
||||
dest: String,
|
||||
) -> Result<()> {
|
||||
let mut dir = tokio::fs::read_dir(source).await?;
|
||||
while let Some(ent) = dir.next_entry().await? {
|
||||
let file_type = ent.file_type().await?;
|
||||
|
@ -116,19 +164,39 @@ async fn upload_dir(url: String, source: impl AsRef<Path>, dest: String) -> Resu
|
|||
format!("{dest}/{file_name_str}")
|
||||
};
|
||||
if file_type.is_dir() {
|
||||
let sub_fut: Pin<Box<dyn Future<Output = Result<()>>>> =
|
||||
Box::pin(upload_dir(url.clone(), ent.path(), tgt));
|
||||
sub_fut.await?;
|
||||
let boxed: Pin<Box<dyn Future<Output = Result<()>>>> = Box::pin(upload_dir(
|
||||
Arc::clone(&client),
|
||||
Arc::clone(&futs),
|
||||
url.clone(),
|
||||
ent.path().to_path_buf(),
|
||||
tgt,
|
||||
));
|
||||
boxed.await?;
|
||||
|
||||
continue;
|
||||
}
|
||||
if file_name_str == "index.html" {
|
||||
if dest.is_empty() {
|
||||
upload(url.clone(), ent.path(), "".to_string()).await?;
|
||||
} else {
|
||||
upload(url.clone(), ent.path(), format!("{dest}/")).await?;
|
||||
if !dest.is_empty() {
|
||||
futs.lock().await.spawn(upload(
|
||||
Arc::clone(&client),
|
||||
url.clone(),
|
||||
ent.path().to_path_buf(),
|
||||
format!("{dest}/"),
|
||||
));
|
||||
}
|
||||
futs.lock().await.spawn(upload(
|
||||
Arc::clone(&client),
|
||||
url.clone(),
|
||||
ent.path().to_path_buf(),
|
||||
dest.clone(),
|
||||
));
|
||||
}
|
||||
upload(url.clone(), ent.path(), tgt).await?;
|
||||
futs.lock().await.spawn(upload(
|
||||
Arc::clone(&client),
|
||||
url.clone(),
|
||||
ent.path().to_path_buf(),
|
||||
tgt,
|
||||
));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -139,11 +207,22 @@ async fn main() -> Result<()> {
|
|||
dotenvy::dotenv().ok();
|
||||
tracing_subscriber::fmt::init();
|
||||
let matches = Args::parse();
|
||||
let client = Arc::new(reqwest::Client::new());
|
||||
|
||||
match matches.command {
|
||||
Command::Login { username, password } => login(matches.url, username, password).await?,
|
||||
Command::Upload { source, dest } => upload(matches.url, source, dest).await?,
|
||||
Command::UploadDir { source, dest } => upload_dir(matches.url, source, dest).await?,
|
||||
Command::Login { username, password } => {
|
||||
login(client, matches.url, username, password).await?
|
||||
}
|
||||
Command::Upload { source, dest } => {
|
||||
upload(client, matches.url, source.into(), dest).await?
|
||||
}
|
||||
Command::UploadDir { source, dest } => {
|
||||
let futs = Arc::new(Mutex::new(JoinSet::new()));
|
||||
upload_dir(client, Arc::clone(&futs), matches.url, source.into(), dest).await?;
|
||||
while let Some(v) = futs.lock().await.join_next().await {
|
||||
v??;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -5,7 +5,7 @@ edition = "2021"
|
|||
|
||||
[dependencies]
|
||||
eyre = "0.6.12"
|
||||
sentry-core = "0.34.0"
|
||||
sentry-core = "0.35.0"
|
||||
serde = { version = "1.0.215", features = ["derive"] }
|
||||
toml = "0.8.19"
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ use tracing::{error, info, instrument};
|
|||
#[instrument]
|
||||
pub async fn expire(db: &Database) -> Result<()> {
|
||||
let id = id_generator::generate();
|
||||
let oldest_acceptable_id = id - ((24 * 60 * 60) << 48);
|
||||
let oldest_acceptable_id = id - ((24 * 60 * 60 * 1_000_000_000) << 48);
|
||||
let oldest_acceptable_id = oldest_acceptable_id.to_be_bytes();
|
||||
#[expect(clippy::panic, reason = "sqlx moment")]
|
||||
query!(
|
||||
|
|
|
@ -22,9 +22,11 @@ chrono = "0.4.38"
|
|||
eyre = "0.6.12"
|
||||
futures = "0.3.31"
|
||||
mime = "0.3.17"
|
||||
rusty_paseto = { version = "0.7.1", default-features = false, features = ["batteries_included", "v4_local"] }
|
||||
sentry-tower = { version = "0.34.0", features = ["axum", "axum-matched-path"] }
|
||||
serde = { version = "1.0.215", features = ["derive"] }
|
||||
rusty_paseto = { version = "0.7.1", default-features = false, features = [
|
||||
"batteries_included",
|
||||
"v4_local",
|
||||
] }
|
||||
sentry-tower = { version = "0.35.0", features = ["axum", "axum-matched-path"] }
|
||||
tokio = { version = "1.41.1", features = ["fs", "net"] }
|
||||
tokio-util = { version = "0.7.13", features = ["compat"] }
|
||||
tower-http = { version = "0.6.2", features = ["trace"] }
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use axum::{
|
||||
body::Body,
|
||||
extract::{Query, State},
|
||||
extract::State,
|
||||
http::{
|
||||
header::{ACCEPT, CACHE_CONTROL, CONTENT_LENGTH, CONTENT_TYPE, ETAG, IF_NONE_MATCH},
|
||||
HeaderMap, Request, StatusCode, Uri,
|
||||
|
@ -15,7 +15,6 @@ use chir_rs_misc::lexicographic_base64;
|
|||
use eyre::Context as _;
|
||||
use futures::TryStreamExt;
|
||||
use mime::MimeIter;
|
||||
use serde::Deserialize;
|
||||
use tokio_util::compat::FuturesAsyncReadCompatExt as _;
|
||||
use tracing::{debug, error, info};
|
||||
|
||||
|
|
12
flake.lock
12
flake.lock
|
@ -78,11 +78,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1733132332,
|
||||
"narHash": "sha256-8DTh3irBPko0ooHaeGJ5kPwBD8mOwiMX4eBjFuicLsA=",
|
||||
"lastModified": 1733563015,
|
||||
"narHash": "sha256-ldx4wbxT6zPzpL/XIA4ixdtQqC4STi03jq2zabxOAr8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b9ffe0d2ef589f4d75a62f908f00dfd6344b6b6e",
|
||||
"rev": "7aad7090b7bd3b5f18e1c5788f1aa35a7b2e57bc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -128,11 +128,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733106880,
|
||||
"narHash": "sha256-aJmAIjZfWfPSWSExwrYBLRgXVvgF5LP1vaeUGOOIQ98=",
|
||||
"lastModified": 1733538766,
|
||||
"narHash": "sha256-FEDfBpM82XGdHDbLDJC4lV+QXSVN1rERt1MqtBGJZds=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "e66c0d43abf5bdefb664c3583ca8994983c332ae",
|
||||
"rev": "66526479b295ad238843a8a7367d2da7ec102757",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
Loading…
Reference in a new issue