From 576e2b68fc451254e7749d41a7bc80aca73fb238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=91=D0=B0?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Wed, 6 May 2026 17:43:44 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D0=BC=D0=BF=D0=B8=D0=BB=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=D1=81=D1=8F=20=D0=BD=D0=BE=20=D0=BD=D0=B5=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.example | 34 +- Cargo.lock | 1892 ++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 7 +- out.txt | 15 + src/config.rs | 59 +- src/file_access.rs | 240 ++++++ src/main.rs | 1 + src/static/index.html | 523 +++++------- src/web.rs | 167 +++- 9 files changed, 2567 insertions(+), 371 deletions(-) create mode 100644 out.txt create mode 100644 src/file_access.rs diff --git a/.env.example b/.env.example index 34e2330..a0ce53e 100644 --- a/.env.example +++ b/.env.example @@ -19,4 +19,36 @@ TEMPLATE_DOUBLE_SRC="file:///path/to/double_team_template.aep" TEMPLATE_SINGLE_SRC="file:///path/to/single_team_template.aep" TEMPLATE_COMPOSITION="main" TEMPLATE_OUTPUT_MODULE="h264" -TEMPLATE_OUTPUT_EXT="mp4" \ No newline at end of file +TEMPLATE_OUTPUT_EXT="mp4" + +# --- Источник готовых видео (где воркер Nexrender уже сохранил файлы) --- +# Тип доступа определяется тем, какая переменная задана: +# SOURCE_LOCAL_PATH -> локальная папка +# SOURCE_SMB_URL -> SMB-шара +# SOURCE_SYNOLOGY_PATH -> папка на Synology NAS (через FileStation API) +# Должна быть указана ровно одна из них. + +# Пример локального источника: +# SOURCE_LOCAL_PATH="/mnt/rendered" + +# Пример SMB-источника (если нужен – закомментируйте LOCAL и раскомментируйте SMB): +#SOURCE_SMB_URL="smb://192.168.1.10/share/output" +#SOURCE_SMB_USER="user" +#SOURCE_SMB_PASS="pass" + +# Пример Synology-источника: +#SOURCE_SYNOLOGY_PATH="/Team Folder/output" + +# --- Приёмник (куда будут перемещены проверенные видео) --- +# Аналогично, одна из трёх переменных обязательна. + +# Пример локального приёмника: +# DESTINATION_LOCAL_PATH="/mnt/approved" + +# Пример SMB-приёмника (раскомментировать при необходимости): +#DESTINATION_SMB_URL="smb://192.168.1.20/share/final" +#DESTINATION_SMB_USER="user" +#DESTINATION_SMB_PASS="pass" + +# Пример Synology-приёмника: +#DESTINATION_SYNOLOGY_PATH="/Team Folder/final" \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 224f194..1533ce4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,10 +10,11 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "ae_anons" -version = "0.2.6" +version = "0.3.0" dependencies = [ "anyhow", "askama", + "async-trait", "axum", "bytes", "calamine", @@ -28,14 +29,51 @@ dependencies = [ "reqwest", "serde", "serde_json", + "smb", "thiserror", "tokio", "tower", "tower-http", + "url", "urlencoding", "winres", ] +[[package]] +name = "aead" +version = "0.6.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac8202ab55fcbf46ca829833f347a82a2a4ce0596f0304ac322c2d100030cd56" +dependencies = [ + "crypto-common 0.2.0-rc.4", + "inout", +] + +[[package]] +name = "aes" +version = "0.9.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e713c57c2a2b19159e7be83b9194600d7e8eb3b7c2cd67e671adf47ce189a05" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.11.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0686ba04dc80c816104c96cd7782b748f6ad58c5dd4ee619ff3258cf68e83d54" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + [[package]] name = "aho-corasick" version = "1.1.4" @@ -119,6 +157,12 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "array-init" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" + [[package]] name = "askama" version = "0.15.6" @@ -146,7 +190,7 @@ dependencies = [ "rustc-hash", "serde", "serde_derive", - "syn", + "syn 2.0.117", ] [[package]] @@ -171,6 +215,47 @@ dependencies = [ "winnow", ] +[[package]] +name = "async-dnssd" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d49ffe175ab45bbfd74b548313d9d7cdfff27161a94b007b52eeeb5f9aaa15e" +dependencies = [ + "bitflags 1.3.2", + "futures-channel", + "futures-core", + "futures-executor", + "futures-util", + "libc", + "log", + "pin-utils", + "pkg-config", + "tokio", + "winapi", +] + +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -235,12 +320,30 @@ dependencies = [ "tracing", ] +[[package]] +name = "base16ct" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8b59d472eab27ade8d770dcb11da7201c11234bef9f82ce7aa517be028d462b" + +[[package]] +name = "base16ct" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd307490d624467aa6f74b0eabb77633d1f758a7b25f12bceb0b22e08d9726f6" + [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + [[package]] name = "basic-toml" version = "0.1.10" @@ -250,18 +353,81 @@ dependencies = [ "serde", ] +[[package]] +name = "binrw" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d53195f985e88ab94d1cc87e80049dd2929fd39e4a772c5ae96a7e5c4aad3642" +dependencies = [ + "array-init", + "binrw_derive", + "bytemuck", +] + +[[package]] +name = "binrw_derive" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5910da05ee556b789032c8ff5a61fb99239580aa3fd0bfaa8f4d094b2aee00ad" +dependencies = [ + "either", + "owo-colors", + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + [[package]] name = "bitflags" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.11.0-rc.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9ef36a6fcdb072aa548f3da057640ec10859eb4e91ddf526ee648d50c76a949" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "block-padding" +version = "0.4.0-rc.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e59c1aab3e6c5e56afe1b7e8650be9b5a791cb997bdea449194ae62e4bf8c73" +dependencies = [ + "hybrid-array", +] + [[package]] name = "bumpalo" version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + [[package]] name = "byteorder" version = "1.5.0" @@ -289,6 +455,15 @@ dependencies = [ "zip", ] +[[package]] +name = "cbc" +version = "0.2.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dbf9e5b071e9de872e32b73f485e8f644ff47c7011d95476733e7482ee3e5c3" +dependencies = [ + "cipher", +] + [[package]] name = "cc" version = "1.2.60" @@ -299,12 +474,30 @@ dependencies = [ "shlex", ] +[[package]] +name = "ccm" +version = "0.6.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a49680966b1cae2a239dd94d11bac423894ee4e00dacea1c50e8673e26a9829f" +dependencies = [ + "aead", + "cipher", + "ctr", + "subtle", +] + [[package]] name = "cfg-if" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.44" @@ -318,6 +511,17 @@ dependencies = [ "windows-link", ] +[[package]] +name = "cipher" +version = "0.5.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e12a13eb01ded5d32ee9658d94f553a19e804204f2dc811df69ab4d9e0cb8c7" +dependencies = [ + "block-buffer 0.11.0-rc.5", + "crypto-common 0.2.0-rc.4", + "inout", +] + [[package]] name = "clap" version = "4.6.1" @@ -349,7 +553,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -358,6 +562,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" +[[package]] +name = "cmac" +version = "0.8.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2fa99ca412f76b4656efeab943ef06f1ddd8036c31ca38f35188f173d0dc85e" +dependencies = [ + "cipher", + "dbl", + "digest 0.11.0-rc.3", +] + [[package]] name = "codepage" version = "0.1.2" @@ -373,6 +588,12 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + [[package]] name = "core-foundation" version = "0.9.4" @@ -399,6 +620,15 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.5.0" @@ -414,6 +644,126 @@ version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +[[package]] +name = "crypto-bigint" +version = "0.7.0-rc.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4113edbc9f68c0a64d5b911f803eb245d04bb812680fd56776411f69c670f3e0" +dependencies = [ + "hybrid-array", + "num-traits", + "rand_core 0.9.5", + "serdect", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-common" +version = "0.2.0-rc.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8235645834fbc6832939736ce2f2d08192652269e11010a6240f61b908a1c6" +dependencies = [ + "hybrid-array", + "rand_core 0.9.5", +] + +[[package]] +name = "crypto-mac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "crypto-primes" +version = "0.7.0-pre.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25f2523fbb68811c8710829417ad488086720a6349e337c38d12fa81e09e50bf" +dependencies = [ + "crypto-bigint", + "libm", + "rand_core 0.9.5", +] + +[[package]] +name = "ctr" +version = "0.10.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27e41d01c6f73b9330177f5cf782ae5b581b5f2c7840e298e0275ceee5001434" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "5.0.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f9200d1d13637f15a6acb71e758f64624048d85b31a5fdbfd8eca1e2687d0b7" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.11.0-rc.3", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "dbl" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d7a944e61df464668c5f51f56cc667396a8821434273112948ea0b66e405d7" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "der" +version = "0.8.0-rc.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d8dd2f26c86b27a2a8ea2767ec7f9df7a89516e4794e54ac01ee618dda3aa4" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", +] + [[package]] name = "derive_arbitrary" version = "1.4.2" @@ -422,7 +772,38 @@ checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", +] + +[[package]] +name = "des" +version = "0.9.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f51594a70805988feb1c85495ddec0c2052e4fbe59d9c0bb7f94bfc164f4f90" +dependencies = [ + "cipher", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common 0.1.7", +] + +[[package]] +name = "digest" +version = "0.11.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac89f8a64533a9b0eaa73a68e424db0fb1fd6271c74cc0125336a05f090568d" +dependencies = [ + "block-buffer 0.11.0-rc.5", + "const-oid", + "crypto-common 0.2.0-rc.4", + "subtle", ] [[package]] @@ -433,7 +814,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -442,6 +823,73 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +[[package]] +name = "ecdsa" +version = "0.17.0-rc.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ab355ec063f7a110eb627471058093aba00eb7f4e70afbd15e696b79d1077b" +dependencies = [ + "der", + "digest 0.11.0-rc.3", + "elliptic-curve", + "rfc6979", + "signature", + "spki", + "zeroize", +] + +[[package]] +name = "ed25519" +version = "3.0.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef49c0b20c0ad088893ad2a790a29c06a012b3f05bcfc66661fd22a94b32129" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "3.0.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad207ed88a133091f83224265eac21109930db09bedcad05d5252f2af2de20a1" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core 0.9.5", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.14.0-rc.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e3be87c458d756141f3b6ee188828132743bf90c7d14843e2835d6443e5fb03" +dependencies = [ + "base16ct 0.3.0", + "crypto-bigint", + "digest 0.11.0-rc.3", + "ff", + "group", + "hkdf", + "hybrid-array", + "once_cell", + "pem-rfc7468", + "pkcs8", + "rand_core 0.9.5", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "encoding_rs" version = "0.8.35" @@ -496,6 +944,22 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" +[[package]] +name = "ff" +version = "0.14.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d42dd26f5790eda47c1a2158ea4120e32c35ddc9a7743c98a292accc01b54ef3" +dependencies = [ + "rand_core 0.9.5", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64cd1e32ddd350061ae6edb1b082d7c54915b5c672c389143b9a63403a109f24" + [[package]] name = "find-msvc-tools" version = "0.1.9" @@ -518,6 +982,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -598,7 +1068,7 @@ checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -630,6 +1100,16 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.2.17" @@ -637,8 +1117,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -648,9 +1130,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", + "js-sys", "libc", - "r-efi", + "r-efi 5.3.0", "wasip2", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + +[[package]] +name = "ghash" +version = "0.6.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f88107cb02ed63adcc4282942e60c4d09d80208d33b360ce7c729ce6dae1739" +dependencies = [ + "polyval", +] + +[[package]] +name = "group" +version = "0.14.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ff6a0b2dd4b981b1ae9e3e6830ab146771f3660d31d57bafd9018805a91b0f1" +dependencies = [ + "ff", + "rand_core 0.9.5", + "subtle", ] [[package]] @@ -672,6 +1189,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + [[package]] name = "hashbrown" version = "0.17.0" @@ -684,6 +1210,30 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.13.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8ef30358b03ca095a5b910547f4f8d4b9f163e4057669c5233ef595b1ecf008" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.13.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3fd4dc94c318c1ede8a2a48341c250d6ddecd3ba793da2820301a9f92417ad9" +dependencies = [ + "digest 0.11.0-rc.3", +] + [[package]] name = "http" version = "1.4.0" @@ -735,6 +1285,17 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "hybrid-array" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d46837a0ed51fe95bd3b05de33cd64a1ee88fc797477ca48446872504507c5" +dependencies = [ + "subtle", + "typenum", + "zeroize", +] + [[package]] name = "hyper" version = "1.9.0" @@ -767,6 +1328,7 @@ dependencies = [ "hyper", "hyper-util", "rustls", + "rustls-native-certs", "tokio", "tokio-rustls", "tower-service", @@ -919,6 +1481,12 @@ dependencies = [ "zerovec", ] +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + [[package]] name = "idna" version = "1.1.0" @@ -947,7 +1515,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.17.0", + "serde", + "serde_core", +] + +[[package]] +name = "inout" +version = "0.2.0-rc.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1603f76010ff924b616c8f44815a42eb10fb0b93d308b41deaa8da6d4251fd4b" +dependencies = [ + "block-padding", + "hybrid-array", ] [[package]] @@ -999,7 +1579,7 @@ checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1014,12 +1594,42 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "kbkdf" +version = "0.1.0-pre.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e97e1f9b50adafd503518a832b24241dca1d319bfc27e9e708bcf220b0b25419" +dependencies = [ + "digest 0.11.0-rc.3", +] + +[[package]] +name = "keccak" +version = "0.2.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d546793a04a1d3049bd192856f804cfe96356e2cf36b54b4e575155babe9f41" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "libc" version = "0.2.185" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -1047,12 +1657,54 @@ version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "lz4_flex" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373f5eceeeab7925e0c1098212f2fbc4d416adec9d35051a6ab251e824c1854a" + [[package]] name = "matchit" version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" +[[package]] +name = "maybe-async" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "md-5" +version = "0.11.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9ec86664728010f574d67ef01aec964e6f1299241a3402857c1a8a390a62478" +dependencies = [ + "cfg-if", + "digest 0.11.0-rc.3", +] + +[[package]] +name = "md4" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da5ac363534dce5fabf69949225e174fbf111a498bf0ff794c8ea1fba9f3dda" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "memchr" version = "2.8.0" @@ -1096,6 +1748,27 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "modular-bitfield" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a53d79ba8304ac1c4f9eb3b9d281f21f7be9d4626f72ce7df4ad8fbde4f38a74" +dependencies = [ + "modular-bitfield-impl", + "static_assertions", +] + +[[package]] +name = "modular-bitfield-impl" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "native-tls" version = "0.2.18" @@ -1113,6 +1786,23 @@ dependencies = [ "tempfile", ] +[[package]] +name = "num-conv" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -1122,6 +1812,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "oid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c19903c598813dba001b53beeae59bb77ad4892c5c1b9b3500ce4293a0d06c2" +dependencies = [ + "serde", +] + [[package]] name = "once_cell" version = "1.21.4" @@ -1140,7 +1839,7 @@ version = "0.10.77" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfe4646e360ec77dff7dde40ed3d6c5fee52d156ef4a62f53973d38294dad87f" dependencies = [ - "bitflags", + "bitflags 2.11.0", "cfg-if", "foreign-types", "libc", @@ -1157,7 +1856,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1188,6 +1887,54 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "owo-colors" +version = "4.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d211803b9b6b570f68772237e415a029d5a50c65d382910b879fb19d3271f94d" + +[[package]] +name = "p256" +version = "0.14.0-pre.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81b374901df34ee468167a58e2a49e468cb059868479cafebeb804f6b855423d" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primefield", + "primeorder", + "sha2", +] + +[[package]] +name = "p384" +version = "0.14.0-pre.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "701032b3730df6b882496d6cee8221de0ce4bc11ddc64e6d89784aa5b8a6de30" +dependencies = [ + "ecdsa", + "elliptic-curve", + "fiat-crypto", + "primefield", + "primeorder", + "sha2", +] + +[[package]] +name = "p521" +version = "0.14.0-pre.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ba29c2906eb5c89a8c411c4f11243ee4e5517ee7d71d9a13fedc877a6057b1" +dependencies = [ + "base16ct 0.3.0", + "ecdsa", + "elliptic-curve", + "primefield", + "primeorder", + "rand_core 0.9.5", + "sha2", +] + [[package]] name = "parking_lot" version = "0.12.5" @@ -1211,24 +1958,210 @@ dependencies = [ "windows-link", ] +[[package]] +name = "pastey" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35fb2e5f958ec131621fdd531e9fc186ed768cbe395337403ae56c17a74c68ec" + +[[package]] +name = "pbkdf2" +version = "0.13.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3fc18bb4460ac250ba6b75dfa7cf9d0b2273e3e623f660bd6ce2c3e902342e" +dependencies = [ + "digest 0.11.0-rc.3", + "hmac", + "sha1", +] + +[[package]] +name = "pem-rfc7468" +version = "1.0.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e58fab693c712c0d4e88f8eb3087b6521d060bcaf76aeb20cb192d809115ba" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" +[[package]] +name = "picky" +version = "7.0.0-rc.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cdc52be663aebd70d7006ae305c87eb32a2b836d6c2f26f7e384f845d80b621" +dependencies = [ + "base64", + "block-buffer 0.11.0-rc.5", + "block-padding", + "crypto-bigint", + "crypto-common 0.2.0-rc.4", + "crypto-primes", + "curve25519-dalek", + "der", + "digest 0.11.0-rc.3", + "ecdsa", + "ed25519", + "ed25519-dalek", + "elliptic-curve", + "ff", + "group", + "hex", + "hkdf", + "inout", + "keccak", + "md-5", + "p256", + "p384", + "p521", + "pem-rfc7468", + "picky-asn1", + "picky-asn1-der", + "picky-asn1-x509", + "pkcs1", + "pkcs8", + "primefield", + "primeorder", + "rand 0.9.4", + "rand_core 0.9.5", + "rfc6979", + "rsa", + "sec1", + "serde", + "sha1", + "sha2", + "sha3", + "signature", + "spki", + "thiserror", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "picky-asn1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ff038f9360b934342fb3c0a1d6e82c438a2624b51c3c6e3e6d7cf252b6f3ee3" +dependencies = [ + "oid", + "serde", + "serde_bytes", + "time", + "zeroize", +] + +[[package]] +name = "picky-asn1-der" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d413165e4bf7f808b9a27cbaba657657a2921f0965db833f488c4d4be96dcd2e" +dependencies = [ + "picky-asn1", + "serde", + "serde_bytes", +] + +[[package]] +name = "picky-asn1-x509" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c97cd14d567a17755910fa8718277baf39d08682a980b1b1a4b4da7d0bc61a04" +dependencies = [ + "base64", + "crypto-bigint", + "oid", + "picky-asn1", + "picky-asn1-der", + "serde", + "widestring", + "zeroize", +] + +[[package]] +name = "picky-krb" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed61c8d7448649c031ecae02afb10c679524c7a9af5fb0fbee466b3cc0d6df1" +dependencies = [ + "aes", + "block-buffer 0.11.0-rc.5", + "block-padding", + "byteorder", + "cbc", + "cipher", + "crypto-bigint", + "crypto-common 0.2.0-rc.4", + "des", + "digest 0.11.0-rc.3", + "hmac", + "inout", + "oid", + "pbkdf2", + "picky-asn1", + "picky-asn1-der", + "picky-asn1-x509", + "rand 0.9.4", + "serde", + "sha1", + "thiserror", + "uuid", +] + [[package]] name = "pin-project-lite" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs1" +version = "0.8.0-rc.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "986d2e952779af96ea048f160fd9194e1751b4faea78bcf3ceb456efe008088e" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.11.0-rc.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93eac55f10aceed84769df670ea4a32d2ffad7399400d41ee1c13b1cd8e1b478" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" +[[package]] +name = "polyval" +version = "0.7.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffd40cc99d0fbb02b4b3771346b811df94194bc103983efa0203c8893755085" +dependencies = [ + "cfg-if", + "cpufeatures", + "universal-hash", +] + [[package]] name = "portable-atomic" version = "1.13.1" @@ -1253,6 +2186,53 @@ dependencies = [ "zerovec", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.117", +] + +[[package]] +name = "primefield" +version = "0.14.0-pre.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7fcd4a163053332fd93f39b81c133e96a98567660981654579c90a99062fbf5" +dependencies = [ + "crypto-bigint", + "ff", + "rand_core 0.9.5", + "subtle", + "zeroize", +] + +[[package]] +name = "primeorder" +version = "0.14.0-pre.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c36e8766fcd270fa9c665b9dc364f570695f5a59240949441b077a397f15b74" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "proc-macro2" version = "1.0.106" @@ -1272,6 +2252,61 @@ dependencies = [ "memchr", ] +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "bytes", + "getrandom 0.3.4", + "lru-slab", + "rand 0.9.4", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.45" @@ -1287,13 +2322,78 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.5", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + [[package]] name = "redox_syscall" version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags", + "bitflags 2.11.0", ] [[package]] @@ -1334,6 +2434,7 @@ dependencies = [ "base64", "bytes", "encoding_rs", + "futures-channel", "futures-core", "futures-util", "h2", @@ -1351,6 +2452,9 @@ dependencies = [ "native-tls", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", + "rustls-native-certs", "rustls-pki-types", "serde", "serde_json", @@ -1358,6 +2462,7 @@ dependencies = [ "sync_wrapper", "tokio", "tokio-native-tls", + "tokio-rustls", "tokio-util", "tower", "tower-http", @@ -1369,6 +2474,16 @@ dependencies = [ "web-sys", ] +[[package]] +name = "rfc6979" +version = "0.5.0-rc.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d369f9c4f79388704648e7bcb92749c0d6cf4397039293a9b747694fa4fb4bae" +dependencies = [ + "hmac", + "subtle", +] + [[package]] name = "ring" version = "0.17.14" @@ -1383,19 +2498,48 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rsa" +version = "0.10.0-rc.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf8955ab399f6426998fde6b76ae27233cce950705e758a6c17afd2f6d0e5d52" +dependencies = [ + "const-oid", + "crypto-bigint", + "crypto-primes", + "digest 0.11.0-rc.3", + "pkcs1", + "pkcs8", + "rand_core 0.9.5", + "sha1", + "signature", + "spki", + "subtle", + "zeroize", +] + [[package]] name = "rustc-hash" version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + [[package]] name = "rustix" version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags", + "bitflags 2.11.0", "errno", "libc", "linux-raw-sys", @@ -1408,19 +2552,34 @@ version = "0.23.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f9466fb2c14ea04357e91413efb882e2a6d4a406e625449bc0a5d360d53a21" dependencies = [ + "log", "once_cell", + "ring", "rustls-pki-types", "rustls-webpki", "subtle", "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pki-types" version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ + "web-time", "zeroize", ] @@ -1462,13 +2621,26 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sec1" +version = "0.8.0-rc.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dff52f6118bc9f0ac974a54a639d499ac26a6cad7a6e39bc0990c19625e793b" +dependencies = [ + "base16ct 0.3.0", + "der", + "hybrid-array", + "subtle", + "zeroize", +] + [[package]] name = "security-framework" version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags", + "bitflags 2.11.0", "core-foundation 0.10.1", "core-foundation-sys", "libc", @@ -1485,6 +2657,12 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + [[package]] name = "serde" version = "1.0.228" @@ -1495,6 +2673,16 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde_bytes" +version = "0.11.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" +dependencies = [ + "serde", + "serde_core", +] + [[package]] name = "serde_core" version = "1.0.228" @@ -1512,7 +2700,7 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1551,6 +2739,48 @@ dependencies = [ "serde", ] +[[package]] +name = "serdect" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66cf8fedced2fcf12406bcb34223dffb92eaf34908ede12fed414c82b7f00b3e" +dependencies = [ + "base16ct 1.0.0", + "serde", +] + +[[package]] +name = "sha1" +version = "0.11.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e046edf639aa2e7afb285589e5405de2ef7e61d4b0ac1e30256e3eab911af9" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.11.0-rc.3", +] + +[[package]] +name = "sha2" +version = "0.11.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1e3878ab0f98e35b2df35fe53201d088299b41a6bb63e3e34dada2ac4abd924" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.11.0-rc.3", +] + +[[package]] +name = "sha3" +version = "0.11.0-rc.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2103ca0e6f4e9505eae906de5e5883e06fc3b2232fb5d6914890c7bbcb62f478" +dependencies = [ + "digest 0.11.0-rc.3", + "keccak", +] + [[package]] name = "shlex" version = "1.3.0" @@ -1567,6 +2797,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "3.0.0-rc.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc280a6ff65c79fbd6622f64d7127f32b85563bca8c53cd2e9141d6744a9056d" +dependencies = [ + "digest 0.11.0-rc.3", + "rand_core 0.9.5", +] + [[package]] name = "simd-adler32" version = "0.3.9" @@ -1585,6 +2825,146 @@ version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +[[package]] +name = "smb" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c12ddf75029c02180237fa98948bd3dea72647c08bd7d1b5fa4923491764100" +dependencies = [ + "aead", + "aes", + "aes-gcm", + "binrw", + "ccm", + "cmac", + "crypto-common 0.2.0-rc.4", + "futures", + "futures-core", + "futures-util", + "hmac", + "kbkdf", + "log", + "lz4_flex", + "maybe-async", + "modular-bitfield", + "pastey", + "rand 0.8.6", + "sha2", + "smb-dtyp", + "smb-fscc", + "smb-msg", + "smb-rpc", + "smb-transport", + "sspi", + "thiserror", + "time", + "tokio", + "tokio-stream", + "tokio-util", + "url", +] + +[[package]] +name = "smb-dtyp" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11e11570063587382275297db37dd686360fcc109d22a8d655846dc93bf4a71a" +dependencies = [ + "binrw", + "modular-bitfield", + "pastey", + "rand 0.8.6", + "smb-dtyp-derive", + "time", +] + +[[package]] +name = "smb-dtyp-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12fcc3a1d02a6b5a78a0380adcc9218a65bbdee515d4f60b9c90566611ef5ec8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "smb-fscc" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07ff4559d37f9c3e6b56fffa1a359a6f151337b18b9d0218161488a4a7e15685" +dependencies = [ + "binrw", + "modular-bitfield", + "pastey", + "smb-dtyp", + "thiserror", + "time", +] + +[[package]] +name = "smb-msg" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87b761115473b9af471c06b28e1d26b16602c97ae315c8d325b2418dedb992bf" +dependencies = [ + "binrw", + "modular-bitfield", + "pastey", + "smb-dtyp", + "smb-fscc", + "smb-msg-derive", + "thiserror", + "time", +] + +[[package]] +name = "smb-msg-derive" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae33ff90211b548f0ff248b511eada2623ba1693d388c363e48003a5a6be5991" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + +[[package]] +name = "smb-rpc" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "352732178153ef2379552a09cd5319fc4ce49a0837576e87eb9ac36652330a46" +dependencies = [ + "binrw", + "maybe-async", + "modular-bitfield", + "pastey", + "smb-dtyp", + "thiserror", + "time", +] + +[[package]] +name = "smb-transport" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "383209d094590c95b748cf20e79e5216ec8cf458486c0253c3610dd2c36d435d" +dependencies = [ + "binrw", + "futures-core", + "futures-util", + "log", + "maybe-async", + "modular-bitfield", + "pastey", + "smb-dtyp", + "thiserror", + "time", + "tokio", + "tokio-util", +] + [[package]] name = "socket2" version = "0.6.3" @@ -1595,12 +2975,90 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "spki" +version = "0.8.0-rc.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8baeff88f34ed0691978ec34440140e1572b68c7dd4a495fd14a3dc1944daa80" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sspi" +version = "0.18.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2f4823ee743a4a0cc2153eb640e28ff95b55ca25c88085b559bae59fb6c317a" +dependencies = [ + "async-dnssd", + "async-recursion", + "bitflags 2.11.0", + "block-buffer 0.11.0-rc.5", + "byteorder", + "cfg-if", + "crypto-bigint", + "crypto-common 0.2.0-rc.4", + "crypto-mac", + "crypto-primes", + "curve25519-dalek", + "der", + "digest 0.11.0-rc.3", + "ed25519-dalek", + "ff", + "futures", + "getrandom 0.3.4", + "group", + "hmac", + "md-5", + "md4", + "num-derive", + "num-traits", + "oid", + "p256", + "p384", + "p521", + "pem-rfc7468", + "picky", + "picky-asn1", + "picky-asn1-der", + "picky-asn1-x509", + "picky-krb", + "pkcs1", + "pkcs8", + "primefield", + "primeorder", + "rand 0.9.4", + "reqwest", + "rsa", + "rustls", + "serde", + "sha1", + "sha2", + "signature", + "spki", + "time", + "tokio", + "tracing", + "url", + "uuid", + "windows", + "windows-registry", + "zeroize", +] + [[package]] name = "stable_deref_trait" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.11.1" @@ -1613,6 +3071,17 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.117" @@ -1641,7 +3110,7 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1650,7 +3119,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ - "bitflags", + "bitflags 2.11.0", "core-foundation 0.9.4", "system-configuration-sys", ] @@ -1672,7 +3141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.2", "once_cell", "rustix", "windows-sys 0.61.2", @@ -1695,7 +3164,38 @@ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "js-sys", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", ] [[package]] @@ -1708,6 +3208,21 @@ dependencies = [ "zerovec", ] +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" version = "1.52.0" @@ -1733,7 +3248,7 @@ checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -1756,6 +3271,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.18" @@ -1800,7 +3326,7 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ - "bitflags", + "bitflags 2.11.0", "bytes", "futures-core", "futures-util", @@ -1842,9 +3368,21 @@ checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "tracing-core" version = "0.1.36" @@ -1860,6 +3398,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "typenum" +version = "1.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ce102ab67701b8526c123c1bab5cbe42d7040ccfd0f64af1a385808d2f43de" + [[package]] name = "unicase" version = "2.9.0" @@ -1872,6 +3416,22 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "universal-hash" +version = "0.6.0-rc.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55be643b40a21558f44806b53ee9319595bc7ca6896372e4e08e5d7d83c9cd6" +dependencies = [ + "crypto-common 0.2.0-rc.4", + "subtle", +] + [[package]] name = "untrusted" version = "0.9.0" @@ -1908,12 +3468,30 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "uuid" +version = "1.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd74a9687298c6858e9b88ec8935ec45d22e8fd5e6394fa1bd4e99a87789c76" +dependencies = [ + "getrandom 0.4.2", + "js-sys", + "serde_core", + "wasm-bindgen", +] + [[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + [[package]] name = "want" version = "0.3.1" @@ -1938,6 +3516,15 @@ dependencies = [ "wit-bindgen", ] +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + [[package]] name = "wasm-bindgen" version = "0.2.118" @@ -1980,7 +3567,7 @@ dependencies = [ "bumpalo", "proc-macro2", "quote", - "syn", + "syn 2.0.117", "wasm-bindgen-shared", ] @@ -1993,6 +3580,28 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + [[package]] name = "wasm-streams" version = "0.4.2" @@ -2006,6 +3615,18 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags 2.11.0", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + [[package]] name = "web-sys" version = "0.3.95" @@ -2016,6 +3637,65 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "widestring" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72069c3113ab32ab29e5584db3c6ec55d416895e60715417b5b883a357c3e471" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.62.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" +dependencies = [ + "windows-collections", + "windows-core", + "windows-future", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" +dependencies = [ + "windows-core", +] + [[package]] name = "windows-core" version = "0.62.2" @@ -2029,6 +3709,17 @@ dependencies = [ "windows-strings", ] +[[package]] +name = "windows-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" +dependencies = [ + "windows-core", + "windows-link", + "windows-threading", +] + [[package]] name = "windows-implement" version = "0.60.2" @@ -2037,7 +3728,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -2048,7 +3739,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] @@ -2057,6 +3748,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" +[[package]] +name = "windows-numerics" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" +dependencies = [ + "windows-core", + "windows-link", +] + [[package]] name = "windows-registry" version = "0.6.1" @@ -2120,6 +3821,15 @@ dependencies = [ "windows_x86_64_msvc", ] +[[package]] +name = "windows-threading" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" +dependencies = [ + "windows-link", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -2191,6 +3901,88 @@ name = "wit-bindgen" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn 2.0.117", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.117", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags 2.11.0", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] [[package]] name = "writeable" @@ -2198,6 +3990,18 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" +[[package]] +name = "x25519-dalek" +version = "3.0.0-pre.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a45998121837fd8c92655d2334aa8f3e5ef0645cdfda5b321b13760c548fd55" +dependencies = [ + "curve25519-dalek", + "rand_core 0.9.5", + "serde", + "zeroize", +] + [[package]] name = "yoke" version = "0.8.2" @@ -2217,10 +4021,30 @@ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", "synstructure", ] +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "zerofrom" version = "0.1.7" @@ -2238,7 +4062,7 @@ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", "synstructure", ] @@ -2247,6 +4071,20 @@ name = "zeroize" version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.117", +] [[package]] name = "zerotrie" @@ -2278,7 +4116,7 @@ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.117", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 18f7965..01a93eb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ae_anons" -version = "0.2.6" +version = "0.3.0" edition = "2021" license = "MIT" authors = ["Alexey Barabanov "] @@ -26,6 +26,9 @@ anyhow = "1.0" log = "0.4" env_logger = "0.11" bytes = "1.9" +smb = { version = "0.11.2", features = ["async"] } +async-trait = "0.1" +url = "2" # Web server (updated to latest stable versions) axum = "0.8.9" @@ -50,4 +53,4 @@ codegen-units = 1 strip = true [build-dependencies] -winres = "0.1" \ No newline at end of file +winres = "0.1" diff --git a/out.txt b/out.txt new file mode 100644 index 0000000..a7cb3ad --- /dev/null +++ b/out.txt @@ -0,0 +1,15 @@ + Compiling ae_anons v0.2.6 (/Users/Lexx/Code/RUST/AE_Anons) +warning: field `smb_domain` is never read + --> src/config.rs:18:9 + | +12 | pub struct AccessConfig { + | ------------ field in this struct +... +18 | pub smb_domain: Option, + | ^^^^^^^^^^ + | + = note: `AccessConfig` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis + = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default + +warning: `ae_anons` (bin "ae_anons") generated 1 warning + Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.42s diff --git a/src/config.rs b/src/config.rs index 1e9ed38..9d46527 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,55 @@ use anyhow::{Context, Result}; use std::env; +#[derive(Debug, Clone)] +pub enum AccessType { + Local, + Smb, + Synology, +} + +#[derive(Debug, Clone)] +pub struct AccessConfig { + pub access_type: AccessType, + pub local_path: Option, + pub smb_url: Option, + pub smb_user: Option, + pub smb_pass: Option, + pub synology_path: Option, +} + +impl AccessConfig { + fn from_env(prefix: &str) -> Result { + let local_path = env::var(format!("{}_LOCAL_PATH", prefix)).ok(); + let smb_url = env::var(format!("{}_SMB_URL", prefix)).ok(); + let synology_path = env::var(format!("{}_SYNOLOGY_PATH", prefix)).ok(); + + let access_type = if local_path.is_some() && smb_url.is_none() && synology_path.is_none() { + AccessType::Local + } else if smb_url.is_some() && local_path.is_none() && synology_path.is_none() { + AccessType::Smb + } else if synology_path.is_some() && local_path.is_none() && smb_url.is_none() { + AccessType::Synology + } else { + anyhow::bail!( + "Exactly one of {}_LOCAL_PATH, {}_SMB_URL, {}_SYNOLOGY_PATH must be set", + prefix, + prefix, + prefix + ); + }; + + Ok(AccessConfig { + access_type, + local_path, + smb_url, + smb_user: env::var(format!("{}_SMB_USER", prefix)).ok(), + smb_pass: env::var(format!("{}_SMB_PASS", prefix)).ok(), + synology_path, + }) + } +} + #[derive(Debug, Clone)] pub struct Config { // Synology @@ -11,14 +60,18 @@ pub struct Config { // Nexrender pub nexrender_api_url: String, pub output_folder: String, - // Templates (all required) + // Templates pub template_double_src: String, pub template_single_src: String, pub template_composition: String, pub template_output_module: String, pub template_output_ext: String, - //web_serwer + // Web server pub web_port: u16, + // Source (where rendered videos appear) + pub source: AccessConfig, + // Destination (where to move approved videos) + pub destination: AccessConfig, } impl Config { @@ -45,6 +98,8 @@ impl Config { .unwrap_or_else(|_| "3000".to_string()) .parse() .context("Invalid WEB_PORT")?, + source: AccessConfig::from_env("SOURCE")?, + destination: AccessConfig::from_env("DESTINATION")?, }) } } diff --git a/src/file_access.rs b/src/file_access.rs new file mode 100644 index 0000000..ab56e86 --- /dev/null +++ b/src/file_access.rs @@ -0,0 +1,240 @@ +use anyhow::{anyhow, Context, Result}; +use async_trait::async_trait; +use smb::{ + resource::GetLen, Client, ClientConfig, CreateOptions, FileAccessMask, FileAttributes, + FileCreateArgs, ReadAt, UncPath, WriteAt, +}; +use std::str::FromStr; +use url::Url; + +/// smb://server/share/path → \\server\share[\path...] +fn smb_url_to_unc(url_str: &str) -> Result { + let url = Url::parse(url_str).context("Invalid SMB URL")?; + let host = url + .host_str() + .ok_or_else(|| anyhow!("No host in SMB URL"))?; + let path_segments: Vec<&str> = url.path().trim_matches('/').split('/').collect(); + let share = path_segments.first().cloned().unwrap_or("IPC$"); + let base = UncPath::from_str(&format!("\\\\{}\\{}", host, share)) + .map_err(|e| anyhow!("Invalid UNC: {}", e))?; + let mut full = base.clone(); + for &segment in path_segments.iter().skip(1) { + if !segment.is_empty() { + full = full.with_path(segment); + } + } + Ok(full) +} + +// ---------- Универсальный трейт ---------- + +#[async_trait] +pub trait FileAccess: Send + Sync { + async fn list_files(&self) -> Result>; + async fn read_file(&self, filename: &str) -> Result>; + async fn write_file(&self, filename: &str, data: &[u8]) -> Result<()>; + async fn delete_file(&self, filename: &str) -> Result<()>; +} + +// ---------- Локальная файловая система ---------- + +pub struct LocalFileAccess { + base_path: String, +} + +impl LocalFileAccess { + pub fn new(base_path: &str) -> Self { + Self { + base_path: base_path.to_string(), + } + } + + fn full_path(&self, filename: &str) -> String { + format!("{}/{}", self.base_path, filename) + } +} + +#[async_trait] +impl FileAccess for LocalFileAccess { + async fn list_files(&self) -> Result> { + let mut files = Vec::new(); + let mut entries = tokio::fs::read_dir(&self.base_path).await?; + while let Some(entry) = entries.next_entry().await? { + if entry.file_type().await?.is_file() { + if let Some(name) = entry.file_name().to_str() { + files.push(name.to_string()); + } + } + } + Ok(files) + } + + async fn read_file(&self, filename: &str) -> Result> { + let path = self.full_path(filename); + tokio::fs::read(&path).await.map_err(Into::into) + } + + async fn write_file(&self, filename: &str, data: &[u8]) -> Result<()> { + let path = self.full_path(filename); + tokio::fs::write(&path, data).await.map_err(Into::into) + } + + async fn delete_file(&self, filename: &str) -> Result<()> { + let path = self.full_path(filename); + tokio::fs::remove_file(&path).await.map_err(Into::into) + } +} + +// ---------- SMB ---------- + +#[derive(Clone)] +pub struct SmbAccessConfig { + pub url: String, + pub user: Option, + pub password: Option, +} + +pub struct SmbFileAccess { + config: SmbAccessConfig, +} + +impl SmbFileAccess { + pub fn new(config: SmbAccessConfig) -> Self { + Self { config } + } + + async fn connect(&self) -> Result<(Client, UncPath)> { + let base_unc = smb_url_to_unc(&self.config.url)?; + let client = Client::new(ClientConfig::default()); + + if let (Some(user), Some(pass)) = (&self.config.user, &self.config.password) { + client.share_connect(&base_unc, user, pass.clone()).await?; + } else { + client.share_connect(&base_unc, "", "".to_string()).await?; + } + Ok((client, base_unc)) + } + + fn full_unc_path(&self, base: &UncPath, filename: &str) -> UncPath { + let segments: Vec<&str> = filename.split('/').filter(|s| !s.is_empty()).collect(); + let mut path = base.clone(); + for seg in segments { + path = path.with_path(seg); + } + path + } +} + +#[async_trait] +impl FileAccess for SmbFileAccess { + async fn list_files(&self) -> Result> { + // SMB list directory пока не реализован в текущем API, + // оставим заглушку для будущей доработки + Ok(Vec::new()) + } + + async fn read_file(&self, filename: &str) -> Result> { + let (client, base_unc) = self.connect().await?; + let file_path = self.full_unc_path(&base_unc, filename); + + let args = + FileCreateArgs::make_open_existing(FileAccessMask::new().with_generic_read(true)); + let resource = client.create_file(&file_path, &args).await?; + let file = resource.unwrap_file(); + + let file_size = file.get_len().await? as usize; + let mut buf = vec![0u8; file_size]; + let bytes_read = file.read_at(&mut buf, 0).await?; + buf.truncate(bytes_read); + + file.close().await?; + Ok(buf) + } + + async fn write_file(&self, filename: &str, data: &[u8]) -> Result<()> { + let (client, base_unc) = self.connect().await?; + let file_path = self.full_unc_path(&base_unc, filename); + + let args = + FileCreateArgs::make_overwrite(FileAttributes::default(), CreateOptions::default()); + let resource = client.create_file(&file_path, &args).await?; + let remote_file = resource.unwrap_file(); + + remote_file.write_at(data, 0).await?; + remote_file.close().await?; + Ok(()) + } + + async fn delete_file(&self, _filename: &str) -> Result<()> { + // Удаление будет добавлено позже + Err(anyhow!("Delete not yet implemented for SMB")) + } +} + +// ---------- Synology ---------- + +pub struct SynologyFileAccess { + client: crate::synology::SynologyClient, + base_path: String, +} + +impl SynologyFileAccess { + pub fn new(client: crate::synology::SynologyClient, base_path: &str) -> Self { + Self { + client, + base_path: base_path.to_string(), + } + } + + fn full_path(&self, filename: &str) -> String { + format!("{}/{}", self.base_path, filename) + } +} + +#[async_trait] +impl FileAccess for SynologyFileAccess { + async fn list_files(&self) -> Result> { + use crate::synology::ListFilesOptions; + let result = self + .client + .list_files(&self.base_path, ListFilesOptions::new()) + .await + .map_err(|e| anyhow::anyhow!(e))?; + let files = result + .files + .into_iter() + .filter(|f| !f.isdir) + .map(|f| f.name) + .collect(); + Ok(files) + } + + async fn read_file(&self, filename: &str) -> Result> { + let path = self.full_path(filename); + self.client + .download(&path) + .await + .map_err(|e| anyhow::anyhow!(e)) + } + + async fn write_file(&self, filename: &str, data: &[u8]) -> Result<()> { + self.client + .upload( + &self.base_path, + filename, + data.to_vec(), + Some(false), + Some(true), + ) + .await + .map_err(|e| anyhow::anyhow!(e)) + } + + async fn delete_file(&self, filename: &str) -> Result<()> { + let path = self.full_path(filename); + self.client + .delete(&[&path], None) + .await + .map_err(|e| anyhow::anyhow!(e)) + } +} diff --git a/src/main.rs b/src/main.rs index cb6faf7..91b7ea7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ mod config; +mod file_access; mod nexrender; mod processor; mod synology; diff --git a/src/static/index.html b/src/static/index.html index bde6f70..caf7620 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -5,12 +5,7 @@ AE Anons - - - - - @@ -21,11 +16,7 @@
- - +

