From d77a985708fb39a15c25ced82ab4be2b458fdf4f Mon Sep 17 00:00:00 2001 From: Ultradesu Date: Thu, 16 Jul 2026 17:22:32 +0300 Subject: [PATCH] init --- .gitignore | 5 + Cargo.lock | 4873 +++++++++++++++++++++++++++++++++++++ Cargo.toml | 19 + README.md | 161 ++ src/error.rs | 62 + src/federation.rs | 499 ++++ src/main.rs | 66 + src/routes/artists.rs | 222 ++ src/routes/genres.rs | 97 + src/routes/media_files.rs | 237 ++ src/routes/metadata.rs | 273 +++ src/routes/mod.rs | 30 + src/routes/releases.rs | 378 +++ src/routes/tracks.rs | 458 ++++ src/schema.rs | 167 ++ src/util.rs | 43 + static/index.html | 555 +++++ 17 files changed, 8145 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 README.md create mode 100644 src/error.rs create mode 100644 src/federation.rs create mode 100644 src/main.rs create mode 100644 src/routes/artists.rs create mode 100644 src/routes/genres.rs create mode 100644 src/routes/media_files.rs create mode 100644 src/routes/metadata.rs create mode 100644 src/routes/mod.rs create mode 100644 src/routes/releases.rs create mode 100644 src/routes/tracks.rs create mode 100644 src/schema.rs create mode 100644 src/util.rs create mode 100644 static/index.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..44edd10 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/target +*.sqlite3 +*.sqlite3-shm +*.sqlite3-wal +*federation/ diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..614d1cb --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,4873 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common 0.1.7", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures 0.2.17", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" + +[[package]] +name = "arc-swap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c049c0be4daef0b145cb3555416b3b8ef5b7888a38aea1a3a155801fe7b0810b" +dependencies = [ + "rustversion", +] + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56" + +[[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", +] + +[[package]] +name = "async_io_stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +dependencies = [ + "futures", + "pharos", + "rustc_version", +] + +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "attohttpc" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e2cdb6d5ed835199484bb92bb8b3edd526effe995c61732580439c1a67e2e9" +dependencies = [ + "base64", + "http", + "log", + "url", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "axum" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" +dependencies = [ + "axum-core", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "backon" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffb0e931875b666fc4fcb20fee52e9bbd1ef836fd9e9e04ec21555f9f85f7ef" +dependencies = [ + "fastrand", + "gloo-timers", + "tokio", +] + +[[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 = "bitflags" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da" +dependencies = [ + "serde_core", +] + +[[package]] +name = "blake3" +version = "1.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0aa83c34e62843d924f905e0f5c866eb1dd6545fc4d719e803d9ba6030371fce" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if", + "constant_time_eq", + "cpufeatures 0.3.0", +] + +[[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.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "block2" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdeb9d870516001442e364c5220d3574d2da8dc765554b4a617230d33fa58ef5" +dependencies = [ + "objc2", +] + +[[package]] +name = "bumpalo" +version = "3.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" + +[[package]] +name = "cc" +version = "1.2.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[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 = "chacha20" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "rand_core 0.10.1", +] + +[[package]] +name = "chrono" +version = "0.4.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" +dependencies = [ + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common 0.1.7", + "inout", +] + +[[package]] +name = "cmov" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a" + +[[package]] +name = "cobs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa961b519f0b462e3a3b4a34b64d119eeaca1d59af726fe450bbba07a9fc0a1" +dependencies = [ + "thiserror 2.0.18", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + +[[package]] +name = "constant_time_eq" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "cordyceps" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688d7fbb8092b8de775ef2536f36c8c31f2bc4006ece2e8d8ad2d17d00ce0a2a" +dependencies = [ + "loom", + "tracing", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +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 = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "217698eaf96b4a3f0bc4f3662aaa55bdf913cd54d7204591faa790070c6d0853" + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-channel" +version = "0.5.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "803d13fb3b09d88be9f4dbc29062c66b19bf7170867ceb746d2a8689bf6c7a26" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + +[[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "ctutils" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" +dependencies = [ + "cmov", +] + +[[package]] +name = "curve25519-dalek" +version = "5.0.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f359e08ca85e7bd759e1fd933ff2bccd81864c60a8fba0e259c7f822b0924bf" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "curve25519-dalek-derive", + "digest 0.11.3", + "fiat-crypto", + "rand_core 0.10.1", + "rustc_version", + "serde", + "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", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "data-encoding" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" + +[[package]] +name = "data-encoding-macro" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3259c913752a86488b501ed8680446a5ed2d5aeac6e596cb23ba3800768ea32c" +dependencies = [ + "data-encoding", + "data-encoding-macro-internal", +] + +[[package]] +name = "data-encoding-macro-internal" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccc2776f0c61eca1ca32528f85548abd1a4be8fb53d1b21c013e4f18da1e7090" +dependencies = [ + "data-encoding", + "syn", +] + +[[package]] +name = "der" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a69dedd701da44b0536442edf09c81a64b0ab97a7a4a5e3d1971f00027cbc63d" +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" + +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn", + "unicode-xid", +] + +[[package]] +name = "diatomic-waker" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab03c107fafeb3ee9f5925686dbb7a73bc76e3932abb0d2b365cb64b169cf04c" + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" +dependencies = [ + "block-buffer 0.12.1", + "crypto-common 0.2.2", + "ctutils", +] + +[[package]] +name = "dispatch2" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38" +dependencies = [ + "bitflags", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "displaydoc" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dlopen2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e2c5bd4158e66d1e215c49b837e11d62f3267b30c92f1d171c4d3105e3dc4d4" +dependencies = [ + "libc", + "once_cell", + "winapi", +] + +[[package]] +name = "document-features" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4b8a88685455ed29a21542a33abd9cb6510b6b129abadabdcef0f4c55bc8f61" +dependencies = [ + "litrs", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "ed25519" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29fcf32e6c73d1079f83ab4d782de2d81620346a5f38c6237a86a22f8368980a" +dependencies = [ + "pkcs8", + "serdect", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "3.0.0-rc.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b011170fe4f04665565b4110afef66774fe9ffff278f3eb5b81cc73d26e27d60" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core 0.10.1", + "serde", + "sha2 0.11.0", + "signature", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" +dependencies = [ + "serde", +] + +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "enum-assoc" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed8956bd5c1f0415200516e78ff07ec9e16415ade83c056c230d7b7ea0d55b7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "etcetera" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de48cc4d1c1d97a20fd819def54b890cadde72ed3ad0c614822a0a433361be96" +dependencies = [ + "cfg-if", + "windows-sys 0.61.2", +] + +[[package]] +name = "event-listener" +version = "5.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + +[[package]] +name = "fallible-streaming-iterator" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" + +[[package]] +name = "fastrand" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" + +[[package]] +name = "federation-net" +version = "0.1.0" +dependencies = [ + "blake3", + "data-encoding", + "futures", + "iroh", + "iroh-base", + "iroh-tickets", + "mainline", + "postcard", + "rand 0.9.5", + "serde", + "thiserror 2.0.18", + "tokio", + "tracing", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "flume" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e139bc46ca777eb5efaf62df0ab8cc5fd400866427e56c68b22e414e53bd3be" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.9", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "furumi-fd" +version = "0.1.0" +dependencies = [ + "anyhow", + "axum", + "chrono", + "music-dht", + "serde", + "serde_json", + "sqlx", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-buffered" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4421cb78ee172b6b06080093479d3c50f058e7c81b7d577bbb8d118d551d4cd5" +dependencies = [ + "cordyceps", + "diatomic-waker", + "futures-core", + "pin-project-lite", + "spin 0.10.1", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-lite" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generator" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3b854b0e584ead1a33f18b2fcad7cf7be18b3875c78816b753639aa501513ae" +dependencies = [ + "cc", + "cfg-if", + "libc", + "log", + "rustversion", + "windows-link", + "windows-result", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "r-efi 6.0.0", + "rand_core 0.10.1", + "wasm-bindgen", +] + +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "gloo-timers" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "h2" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb093c84e8bd9b188d4c4a8cb6579fc016968d14c99882163cd3ff402a4f155" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824e001ac4f3012dd16a264bec811403a67ca9deb6c102fc5049b32c4574b35f" +dependencies = [ + "hashbrown 0.16.1", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version", + "serde", + "spin 0.9.9", + "stable_deref_trait", +] + +[[package]] +name = "heck" +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 = "hickory-net" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2295ed2f9c31e471e1428a8f88a3f0e1f4b27c15049592138d1eebe9c35b183" +dependencies = [ + "async-trait", + "bytes", + "cfg-if", + "data-encoding", + "futures-channel", + "futures-io", + "futures-util", + "h2", + "hickory-proto", + "http", + "idna", + "ipnet", + "jni 0.22.4", + "rand 0.10.2", + "rustls", + "thiserror 2.0.18", + "tinyvec", + "tokio", + "tokio-rustls", + "tracing", + "url", +] + +[[package]] +name = "hickory-proto" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bab31817bfb44672a252e97fe81cd0c18d1b2cf892108922f6818820df8c643" +dependencies = [ + "data-encoding", + "idna", + "ipnet", + "jni 0.22.4", + "once_cell", + "prefix-trie", + "rand 0.10.2", + "ring", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d58d28879ceecde6607729660c2667a081ccdc082e082675042793960f178c" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-net", + "hickory-proto", + "ipconfig", + "ipnet", + "jni 0.22.4", + "moka", + "ndk-context", + "once_cell", + "parking_lot", + "rand 0.10.2", + "resolv-conf", + "rustls", + "smallvec", + "system-configuration", + "thiserror 2.0.18", + "tokio", + "tokio-rustls", + "tracing", +] + +[[package]] +name = "hkdf" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aaa26c720c68b866f2c96ef5c1264b3e6f473fe5d4ce61cd44bbe913e553018" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" +dependencies = [ + "digest 0.11.3", +] + +[[package]] +name = "http" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f41fd6a08e4d4ec69df65976da761afd5ad5e58a9d4acb46bd1c953a9e3ff2" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hybrid-array" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c" +dependencies = [ + "typenum", +] + +[[package]] +name = "hyper" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" +dependencies = [ + "http", + "hyper", + "hyper-util", + "rustls", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "base64", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "ipnet", + "libc", + "percent-encoding", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "identity-hash" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfdd7caa900436d8f13b2346fe10257e0c05c1f1f9e351f4f5d57c03bd5f45da" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "igd-next" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de7238d487a9aff61f81b5ab41c0a841532a115a398b5fa92a2fadd0885e2581" +dependencies = [ + "attohttpc", + "bytes", + "futures", + "http", + "http-body-util", + "hyper", + "hyper-util", + "log", + "rand 0.10.2", + "tokio", + "url", + "xmltree", +] + +[[package]] +name = "indexmap" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "ipconfig" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d40460c0ce33d6ce4b0630ad68ff63d6661961c48b6dba35e5a4d81cfb48222" +dependencies = [ + "socket2", + "widestring", + "windows-registry", + "windows-result", + "windows-sys 0.61.2", +] + +[[package]] +name = "ipnet" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" +dependencies = [ + "serde", +] + +[[package]] +name = "iroh" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fca9b4b462c343ff88fc0af4096c186f939b602a0bc08723536ef2c31c93971" +dependencies = [ + "backon", + "blake3", + "bytes", + "cfg_aliases", + "ctutils", + "data-encoding", + "derive_more", + "ed25519-dalek", + "futures-util", + "getrandom 0.4.3", + "hickory-resolver", + "http", + "ipnet", + "iroh-base", + "iroh-dns", + "iroh-metrics", + "iroh-relay", + "n0-error", + "n0-future", + "n0-watcher", + "netwatch", + "noq", + "noq-proto", + "noq-udp", + "papaya", + "pin-project", + "portable-atomic", + "portmapper", + "rand 0.10.2", + "reqwest", + "rustc-hash", + "rustls", + "rustls-pki-types", + "serde", + "smallvec", + "strum", + "time", + "tokio", + "tokio-stream", + "tokio-util", + "tracing", + "url", + "wasm-bindgen-futures", +] + +[[package]] +name = "iroh-base" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830a582cd54410dc1aa71d4786a82c3297d7b0165accd8b6dbbb3b240b48140d" +dependencies = [ + "curve25519-dalek", + "data-encoding", + "data-encoding-macro", + "derive_more", + "ed25519-dalek", + "getrandom 0.4.3", + "n0-error", + "rand 0.10.2", + "serde", + "url", + "zeroize", +] + +[[package]] +name = "iroh-dns" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "516e4eedc38e33ab69a6bd325520332dc3d67b25454e2d590ebb84a25240dd9a" +dependencies = [ + "arc-swap", + "cfg_aliases", + "derive_more", + "hickory-resolver", + "iroh-base", + "n0-error", + "n0-future", + "ndk-context", + "portable-atomic", + "rand 0.10.2", + "rustls", + "simple-dns", + "strum", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "iroh-metrics" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291065721ad7c477b972e581bbc528df031dc8eb5e39fe1ff3300ae5dfb157ef" +dependencies = [ + "iroh-metrics-derive", + "itoa", + "n0-error", + "portable-atomic", + "ryu", + "serde", + "tracing", +] + +[[package]] +name = "iroh-metrics-derive" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ae5f0c4405d1fbc9fb16ff422ca40620e93dc36c30ecaba0c2aee3992b7bd48" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "iroh-relay" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8149bb6a57126225a07d6928846d82dcedfd24ea0f863ef7b2eb475e1d726354" +dependencies = [ + "blake3", + "bytes", + "cfg_aliases", + "data-encoding", + "derive_more", + "getrandom 0.4.3", + "hickory-resolver", + "http", + "http-body-util", + "hyper", + "hyper-util", + "iroh-base", + "iroh-dns", + "iroh-metrics", + "lru 0.18.1", + "n0-error", + "n0-future", + "noq", + "noq-proto", + "num_enum", + "pin-project", + "postcard", + "rand 0.10.2", + "reqwest", + "rustls", + "rustls-pki-types", + "serde", + "serde_bytes", + "strum", + "tokio", + "tokio-rustls", + "tokio-util", + "tokio-websockets", + "tracing", + "url", + "vergen-gitcl", + "webpki-roots", + "ws_stream_wasm", +] + +[[package]] +name = "iroh-tickets" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da53233419ca36bf521ed45683b7748366f9b233032891eefc2d70567a84ac54" +dependencies = [ + "data-encoding", + "derive_more", + "iroh-base", + "n0-error", + "postcard", + "serde", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys 0.4.1", + "log", + "simd_cesu8", + "thiserror 2.0.18", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn", +] + +[[package]] +name = "js-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" +dependencies = [ + "cfg-if", + "futures-util", + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.186" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" + +[[package]] +name = "libsqlite3-sys" +version = "0.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f111c8c41e7c61a49cd34e44c7619462967221a6443b0ec299e0ac30cfb9b1" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "litrs" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d3d7f243d5c5a8b9bb5d6dd2b1602c0cb0b9db1621bafc7ed66e35ff9fe092" + +[[package]] +name = "lock_api" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" +dependencies = [ + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" + +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "lru" +version = "0.16.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39" + +[[package]] +name = "lru" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6180140927ee907000b0aa540091f6ea512ead4447c92b8fc35bc72788a5a6" +dependencies = [ + "hashbrown 0.17.1", +] + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "mac-addr" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d25b0e0b648a86960ac23b7ad4abb9717601dec6f66c165f5b037f3f03065f" + +[[package]] +name = "mainline" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dfad9601b9117218868271c05403853593d4817e7abeab5c95e11eee16382bb" +dependencies = [ + "crc", + "document-features", + "dyn-clone", + "ed25519-dalek", + "flume", + "futures-lite", + "getrandom 0.4.3", + "lru 0.16.4", + "serde", + "serde_bencode", + "serde_bytes", + "sha1_smol", + "thiserror 2.0.18", + "tracing", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "md-5" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b6441f590336821bb897fb28fc622898ccceb1d6cea3fde5ea86b090c4de98" +dependencies = [ + "cfg-if", + "digest 0.11.3", +] + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mio" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30d65c71f1ce40ab09135ce117d742b9f8a19ff91a41a8b57ed50bc2de59c427" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "moka" +version = "0.12.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957228ad12042ee839f93c8f257b62b4c0ab5eaae1d4fa60de53b27c9d7c5046" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "equivalent", + "parking_lot", + "portable-atomic", + "smallvec", + "tagptr", + "uuid", +] + +[[package]] +name = "music-dht" +version = "0.1.0" +dependencies = [ + "blake3", + "data-encoding", + "federation-net", + "futures", + "postcard", + "rand 0.9.5", + "rusqlite", + "serde", + "thiserror 2.0.18", + "tokio", + "tracing", + "unicode-normalization", +] + +[[package]] +name = "n0-error" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c37e81176a83a77d2514528b91bdafc70ef88aab428f0e1b91aebb8d99888895" +dependencies = [ + "n0-error-macros", + "spez", +] + +[[package]] +name = "n0-error-macros" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2acd8b070213b0299282f884b4beba4e7b52d624fdcd504a3ad3665390c11e1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "n0-future" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2ab99dfb861450e68853d34ae665243a88b8c493d01ba957321a1e9b2312bbe" +dependencies = [ + "cfg_aliases", + "derive_more", + "futures-buffered", + "futures-lite", + "futures-util", + "js-sys", + "pin-project", + "send_wrapper", + "tokio", + "tokio-util", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-time", +] + +[[package]] +name = "n0-watcher" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbc618745ad0b7414b149d0517ad8b5573b2fb4d4e2717add3d2446ce1fdd826" +dependencies = [ + "derive_more", + "n0-error", + "n0-future", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "netdev" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "569dfbdd2efd771b24ec9bb57f956e04d4fbfc72f62b2f11961723f9b3f4b020" +dependencies = [ + "block2", + "dispatch2", + "dlopen2", + "ipnet", + "jni 0.21.1", + "libc", + "mac-addr", + "ndk-context", + "netlink-packet-core", + "netlink-packet-route", + "netlink-sys", + "objc2", + "objc2-core-foundation", + "objc2-core-wlan", + "objc2-foundation", + "objc2-system-configuration", + "once_cell", + "plist", + "windows-sys 0.61.2", +] + +[[package]] +name = "netlink-packet-core" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3463cbb78394cb0141e2c926b93fc2197e473394b761986eca3b9da2c63ae0f4" +dependencies = [ + "paste", +] + +[[package]] +name = "netlink-packet-route" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2288fcb784eb3defd5fb16f4c4160d5f477de192eac730f43e1d11c24d9a007" +dependencies = [ + "bitflags", + "libc", + "log", + "netlink-packet-core", +] + +[[package]] +name = "netlink-proto" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65d130ee111430e47eed7896ea43ca693c387f097dd97376bffafbf25812128" +dependencies = [ + "bytes", + "futures", + "log", + "netlink-packet-core", + "netlink-sys", + "thiserror 2.0.18", +] + +[[package]] +name = "netlink-sys" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd6c30ed10fa69cc491d491b85cc971f6bdeb8e7367b7cde2ee6cc878d583fae" +dependencies = [ + "bytes", + "futures-util", + "libc", + "log", + "tokio", +] + +[[package]] +name = "netwatch" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d9cbe01741347ef750d743d6690603f5eed8341e679fb51c8e629337aa11976" +dependencies = [ + "atomic-waker", + "bytes", + "cfg_aliases", + "derive_more", + "ipnet", + "js-sys", + "libc", + "n0-error", + "n0-future", + "n0-watcher", + "netdev", + "netlink-packet-core", + "netlink-packet-route", + "netlink-proto", + "netlink-sys", + "noq-udp", + "objc2-core-foundation", + "objc2-system-configuration", + "pin-project-lite", + "serde", + "socket2", + "time", + "tokio", + "tokio-util", + "tracing", + "web-sys", + "windows", + "windows-result", + "wmi", +] + +[[package]] +name = "noq" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bf95190af1bd4a00a10e8255ca0c8ddd9e9a9f5e79151d7a7eb6d56aff5dc89" +dependencies = [ + "bytes", + "cfg_aliases", + "derive_more", + "noq-proto", + "noq-udp", + "pin-project-lite", + "rustc-hash", + "rustls", + "socket2", + "thiserror 2.0.18", + "tokio", + "tokio-stream", + "tracing", + "web-time", +] + +[[package]] +name = "noq-proto" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa6c890013591e709a3e45dd53501351b7e27e7ff3c7e9fc3dce43e300e7e9d3" +dependencies = [ + "aes-gcm", + "bytes", + "derive_more", + "enum-assoc", + "getrandom 0.4.3", + "identity-hash", + "lru-slab", + "rand 0.10.2", + "rand_pcg", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "sorted-index-buffer", + "thiserror 2.0.18", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "noq-udp" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3137a52df66c20090a889828d1c655f21f52294cba64e5c4fbb04fc83eee7c8e" +dependencies = [ + "cfg_aliases", + "libc", + "socket2", + "tracing", + "windows-sys 0.61.2", +] + +[[package]] +name = "nu-ansi-term" +version = "0.50.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "num-conv" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", +] + +[[package]] +name = "objc2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f" +dependencies = [ + "objc2-encode", +] + +[[package]] +name = "objc2-core-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" +dependencies = [ + "bitflags", + "block2", + "dispatch2", + "libc", + "objc2", +] + +[[package]] +name = "objc2-core-wlan" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e34919aba0d701380d911702455038a8a3587467fe0141d6a71501e7ffe48" +dependencies = [ + "bitflags", + "objc2", + "objc2-core-foundation", + "objc2-foundation", + "objc2-security", + "objc2-security-foundation", +] + +[[package]] +name = "objc2-encode" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33" + +[[package]] +name = "objc2-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272" +dependencies = [ + "bitflags", + "block2", + "libc", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-security" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe137109bd1e8b5a99390f77a7d8b2961dafc1a1c5db8f2e60329ad6d895a" +dependencies = [ + "bitflags", + "objc2", + "objc2-core-foundation", +] + +[[package]] +name = "objc2-security-foundation" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef76382e9cedd18123099f17638715cc3d81dba3637d4c0d39ab69df2ef345a5" +dependencies = [ + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-system-configuration" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7216bd11cbda54ccabcab84d523dc93b858ec75ecfb3a7d89513fa22464da396" +dependencies = [ + "bitflags", + "dispatch2", + "libc", + "objc2", + "objc2-core-foundation", + "objc2-security", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" +dependencies = [ + "critical-section", + "portable-atomic", +] + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "papaya" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "997ee03cd38c01469a7046643714f0ad28880bcb9e6679ff0666e24817ca19b7" +dependencies = [ + "equivalent", + "seize", +] + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[package]] +name = "parking_lot" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-link", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pem-rfc7468" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6305423e0e7738146434843d1694d621cce767262b2a86910beab705e4493d9" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "pharos" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +dependencies = [ + "futures", + "rustc_version", +] + +[[package]] +name = "pin-project" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkcs8" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451913da69c775a56034ea8d9003d27ee8948e12443eae7c038ba100a4f21cb7" +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 = "plist" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da1d65da6dd5d1e44199ac0f58712d241c0f439f80adea8924d832384087f85" +dependencies = [ + "base64", + "indexmap", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" +dependencies = [ + "serde", +] + +[[package]] +name = "portmapper" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3713e4977408279158444a18c1a01ac9bf2e7eaf1fbfd1a19ac9cd18d90721" +dependencies = [ + "base64", + "bytes", + "derive_more", + "hyper-util", + "igd-next", + "iroh-metrics", + "libc", + "n0-error", + "n0-future", + "netwatch", + "num_enum", + "rand 0.10.2", + "serde", + "smallvec", + "socket2", + "time", + "tokio", + "tokio-util", + "tower-layer", + "tracing", + "url", +] + +[[package]] +name = "postcard" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6764c3b5dd454e283a30e6dfe78e9b31096d9e32036b5d1eaac7a6119ccb9a24" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "heapless", + "postcard-derive", + "serde", +] + +[[package]] +name = "postcard-derive" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0232bd009a197ceec9cc881ba46f727fcd8060a2d8d6a9dde7a69030a6fe2bb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +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 = "prefix-trie" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cf6e3177f0684016a5c209b00882e15f8bdd3f3bb48f0491df10cd102d0c6e7" +dependencies = [ + "either", + "ipnet", + "num-traits", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" +dependencies = [ + "memchr", +] + +[[package]] +name = "quote" +version = "1.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +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.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" +dependencies = [ + "rand_chacha", + "rand_core 0.9.5", +] + +[[package]] +name = "rand" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand_core 0.10.1", +] + +[[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.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_pcg" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a" +dependencies = [ + "rand_core 0.10.1", +] + +[[package]] +name = "redox_syscall" +version = "0.5.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex-automata" +version = "0.4.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdb36bda0c880c5931cdc7a2bcdc8ba4556847b9d912bca70bc94708711ad" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" + +[[package]] +name = "reqwest" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", + "sync_wrapper", + "tokio", + "tokio-rustls", + "tokio-util", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "wasm-streams", + "web-sys", +] + +[[package]] +name = "resolv-conf" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e061d1b48cb8d38042de4ae0a7a6401009d6143dc80d2e2d6f31f0bdd6470c7" + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rsqlite-vfs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c51c9ae4df8a7fba42103df5c621fa3c37eccf3a3c650879e90fc48b11cc192c" +dependencies = [ + "hashbrown 0.16.1", + "thiserror 2.0.18", +] + +[[package]] +name = "rusqlite" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d2b0146dd9661bf67bb107c0bb2a55064d556eeb3fc314151b957f313bcd4e" +dependencies = [ + "bitflags", + "fallible-iterator", + "fallible-streaming-iterator", + "hashlink", + "libsqlite3-sys", + "smallvec", + "sqlite-wasm-rs", +] + +[[package]] +name = "rustc-hash" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustls" +version = "0.23.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c54fcab019b409d04215d3a17cb438fd7fbf192ee61461f20f4fe18704bc138" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "764899a24af3980067ee14bc143654f297b22eaebfe3c7b6b211920a5a59b046" +dependencies = [ + "web-time", + "zeroize", +] + +[[package]] +name = "rustls-platform-verifier" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni 0.22.4", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + +[[package]] +name = "rustls-webpki" +version = "0.103.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" + +[[package]] +name = "ryu" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation 0.10.1", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "seize" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b55fb86dfd3a2f5f76ea78310a88f96c4ea21a3031f8d212443d56123fd0521" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_bencode" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a70dfc7b7438b99896e7f8992363ab8e2c4ba26aa5ec675d32d1c3c2c33d413e" +dependencies = [ + "serde", + "serde_bytes", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.150" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" +dependencies = [ + "itoa", + "serde", + "serde_core", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serdect" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66cf8fedced2fcf12406bcb34223dffb92eaf34908ede12fed414c82b7f00b3e" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "sha1" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", +] + +[[package]] +name = "sha1_smol" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "signature" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d567dcbaf0049cb8ac2608a76cd95ff9e4412e1899d389ee400918ca7537f5" + +[[package]] +name = "simd_cesu8" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "simple-dns" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a75cbde1bf934313596a004973e462f9a82caa814dcf1a5f507bdf51597eeb4" +dependencies = [ + "bitflags", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "sorted-index-buffer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea06cc588e43c632923a55450401b8f25e628131571d4e1baea1bdfdb2b5ed06" + +[[package]] +name = "spez" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c87e960f4dca2788eeb86bbdde8dd246be8948790b7618d656e68f9b720a86e8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "spin" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3763264f6b73151db08c50ff20d7d8a0b8796e021cdea7ceedad07b80155fa0e" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spin" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "023a211cb3138dbc438680b32560ad89f699977624c9f8dbb95a47d5b4c07dd3" + +[[package]] +name = "spki" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d9efca8738c78ee9484207732f728b1ef517bbb1833d6fc0879ca898a522f6f" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlite-wasm-rs" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3efc0da82635d7e1ced0053bbbfa8c7ab9645d0bf36ceb4f7127bb85315d75" +dependencies = [ + "cc", + "js-sys", + "rsqlite-vfs", + "wasm-bindgen", +] + +[[package]] +name = "sqlx" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "378620ccc25c62c89d8be1c819e76a88d59bdcc3304733330788948e619bfd71" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b44e85bf579a8eeb4ceaa77a3a523baf2bf0e9bac7e40f405d537b5d2d5ccb" +dependencies = [ + "base64", + "bytes", + "cfg-if", + "crc", + "crossbeam-queue", + "either", + "event-listener", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashbrown 0.16.1", + "hashlink", + "indexmap", + "log", + "memchr", + "percent-encoding", + "serde", + "serde_json", + "sha2 0.10.9", + "smallvec", + "thiserror 2.0.18", + "tokio", + "tokio-stream", + "tracing", + "url", +] + +[[package]] +name = "sqlx-macros" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2b84f2bc39a5705ef27ec785a11c934a41bbd4a24941e257927cddc26b60bf" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb8d96de5fdc85a5c4ec813432b523ec637e80ba98f046555f75f7908ddac7c3" +dependencies = [ + "cfg-if", + "dotenvy", + "either", + "heck", + "hex", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.9", + "sqlx-core", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn", + "thiserror 2.0.18", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90b8020fe17c5f2c245bfa2505d7ef59c5604839527c740266ad2214acebea27" +dependencies = [ + "bitflags", + "byteorder", + "bytes", + "crc", + "digest 0.11.3", + "dotenvy", + "either", + "futures-core", + "futures-util", + "generic-array", + "log", + "percent-encoding", + "serde", + "sha1", + "sha2 0.11.0", + "sqlx-core", + "thiserror 2.0.18", + "tracing", +] + +[[package]] +name = "sqlx-postgres" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87a2bdd6e83f6b3ea525ca9fee568030508b58355a43d0b2c1674d5f79dcd65e" +dependencies = [ + "atoi", + "base64", + "bitflags", + "byteorder", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-util", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "rand 0.10.2", + "serde", + "serde_json", + "sha2 0.11.0", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 2.0.18", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488e99c397a62007e4229aec669a179816339afc6d2620ca6fa420dbee2e982c" +dependencies = [ + "atoi", + "flume", + "form_urlencoded", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "thiserror 2.0.18", + "tracing", + "url", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +dependencies = [ + "thiserror-impl 2.0.18", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "time" +version = "0.3.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18dfaaeddcb932337b5e7866ee7d0ce9b76d2fd092997146f187ec09b4558a50" +dependencies = [ + "deranged", + "js-sys", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" + +[[package]] +name = "time-macros" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c431b87111666e491a90baa837f914fb45cd5dc3c268591b0220ff5057f2085f" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f" +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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "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", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "futures-util", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-websockets" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52efb639344a7c6adb8e62c6f3d2c19c001ff1b79a5041ba1c6ed42e19c6aa5" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-sink", + "getrandom 0.4.3", + "http", + "httparse", + "rand 0.10.2", + "ring", + "rustls-pki-types", + "sha1_smol", + "simdutf8", + "tokio", + "tokio-rustls", + "tokio-util", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.13+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" +dependencies = [ + "indexmap", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +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", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex-automata", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-normalization" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd4f6878c9cb28d874b009da9e8d183b5abc80117c40bbd187a1fde336be6e8" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7df058c713841ad818f1dc5d3fd88063241cc61f49f5fbea4b951e8cf5a8d71d" + +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + +[[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.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common 0.1.7", + "subtle", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", + "serde_derive", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf3923a6f5c4c6382e0b653c4117f48d631ea17f38ed86e2a828e6f7412f5239" +dependencies = [ + "getrandom 0.4.3", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "vergen" +version = "9.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b849a1f6d8639e8de261e81ee0fc881e3e3620db1af9f2e0da015d4382ceaf75" +dependencies = [ + "anyhow", + "derive_builder", + "rustversion", + "vergen-lib", +] + +[[package]] +name = "vergen-gitcl" +version = "9.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ff3b5300a085d6bcd8fc96a507f706a28ae3814693236c9b409db71a1d15b9" +dependencies = [ + "anyhow", + "derive_builder", + "rustversion", + "time", + "vergen", + "vergen-lib", +] + +[[package]] +name = "vergen-lib" +version = "9.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b34a29ba7e9c59e62f229ae1932fb1b8fb8a6fdcc99215a641913f5f5a59a569" +dependencies = [ + "anyhow", + "derive_builder", + "rustversion", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.4+wasi-0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.76" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.126" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-streams" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1ec4f6517c9e11ae630e200b2b65d193279042e28edd4a2cda233e46670bbb" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "web-sys" +version = "0.3.103" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" +dependencies = [ + "js-sys", + "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 = "webpki-root-certs" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d46a5a140e6f7afeccd8eae97eff335163939eac8b929834875168b29b3d267" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "webpki-roots" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf85cb06032201fa7c6f829d7db5a7e5aa45bcc0655327713065f6f0576731bf" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "whoami" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998767ef88740d1f5b0682a9c53c24431453923962269c2db68ee43788c5a40d" + +[[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-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-link" +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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" +dependencies = [ + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[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.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen" +version = "0.57.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" + +[[package]] +name = "wmi" +version = "0.18.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c81b85c57a57500e56669586496bf2abd5cf082b9d32995251185d105208b64" +dependencies = [ + "chrono", + "futures", + "log", + "serde", + "thiserror 2.0.18", + "windows", + "windows-core", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "ws_stream_wasm" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c173014acad22e83f16403ee360115b38846fe754e735c5d9d3803fe70c6abc" +dependencies = [ + "async_io_stream", + "futures", + "js-sys", + "log", + "pharos", + "rustc_version", + "send_wrapper", + "thiserror 2.0.18", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "xml-rs" +version = "0.8.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae8337f8a065cfc972643663ea4279e04e7256de865aa66fe25cec5fb912d3f" + +[[package]] +name = "xmltree" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d8a75eaf6557bb84a65ace8609883db44a29951042ada9b393151532e41fcb" +dependencies = [ + "xml-rs", +] + +[[package]] +name = "yoke" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..4991d1a --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "furumi-fd" +version = "0.1.0" +edition = "2024" +description = "Localhost music library index manager: REST API over a local SQLite database" + +[dependencies] +axum = "0.8" +tokio = { version = "1", features = ["macros", "rt-multi-thread", "signal", "sync", "time"] } +# P2P federation: publishes the library index into a DHT and searches other +# peers' libraries. Local path dependency on the frid workspace. +music-dht = { path = "../../frid/crates/music-dht" } +sqlx = { version = "0.9", features = ["runtime-tokio", "sqlite"] } +serde = { version = "1", features = ["derive"] } +serde_json = "1" +chrono = "0.4" +anyhow = "1" +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } diff --git a/README.md b/README.md new file mode 100644 index 0000000..063fe6d --- /dev/null +++ b/README.md @@ -0,0 +1,161 @@ +# furumi-fd + +Localhost music library **index** manager. A small REST API over a local SQLite +database that mirrors the library primitives of the furumusic schema (artists, +releases, tracks, media files, genres, weighted genre tags, external metadata +ids, popularity), so data can be migrated from furumusic 1:1 by an external +script. + +**This service never touches real files.** It only stores records about them. +Audio processing, metadata extraction, artwork handling etc. are done by other +software that talks to this API. + +## Running + +```sh +cargo run +``` + +| Env var | Default | Meaning | +|---|---|---| +| `FURUMI_FD_DB` | `furumi-fd.sqlite3` | Path to the SQLite database file (created if missing) | +| `FURUMI_FD_LISTEN` | `127.0.0.1:8321` | Listen address | +| `FURUMI_FD_FEDERATION_DIR` | `.federation` | Directory for the federation identity and DHT state | + +No authentication — localhost only by default. + +`GET /` serves a small built-in web UI (embedded into the binary from +`static/index.html`) for browsing, adding and deleting artists, releases, +tracks and media file records — plus the **Федерация** page with the +federation settings, live statistics and network-wide search. + +## Federation (P2P library search) + +Instances of furumi-fd can form a **federated network**: each publishes its +library index (artist names, release titles, track titles and small metadata +— never files or file paths) into a distributed hash table and can search +the libraries of all other participants. Built on the +[`music-dht`](../../frid/crates/music-dht) / `federation-net` crates; peers +find each other automatically knowing **only the shared network id** (no +bootstrap servers, no invites). + +Federation is **off by default**. Enable it on the *Федерация* page (or via +the API): tick the checkbox, enter a network id and save. Every instance +using the same id joins the same network; a different id forms a separate, +isolated network. The id is effectively a shared secret — pick something +unique like `my-crew-music-7f3a`. + +While enabled, the library is re-synchronized into the DHT every minute +(added/changed items are republished, removed ones are tombstoned), and the +page shows the node ids, connected peers, published item count and the last +sync outcome. + +### Federation API + +- `GET /api/federation` — settings + live node status. +- `PUT /api/federation/settings` — `{enabled, network_id}`; starts/stops the + node immediately and persists the settings across restarts. +- `GET /api/federation/search?q=&kind=` — search the network + (`kind` optional: `artist | release | track`). Results carry the kind, + name, artist names, year/type/duration and the owning peer's id. +- `POST /api/federation/sync` — force an immediate library sync. + +## Schema mapping (furumusic → furumi-fd) + +| furumusic (PostgreSQL) | furumi-fd (SQLite) | Notes | +|---|---|---| +| `furumusic__media_file` | `media_files` | `uploaded_by_user_id` dropped (no users here); `uploader_name` kept | +| `furumusic__artist` | `artists` | same fields | +| `furumusic__release` | `releases` | same fields, same `release_type` vocabulary | +| `furumusic__release_artist` | `release_artists` | surrogate `id` dropped; PK `(release_id, artist_id)` | +| `furumusic__track` | `tracks` | includes `lastfm_listeners/playcount/rating/updated_at` | +| `furumusic__track_artist` | `track_artists` | surrogate `id` dropped; PK `(track_id, artist_id, role)` | +| `furumusic__genre` | `genres` | same fields | +| `furumusic__track_genre` | `track_genres` | surrogate `id` dropped; PK `(track_id, genre_id)` | +| `furumusic__entity_genre_tag` | `entity_genre_tags` | same fields + unique key | +| `furumusic__external_metadata_id` | `external_metadata_ids` | same fields + unique key | +| `furumusic__track_popularity_history` | `track_popularity_history` | schema only, no API endpoints yet | + +Shared conventions kept from furumusic: + +- timestamps are `TEXT` in `%Y-%m-%dT%H:%M:%SZ` format; +- `name_sort` / `title_sort` = trimmed lowercase of the display value; +- `media_files.file_path` is relative to the media root; +- `entity_kind` is one of `artist | release | track`; +- track artist `role` is one of `main | featuring | remixer | producer`; +- `release_type` is one of `album | single | ep | compilation | mixtape | live | soundtrack | remix | demo`. + +### Migration notes + +- Every create endpoint accepts an optional explicit `id`, plus optional + `created_at` / `updated_at` overrides — so a migration script can replay + rows through the API preserving original ids and timestamps. Insert in FK + order: media files → artists → releases (+ artist links) → tracks + (+ artist/genre links) → genre tags / external ids. +- Alternatively write straight into the SQLite file; the schema is in + `src/schema.rs`. + +## REST API + +Base path `/api`. All bodies are JSON. Errors come back as +`{"error": "..."}` with 400/404/409/500. + +`GET /api` — health check. + +### Common conventions + +- List endpoints accept `limit` (default 100, max 1000) and `offset`. +- `PATCH` is a partial update: absent fields are unchanged; explicit `null` + clears a nullable field. +- `DELETE` removes index records only, never files on disk. + +### Media files + +- `GET /api/media-files?file_type=&sha256=&q=&limit=&offset=` — `q` matches `file_path`. +- `POST /api/media-files` — `{file_type ("audio"|"cover_art"), file_path, original_filename?, mime_type?, file_size_bytes?, sha256_hash?, audio_format?, audio_bitrate?, audio_sample_rate?, audio_bit_depth?, uploader_name?, id?, created_at?}` +- `GET | PATCH | DELETE /api/media-files/{id}` — delete is refused (409) while the file is referenced as a track's `audio_file_id`; cover references are cleared automatically. + +### Artists + +- `GET /api/artists?q=&hidden=&limit=&offset=` +- `POST /api/artists` — `{name, image_file_id?, is_hidden?, model_name?, id?, created_at?, updated_at?}` +- `GET /api/artists/{id}` — artist + releases + track count. +- `PATCH /api/artists/{id}` +- `DELETE /api/artists/{id}` — releases/tracks stay, artist links and the artist's genre tags / external ids are removed. + +### Releases + +- `GET /api/releases?q=&artist_id=&release_type=&year=&hidden=&limit=&offset=` +- `POST /api/releases` — `{title, release_type?, year?, cover_file_id?, total_tracks?, total_discs?, is_hidden?, model_name?, artist_ids?, id?, created_at?, updated_at?}` +- `GET /api/releases/{id}` — release + ordered artists + tracks. +- `PATCH /api/releases/{id}` +- `PUT /api/releases/{id}/artists` — `{artist_ids: [..]}` replaces the artist list (positions by index). +- `DELETE /api/releases/{id}` — **deletes the release's tracks too** (index records only). + +### Tracks + +- `GET /api/tracks?q=&release_id=&artist_id=&genre_id=&hidden=&limit=&offset=` +- `POST /api/tracks` — `{title, release_id, audio_file_id, track_number?, disc_number?, duration_seconds?, cover_file_id?, year?, is_hidden?, model_name?, artists? [{artist_id, role?, position?}], genre_ids?, lastfm_*?, id?, created_at?, updated_at?}` +- `GET /api/tracks/{id}` — track + artists (with roles) + genres. +- `PATCH /api/tracks/{id}` — including `lastfm_listeners/playcount/rating/updated_at`. +- `PUT /api/tracks/{id}/artists` — `{artists: [{artist_id, role?, position?}]}` replaces links. +- `PUT /api/tracks/{id}/genres` — `{genre_ids: [..]}` replaces links. +- `DELETE /api/tracks/{id}` + +### Genres + +- `GET /api/genres?q=&limit=&offset=` +- `POST /api/genres` — `{name, id?}`; upsert by normalized name (posting an existing genre returns it). +- `GET | DELETE /api/genres/{id}` + +### Genre tags (weighted, per source) + +- `GET /api/genre-tags?entity_kind=&entity_id=&genre_id=&source=` +- `POST /api/genre-tags` — `{entity_kind, entity_id, genre_id, source, weight?}`; upsert on `(entity_kind, entity_id, genre_id, source)`. +- `DELETE /api/genre-tags/{id}` + +### External ids (MusicBrainz, Last.fm, Discogs, …) + +- `GET /api/external-ids?entity_kind=&entity_id=&source=&id_kind=&external_id=` +- `POST /api/external-ids` — `{entity_kind, entity_id, source, id_kind, external_id, confidence?}`; upsert on `(entity_kind, entity_id, source, id_kind)`. +- `DELETE /api/external-ids/{id}` diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 0000000..ba66343 --- /dev/null +++ b/src/error.rs @@ -0,0 +1,62 @@ +use axum::Json; +use axum::http::StatusCode; +use axum::response::{IntoResponse, Response}; +use serde_json::json; + +pub type ApiResult = Result; + +#[derive(Debug)] +pub enum ApiError { + NotFound(String), + BadRequest(String), + Conflict(String), + Internal(anyhow::Error), +} + +impl ApiError { + pub fn not_found(what: &str, id: i64) -> Self { + Self::NotFound(format!("{what} {id} not found")) + } +} + +impl IntoResponse for ApiError { + fn into_response(self) -> Response { + let (status, message) = match self { + Self::NotFound(msg) => (StatusCode::NOT_FOUND, msg), + Self::BadRequest(msg) => (StatusCode::BAD_REQUEST, msg), + Self::Conflict(msg) => (StatusCode::CONFLICT, msg), + Self::Internal(err) => { + tracing::error!("internal error: {err:#}"); + (StatusCode::INTERNAL_SERVER_ERROR, err.to_string()) + } + }; + (status, Json(json!({ "error": message }))).into_response() + } +} + +impl From for ApiError { + fn from(err: sqlx::Error) -> Self { + if let sqlx::Error::Database(db_err) = &err { + let msg = db_err.message().to_string(); + if msg.contains("FOREIGN KEY constraint failed") { + return Self::Conflict( + "operation violates a foreign key constraint (referenced row missing or still in use)" + .to_string(), + ); + } + if msg.contains("UNIQUE constraint failed") { + return Self::Conflict(msg); + } + if msg.contains("CHECK constraint failed") { + return Self::BadRequest(msg); + } + } + Self::Internal(err.into()) + } +} + +impl From for ApiError { + fn from(err: anyhow::Error) -> Self { + Self::Internal(err) + } +} diff --git a/src/federation.rs b/src/federation.rs new file mode 100644 index 0000000..6d962c2 --- /dev/null +++ b/src/federation.rs @@ -0,0 +1,499 @@ +//! P2P federation: publishes the local library index (artists, releases, +//! tracks — names and small metadata, never files) into a distributed hash +//! table shared by every furumi-fd instance that joined the same network, +//! and searches the other participants' libraries. +//! +//! Built on the `music-dht` crate. Peers of a network find each other +//! automatically knowing only the network name (rendezvous through the +//! BitTorrent Mainline DHT); no tickets or bootstrap servers are involved. +//! +//! Federation is **off by default** and controlled at runtime through +//! `/api/federation`; the settings persist in the `federation_settings` +//! table. + +use std::path::PathBuf; +use std::sync::Arc; +use std::time::Duration; + +use axum::extract::{Query, State}; +use axum::routing::{get, post, put}; +use axum::{Json, Router}; +use music_dht::{ + ItemKind, ItemSpec, LibraryItem, MusicDhtConfig, MusicDhtService, NetworkId, RendezvousConfig, +}; +use serde::{Deserialize, Serialize}; +use serde_json::{Value, json}; +use sqlx::{Row, SqlitePool}; +use tokio::task::JoinHandle; + +use crate::error::{ApiError, ApiResult}; +use crate::util::now_iso; + +/// How often the published library is re-synchronized with the local index. +const SYNC_INTERVAL: Duration = Duration::from_secs(60); + +/// Persisted federation settings (one row in `federation_settings`). +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct FederationSettings { + pub enabled: bool, + pub network_id: String, +} + +/// Outcome of the most recent library synchronization. +#[derive(Debug, Clone, Serialize)] +struct LastSync { + at: String, + added: usize, + updated: usize, + removed: usize, + unchanged: usize, + failed: usize, +} + +/// State of a running DHT node. +struct Running { + service: Arc, + network_name: String, + tasks: Vec>, +} + +/// The federation subsystem: settings, node lifecycle and search. +pub struct Federation { + pool: SqlitePool, + data_dir: PathBuf, + running: tokio::sync::Mutex>, + last_sync: std::sync::Mutex>, + last_error: std::sync::Mutex>, +} + +impl Federation { + pub fn new(pool: SqlitePool, data_dir: PathBuf) -> Arc { + Arc::new(Self { + pool, + data_dir, + running: tokio::sync::Mutex::new(None), + last_sync: std::sync::Mutex::new(None), + last_error: std::sync::Mutex::new(None), + }) + } + + async fn load_settings(&self) -> ApiResult { + let row = sqlx::query("SELECT enabled, network_id FROM federation_settings WHERE id = 1") + .fetch_one(&self.pool) + .await?; + Ok(FederationSettings { + enabled: row.get::(0) != 0, + network_id: row.get(1), + }) + } + + async fn save_settings(&self, settings: &FederationSettings) -> ApiResult<()> { + sqlx::query("UPDATE federation_settings SET enabled = ?, network_id = ? WHERE id = 1") + .bind(settings.enabled as i64) + .bind(&settings.network_id) + .execute(&self.pool) + .await?; + Ok(()) + } + + /// Starts the DHT node on boot when federation was left enabled. + pub async fn start_if_enabled(self: &Arc) { + match self.load_settings().await { + Ok(settings) if settings.enabled && !settings.network_id.trim().is_empty() => { + if let Err(err) = self.start(settings.network_id).await { + tracing::error!("federation autostart failed: {err:?}"); + self.set_error(format!("autostart failed: {err}")); + } + } + Ok(_) => {} + Err(err) => tracing::error!("failed to load federation settings: {err:?}"), + } + } + + fn set_error(&self, message: impl Into>) { + *self + .last_error + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) = message.into(); + } + + /// Starts the DHT node for `network_name`. Idempotent per network: a node + /// already running on the same network is kept; a node on a different + /// network is stopped first. + async fn start(self: &Arc, network_name: String) -> anyhow::Result<()> { + let mut guard = self.running.lock().await; + if let Some(running) = guard.as_ref() { + if running.network_name == network_name { + return Ok(()); + } + stop_running(guard.take()).await; + } + + let config = MusicDhtConfig::builder() + .data_dir(&self.data_dir) + .network_id(NetworkId::from_name(&network_name)) + // Peers of the network find each other knowing only its name. + .rendezvous(RendezvousConfig::default()) + .build() + .map_err(|err| anyhow::anyhow!("invalid federation config: {err}"))?; + let (service, mut events) = MusicDhtService::start(config) + .await + .map_err(|err| anyhow::anyhow!("failed to start the DHT node: {err}"))?; + let service = Arc::new(service); + tracing::info!( + endpoint_id = %service.endpoint_id(), + network = %network_name, + "federation started" + ); + + // Drain DHT events into the log; the channel is bounded and must be + // consumed. + let event_task = tokio::spawn(async move { + while let Some(event) = events.recv().await { + tracing::debug!("federation event: {event:?}"); + } + }); + // Keep the published library in sync with the local index. + let sync_self = self.clone(); + let sync_service = service.clone(); + let sync_task = tokio::spawn(async move { + let mut interval = tokio::time::interval(SYNC_INTERVAL); + loop { + interval.tick().await; + sync_self.sync_once(&sync_service).await; + } + }); + + *guard = Some(Running { + service, + network_name, + tasks: vec![event_task, sync_task], + }); + self.set_error(None); + Ok(()) + } + + /// Stops the DHT node if it is running. + async fn stop(&self) { + let mut guard = self.running.lock().await; + stop_running(guard.take()).await; + } + + /// Called on process shutdown. + pub async fn shutdown(&self) { + self.stop().await; + } + + /// Runs one library synchronization and records the outcome. + async fn sync_once(&self, service: &MusicDhtService) { + let specs = match collect_library(&self.pool).await { + Ok(specs) => specs, + Err(err) => { + tracing::warn!("federation sync: failed to read the library: {err:?}"); + self.set_error(format!("library read failed: {err}")); + return; + } + }; + match service.sync_library(specs).await { + Ok(stats) => { + *self + .last_sync + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) = Some(LastSync { + at: now_iso(), + added: stats.added, + updated: stats.updated, + removed: stats.removed, + unchanged: stats.unchanged, + failed: stats.failed, + }); + self.set_error(None); + } + Err(err) => { + tracing::warn!("federation sync failed: {err}"); + self.set_error(format!("sync failed: {err}")); + } + } + } + + /// Current status: settings plus live node statistics. + async fn status(&self) -> ApiResult { + let settings = self.load_settings().await?; + let guard = self.running.lock().await; + let node = match guard.as_ref() { + Some(running) => { + let service = &running.service; + let published = service + .list_local_items() + .await + .map(|items| items.len()) + .unwrap_or(0); + let peers: Vec = service + .connected_peers() + .iter() + .map(|p| p.to_string()) + .collect(); + json!({ + "running": true, + "network": running.network_name, + "endpoint_id": service.endpoint_id().to_string(), + "node_id": service.node_id().to_string(), + "connected_peers": peers, + "known_contacts": service.known_peers().len(), + "published_items": published, + }) + } + None => json!({ "running": false }), + }; + let last_sync = self + .last_sync + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .clone(); + let last_error = self + .last_error + .lock() + .unwrap_or_else(std::sync::PoisonError::into_inner) + .clone(); + Ok(json!({ + "settings": settings, + "node": node, + "last_sync": last_sync, + "last_error": last_error, + })) + } +} + +async fn stop_running(running: Option) { + let Some(running) = running else { return }; + for task in &running.tasks { + task.abort(); + } + if let Err(err) = running.service.shutdown().await { + tracing::warn!("federation node shutdown reported an error: {err}"); + } + tracing::info!("federation stopped"); +} + +/// Reads the local library index and converts it into DHT item specs. +/// +/// Only names and small metadata are shared — never file paths, hashes or +/// anything about the files themselves. +async fn collect_library(pool: &SqlitePool) -> anyhow::Result> { + let mut specs = Vec::new(); + + let artists = sqlx::query("SELECT id, name FROM artists WHERE is_hidden = 0") + .fetch_all(pool) + .await?; + for row in &artists { + let id: i64 = row.get(0); + specs.push(ItemSpec { + local_key: format!("artist:{id}"), + kind: ItemKind::Artist, + name: row.get(1), + artist_names: Vec::new(), + year: None, + release_type: None, + duration_seconds: None, + }); + } + + let release_artists = sqlx::query( + "SELECT ra.release_id, a.name FROM release_artists ra + JOIN artists a ON a.id = ra.artist_id + ORDER BY ra.release_id, ra.position", + ) + .fetch_all(pool) + .await?; + let mut artists_of_release: std::collections::HashMap> = Default::default(); + for row in &release_artists { + artists_of_release + .entry(row.get(0)) + .or_default() + .push(row.get(1)); + } + let releases = + sqlx::query("SELECT id, title, year, release_type FROM releases WHERE is_hidden = 0") + .fetch_all(pool) + .await?; + for row in &releases { + let id: i64 = row.get(0); + specs.push(ItemSpec { + local_key: format!("release:{id}"), + kind: ItemKind::Release, + name: row.get(1), + artist_names: artists_of_release.remove(&id).unwrap_or_default(), + year: row.get(2), + release_type: row.get(3), + duration_seconds: None, + }); + } + + let track_artists = sqlx::query( + "SELECT ta.track_id, a.name FROM track_artists ta + JOIN artists a ON a.id = ta.artist_id + ORDER BY ta.track_id, ta.position", + ) + .fetch_all(pool) + .await?; + let mut artists_of_track: std::collections::HashMap> = Default::default(); + for row in &track_artists { + artists_of_track + .entry(row.get(0)) + .or_default() + .push(row.get(1)); + } + let tracks = + sqlx::query("SELECT id, title, year, duration_seconds FROM tracks WHERE is_hidden = 0") + .fetch_all(pool) + .await?; + for row in &tracks { + let id: i64 = row.get(0); + let duration: f64 = row.get(3); + specs.push(ItemSpec { + local_key: format!("track:{id}"), + kind: ItemKind::Track, + name: row.get(1), + artist_names: artists_of_track.remove(&id).unwrap_or_default(), + year: row.get(2), + release_type: None, + duration_seconds: (duration > 0.0).then_some(duration), + }); + } + + Ok(specs) +} + +fn item_to_json(item: &LibraryItem) -> Value { + json!({ + "kind": item.kind.as_str(), + "name": item.name, + "artist_names": item.artist_names, + "year": item.year, + "release_type": item.release_type, + "duration_seconds": item.duration_seconds, + "owner": item.owner.to_string(), + "updated_at_ms": item.updated_at_ms, + }) +} + +// --------------------------------------------------------------------------- +// HTTP API +// --------------------------------------------------------------------------- + +pub fn router() -> Router> { + Router::new() + .route("/federation", get(get_status)) + .route("/federation/settings", put(put_settings)) + .route("/federation/search", get(search)) + .route("/federation/sync", post(sync_now)) +} + +async fn get_status(State(fed): State>) -> ApiResult> { + Ok(Json(fed.status().await?)) +} + +#[derive(Debug, Deserialize)] +struct PutSettings { + enabled: bool, + network_id: String, +} + +/// Applies new settings: persists them and starts/stops/restarts the node. +async fn put_settings( + State(fed): State>, + Json(body): Json, +) -> ApiResult> { + let network_id = body.network_id.trim().to_string(); + if body.enabled && network_id.is_empty() { + return Err(ApiError::BadRequest( + "network_id must not be empty when federation is enabled".to_string(), + )); + } + let settings = FederationSettings { + enabled: body.enabled, + network_id, + }; + fed.save_settings(&settings).await?; + if settings.enabled { + fed.start(settings.network_id.clone()) + .await + .map_err(|err| ApiError::BadRequest(format!("failed to start federation: {err}")))?; + // Publish the library right away instead of waiting for the timer. + let guard = fed.running.lock().await; + if let Some(running) = guard.as_ref() { + let fed = fed.clone(); + let service = running.service.clone(); + tokio::spawn(async move { fed.sync_once(&service).await }); + } + } else { + fed.stop().await; + } + Ok(Json(fed.status().await?)) +} + +#[derive(Debug, Deserialize)] +struct SearchParams { + q: String, + /// Optional filter: artist | release | track. + kind: Option, +} + +/// Searches the federated network (and the local replica store). +async fn search( + State(fed): State>, + Query(params): Query, +) -> ApiResult> { + let kind_filter: Option = match params.kind.as_deref() { + None | Some("") => None, + Some(kind) => Some( + kind.parse() + .map_err(|_| ApiError::BadRequest(format!("unknown kind '{kind}'")))?, + ), + }; + let guard = fed.running.lock().await; + let Some(running) = guard.as_ref() else { + return Err(ApiError::BadRequest( + "federation is not running".to_string(), + )); + }; + let service = running.service.clone(); + drop(guard); + + let outcome = service + .search_network(¶ms.q) + .await + .map_err(|err| ApiError::BadRequest(format!("search failed: {err}")))?; + let own = service.endpoint_id(); + let results: Vec = outcome + .network_results + .iter() + .filter(|item| kind_filter.is_none_or(|kind| item.kind == kind)) + .map(|item| { + let mut value = item_to_json(item); + value["own"] = Value::Bool(item.owner == own); + value + }) + .collect(); + Ok(Json(json!({ + "query": params.q, + "results": results, + "queried_nodes": outcome.queried_nodes, + "discovered_nodes": outcome.discovered_nodes, + "duration_ms": outcome.duration.as_millis() as u64, + }))) +} + +/// Forces an immediate library synchronization. +async fn sync_now(State(fed): State>) -> ApiResult> { + let guard = fed.running.lock().await; + let Some(running) = guard.as_ref() else { + return Err(ApiError::BadRequest( + "federation is not running".to_string(), + )); + }; + let service = running.service.clone(); + drop(guard); + fed.sync_once(&service).await; + Ok(Json(fed.status().await?)) +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..a067ef9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,66 @@ +mod error; +mod federation; +mod routes; +mod schema; +mod util; + +use std::str::FromStr; + +use sqlx::sqlite::{SqliteConnectOptions, SqliteJournalMode, SqlitePoolOptions}; + +#[tokio::main] +async fn main() -> anyhow::Result<()> { + tracing_subscriber::fmt() + .with_env_filter( + tracing_subscriber::EnvFilter::try_from_default_env() + .unwrap_or_else(|_| "furumi_fd=info,tower_http=info".into()), + ) + .init(); + + let db_path = std::env::var("FURUMI_FD_DB").unwrap_or_else(|_| "furumi-fd.sqlite3".to_string()); + let listen_addr = + std::env::var("FURUMI_FD_LISTEN").unwrap_or_else(|_| "127.0.0.1:8321".to_string()); + + let options = SqliteConnectOptions::from_str(&format!("sqlite://{db_path}"))? + .create_if_missing(true) + .journal_mode(SqliteJournalMode::Wal) + .foreign_keys(true) + .busy_timeout(std::time::Duration::from_secs(5)); + let pool = SqlitePoolOptions::new() + .max_connections(8) + .connect_with(options) + .await?; + schema::init(&pool).await?; + tracing::info!("database ready at {db_path}"); + + // Federation state (identity, DHT replicas) lives outside the main db. + let federation_dir = std::env::var("FURUMI_FD_FEDERATION_DIR") + .unwrap_or_else(|_| format!("{db_path}.federation")); + let federation = federation::Federation::new(pool.clone(), federation_dir.into()); + federation.start_if_enabled().await; + + let app = axum::Router::new() + .route( + "/", + axum::routing::get(|| async { + axum::response::Html(include_str!("../static/index.html")) + }), + ) + .nest( + "/api", + routes::api_router() + .with_state(pool) + .merge(federation::router().with_state(federation.clone())), + ); + + let listener = tokio::net::TcpListener::bind(&listen_addr).await?; + tracing::info!("furumi-fd listening on http://{listen_addr}"); + axum::serve(listener, app) + .with_graceful_shutdown(async { + let _ = tokio::signal::ctrl_c().await; + }) + .await?; + // Leave the DHT gracefully so peers see a clean disconnect. + federation.shutdown().await; + Ok(()) +} diff --git a/src/routes/artists.rs b/src/routes/artists.rs new file mode 100644 index 0000000..5fafc5f --- /dev/null +++ b/src/routes/artists.rs @@ -0,0 +1,222 @@ +use axum::extract::{Path, Query, State}; +use axum::routing::get; +use axum::{Json, Router}; +use serde::{Deserialize, Serialize}; +use sqlx::SqlitePool; + +use crate::error::{ApiError, ApiResult}; +use crate::util::{double_option, normalize_name, now_iso, page_limit, page_offset}; + +pub fn router() -> Router { + Router::new() + .route("/", get(list).post(create)) + .route("/{id}", get(get_one).patch(update).delete(delete_one)) +} + +#[derive(Debug, Serialize, sqlx::FromRow)] +pub struct Artist { + pub id: i64, + pub name: String, + pub name_sort: String, + pub image_file_id: Option, + pub is_hidden: bool, + pub model_name: Option, + pub created_at: String, + pub updated_at: String, +} + +pub async fn fetch(pool: &SqlitePool, id: i64) -> ApiResult { + sqlx::query_as::<_, Artist>("SELECT * FROM artists WHERE id = ?") + .bind(id) + .fetch_optional(pool) + .await? + .ok_or_else(|| ApiError::not_found("artist", id)) +} + +#[derive(Debug, Deserialize)] +struct ListParams { + /// Substring match against name (normalized) + q: Option, + hidden: Option, + limit: Option, + offset: Option, +} + +async fn list( + State(pool): State, + Query(params): Query, +) -> ApiResult>> { + let mut qb = sqlx::QueryBuilder::new("SELECT * FROM artists WHERE 1=1"); + if let Some(q) = ¶ms.q { + qb.push(" AND name_sort LIKE ") + .push_bind(format!("%{}%", normalize_name(q))); + } + if let Some(hidden) = params.hidden { + qb.push(" AND is_hidden = ").push_bind(hidden); + } + qb.push(" ORDER BY name_sort LIMIT ") + .push_bind(page_limit(params.limit)) + .push(" OFFSET ") + .push_bind(page_offset(params.offset)); + let rows = qb.build_query_as::().fetch_all(&pool).await?; + Ok(Json(rows)) +} + +#[derive(Debug, Serialize, sqlx::FromRow)] +struct ArtistRelease { + id: i64, + title: String, + release_type: String, + year: Option, + position: i64, +} + +#[derive(Debug, Serialize)] +struct ArtistDetail { + #[serde(flatten)] + artist: Artist, + releases: Vec, + track_count: i64, +} + +async fn get_one( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + let artist = fetch(&pool, id).await?; + let releases = sqlx::query_as::<_, ArtistRelease>( + "SELECT r.id, r.title, r.release_type, r.year, ra.position + FROM releases r + JOIN release_artists ra ON ra.release_id = r.id + WHERE ra.artist_id = ? + ORDER BY r.year, r.title_sort", + ) + .bind(id) + .fetch_all(&pool) + .await?; + let (track_count,): (i64,) = + sqlx::query_as("SELECT COUNT(*) FROM track_artists WHERE artist_id = ?") + .bind(id) + .fetch_one(&pool) + .await?; + Ok(Json(ArtistDetail { + artist, + releases, + track_count, + })) +} + +#[derive(Debug, Deserialize)] +struct CreateArtist { + /// Explicit id for migration; omit for auto-increment. + id: Option, + name: String, + image_file_id: Option, + #[serde(default)] + is_hidden: bool, + model_name: Option, + /// Overrides for migration; default to now. + created_at: Option, + updated_at: Option, +} + +async fn create( + State(pool): State, + Json(body): Json, +) -> ApiResult> { + if body.name.trim().is_empty() { + return Err(ApiError::BadRequest("name must not be empty".to_string())); + } + let now = now_iso(); + let row = sqlx::query_as::<_, Artist>( + "INSERT INTO artists (id, name, name_sort, image_file_id, is_hidden, model_name, created_at, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + RETURNING *", + ) + .bind(body.id) + .bind(&body.name) + .bind(normalize_name(&body.name)) + .bind(body.image_file_id) + .bind(body.is_hidden) + .bind(&body.model_name) + .bind(body.created_at.unwrap_or_else(|| now.clone())) + .bind(body.updated_at.unwrap_or(now)) + .fetch_one(&pool) + .await?; + Ok(Json(row)) +} + +#[derive(Debug, Deserialize)] +struct UpdateArtist { + name: Option, + #[serde(default, deserialize_with = "double_option")] + image_file_id: Option>, + is_hidden: Option, + #[serde(default, deserialize_with = "double_option")] + model_name: Option>, +} + +async fn update( + State(pool): State, + Path(id): Path, + Json(body): Json, +) -> ApiResult> { + let mut row = fetch(&pool, id).await?; + if let Some(name) = body.name { + if name.trim().is_empty() { + return Err(ApiError::BadRequest("name must not be empty".to_string())); + } + row.name_sort = normalize_name(&name); + row.name = name; + } + if let Some(v) = body.image_file_id { + row.image_file_id = v; + } + if let Some(v) = body.is_hidden { + row.is_hidden = v; + } + if let Some(v) = body.model_name { + row.model_name = v; + } + row.updated_at = now_iso(); + sqlx::query( + "UPDATE artists SET name = ?, name_sort = ?, image_file_id = ?, is_hidden = ?, + model_name = ?, updated_at = ? + WHERE id = ?", + ) + .bind(&row.name) + .bind(&row.name_sort) + .bind(row.image_file_id) + .bind(row.is_hidden) + .bind(&row.model_name) + .bind(&row.updated_at) + .bind(id) + .execute(&pool) + .await?; + Ok(Json(row)) +} + +async fn delete_one( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + let mut tx = pool.begin().await?; + let result = sqlx::query("DELETE FROM artists WHERE id = ?") + .bind(id) + .execute(&mut *tx) + .await?; + if result.rows_affected() == 0 { + return Err(ApiError::not_found("artist", id)); + } + // Link rows cascade via FK; polymorphic metadata is cleaned manually. + sqlx::query("DELETE FROM entity_genre_tags WHERE entity_kind = 'artist' AND entity_id = ?") + .bind(id) + .execute(&mut *tx) + .await?; + sqlx::query("DELETE FROM external_metadata_ids WHERE entity_kind = 'artist' AND entity_id = ?") + .bind(id) + .execute(&mut *tx) + .await?; + tx.commit().await?; + Ok(Json(serde_json::json!({ "deleted": id }))) +} diff --git a/src/routes/genres.rs b/src/routes/genres.rs new file mode 100644 index 0000000..bf55da5 --- /dev/null +++ b/src/routes/genres.rs @@ -0,0 +1,97 @@ +use axum::extract::{Path, Query, State}; +use axum::routing::get; +use axum::{Json, Router}; +use serde::{Deserialize, Serialize}; +use sqlx::SqlitePool; + +use crate::error::{ApiError, ApiResult}; +use crate::util::{normalize_name, page_limit, page_offset}; + +pub fn router() -> Router { + Router::new() + .route("/", get(list).post(create)) + .route("/{id}", get(get_one).delete(delete_one)) +} + +#[derive(Debug, Serialize, sqlx::FromRow)] +pub struct Genre { + pub id: i64, + pub name: String, + pub name_normalized: String, +} + +#[derive(Debug, Deserialize)] +struct ListParams { + q: Option, + limit: Option, + offset: Option, +} + +async fn list( + State(pool): State, + Query(params): Query, +) -> ApiResult>> { + let mut qb = sqlx::QueryBuilder::new("SELECT * FROM genres WHERE 1=1"); + if let Some(q) = ¶ms.q { + qb.push(" AND name_normalized LIKE ") + .push_bind(format!("%{}%", normalize_name(q))); + } + qb.push(" ORDER BY name_normalized LIMIT ") + .push_bind(page_limit(params.limit)) + .push(" OFFSET ") + .push_bind(page_offset(params.offset)); + let rows = qb.build_query_as::().fetch_all(&pool).await?; + Ok(Json(rows)) +} + +async fn get_one(State(pool): State, Path(id): Path) -> ApiResult> { + sqlx::query_as::<_, Genre>("SELECT * FROM genres WHERE id = ?") + .bind(id) + .fetch_optional(&pool) + .await? + .map(Json) + .ok_or_else(|| ApiError::not_found("genre", id)) +} + +#[derive(Debug, Deserialize)] +struct CreateGenre { + /// Explicit id for migration; omit for auto-increment. + id: Option, + name: String, +} + +/// Upsert by normalized name: creating an existing genre returns the +/// existing row instead of failing. +async fn create( + State(pool): State, + Json(body): Json, +) -> ApiResult> { + if body.name.trim().is_empty() { + return Err(ApiError::BadRequest("name must not be empty".to_string())); + } + let row = sqlx::query_as::<_, Genre>( + "INSERT INTO genres (id, name, name_normalized) VALUES (?, ?, ?) + ON CONFLICT (name_normalized) DO UPDATE SET name = excluded.name + RETURNING *", + ) + .bind(body.id) + .bind(body.name.trim()) + .bind(normalize_name(&body.name)) + .fetch_one(&pool) + .await?; + Ok(Json(row)) +} + +async fn delete_one( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + let result = sqlx::query("DELETE FROM genres WHERE id = ?") + .bind(id) + .execute(&pool) + .await?; + if result.rows_affected() == 0 { + return Err(ApiError::not_found("genre", id)); + } + Ok(Json(serde_json::json!({ "deleted": id }))) +} diff --git a/src/routes/media_files.rs b/src/routes/media_files.rs new file mode 100644 index 0000000..18fcfa7 --- /dev/null +++ b/src/routes/media_files.rs @@ -0,0 +1,237 @@ +use axum::extract::{Path, Query, State}; +use axum::routing::get; +use axum::{Json, Router}; +use serde::{Deserialize, Serialize}; +use sqlx::SqlitePool; + +use crate::error::{ApiError, ApiResult}; +use crate::util::{double_option, now_iso, page_limit, page_offset}; + +pub fn router() -> Router { + Router::new() + .route("/", get(list).post(create)) + .route("/{id}", get(get_one).patch(update).delete(delete_one)) +} + +#[derive(Debug, Serialize, sqlx::FromRow)] +pub struct MediaFile { + pub id: i64, + pub file_type: String, + pub file_path: String, + pub original_filename: String, + pub mime_type: String, + pub file_size_bytes: i64, + pub sha256_hash: String, + pub audio_format: Option, + pub audio_bitrate: Option, + pub audio_sample_rate: Option, + pub audio_bit_depth: Option, + pub uploader_name: String, + pub created_at: String, +} + +pub async fn fetch(pool: &SqlitePool, id: i64) -> ApiResult { + sqlx::query_as::<_, MediaFile>("SELECT * FROM media_files WHERE id = ?") + .bind(id) + .fetch_optional(pool) + .await? + .ok_or_else(|| ApiError::not_found("media file", id)) +} + +#[derive(Debug, Deserialize)] +pub struct ListParams { + file_type: Option, + sha256: Option, + /// Substring match against file_path + q: Option, + limit: Option, + offset: Option, +} + +async fn list( + State(pool): State, + Query(params): Query, +) -> ApiResult>> { + let mut qb = sqlx::QueryBuilder::new("SELECT * FROM media_files WHERE 1=1"); + if let Some(file_type) = ¶ms.file_type { + qb.push(" AND file_type = ").push_bind(file_type); + } + if let Some(sha256) = ¶ms.sha256 { + qb.push(" AND sha256_hash = ").push_bind(sha256); + } + if let Some(q) = ¶ms.q { + qb.push(" AND file_path LIKE ").push_bind(format!("%{q}%")); + } + qb.push(" ORDER BY id LIMIT ") + .push_bind(page_limit(params.limit)) + .push(" OFFSET ") + .push_bind(page_offset(params.offset)); + let rows = qb.build_query_as::().fetch_all(&pool).await?; + Ok(Json(rows)) +} + +async fn get_one( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + Ok(Json(fetch(&pool, id).await?)) +} + +#[derive(Debug, Deserialize)] +struct CreateMediaFile { + /// Explicit id for migration; omit for auto-increment. + id: Option, + file_type: String, + file_path: String, + #[serde(default)] + original_filename: Option, + #[serde(default)] + mime_type: Option, + #[serde(default)] + file_size_bytes: Option, + #[serde(default)] + sha256_hash: Option, + audio_format: Option, + audio_bitrate: Option, + audio_sample_rate: Option, + audio_bit_depth: Option, + #[serde(default)] + uploader_name: Option, + /// Override for migration; defaults to now. + created_at: Option, +} + +async fn create( + State(pool): State, + Json(body): Json, +) -> ApiResult> { + if body.file_type != "audio" && body.file_type != "cover_art" { + return Err(ApiError::BadRequest( + "file_type must be 'audio' or 'cover_art'".to_string(), + )); + } + let row = sqlx::query_as::<_, MediaFile>( + "INSERT INTO media_files ( + id, file_type, file_path, original_filename, mime_type, + file_size_bytes, sha256_hash, audio_format, audio_bitrate, + audio_sample_rate, audio_bit_depth, uploader_name, created_at + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + RETURNING *", + ) + .bind(body.id) + .bind(&body.file_type) + .bind(&body.file_path) + .bind(body.original_filename.unwrap_or_default()) + .bind(body.mime_type.unwrap_or_default()) + .bind(body.file_size_bytes.unwrap_or(0)) + .bind(body.sha256_hash.unwrap_or_default()) + .bind(&body.audio_format) + .bind(body.audio_bitrate) + .bind(body.audio_sample_rate) + .bind(body.audio_bit_depth) + .bind(body.uploader_name.unwrap_or_else(|| "UFO".to_string())) + .bind(body.created_at.unwrap_or_else(now_iso)) + .fetch_one(&pool) + .await?; + Ok(Json(row)) +} + +#[derive(Debug, Deserialize)] +struct UpdateMediaFile { + file_type: Option, + file_path: Option, + original_filename: Option, + mime_type: Option, + file_size_bytes: Option, + sha256_hash: Option, + #[serde(default, deserialize_with = "double_option")] + audio_format: Option>, + #[serde(default, deserialize_with = "double_option")] + audio_bitrate: Option>, + #[serde(default, deserialize_with = "double_option")] + audio_sample_rate: Option>, + #[serde(default, deserialize_with = "double_option")] + audio_bit_depth: Option>, + uploader_name: Option, +} + +async fn update( + State(pool): State, + Path(id): Path, + Json(body): Json, +) -> ApiResult> { + let mut row = fetch(&pool, id).await?; + if let Some(file_type) = body.file_type { + if file_type != "audio" && file_type != "cover_art" { + return Err(ApiError::BadRequest( + "file_type must be 'audio' or 'cover_art'".to_string(), + )); + } + row.file_type = file_type; + } + if let Some(v) = body.file_path { + row.file_path = v; + } + if let Some(v) = body.original_filename { + row.original_filename = v; + } + if let Some(v) = body.mime_type { + row.mime_type = v; + } + if let Some(v) = body.file_size_bytes { + row.file_size_bytes = v; + } + if let Some(v) = body.sha256_hash { + row.sha256_hash = v; + } + if let Some(v) = body.audio_format { + row.audio_format = v; + } + if let Some(v) = body.audio_bitrate { + row.audio_bitrate = v; + } + if let Some(v) = body.audio_sample_rate { + row.audio_sample_rate = v; + } + if let Some(v) = body.audio_bit_depth { + row.audio_bit_depth = v; + } + if let Some(v) = body.uploader_name { + row.uploader_name = v; + } + sqlx::query( + "UPDATE media_files SET file_type = ?, file_path = ?, original_filename = ?, + mime_type = ?, file_size_bytes = ?, sha256_hash = ?, audio_format = ?, + audio_bitrate = ?, audio_sample_rate = ?, audio_bit_depth = ?, uploader_name = ? + WHERE id = ?", + ) + .bind(&row.file_type) + .bind(&row.file_path) + .bind(&row.original_filename) + .bind(&row.mime_type) + .bind(row.file_size_bytes) + .bind(&row.sha256_hash) + .bind(&row.audio_format) + .bind(row.audio_bitrate) + .bind(row.audio_sample_rate) + .bind(row.audio_bit_depth) + .bind(&row.uploader_name) + .bind(id) + .execute(&pool) + .await?; + Ok(Json(row)) +} + +async fn delete_one( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + let result = sqlx::query("DELETE FROM media_files WHERE id = ?") + .bind(id) + .execute(&pool) + .await?; + if result.rows_affected() == 0 { + return Err(ApiError::not_found("media file", id)); + } + Ok(Json(serde_json::json!({ "deleted": id }))) +} diff --git a/src/routes/metadata.rs b/src/routes/metadata.rs new file mode 100644 index 0000000..3068f64 --- /dev/null +++ b/src/routes/metadata.rs @@ -0,0 +1,273 @@ +//! Polymorphic metadata: weighted genre tags and external identifiers +//! attached to an artist, release or track. + +use axum::extract::{Path, Query, State}; +use axum::routing::get; +use axum::{Json, Router}; +use serde::{Deserialize, Serialize}; +use sqlx::SqlitePool; + +use crate::error::{ApiError, ApiResult}; +use crate::util::{ENTITY_KINDS, now_iso, page_limit, page_offset}; + +pub fn genre_tags_router() -> Router { + Router::new() + .route("/", get(list_genre_tags).post(upsert_genre_tag)) + .route("/{id}", axum::routing::delete(delete_genre_tag)) +} + +pub fn external_ids_router() -> Router { + Router::new() + .route("/", get(list_external_ids).post(upsert_external_id)) + .route("/{id}", axum::routing::delete(delete_external_id)) +} + +async fn validate_entity(pool: &SqlitePool, entity_kind: &str, entity_id: i64) -> ApiResult<()> { + let table = match entity_kind { + "artist" => "artists", + "release" => "releases", + "track" => "tracks", + _ => { + return Err(ApiError::BadRequest(format!( + "entity_kind must be one of: {}", + ENTITY_KINDS.join(", ") + ))); + } + }; + // The table name comes from the whitelist above, never from user input. + let exists: Option<(i64,)> = sqlx::query_as(sqlx::AssertSqlSafe(format!( + "SELECT id FROM {table} WHERE id = ?" + ))) + .bind(entity_id) + .fetch_optional(pool) + .await?; + if exists.is_none() { + return Err(ApiError::not_found(entity_kind, entity_id)); + } + Ok(()) +} + +// --------------------------------------------------------------------------- +// Genre tags +// --------------------------------------------------------------------------- + +#[derive(Debug, Serialize, sqlx::FromRow)] +pub struct GenreTag { + pub id: i64, + pub entity_kind: String, + pub entity_id: i64, + pub genre_id: i64, + pub genre_name: String, + pub source: String, + pub weight: f64, + pub updated_at: String, +} + +#[derive(Debug, Deserialize)] +struct GenreTagListParams { + entity_kind: Option, + entity_id: Option, + genre_id: Option, + source: Option, + limit: Option, + offset: Option, +} + +async fn list_genre_tags( + State(pool): State, + Query(params): Query, +) -> ApiResult>> { + let mut qb = sqlx::QueryBuilder::new( + "SELECT egt.id, egt.entity_kind, egt.entity_id, egt.genre_id, + g.name AS genre_name, egt.source, egt.weight, egt.updated_at + FROM entity_genre_tags egt + JOIN genres g ON g.id = egt.genre_id + WHERE 1=1", + ); + if let Some(entity_kind) = ¶ms.entity_kind { + qb.push(" AND egt.entity_kind = ").push_bind(entity_kind); + } + if let Some(entity_id) = params.entity_id { + qb.push(" AND egt.entity_id = ").push_bind(entity_id); + } + if let Some(genre_id) = params.genre_id { + qb.push(" AND egt.genre_id = ").push_bind(genre_id); + } + if let Some(source) = ¶ms.source { + qb.push(" AND egt.source = ").push_bind(source); + } + qb.push(" ORDER BY egt.weight DESC, egt.id LIMIT ") + .push_bind(page_limit(params.limit)) + .push(" OFFSET ") + .push_bind(page_offset(params.offset)); + let rows = qb.build_query_as::().fetch_all(&pool).await?; + Ok(Json(rows)) +} + +#[derive(Debug, Deserialize)] +struct UpsertGenreTag { + entity_kind: String, + entity_id: i64, + genre_id: i64, + source: String, + #[serde(default)] + weight: Option, +} + +/// Upsert on (entity_kind, entity_id, genre_id, source): posting an existing +/// combination updates its weight. +async fn upsert_genre_tag( + State(pool): State, + Json(body): Json, +) -> ApiResult> { + validate_entity(&pool, &body.entity_kind, body.entity_id).await?; + let (id,): (i64,) = sqlx::query_as( + "INSERT INTO entity_genre_tags (entity_kind, entity_id, genre_id, source, weight, updated_at) + VALUES (?, ?, ?, ?, ?, ?) + ON CONFLICT (entity_kind, entity_id, genre_id, source) + DO UPDATE SET weight = excluded.weight, updated_at = excluded.updated_at + RETURNING id", + ) + .bind(&body.entity_kind) + .bind(body.entity_id) + .bind(body.genre_id) + .bind(&body.source) + .bind(body.weight.unwrap_or(1.0)) + .bind(now_iso()) + .fetch_one(&pool) + .await?; + let row = sqlx::query_as::<_, GenreTag>( + "SELECT egt.id, egt.entity_kind, egt.entity_id, egt.genre_id, + g.name AS genre_name, egt.source, egt.weight, egt.updated_at + FROM entity_genre_tags egt + JOIN genres g ON g.id = egt.genre_id + WHERE egt.id = ?", + ) + .bind(id) + .fetch_one(&pool) + .await?; + Ok(Json(row)) +} + +async fn delete_genre_tag( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + let result = sqlx::query("DELETE FROM entity_genre_tags WHERE id = ?") + .bind(id) + .execute(&pool) + .await?; + if result.rows_affected() == 0 { + return Err(ApiError::not_found("genre tag", id)); + } + Ok(Json(serde_json::json!({ "deleted": id }))) +} + +// --------------------------------------------------------------------------- +// External metadata ids (MusicBrainz, Last.fm, Discogs, ...) +// --------------------------------------------------------------------------- + +#[derive(Debug, Serialize, sqlx::FromRow)] +pub struct ExternalId { + pub id: i64, + pub entity_kind: String, + pub entity_id: i64, + pub source: String, + pub id_kind: String, + pub external_id: String, + pub confidence: f64, + pub updated_at: String, +} + +#[derive(Debug, Deserialize)] +struct ExternalIdListParams { + entity_kind: Option, + entity_id: Option, + source: Option, + id_kind: Option, + external_id: Option, + limit: Option, + offset: Option, +} + +async fn list_external_ids( + State(pool): State, + Query(params): Query, +) -> ApiResult>> { + let mut qb = sqlx::QueryBuilder::new("SELECT * FROM external_metadata_ids WHERE 1=1"); + if let Some(entity_kind) = ¶ms.entity_kind { + qb.push(" AND entity_kind = ").push_bind(entity_kind); + } + if let Some(entity_id) = params.entity_id { + qb.push(" AND entity_id = ").push_bind(entity_id); + } + if let Some(source) = ¶ms.source { + qb.push(" AND source = ").push_bind(source); + } + if let Some(id_kind) = ¶ms.id_kind { + qb.push(" AND id_kind = ").push_bind(id_kind); + } + if let Some(external_id) = ¶ms.external_id { + qb.push(" AND external_id = ").push_bind(external_id); + } + qb.push(" ORDER BY id LIMIT ") + .push_bind(page_limit(params.limit)) + .push(" OFFSET ") + .push_bind(page_offset(params.offset)); + let rows = qb.build_query_as::().fetch_all(&pool).await?; + Ok(Json(rows)) +} + +#[derive(Debug, Deserialize)] +struct UpsertExternalId { + entity_kind: String, + entity_id: i64, + source: String, + id_kind: String, + external_id: String, + #[serde(default)] + confidence: Option, +} + +/// Upsert on (entity_kind, entity_id, source, id_kind): posting an existing +/// combination updates external_id and confidence. +async fn upsert_external_id( + State(pool): State, + Json(body): Json, +) -> ApiResult> { + validate_entity(&pool, &body.entity_kind, body.entity_id).await?; + let row = sqlx::query_as::<_, ExternalId>( + "INSERT INTO external_metadata_ids + (entity_kind, entity_id, source, id_kind, external_id, confidence, updated_at) + VALUES (?, ?, ?, ?, ?, ?, ?) + ON CONFLICT (entity_kind, entity_id, source, id_kind) + DO UPDATE SET external_id = excluded.external_id, + confidence = excluded.confidence, + updated_at = excluded.updated_at + RETURNING *", + ) + .bind(&body.entity_kind) + .bind(body.entity_id) + .bind(&body.source) + .bind(&body.id_kind) + .bind(&body.external_id) + .bind(body.confidence.unwrap_or(1.0)) + .bind(now_iso()) + .fetch_one(&pool) + .await?; + Ok(Json(row)) +} + +async fn delete_external_id( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + let result = sqlx::query("DELETE FROM external_metadata_ids WHERE id = ?") + .bind(id) + .execute(&pool) + .await?; + if result.rows_affected() == 0 { + return Err(ApiError::not_found("external id", id)); + } + Ok(Json(serde_json::json!({ "deleted": id }))) +} diff --git a/src/routes/mod.rs b/src/routes/mod.rs new file mode 100644 index 0000000..0e1de55 --- /dev/null +++ b/src/routes/mod.rs @@ -0,0 +1,30 @@ +pub mod artists; +pub mod genres; +pub mod media_files; +pub mod metadata; +pub mod releases; +pub mod tracks; + +use axum::routing::get; +use axum::{Json, Router}; +use sqlx::SqlitePool; + +pub fn api_router() -> Router { + Router::new() + .route("/", get(health)) + .nest("/artists", artists::router()) + .nest("/releases", releases::router()) + .nest("/tracks", tracks::router()) + .nest("/media-files", media_files::router()) + .nest("/genres", genres::router()) + .nest("/genre-tags", metadata::genre_tags_router()) + .nest("/external-ids", metadata::external_ids_router()) +} + +async fn health() -> Json { + Json(serde_json::json!({ + "name": "furumi-fd", + "version": env!("CARGO_PKG_VERSION"), + "status": "ok", + })) +} diff --git a/src/routes/releases.rs b/src/routes/releases.rs new file mode 100644 index 0000000..83eec3c --- /dev/null +++ b/src/routes/releases.rs @@ -0,0 +1,378 @@ +use axum::extract::{Path, Query, State}; +use axum::routing::{get, put}; +use axum::{Json, Router}; +use serde::{Deserialize, Serialize}; +use sqlx::{Sqlite, SqlitePool, Transaction}; + +use crate::error::{ApiError, ApiResult}; +use crate::util::{RELEASE_TYPES, double_option, normalize_name, now_iso, page_limit, page_offset}; + +pub fn router() -> Router { + Router::new() + .route("/", get(list).post(create)) + .route("/{id}", get(get_one).patch(update).delete(delete_one)) + .route("/{id}/artists", put(set_artists)) +} + +#[derive(Debug, Serialize, sqlx::FromRow)] +pub struct Release { + pub id: i64, + pub title: String, + pub title_sort: String, + pub release_type: String, + pub year: Option, + pub cover_file_id: Option, + pub total_tracks: Option, + pub total_discs: Option, + pub is_hidden: bool, + pub model_name: Option, + pub created_at: String, + pub updated_at: String, +} + +pub async fn fetch(pool: &SqlitePool, id: i64) -> ApiResult { + sqlx::query_as::<_, Release>("SELECT * FROM releases WHERE id = ?") + .bind(id) + .fetch_optional(pool) + .await? + .ok_or_else(|| ApiError::not_found("release", id)) +} + +fn validate_release_type(release_type: &str) -> ApiResult<()> { + if RELEASE_TYPES.contains(&release_type) { + Ok(()) + } else { + Err(ApiError::BadRequest(format!( + "release_type must be one of: {}", + RELEASE_TYPES.join(", ") + ))) + } +} + +#[derive(Debug, Deserialize)] +struct ListParams { + /// Substring match against title (normalized) + q: Option, + artist_id: Option, + release_type: Option, + year: Option, + hidden: Option, + limit: Option, + offset: Option, +} + +async fn list( + State(pool): State, + Query(params): Query, +) -> ApiResult>> { + let mut qb = sqlx::QueryBuilder::new("SELECT r.* FROM releases r WHERE 1=1"); + if let Some(artist_id) = params.artist_id { + qb.push( + " AND EXISTS (SELECT 1 FROM release_artists ra + WHERE ra.release_id = r.id AND ra.artist_id = ", + ) + .push_bind(artist_id) + .push(")"); + } + if let Some(q) = ¶ms.q { + qb.push(" AND r.title_sort LIKE ") + .push_bind(format!("%{}%", normalize_name(q))); + } + if let Some(release_type) = ¶ms.release_type { + qb.push(" AND r.release_type = ").push_bind(release_type); + } + if let Some(year) = params.year { + qb.push(" AND r.year = ").push_bind(year); + } + if let Some(hidden) = params.hidden { + qb.push(" AND r.is_hidden = ").push_bind(hidden); + } + qb.push(" ORDER BY r.title_sort LIMIT ") + .push_bind(page_limit(params.limit)) + .push(" OFFSET ") + .push_bind(page_offset(params.offset)); + let rows = qb.build_query_as::().fetch_all(&pool).await?; + Ok(Json(rows)) +} + +#[derive(Debug, Serialize, sqlx::FromRow)] +struct ReleaseArtistOut { + id: i64, + name: String, + position: i64, +} + +#[derive(Debug, Serialize, sqlx::FromRow)] +struct ReleaseTrackOut { + id: i64, + title: String, + track_number: Option, + disc_number: Option, + duration_seconds: f64, + audio_file_id: i64, +} + +#[derive(Debug, Serialize)] +struct ReleaseDetail { + #[serde(flatten)] + release: Release, + artists: Vec, + tracks: Vec, +} + +async fn get_one( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + let release = fetch(&pool, id).await?; + let artists = sqlx::query_as::<_, ReleaseArtistOut>( + "SELECT a.id, a.name, ra.position + FROM artists a + JOIN release_artists ra ON ra.artist_id = a.id + WHERE ra.release_id = ? + ORDER BY ra.position", + ) + .bind(id) + .fetch_all(&pool) + .await?; + let tracks = sqlx::query_as::<_, ReleaseTrackOut>( + "SELECT id, title, track_number, disc_number, duration_seconds, audio_file_id + FROM tracks WHERE release_id = ? + ORDER BY disc_number, track_number, title_sort", + ) + .bind(id) + .fetch_all(&pool) + .await?; + Ok(Json(ReleaseDetail { + release, + artists, + tracks, + })) +} + +#[derive(Debug, Deserialize)] +struct CreateRelease { + /// Explicit id for migration; omit for auto-increment. + id: Option, + title: String, + #[serde(default)] + release_type: Option, + year: Option, + cover_file_id: Option, + total_tracks: Option, + total_discs: Option, + #[serde(default)] + is_hidden: bool, + model_name: Option, + /// Ordered list of artist ids; positions are assigned by index. + #[serde(default)] + artist_ids: Vec, + /// Overrides for migration; default to now. + created_at: Option, + updated_at: Option, +} + +async fn replace_artists( + tx: &mut Transaction<'_, Sqlite>, + release_id: i64, + artist_ids: &[i64], +) -> ApiResult<()> { + sqlx::query("DELETE FROM release_artists WHERE release_id = ?") + .bind(release_id) + .execute(&mut **tx) + .await?; + for (position, artist_id) in artist_ids.iter().enumerate() { + sqlx::query( + "INSERT INTO release_artists (release_id, artist_id, position) VALUES (?, ?, ?)", + ) + .bind(release_id) + .bind(artist_id) + .bind(position as i64) + .execute(&mut **tx) + .await?; + } + Ok(()) +} + +async fn create( + State(pool): State, + Json(body): Json, +) -> ApiResult> { + if body.title.trim().is_empty() { + return Err(ApiError::BadRequest("title must not be empty".to_string())); + } + let release_type = body.release_type.unwrap_or_else(|| "album".to_string()); + validate_release_type(&release_type)?; + let now = now_iso(); + let mut tx = pool.begin().await?; + let row = sqlx::query_as::<_, Release>( + "INSERT INTO releases ( + id, title, title_sort, release_type, year, cover_file_id, + total_tracks, total_discs, is_hidden, model_name, created_at, updated_at + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + RETURNING *", + ) + .bind(body.id) + .bind(&body.title) + .bind(normalize_name(&body.title)) + .bind(&release_type) + .bind(body.year) + .bind(body.cover_file_id) + .bind(body.total_tracks) + .bind(body.total_discs) + .bind(body.is_hidden) + .bind(&body.model_name) + .bind(body.created_at.unwrap_or_else(|| now.clone())) + .bind(body.updated_at.unwrap_or(now)) + .fetch_one(&mut *tx) + .await?; + replace_artists(&mut tx, row.id, &body.artist_ids).await?; + tx.commit().await?; + Ok(Json(row)) +} + +#[derive(Debug, Deserialize)] +struct UpdateRelease { + title: Option, + release_type: Option, + #[serde(default, deserialize_with = "double_option")] + year: Option>, + #[serde(default, deserialize_with = "double_option")] + cover_file_id: Option>, + #[serde(default, deserialize_with = "double_option")] + total_tracks: Option>, + #[serde(default, deserialize_with = "double_option")] + total_discs: Option>, + is_hidden: Option, + #[serde(default, deserialize_with = "double_option")] + model_name: Option>, +} + +async fn update( + State(pool): State, + Path(id): Path, + Json(body): Json, +) -> ApiResult> { + let mut row = fetch(&pool, id).await?; + if let Some(title) = body.title { + if title.trim().is_empty() { + return Err(ApiError::BadRequest("title must not be empty".to_string())); + } + row.title_sort = normalize_name(&title); + row.title = title; + } + if let Some(release_type) = body.release_type { + validate_release_type(&release_type)?; + row.release_type = release_type; + } + if let Some(v) = body.year { + row.year = v; + } + if let Some(v) = body.cover_file_id { + row.cover_file_id = v; + } + if let Some(v) = body.total_tracks { + row.total_tracks = v; + } + if let Some(v) = body.total_discs { + row.total_discs = v; + } + if let Some(v) = body.is_hidden { + row.is_hidden = v; + } + if let Some(v) = body.model_name { + row.model_name = v; + } + row.updated_at = now_iso(); + sqlx::query( + "UPDATE releases SET title = ?, title_sort = ?, release_type = ?, year = ?, + cover_file_id = ?, total_tracks = ?, total_discs = ?, is_hidden = ?, + model_name = ?, updated_at = ? + WHERE id = ?", + ) + .bind(&row.title) + .bind(&row.title_sort) + .bind(&row.release_type) + .bind(row.year) + .bind(row.cover_file_id) + .bind(row.total_tracks) + .bind(row.total_discs) + .bind(row.is_hidden) + .bind(&row.model_name) + .bind(&row.updated_at) + .bind(id) + .execute(&pool) + .await?; + Ok(Json(row)) +} + +#[derive(Debug, Deserialize)] +struct SetArtists { + /// Ordered list of artist ids; positions are assigned by index. + artist_ids: Vec, +} + +async fn set_artists( + State(pool): State, + Path(id): Path, + Json(body): Json, +) -> ApiResult> { + fetch(&pool, id).await?; + let mut tx = pool.begin().await?; + replace_artists(&mut tx, id, &body.artist_ids).await?; + sqlx::query("UPDATE releases SET updated_at = ? WHERE id = ?") + .bind(now_iso()) + .bind(id) + .execute(&mut *tx) + .await?; + tx.commit().await?; + Ok(Json( + serde_json::json!({ "release_id": id, "artist_ids": body.artist_ids }), + )) +} + +async fn delete_one( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + let mut tx = pool.begin().await?; + let track_ids: Vec<(i64,)> = sqlx::query_as("SELECT id FROM tracks WHERE release_id = ?") + .bind(id) + .fetch_all(&mut *tx) + .await?; + let result = sqlx::query("DELETE FROM releases WHERE id = ?") + .bind(id) + .execute(&mut *tx) + .await?; + if result.rows_affected() == 0 { + return Err(ApiError::not_found("release", id)); + } + // Tracks and link rows cascade via FK; polymorphic metadata is cleaned manually. + sqlx::query("DELETE FROM entity_genre_tags WHERE entity_kind = 'release' AND entity_id = ?") + .bind(id) + .execute(&mut *tx) + .await?; + sqlx::query( + "DELETE FROM external_metadata_ids WHERE entity_kind = 'release' AND entity_id = ?", + ) + .bind(id) + .execute(&mut *tx) + .await?; + for (track_id,) in &track_ids { + sqlx::query("DELETE FROM entity_genre_tags WHERE entity_kind = 'track' AND entity_id = ?") + .bind(track_id) + .execute(&mut *tx) + .await?; + sqlx::query( + "DELETE FROM external_metadata_ids WHERE entity_kind = 'track' AND entity_id = ?", + ) + .bind(track_id) + .execute(&mut *tx) + .await?; + } + tx.commit().await?; + Ok(Json(serde_json::json!({ + "deleted": id, + "deleted_tracks": track_ids.iter().map(|(t,)| *t).collect::>(), + }))) +} diff --git a/src/routes/tracks.rs b/src/routes/tracks.rs new file mode 100644 index 0000000..1af53dd --- /dev/null +++ b/src/routes/tracks.rs @@ -0,0 +1,458 @@ +use axum::extract::{Path, Query, State}; +use axum::routing::{get, put}; +use axum::{Json, Router}; +use serde::{Deserialize, Serialize}; +use sqlx::{Sqlite, SqlitePool, Transaction}; + +use crate::error::{ApiError, ApiResult}; +use crate::util::{ARTIST_ROLES, double_option, normalize_name, now_iso, page_limit, page_offset}; + +pub fn router() -> Router { + Router::new() + .route("/", get(list).post(create)) + .route("/{id}", get(get_one).patch(update).delete(delete_one)) + .route("/{id}/artists", put(set_artists)) + .route("/{id}/genres", put(set_genres)) +} + +#[derive(Debug, Serialize, sqlx::FromRow)] +pub struct Track { + pub id: i64, + pub title: String, + pub title_sort: String, + pub release_id: i64, + pub track_number: Option, + pub disc_number: Option, + pub duration_seconds: f64, + pub audio_file_id: i64, + pub cover_file_id: Option, + pub year: Option, + pub is_hidden: bool, + pub model_name: Option, + pub lastfm_listeners: Option, + pub lastfm_playcount: Option, + pub lastfm_rating: Option, + pub lastfm_updated_at: Option, + pub created_at: String, + pub updated_at: String, +} + +pub async fn fetch(pool: &SqlitePool, id: i64) -> ApiResult { + sqlx::query_as::<_, Track>("SELECT * FROM tracks WHERE id = ?") + .bind(id) + .fetch_optional(pool) + .await? + .ok_or_else(|| ApiError::not_found("track", id)) +} + +#[derive(Debug, Deserialize)] +struct ListParams { + /// Substring match against title (normalized) + q: Option, + release_id: Option, + artist_id: Option, + genre_id: Option, + hidden: Option, + limit: Option, + offset: Option, +} + +async fn list( + State(pool): State, + Query(params): Query, +) -> ApiResult>> { + let mut qb = sqlx::QueryBuilder::new("SELECT t.* FROM tracks t WHERE 1=1"); + if let Some(q) = ¶ms.q { + qb.push(" AND t.title_sort LIKE ") + .push_bind(format!("%{}%", normalize_name(q))); + } + if let Some(release_id) = params.release_id { + qb.push(" AND t.release_id = ").push_bind(release_id); + } + if let Some(artist_id) = params.artist_id { + qb.push( + " AND EXISTS (SELECT 1 FROM track_artists ta + WHERE ta.track_id = t.id AND ta.artist_id = ", + ) + .push_bind(artist_id) + .push(")"); + } + if let Some(genre_id) = params.genre_id { + qb.push( + " AND EXISTS (SELECT 1 FROM track_genres tg + WHERE tg.track_id = t.id AND tg.genre_id = ", + ) + .push_bind(genre_id) + .push(")"); + } + if let Some(hidden) = params.hidden { + qb.push(" AND t.is_hidden = ").push_bind(hidden); + } + qb.push(" ORDER BY t.release_id, t.disc_number, t.track_number, t.title_sort LIMIT ") + .push_bind(page_limit(params.limit)) + .push(" OFFSET ") + .push_bind(page_offset(params.offset)); + let rows = qb.build_query_as::().fetch_all(&pool).await?; + Ok(Json(rows)) +} + +#[derive(Debug, Serialize, sqlx::FromRow)] +struct TrackArtistOut { + id: i64, + name: String, + role: String, + position: i64, +} + +#[derive(Debug, Serialize, sqlx::FromRow)] +struct TrackGenreOut { + id: i64, + name: String, +} + +#[derive(Debug, Serialize)] +struct TrackDetail { + #[serde(flatten)] + track: Track, + artists: Vec, + genres: Vec, +} + +async fn get_one( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + let track = fetch(&pool, id).await?; + let artists = sqlx::query_as::<_, TrackArtistOut>( + "SELECT a.id, a.name, ta.role, ta.position + FROM artists a + JOIN track_artists ta ON ta.artist_id = a.id + WHERE ta.track_id = ? + ORDER BY ta.position", + ) + .bind(id) + .fetch_all(&pool) + .await?; + let genres = sqlx::query_as::<_, TrackGenreOut>( + "SELECT g.id, g.name + FROM genres g + JOIN track_genres tg ON tg.genre_id = g.id + WHERE tg.track_id = ? + ORDER BY g.name_normalized", + ) + .bind(id) + .fetch_all(&pool) + .await?; + Ok(Json(TrackDetail { + track, + artists, + genres, + })) +} + +#[derive(Debug, Deserialize)] +struct TrackArtistIn { + artist_id: i64, + #[serde(default)] + role: Option, + #[serde(default)] + position: Option, +} + +#[derive(Debug, Deserialize)] +struct CreateTrack { + /// Explicit id for migration; omit for auto-increment. + id: Option, + title: String, + release_id: i64, + audio_file_id: i64, + track_number: Option, + disc_number: Option, + #[serde(default)] + duration_seconds: Option, + cover_file_id: Option, + year: Option, + #[serde(default)] + is_hidden: bool, + model_name: Option, + #[serde(default)] + artists: Vec, + #[serde(default)] + genre_ids: Vec, + lastfm_listeners: Option, + lastfm_playcount: Option, + lastfm_rating: Option, + lastfm_updated_at: Option, + /// Overrides for migration; default to now. + created_at: Option, + updated_at: Option, +} + +async fn replace_artists( + tx: &mut Transaction<'_, Sqlite>, + track_id: i64, + artists: &[TrackArtistIn], +) -> ApiResult<()> { + sqlx::query("DELETE FROM track_artists WHERE track_id = ?") + .bind(track_id) + .execute(&mut **tx) + .await?; + for (index, entry) in artists.iter().enumerate() { + let role = entry.role.as_deref().unwrap_or("main"); + if !ARTIST_ROLES.contains(&role) { + return Err(ApiError::BadRequest(format!( + "role must be one of: {}", + ARTIST_ROLES.join(", ") + ))); + } + sqlx::query( + "INSERT INTO track_artists (track_id, artist_id, role, position) VALUES (?, ?, ?, ?)", + ) + .bind(track_id) + .bind(entry.artist_id) + .bind(role) + .bind(entry.position.unwrap_or(index as i64)) + .execute(&mut **tx) + .await?; + } + Ok(()) +} + +async fn replace_genres( + tx: &mut Transaction<'_, Sqlite>, + track_id: i64, + genre_ids: &[i64], +) -> ApiResult<()> { + sqlx::query("DELETE FROM track_genres WHERE track_id = ?") + .bind(track_id) + .execute(&mut **tx) + .await?; + for genre_id in genre_ids { + sqlx::query("INSERT OR IGNORE INTO track_genres (track_id, genre_id) VALUES (?, ?)") + .bind(track_id) + .bind(genre_id) + .execute(&mut **tx) + .await?; + } + Ok(()) +} + +async fn create( + State(pool): State, + Json(body): Json, +) -> ApiResult> { + if body.title.trim().is_empty() { + return Err(ApiError::BadRequest("title must not be empty".to_string())); + } + let now = now_iso(); + let mut tx = pool.begin().await?; + let row = sqlx::query_as::<_, Track>( + "INSERT INTO tracks ( + id, title, title_sort, release_id, track_number, disc_number, + duration_seconds, audio_file_id, cover_file_id, year, is_hidden, + model_name, lastfm_listeners, lastfm_playcount, lastfm_rating, + lastfm_updated_at, created_at, updated_at + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + RETURNING *", + ) + .bind(body.id) + .bind(&body.title) + .bind(normalize_name(&body.title)) + .bind(body.release_id) + .bind(body.track_number) + .bind(body.disc_number) + .bind(body.duration_seconds.unwrap_or(0.0)) + .bind(body.audio_file_id) + .bind(body.cover_file_id) + .bind(body.year) + .bind(body.is_hidden) + .bind(&body.model_name) + .bind(body.lastfm_listeners) + .bind(body.lastfm_playcount) + .bind(body.lastfm_rating) + .bind(&body.lastfm_updated_at) + .bind(body.created_at.unwrap_or_else(|| now.clone())) + .bind(body.updated_at.unwrap_or(now)) + .fetch_one(&mut *tx) + .await?; + replace_artists(&mut tx, row.id, &body.artists).await?; + replace_genres(&mut tx, row.id, &body.genre_ids).await?; + tx.commit().await?; + Ok(Json(row)) +} + +#[derive(Debug, Deserialize)] +struct UpdateTrack { + title: Option, + release_id: Option, + #[serde(default, deserialize_with = "double_option")] + track_number: Option>, + #[serde(default, deserialize_with = "double_option")] + disc_number: Option>, + duration_seconds: Option, + audio_file_id: Option, + #[serde(default, deserialize_with = "double_option")] + cover_file_id: Option>, + #[serde(default, deserialize_with = "double_option")] + year: Option>, + is_hidden: Option, + #[serde(default, deserialize_with = "double_option")] + model_name: Option>, + #[serde(default, deserialize_with = "double_option")] + lastfm_listeners: Option>, + #[serde(default, deserialize_with = "double_option")] + lastfm_playcount: Option>, + #[serde(default, deserialize_with = "double_option")] + lastfm_rating: Option>, + #[serde(default, deserialize_with = "double_option")] + lastfm_updated_at: Option>, +} + +async fn update( + State(pool): State, + Path(id): Path, + Json(body): Json, +) -> ApiResult> { + let mut row = fetch(&pool, id).await?; + if let Some(title) = body.title { + if title.trim().is_empty() { + return Err(ApiError::BadRequest("title must not be empty".to_string())); + } + row.title_sort = normalize_name(&title); + row.title = title; + } + if let Some(v) = body.release_id { + row.release_id = v; + } + if let Some(v) = body.track_number { + row.track_number = v; + } + if let Some(v) = body.disc_number { + row.disc_number = v; + } + if let Some(v) = body.duration_seconds { + row.duration_seconds = v; + } + if let Some(v) = body.audio_file_id { + row.audio_file_id = v; + } + if let Some(v) = body.cover_file_id { + row.cover_file_id = v; + } + if let Some(v) = body.year { + row.year = v; + } + if let Some(v) = body.is_hidden { + row.is_hidden = v; + } + if let Some(v) = body.model_name { + row.model_name = v; + } + if let Some(v) = body.lastfm_listeners { + row.lastfm_listeners = v; + } + if let Some(v) = body.lastfm_playcount { + row.lastfm_playcount = v; + } + if let Some(v) = body.lastfm_rating { + row.lastfm_rating = v; + } + if let Some(v) = body.lastfm_updated_at { + row.lastfm_updated_at = v; + } + row.updated_at = now_iso(); + sqlx::query( + "UPDATE tracks SET title = ?, title_sort = ?, release_id = ?, track_number = ?, + disc_number = ?, duration_seconds = ?, audio_file_id = ?, cover_file_id = ?, + year = ?, is_hidden = ?, model_name = ?, lastfm_listeners = ?, + lastfm_playcount = ?, lastfm_rating = ?, lastfm_updated_at = ?, updated_at = ? + WHERE id = ?", + ) + .bind(&row.title) + .bind(&row.title_sort) + .bind(row.release_id) + .bind(row.track_number) + .bind(row.disc_number) + .bind(row.duration_seconds) + .bind(row.audio_file_id) + .bind(row.cover_file_id) + .bind(row.year) + .bind(row.is_hidden) + .bind(&row.model_name) + .bind(row.lastfm_listeners) + .bind(row.lastfm_playcount) + .bind(row.lastfm_rating) + .bind(&row.lastfm_updated_at) + .bind(&row.updated_at) + .bind(id) + .execute(&pool) + .await?; + Ok(Json(row)) +} + +#[derive(Debug, Deserialize)] +struct SetTrackArtists { + artists: Vec, +} + +async fn set_artists( + State(pool): State, + Path(id): Path, + Json(body): Json, +) -> ApiResult> { + fetch(&pool, id).await?; + let mut tx = pool.begin().await?; + replace_artists(&mut tx, id, &body.artists).await?; + sqlx::query("UPDATE tracks SET updated_at = ? WHERE id = ?") + .bind(now_iso()) + .bind(id) + .execute(&mut *tx) + .await?; + tx.commit().await?; + Ok(Json(serde_json::json!({ "track_id": id }))) +} + +#[derive(Debug, Deserialize)] +struct SetTrackGenres { + genre_ids: Vec, +} + +async fn set_genres( + State(pool): State, + Path(id): Path, + Json(body): Json, +) -> ApiResult> { + fetch(&pool, id).await?; + let mut tx = pool.begin().await?; + replace_genres(&mut tx, id, &body.genre_ids).await?; + tx.commit().await?; + Ok(Json( + serde_json::json!({ "track_id": id, "genre_ids": body.genre_ids }), + )) +} + +async fn delete_one( + State(pool): State, + Path(id): Path, +) -> ApiResult> { + let mut tx = pool.begin().await?; + let result = sqlx::query("DELETE FROM tracks WHERE id = ?") + .bind(id) + .execute(&mut *tx) + .await?; + if result.rows_affected() == 0 { + return Err(ApiError::not_found("track", id)); + } + // Link rows and popularity history cascade via FK; polymorphic metadata + // is cleaned manually. + sqlx::query("DELETE FROM entity_genre_tags WHERE entity_kind = 'track' AND entity_id = ?") + .bind(id) + .execute(&mut *tx) + .await?; + sqlx::query("DELETE FROM external_metadata_ids WHERE entity_kind = 'track' AND entity_id = ?") + .bind(id) + .execute(&mut *tx) + .await?; + tx.commit().await?; + Ok(Json(serde_json::json!({ "deleted": id }))) +} diff --git a/src/schema.rs b/src/schema.rs new file mode 100644 index 0000000..4049ecd --- /dev/null +++ b/src/schema.rs @@ -0,0 +1,167 @@ +//! SQLite schema for the music library index. +//! +//! Mirrors the library-related primitives of the furumusic database +//! (artists, releases, tracks, media files, genres, genre tags, external +//! metadata ids, popularity) so that data can be migrated 1:1 by an +//! external script. Everything else (users, playlists, playback state, +//! jobs, torrents, scrobbling) is intentionally out of scope. + +use sqlx::SqlitePool; + +const SCHEMA: &[&str] = &[ + // Audio files and cover art on disk. This service only registers + // records — it never reads, writes or deletes the files themselves. + "CREATE TABLE IF NOT EXISTS media_files ( + id INTEGER PRIMARY KEY, + file_type TEXT NOT NULL CHECK (file_type IN ('audio', 'cover_art')), + file_path TEXT NOT NULL, + original_filename TEXT NOT NULL DEFAULT '', + mime_type TEXT NOT NULL DEFAULT '', + file_size_bytes INTEGER NOT NULL DEFAULT 0, + sha256_hash TEXT NOT NULL DEFAULT '', + audio_format TEXT, + audio_bitrate INTEGER, + audio_sample_rate INTEGER, + audio_bit_depth INTEGER, + uploader_name TEXT NOT NULL DEFAULT 'UFO', + created_at TEXT NOT NULL + )", + "CREATE INDEX IF NOT EXISTS idx_media_files_sha256 ON media_files (sha256_hash)", + "CREATE INDEX IF NOT EXISTS idx_media_files_type ON media_files (file_type)", + "CREATE TABLE IF NOT EXISTS artists ( + id INTEGER PRIMARY KEY, + name TEXT NOT NULL, + name_sort TEXT NOT NULL, + image_file_id INTEGER REFERENCES media_files(id) ON DELETE SET NULL, + is_hidden INTEGER NOT NULL DEFAULT 0, + model_name TEXT, + created_at TEXT NOT NULL, + updated_at TEXT NOT NULL + )", + "CREATE INDEX IF NOT EXISTS idx_artists_name_sort ON artists (name_sort)", + // release_type is one of: album, single, ep, compilation, mixtape, + // live, soundtrack, remix, demo (same vocabulary as furumusic). + "CREATE TABLE IF NOT EXISTS releases ( + id INTEGER PRIMARY KEY, + title TEXT NOT NULL, + title_sort TEXT NOT NULL, + release_type TEXT NOT NULL DEFAULT 'album', + year INTEGER, + cover_file_id INTEGER REFERENCES media_files(id) ON DELETE SET NULL, + total_tracks INTEGER, + total_discs INTEGER, + is_hidden INTEGER NOT NULL DEFAULT 0, + model_name TEXT, + created_at TEXT NOT NULL, + updated_at TEXT NOT NULL + )", + "CREATE INDEX IF NOT EXISTS idx_releases_title_sort ON releases (title_sort)", + "CREATE TABLE IF NOT EXISTS release_artists ( + release_id INTEGER NOT NULL REFERENCES releases(id) ON DELETE CASCADE, + artist_id INTEGER NOT NULL REFERENCES artists(id) ON DELETE CASCADE, + position INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (release_id, artist_id) + )", + "CREATE INDEX IF NOT EXISTS idx_release_artists_artist ON release_artists (artist_id)", + // lastfm_* columns mirror furumusic track popularity fields; they are + // filled by external agents through the regular update API. + "CREATE TABLE IF NOT EXISTS tracks ( + id INTEGER PRIMARY KEY, + title TEXT NOT NULL, + title_sort TEXT NOT NULL, + release_id INTEGER NOT NULL REFERENCES releases(id) ON DELETE CASCADE, + track_number INTEGER, + disc_number INTEGER, + duration_seconds REAL NOT NULL DEFAULT 0, + audio_file_id INTEGER NOT NULL REFERENCES media_files(id) ON DELETE RESTRICT, + cover_file_id INTEGER REFERENCES media_files(id) ON DELETE SET NULL, + year INTEGER, + is_hidden INTEGER NOT NULL DEFAULT 0, + model_name TEXT, + lastfm_listeners INTEGER, + lastfm_playcount INTEGER, + lastfm_rating REAL, + lastfm_updated_at TEXT, + created_at TEXT NOT NULL, + updated_at TEXT NOT NULL + )", + "CREATE INDEX IF NOT EXISTS idx_tracks_release ON tracks (release_id)", + "CREATE INDEX IF NOT EXISTS idx_tracks_title_sort ON tracks (title_sort)", + "CREATE INDEX IF NOT EXISTS idx_tracks_audio_file ON tracks (audio_file_id)", + // role is one of: main, featuring, remixer, producer. + "CREATE TABLE IF NOT EXISTS track_artists ( + track_id INTEGER NOT NULL REFERENCES tracks(id) ON DELETE CASCADE, + artist_id INTEGER NOT NULL REFERENCES artists(id) ON DELETE CASCADE, + role TEXT NOT NULL DEFAULT 'main', + position INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (track_id, artist_id, role) + )", + "CREATE INDEX IF NOT EXISTS idx_track_artists_artist ON track_artists (artist_id)", + "CREATE TABLE IF NOT EXISTS genres ( + id INTEGER PRIMARY KEY, + name TEXT NOT NULL, + name_normalized TEXT NOT NULL UNIQUE + )", + "CREATE TABLE IF NOT EXISTS track_genres ( + track_id INTEGER NOT NULL REFERENCES tracks(id) ON DELETE CASCADE, + genre_id INTEGER NOT NULL REFERENCES genres(id) ON DELETE CASCADE, + PRIMARY KEY (track_id, genre_id) + )", + // Weighted genre tags per entity (artist/release/track) with a source + // label, as in furumusic__entity_genre_tag. Filled by external agents. + "CREATE TABLE IF NOT EXISTS entity_genre_tags ( + id INTEGER PRIMARY KEY, + entity_kind TEXT NOT NULL CHECK (entity_kind IN ('artist', 'release', 'track')), + entity_id INTEGER NOT NULL, + genre_id INTEGER NOT NULL REFERENCES genres(id) ON DELETE CASCADE, + source TEXT NOT NULL, + weight REAL NOT NULL DEFAULT 1, + updated_at TEXT NOT NULL, + UNIQUE (entity_kind, entity_id, genre_id, source) + )", + "CREATE INDEX IF NOT EXISTS idx_entity_genre_tags_entity + ON entity_genre_tags (entity_kind, entity_id, source)", + // External identifiers (MusicBrainz, Last.fm, Discogs, ...) per entity, + // as in furumusic__external_metadata_id. + "CREATE TABLE IF NOT EXISTS external_metadata_ids ( + id INTEGER PRIMARY KEY, + entity_kind TEXT NOT NULL CHECK (entity_kind IN ('artist', 'release', 'track')), + entity_id INTEGER NOT NULL, + source TEXT NOT NULL, + id_kind TEXT NOT NULL, + external_id TEXT NOT NULL, + confidence REAL NOT NULL DEFAULT 1, + updated_at TEXT NOT NULL, + UNIQUE (entity_kind, entity_id, source, id_kind) + )", + "CREATE INDEX IF NOT EXISTS idx_external_metadata_ids_lookup + ON external_metadata_ids (source, id_kind, external_id)", + // Popularity snapshots per track, as in furumusic__track_popularity_history. + // Schema kept for migration/agents; no dedicated API endpoints yet. + "CREATE TABLE IF NOT EXISTS track_popularity_history ( + id INTEGER PRIMARY KEY, + track_id INTEGER NOT NULL REFERENCES tracks(id) ON DELETE CASCADE, + source TEXT NOT NULL, + listeners INTEGER NOT NULL, + playcount INTEGER NOT NULL, + rating REAL NOT NULL, + fetched_at TEXT NOT NULL + )", + "CREATE INDEX IF NOT EXISTS idx_track_popularity_history_track + ON track_popularity_history (track_id, fetched_at DESC)", + // P2P federation settings: a single row, disabled by default. The + // network name is the only thing peers need to share to find each other. + "CREATE TABLE IF NOT EXISTS federation_settings ( + id INTEGER PRIMARY KEY CHECK (id = 1), + enabled INTEGER NOT NULL DEFAULT 0, + network_id TEXT NOT NULL DEFAULT '' + )", + "INSERT OR IGNORE INTO federation_settings (id, enabled, network_id) VALUES (1, 0, '')", +]; + +pub async fn init(pool: &SqlitePool) -> anyhow::Result<()> { + for stmt in SCHEMA { + sqlx::query(*stmt).execute(pool).await?; + } + Ok(()) +} diff --git a/src/util.rs b/src/util.rs new file mode 100644 index 0000000..34f6b8f --- /dev/null +++ b/src/util.rs @@ -0,0 +1,43 @@ +use serde::{Deserialize, Deserializer}; + +/// Same timestamp format as furumusic: `2026-07-16T12:00:00Z`. +pub fn now_iso() -> String { + chrono::Utc::now().format("%Y-%m-%dT%H:%M:%SZ").to_string() +} + +/// Normalization used for `name_sort` / `title_sort`, same as furumusic. +pub fn normalize_name(name: &str) -> String { + name.trim().to_lowercase() +} + +/// Deserializes a field that distinguishes "absent" from "explicit null": +/// absent -> None, null -> Some(None), value -> Some(Some(v)). +pub fn double_option<'de, T, D>(de: D) -> Result>, D::Error> +where + T: Deserialize<'de>, + D: Deserializer<'de>, +{ + Deserialize::deserialize(de).map(Some) +} + +pub const ENTITY_KINDS: &[&str] = &["artist", "release", "track"]; +pub const RELEASE_TYPES: &[&str] = &[ + "album", + "single", + "ep", + "compilation", + "mixtape", + "live", + "soundtrack", + "remix", + "demo", +]; +pub const ARTIST_ROLES: &[&str] = &["main", "featuring", "remixer", "producer"]; + +pub fn page_limit(limit: Option) -> i64 { + limit.unwrap_or(100).clamp(1, 1000) +} + +pub fn page_offset(offset: Option) -> i64 { + offset.unwrap_or(0).max(0) +} diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..9bdcca5 --- /dev/null +++ b/static/index.html @@ -0,0 +1,555 @@ + + + + + +furumi-fd + + + + +

furumi-fd

менеджер музыкальной библиотеки (только индекс — файлы не трогает)
+ +
+
+
+ + +
+
+ +
+ + +
IDИмяСоздан
+ +
+ +
+
+ + + + + +
+
+ +
+ + +
IDНазваниеТипГодАртисты
+ +
+ +
+
+ + + + + + + +
+
+ +
+ + +
IDНазваниеРелиз#Длит.
+ +
+ +
+
+ + + + +
+
+ + +
+ + +
IDТипПутьMIME
+ +
+
+
+ + + + +
+ +
Загрузка…
+ +

Поиск по сети

+
+ + + + +
+ + +
ТипНазваниеАртистыГодДеталиВладелец
+ +
+
+ +
+ +
+ + +
+

+
+ + + +