AE Anons

@@ -37,81 +28,107 @@
- -
- - - - -
- - Ready + +
+ + +
+ + +
+
+ + + + +
+ + Ready +
+
+ +
+ +
+
+ + +
+
+ + Auto-refresh: 60s + 60s +
+
+ +
+ + + + + + + + + + + + + + + +
+ Output File + + State + + Created + + Updated + + UID +
+
+ +

Loading jobs...

+
+
- -
- - -
-
- - -
-
- - Auto-refresh: 60s - 60s + +
+
+ +
+ Видео не загружены +
+
- -
- - - - - - - - - - - - - - - -
- Output File - - State - - Created - - Updated - - UID -
-
- -

Loading jobs...

-
-
+ +
diff --git a/src/web.rs b/src/web.rs index 6b27b38..2a46a1e 100644 --- a/src/web.rs +++ b/src/web.rs @@ -1,8 +1,12 @@ -use crate::config::Config; +use crate::config::{AccessType, Config}; +use crate::file_access::{ + FileAccess, LocalFileAccess, SmbAccessConfig, SmbFileAccess, SynologyFileAccess, +}; use crate::processor::{cleanup_finished_jobs, fetch_all_jobs, process_spreadsheet}; +use crate::synology::SynologyClient; use axum::{ - extract::State, - http::{header::CONTENT_TYPE, StatusCode}, + extract::{Path, State}, + http::{header, HeaderMap, StatusCode}, response::{Html, IntoResponse, Json}, routing::{get, post}, Router, @@ -17,6 +21,8 @@ use tower_http::trace::TraceLayer; pub struct AppState { pub config: Config, pub last_generation: Arc>>>, + pub source_access: Arc, + pub dest_access: Arc, } #[derive(Serialize)] @@ -77,10 +83,16 @@ impl JobInfo { } pub async fn run_web_server(config: Config) -> anyhow::Result<()> { + let source_access = create_file_access(&config.source, &config).await?; + let dest_access = create_file_access(&config.destination, &config).await?; + let web_port = config.web_port; + let state = AppState { config, last_generation: Arc::new(Mutex::new(None)), + source_access, + dest_access, }; let app = Router::new() @@ -106,48 +118,84 @@ pub async fn run_web_server(config: Config) -> anyhow::Result<()> { .route("/api/cleanup", post(cleanup_jobs)) .route("/api/status", get(get_status)) .route("/api/jobs/stop-all", post(stop_all_jobs)) + .route("/api/videos", get(list_videos)) + .route("/api/videos/{filename}", get(stream_video)) + .route("/api/videos/{filename}/move", post(move_video)) .layer(TraceLayer::new_for_http()) .with_state(state); + let addr: SocketAddr = format!("0.0.0.0:{}", web_port).parse()?; log::info!("Web server listening on http://{}", addr); - let listener = tokio::net::TcpListener::bind(addr).await?; axum::serve(listener, app).await?; Ok(()) } +async fn create_file_access( + access_config: &crate::config::AccessConfig, + nas_config: &Config, +) -> anyhow::Result> { + match access_config.access_type { + AccessType::Local => { + let path = access_config.local_path.as_ref().unwrap(); + Ok(Arc::new(LocalFileAccess::new(path))) + } + AccessType::Smb => { + let url = access_config.smb_url.as_ref().unwrap().clone(); + let user = access_config.smb_user.clone(); + let password = access_config.smb_pass.clone(); + let smb_config = SmbAccessConfig { + url, + user, + password, + }; + Ok(Arc::new(SmbFileAccess::new(smb_config))) + } + AccessType::Synology => { + let mut client = SynologyClient::new(&nas_config.nas_fqdn); + client + .login(&nas_config.nas_user, &nas_config.nas_pass) + .await?; + let base_path = access_config.synology_path.as_ref().unwrap().clone(); + Ok(Arc::new(SynologyFileAccess::new(client, &base_path))) + } + } +} + +// Статические ресурсы async fn index_page() -> Html<&'static str> { Html(include_str!("static/index.html")) } async fn style_css() -> impl IntoResponse { ( - [(CONTENT_TYPE, "text/css")], + [(header::CONTENT_TYPE, "text/css")], include_str!("static/style.css"), ) } async fn fontawesome_css() -> impl IntoResponse { ( - [(CONTENT_TYPE, "text/css")], + [(header::CONTENT_TYPE, "text/css")], include_str!("static/fontawesome/all.min.css"), ) } async fn logo_png() -> impl IntoResponse { ( - [(CONTENT_TYPE, "image/png")], + [(header::CONTENT_TYPE, "image/png")], include_bytes!("../assets/logo.png").as_slice(), ) } async fn favicon() -> impl IntoResponse { ( - [(CONTENT_TYPE, "image/x-icon")], + [(header::CONTENT_TYPE, "image/x-icon")], include_bytes!("static/favicon.ico").as_slice(), ) } +// Управление заданиями Nexrender async fn list_jobs(State(state): State) -> Result>, AppError> { let jobs_json = fetch_all_jobs(&state.config.nexrender_api_url) .await @@ -235,23 +283,120 @@ async fn stop_all_jobs(State(state): State) -> Result) -> Result>, AppError> { + let files = state + .source_access + .list_files() + .await + .map_err(|e| AppError(StatusCode::INTERNAL_SERVER_ERROR, e.to_string()))?; + let videos: Vec = files + .into_iter() + .filter(|name| { + let lower = name.to_lowercase(); + lower.ends_with(".mp4") || lower.ends_with(".mov") || lower.ends_with(".avi") + }) + .collect(); + Ok(Json(videos)) +} + +async fn stream_video( + Path(filename): Path, + State(state): State, + headers: axum::http::HeaderMap, +) -> Result { + let file_data = state + .source_access + .read_file(&filename) + .await + .map_err(|e| AppError(StatusCode::NOT_FOUND, format!("File not found: {}", e)))?; + + let file_size = file_data.len() as u64; + let range = headers.get(header::RANGE).and_then(|v| v.to_str().ok()); + + let (status, content_range, start, end) = if let Some(range_str) = range { + let range_str = range_str.trim_start_matches("bytes="); + let parts: Vec<&str> = range_str.split('-').collect(); + let start: u64 = parts[0].parse().unwrap_or(0); + let end: u64 = if parts.len() > 1 && !parts[1].is_empty() { + parts[1].parse().unwrap_or(file_size - 1) + } else { + file_size - 1 + }; + ( + StatusCode::PARTIAL_CONTENT, + Some(format!("bytes {}-{}/{}", start, end, file_size)), + start, + end, + ) + } else { + (StatusCode::OK, None, 0, file_size - 1) + }; + + let mut resp_headers = HeaderMap::new(); + resp_headers.insert(header::CONTENT_TYPE, "video/mp4".parse().unwrap()); + if let Some(content_range) = content_range { + resp_headers.insert(header::CONTENT_RANGE, content_range.parse().unwrap()); + } + let len = end - start + 1; + resp_headers.insert(header::CONTENT_LENGTH, len.to_string().parse().unwrap()); + resp_headers.insert(header::ACCEPT_RANGES, "bytes".parse().unwrap()); + + let body = file_data[start as usize..=end as usize].to_vec(); + Ok((status, resp_headers, body)) +} + +async fn move_video( + Path(filename): Path, + State(state): State, + axum::extract::Query(params): axum::extract::Query>, +) -> Result { + let remove = params.get("remove").map(|s| s == "true").unwrap_or(false); + + let data = state + .source_access + .read_file(&filename) + .await + .map_err(|e| AppError(StatusCode::NOT_FOUND, e.to_string()))?; + + state + .dest_access + .write_file(&filename, &data) + .await + .map_err(|e| AppError(StatusCode::INTERNAL_SERVER_ERROR, e.to_string()))?; + + if remove { + state + .source_access + .delete_file(&filename) + .await + .map_err(|e| AppError(StatusCode::INTERNAL_SERVER_ERROR, e.to_string()))?; + } + + Ok(( + StatusCode::OK, + format!("File {} moved successfully", filename), + )) +} + +// Шрифты Font Awesome async fn fa_solid_woff2() -> impl IntoResponse { ( - [(CONTENT_TYPE, "font/woff2")], + [(header::CONTENT_TYPE, "font/woff2")], include_bytes!("static/fontawesome/webfonts/fa-solid-900.woff2").as_slice(), ) } async fn fa_regular_woff2() -> impl IntoResponse { ( - [(CONTENT_TYPE, "font/woff2")], + [(header::CONTENT_TYPE, "font/woff2")], include_bytes!("static/fontawesome/webfonts/fa-regular-400.woff2").as_slice(), ) } async fn fa_brands_woff2() -> impl IntoResponse { ( - [(CONTENT_TYPE, "font/woff2")], + [(header::CONTENT_TYPE, "font/woff2")], include_bytes!("static/fontawesome/webfonts/fa-brands-400.woff2").as_slice(), ) }