diff --git a/.env.example b/.env.example index 4c7c6d9..23ba769 100644 --- a/.env.example +++ b/.env.example @@ -11,6 +11,13 @@ GETH_URL=http://127.0.0.1:8545 # Bind address for the proxy's HTTP listener (the .onion service forwards here). BIND_ADDR=127.0.0.1:8080 +# Bind address for the admin listener — `/health` and `/metrics`. Kept on a +# separate socket from BIND_ADDR so admin endpoints are NOT reachable +# through the Tor hidden service. Must be a loopback address; the daemon +# refuses to bind a non-loopback admin endpoint to prevent operators from +# accidentally exposing component state, request volume, and version. +ADMIN_BIND_ADDR=127.0.0.1:9001 + # tracing-subscriber filter. Examples: `info`, `debug`, `torpc=trace,hyper=info`. RUST_LOG=info @@ -32,6 +39,9 @@ RUST_LOG=info # Backwards-compatible alias for FLASHBOTS_RELAY_URL. Prefer the latter. # FLASHBOTS_URL=https://relay.flashbots.net +# Per-attempt timeout for Flashbots relay POSTs, in seconds. Default 5. +# FLASHBOTS_REQUEST_TIMEOUT=5 + # ----- Security ------------------------------------------------------------- # Maximum request body size in bytes. Default 1 MiB. @@ -53,9 +63,23 @@ RATE_LIMIT_REQUESTS=100 # Window duration in seconds. Default 60. RATE_LIMIT_WINDOW=60 +# Strict per-method bucket for write methods (`eth_sendRawTransaction`, +# `eth_sendBundle`). These are far more sensitive than reads, so they get a +# tighter limit even when the global RATE_LIMIT_REQUESTS budget is healthy. +# WRITE_RATE_LIMIT_REQUESTS=10 +# WRITE_RATE_LIMIT_WINDOW=60 + # Max concurrent in-flight requests across the entire router. Default 256. MAX_CONCURRENT_CONNECTIONS=256 +# ----- Tor anonymity safety net -------------------------------------------- + +# Set to `1` to permit the daemon to start even when configs/torrc enables +# `HiddenServiceSingleHopMode 1` or `HiddenServiceNonAnonymousMode 1`. +# These flags strip Tor's anonymity guarantees and exist for benchmarks / +# CI only — never set this in production. +# TORPC_ALLOW_NON_ANONYMOUS=1 + # ----- Discovery (client-side proxy only) ----------------------------------- # Enable the optional discovery server that wallet GUIs use to detect a diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 462d80a..ceaa822 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,37 +23,85 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: components: rustfmt - - name: cargo fmt --check (root) - run: cargo fmt --check - - name: cargo fmt --check (torpc-proxy workspace) - run: cargo fmt --check --manifest-path torpc-proxy/Cargo.toml --all + - name: cargo fmt --check + run: cargo fmt --all --check + # clippy and test cover the full workspace including the Tauri GUI crate. + # Tauri 1.x links against `libwebkit2gtk-4.0` + `libsoup2.4`, both of + # which Ubuntu 24.04 (the `ubuntu-latest` image) dropped in favor of -4.1 + # / -3.0. Pin to `ubuntu-22.04` until the GUI migrates to Tauri 2.x — + # ubuntu-22.04 GH runner support extends well past that migration. clippy: name: clippy - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: clippy - uses: Swatinem/rust-cache@v2 - - name: clippy (root) - run: cargo clippy --all-targets -- -D warnings - - name: clippy (torpc-proxy workspace) - run: cargo clippy --manifest-path torpc-proxy/Cargo.toml --workspace --all-targets -- -D warnings + with: + # rust-cache keys on `runner.os` ("Linux") which is shared + # between ubuntu-latest (24.04) and ubuntu-22.04. Without a + # per-image prefix, build-script binaries cached on 24.04 + # (GLIBC 2.39) leak into 22.04 jobs (GLIBC 2.35) and fail with + # `version 'GLIBC_2.39' not found`. The `ImageOS` env var + # (ubuntu22 / ubuntu24 / etc.) gives us proper isolation. + prefix-key: "v0-rust-${{ env.ImageOS }}" + - name: install Tauri 1.x system deps + run: | + sudo apt-get update + sudo apt-get install -y \ + libwebkit2gtk-4.0-dev \ + libgtk-3-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + libsoup2.4-dev + - name: clippy + run: cargo clippy --workspace --all-targets -- -D warnings test: name: test (no services) - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 + with: + # rust-cache keys on `runner.os` ("Linux") which is shared + # between ubuntu-latest (24.04) and ubuntu-22.04. Without a + # per-image prefix, build-script binaries cached on 24.04 + # (GLIBC 2.39) leak into 22.04 jobs (GLIBC 2.35) and fail with + # `version 'GLIBC_2.39' not found`. The `ImageOS` env var + # (ubuntu22 / ubuntu24 / etc.) gives us proper isolation. + prefix-key: "v0-rust-${{ env.ImageOS }}" + - name: install Tauri 1.x system deps + run: | + sudo apt-get update + sudo apt-get install -y \ + libwebkit2gtk-4.0-dev \ + libgtk-3-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + libsoup2.4-dev - name: build run: cargo build --workspace - - name: build torpc-proxy workspace - run: cargo build --manifest-path torpc-proxy/Cargo.toml --workspace - - name: fast tests - run: make test - - name: torpc-proxy workspace tests - run: cargo test --manifest-path torpc-proxy/Cargo.toml --workspace + - name: tests + run: cargo test --workspace --tests + + # Mandatory: any new RUSTSEC vulnerability against a crate in `Cargo.lock` + # fails the pipeline. Default cargo-audit behavior treats unmaintained / + # unsound / yanked as informational warnings, which is the right balance + # here — the Tauri 1.x dep tree carries some unmaintained transitives that + # we'll clear when we migrate to 2.x; surfacing them as hard errors today + # would block the daemon from shipping for an unrelated reason. + audit: + name: cargo audit + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: install cargo-audit + run: cargo install --locked cargo-audit + - name: cargo audit + run: cargo audit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..049553b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,118 @@ +name: Release + +on: + push: + tags: + - 'v*' + +# Need write access to create the release and upload assets. +permissions: + contents: write + +jobs: + build: + name: build (${{ matrix.target }}) + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + # Linux x86_64 + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + archive_ext: tar.gz + # macOS Intel + - os: macos-13 + target: x86_64-apple-darwin + archive_ext: tar.gz + # macOS Apple Silicon + - os: macos-latest + target: aarch64-apple-darwin + archive_ext: tar.gz + # Windows x86_64 + - os: windows-latest + target: x86_64-pc-windows-msvc + archive_ext: zip + + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.target }} + + # Build the daemon and the CLI client. The Tauri GUI is intentionally + # excluded from the release for now — bundling needs platform-specific + # post-build steps (DMG, AppImage, MSI) that we'll add when there's + # demand. Source build of the GUI is documented in the README. + - name: build daemon + CLI client + run: | + cargo build --release --target ${{ matrix.target }} --bin torpc + cargo build --release --target ${{ matrix.target }} --bin torpc-proxy + + # Pack each binary into the platform-conventional archive. macOS and + # Linux get tar.gz; Windows gets zip. Strip is implicit via the + # workspace [profile.release] `strip = true` setting. + - name: package (Unix) + if: runner.os != 'Windows' + shell: bash + run: | + set -euo pipefail + mkdir -p dist + for bin in torpc torpc-proxy; do + archive="${bin}-${GITHUB_REF_NAME}-${{ matrix.target }}.tar.gz" + tar -C "target/${{ matrix.target }}/release" -czf "dist/${archive}" "${bin}" + (cd dist && shasum -a 256 "${archive}" > "${archive}.sha256") + done + ls -la dist/ + + - name: package (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + New-Item -ItemType Directory -Force -Path dist | Out-Null + foreach ($bin in @("torpc", "torpc-proxy")) { + $archive = "${bin}-${env:GITHUB_REF_NAME}-${{ matrix.target }}.zip" + $exe = "target/${{ matrix.target }}/release/${bin}.exe" + Compress-Archive -Path $exe -DestinationPath "dist/${archive}" + $hash = (Get-FileHash -Algorithm SHA256 "dist/${archive}").Hash.ToLower() + "$hash ${archive}" | Out-File -Encoding ascii "dist/${archive}.sha256" + } + Get-ChildItem dist + + - name: upload artifacts + uses: actions/upload-artifact@v4 + with: + name: dist-${{ matrix.target }} + path: dist/* + if-no-files-found: error + + release: + name: publish release + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: collect artifacts + uses: actions/download-artifact@v4 + with: + path: dist + merge-multiple: true + + - name: list collected artifacts + run: ls -la dist/ + + # Use the tag annotation as the release body if present, else fall back + # to a generic message. softprops/action-gh-release auto-generates a + # release on the corresponding tag. + - name: publish release + uses: softprops/action-gh-release@v2 + with: + files: dist/* + generate_release_notes: true + fail_on_unmatched_files: true diff --git a/Cargo.lock b/Cargo.lock index ef9d524..a471688 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,6 +26,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + [[package]] name = "android-tzdata" version = "0.1.1" @@ -41,6 +56,56 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.60.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.60.2", +] + [[package]] name = "anyhow" version = "1.0.98" @@ -57,6 +122,21 @@ dependencies = [ "serde_json", ] +[[package]] +name = "assert_cmd" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39bae1d3fa576f7c6519514180a72559268dd7d1fe104070956cb687bc6673bd" +dependencies = [ + "anstyle", + "bstr", + "libc", + "predicates", + "predicates-core", + "predicates-tree", + "wait-timeout", +] + [[package]] name = "async-trait" version = "0.1.88" @@ -65,7 +145,31 @@ checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", +] + +[[package]] +name = "atk" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c3d816ce6f0e2909a96830d6911c2aff044370b1ef92d7f267b43bae5addedd" +dependencies = [ + "atk-sys", + "bitflags 1.3.2", + "glib", + "libc", +] + +[[package]] +name = "atk-sys" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58aeb089fb698e06db8089971c7ee317ab9644bade33383f63631437b03aafb6" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.2.2", ] [[package]] @@ -101,7 +205,7 @@ dependencies = [ "http-body-util", "hyper 1.6.0", "hyper-util", - "itoa", + "itoa 1.0.15", "matchit", "memchr", "mime", @@ -185,12 +289,24 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bitflags" version = "1.3.2" @@ -203,6 +319,12 @@ version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + [[package]] name = "block-buffer" version = "0.10.4" @@ -212,17 +334,95 @@ dependencies = [ "generic-array", ] +[[package]] +name = "brotli" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a334ef7c9e23abf0ce748e8cd309037da93e606ad52eb372e4ce327a0dcfbdfd" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + +[[package]] +name = "bstr" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63044e1ae8e69f3b5a92c736ca6269b8d12fa7efe39bf34ddb06d102cf0e2cab" +dependencies = [ + "memchr", + "regex-automata", + "serde", +] + [[package]] name = "bumpalo" version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +[[package]] +name = "bytemuck" +version = "1.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bytes" -version = "1.10.1" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" + +[[package]] +name = "cairo-rs" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c76ee391b03d35510d9fa917357c7f1855bd9a6659c95a1b392e33f49b3369bc" +dependencies = [ + "bitflags 1.3.2", + "cairo-sys-rs", + "glib", + "libc", + "thiserror 1.0.69", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c55d429bef56ac9172d25fecb85dc8068307d17acd74b377866b7a1ef25d3c8" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "cargo_toml" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" +checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" +dependencies = [ + "serde", + "toml 0.7.8", +] [[package]] name = "cc" @@ -233,6 +433,42 @@ dependencies = [ "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfb" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" +dependencies = [ + "byteorder", + "fnv", + "uuid", +] + +[[package]] +name = "cfg-expr" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3431df59f28accaf4cb4eed4a9acc66bea3f3c3753aa6cdc2f024174ef232af7" +dependencies = [ + "smallvec", +] + +[[package]] +name = "cfg-expr" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.1" @@ -257,9 +493,91 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-link", + "windows-link 0.1.3", +] + +[[package]] +name = "clap" +version = "4.5.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92793da1a46a5f2a02a6f4c46c6496b28c43638adea8306fcb0caa1634f24e5" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "clap_lex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" + +[[package]] +name = "cocoa" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f425db7937052c684daec3bd6375c8abe2d146dca4b8b143d6db777c39138f3a" +dependencies = [ + "bitflags 1.3.2", + "block", + "cocoa-foundation", + "core-foundation", + "core-graphics", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c6234cbb2e4c785b456c0644748b1ac416dd045799740356f8363dfe00c93f7" +dependencies = [ + "bitflags 1.3.2", + "block", + "core-foundation", + "core-graphics-types", + "libc", + "objc", ] +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + [[package]] name = "colored" version = "3.0.0" @@ -269,6 +587,22 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "cookie" version = "0.18.1" @@ -296,1403 +630,3430 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] -name = "cpufeatures" -version = "0.2.17" +name = "core-graphics" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "core-graphics-types", + "foreign-types", "libc", ] [[package]] -name = "crypto-common" -version = "0.1.6" +name = "core-graphics-types" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ - "generic-array", - "typenum", + "bitflags 1.3.2", + "core-foundation", + "libc", ] [[package]] -name = "deranged" -version = "0.4.0" +name = "cpufeatures" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ - "powerfmt", + "libc", ] [[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "digest" -version = "0.10.7" +name = "crc32fast" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ - "block-buffer", - "crypto-common", + "cfg-if", ] [[package]] -name = "displaydoc" -version = "0.2.5" +name = "crossbeam-channel" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" dependencies = [ - "proc-macro2", - "quote", - "syn", + "crossbeam-utils", ] [[package]] -name = "either" -version = "1.15.0" +name = "crossbeam-deque" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] [[package]] -name = "encoding_rs" -version = "0.8.35" +name = "crossbeam-epoch" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", + "crossbeam-utils", ] [[package]] -name = "equivalent" -version = "1.0.2" +name = "crossbeam-utils" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] -name = "errno" -version = "0.3.13" +name = "crypto-common" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "libc", - "windows-sys 0.60.2", + "generic-array", + "typenum", ] [[package]] -name = "fastrand" -version = "2.3.0" +name = "cssparser" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - +checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa 0.4.8", + "matches", + "phf 0.8.0", + "proc-macro2", + "quote", + "smallvec", + "syn 1.0.109", +] + [[package]] -name = "fnv" -version = "1.0.7" +name = "cssparser-macros" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.104", +] [[package]] -name = "foreign-types" -version = "0.3.2" +name = "ctor" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ - "foreign-types-shared", + "quote", + "syn 2.0.104", ] [[package]] -name = "foreign-types-shared" -version = "0.1.1" +name = "daemonize" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +checksum = "ab8bfdaacb3c887a54d41bdf48d3af8873b3f5566469f8ba21b92057509f116e" +dependencies = [ + "libc", +] [[package]] -name = "form_urlencoded" -version = "1.2.1" +name = "darling" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" dependencies = [ - "percent-encoding", + "darling_core", + "darling_macro", ] [[package]] -name = "futures-channel" -version = "0.3.31" +name = "darling_core" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" dependencies = [ - "futures-core", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.104", ] [[package]] -name = "futures-core" -version = "0.3.31" +name = "darling_macro" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.104", +] [[package]] -name = "futures-io" -version = "0.3.31" +name = "deranged" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", + "serde_core", +] [[package]] -name = "futures-sink" -version = "0.3.31" +name = "derive_more" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.104", +] [[package]] -name = "futures-task" -version = "0.3.31" +name = "diff" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" [[package]] -name = "futures-util" -version = "0.3.31" +name = "difflib" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8" + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "futures-core", - "futures-io", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", + "block-buffer", + "crypto-common", ] [[package]] -name = "generic-array" -version = "0.14.7" +name = "dirs" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "typenum", - "version_check", + "dirs-sys", ] [[package]] -name = "getrandom" -version = "0.2.16" +name = "dirs-next" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ "cfg-if", - "libc", - "wasi 0.11.1+wasi-snapshot-preview1", + "dirs-sys-next", ] [[package]] -name = "getrandom" -version = "0.3.3" +name = "dirs-sys" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ - "cfg-if", "libc", - "r-efi", - "wasi 0.14.2+wasi-0.2.4", + "option-ext", + "redox_users", + "windows-sys 0.48.0", ] [[package]] -name = "gimli" -version = "0.31.1" +name = "dirs-sys-next" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] [[package]] -name = "h2" -version = "0.3.26" +name = "dispatch" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] +checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" [[package]] -name = "h2" -version = "0.4.11" +name = "displaydoc" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17da50a276f1e01e0ba6c029e47b7100754904ee8a278f886546e98575380785" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http 1.3.1", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] -name = "hashbrown" -version = "0.15.4" +name = "dotenvy" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] -name = "hex" -version = "0.4.3" +name = "dtoa" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "4c3cf4824e2d5f025c7b531afcb2325364084a16806f6d47fbc1f5fbd9960590" [[package]] -name = "http" -version = "0.2.12" +name = "dtoa-short" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" dependencies = [ - "bytes", - "fnv", - "itoa", + "dtoa", ] [[package]] -name = "http" -version = "1.3.1" +name = "dunce" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" -dependencies = [ - "bytes", - "fnv", - "itoa", -] +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] -name = "http-body" -version = "0.4.6" +name = "dyn-clone" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" [[package]] -name = "http-body" -version = "1.0.1" +name = "either" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "embed-resource" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d506610004cfc74a6f5ee7e8c632b355de5eca1f03ee5e5e0ec11b77d4eb3d61" dependencies = [ - "bytes", - "http 1.3.1", + "cc", + "memchr", + "rustc_version", + "toml 0.8.23", + "vswhom", + "winreg 0.52.0", ] [[package]] -name = "http-body-util" -version = "0.1.3" +name = "embed_plist" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ - "bytes", - "futures-core", - "http 1.3.1", - "http-body 1.0.1", - "pin-project-lite", + "cfg-if", ] [[package]] -name = "http-range-header" -version = "0.4.2" +name = "equivalent" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] -name = "httparse" -version = "1.10.1" +name = "errno" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" +checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +dependencies = [ + "libc", + "windows-sys 0.60.2", +] [[package]] -name = "httpdate" -version = "1.0.3" +name = "fastrand" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] -name = "hyper" -version = "0.14.32" +name = "fdeflate" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +checksum = "1e6853b52649d4ac5c0bd02320cddc5ba956bdb407c4b75a2c6b75bf51500f8c" dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", + "simd-adler32", ] [[package]] -name = "hyper" -version = "1.6.0" +name = "field-offset" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f" dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2 0.4.11", - "http 1.3.1", - "http-body 1.0.1", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", + "memoffset", + "rustc_version", ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "filetime" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" dependencies = [ - "bytes", - "hyper 0.14.32", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "hyper-util" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "http 1.3.1", - "http-body 1.0.1", - "hyper 1.6.0", + "cfg-if", "libc", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", + "libredox", ] [[package]] -name = "iana-time-zone" -version = "0.1.63" +name = "flate2" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "log", - "wasm-bindgen", - "windows-core", + "crc32fast", + "miniz_oxide", ] [[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" +name = "float-cmp" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "b09cf3155332e944990140d967ff5eceb70df778b34f77d8075db46e4704e6d8" dependencies = [ - "cc", + "num-traits", ] [[package]] -name = "icu_collections" -version = "2.0.0" +name = "fluent-uri" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" dependencies = [ - "displaydoc", - "potential_utf", - "yoke", - "zerofrom", - "zerovec", + "bitflags 1.3.2", ] [[package]] -name = "icu_locale_core" -version = "2.0.0" +name = "fnv" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] -name = "icu_normalizer" -version = "2.0.0" +name = "foreign-types" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "zerovec", + "foreign-types-shared", ] [[package]] -name = "icu_normalizer_data" -version = "2.0.0" +name = "foreign-types-shared" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] -name = "icu_properties" -version = "2.0.1" +name = "form_urlencoded" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "displaydoc", - "icu_collections", - "icu_locale_core", - "icu_properties_data", - "icu_provider", - "potential_utf", - "zerotrie", - "zerovec", + "percent-encoding", ] [[package]] -name = "icu_properties_data" -version = "2.0.1" +name = "futf" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" +checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" +dependencies = [ + "mac", + "new_debug_unreachable", +] [[package]] -name = "icu_provider" -version = "2.0.0" +name = "futures-channel" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ - "displaydoc", - "icu_locale_core", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerotrie", - "zerovec", + "futures-core", ] [[package]] -name = "idna" -version = "1.0.3" +name = "futures-core" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] -name = "idna_adapter" -version = "1.2.1" +name = "futures-executor" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ - "icu_normalizer", - "icu_properties", + "futures-core", + "futures-task", + "futures-util", ] [[package]] -name = "indexmap" -version = "2.10.0" +name = "futures-io" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ - "equivalent", - "hashbrown", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] -name = "ipnet" -version = "2.11.0" +name = "futures-sink" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] -name = "itoa" -version = "1.0.15" +name = "futures-task" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] -name = "js-sys" -version = "0.3.77" +name = "futures-util" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ - "once_cell", - "wasm-bindgen", + "futures-core", + "futures-io", + "futures-macro", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", ] [[package]] -name = "keccak" -version = "0.1.5" +name = "fxhash" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" dependencies = [ - "cpufeatures", + "byteorder", ] [[package]] -name = "lazy_static" -version = "1.5.0" +name = "gdk" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "a6e05c1f572ab0e1f15be94217f0dc29088c248b14f792a5ff0af0d84bcda9e8" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk-pixbuf", + "gdk-sys", + "gio", + "glib", + "libc", + "pango", +] [[package]] -name = "libc" -version = "0.2.174" +name = "gdk-pixbuf" +version = "0.15.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +checksum = "ad38dd9cc8b099cceecdf41375bb6d481b1b5a7cd5cd603e10a69a9383f8619a" +dependencies = [ + "bitflags 1.3.2", + "gdk-pixbuf-sys", + "gio", + "glib", + "libc", +] [[package]] -name = "linux-raw-sys" -version = "0.9.4" +name = "gdk-pixbuf-sys" +version = "0.15.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" +checksum = "140b2f5378256527150350a8346dbdb08fadc13453a7a2d73aecd5fab3c402a7" +dependencies = [ + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.2.2", +] [[package]] -name = "litemap" -version = "0.8.0" +name = "gdk-sys" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" +checksum = "32e7a08c1e8f06f4177fb7e51a777b8c1689f743a7bc11ea91d44d2226073a88" +dependencies = [ + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "pkg-config", + "system-deps 6.2.2", +] [[package]] -name = "lock_api" -version = "0.4.13" +name = "gdkwayland-sys" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +checksum = "cca49a59ad8cfdf36ef7330fe7bdfbe1d34323220cc16a0de2679ee773aee2c2" dependencies = [ - "autocfg", - "scopeguard", + "gdk-sys", + "glib-sys", + "gobject-sys", + "libc", + "pkg-config", + "system-deps 6.2.2", ] [[package]] -name = "log" -version = "0.4.27" +name = "gdkx11-sys" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +checksum = "b4b7f8c7a84b407aa9b143877e267e848ff34106578b64d1e0a24bf550716178" +dependencies = [ + "gdk-sys", + "glib-sys", + "libc", + "system-deps 6.2.2", + "x11", +] [[package]] -name = "matchers" -version = "0.1.0" +name = "generator" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" dependencies = [ - "regex-automata 0.1.10", + "cc", + "libc", + "log", + "rustversion", + "windows 0.48.0", ] [[package]] -name = "matchit" -version = "0.7.3" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] [[package]] -name = "memchr" -version = "2.7.5" +name = "getrandom" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] [[package]] -name = "mime" -version = "0.3.17" +name = "getrandom" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "gio" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68fdbc90312d462781a395f7a16d96a2b379bb6ef8cd6310a2df272771c4283b" +dependencies = [ + "bitflags 1.3.2", + "futures-channel", + "futures-core", + "futures-io", + "gio-sys", + "glib", + "libc", + "once_cell", + "thiserror 1.0.69", +] + +[[package]] +name = "gio-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32157a475271e2c4a023382e9cab31c4584ee30a97da41d3c4e9fdd605abcf8d" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.2.2", + "winapi", +] + +[[package]] +name = "glib" +version = "0.15.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edb0306fbad0ab5428b0ca674a23893db909a98582969c9b537be4ced78c505d" +dependencies = [ + "bitflags 1.3.2", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "glib-macros", + "glib-sys", + "gobject-sys", + "libc", + "once_cell", + "smallvec", + "thiserror 1.0.69", +] + +[[package]] +name = "glib-macros" +version = "0.15.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10c6ae9f6fa26f4fb2ac16b528d138d971ead56141de489f8111e259b9df3c4a" +dependencies = [ + "anyhow", + "heck 0.4.1", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "glib-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef4b192f8e65e9cf76cbf4ea71fa8e3be4a0e18ffe3d68b8da6836974cc5bad4" +dependencies = [ + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "glob" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cc23270f6e1808e30a928bdc84dea0b9b4136a8bc82338574f23baf47bbd280" + +[[package]] +name = "globset" +version = "0.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52dfc19153a48bde0cbd630453615c8151bce3a5adfac7a0aebfbf0a1e1f57e3" +dependencies = [ + "aho-corasick", + "bstr", + "log", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "gobject-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d57ce44246becd17153bd035ab4d32cfee096a657fc01f2231c9278378d1e0a" +dependencies = [ + "glib-sys", + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "gtk" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e3004a2d5d6d8b5057d2b57b3712c9529b62e82c77f25c1fecde1fd5c23bd0" +dependencies = [ + "atk", + "bitflags 1.3.2", + "cairo-rs", + "field-offset", + "futures-channel", + "gdk", + "gdk-pixbuf", + "gio", + "glib", + "gtk-sys", + "gtk3-macros", + "libc", + "once_cell", + "pango", + "pkg-config", +] + +[[package]] +name = "gtk-sys" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5bc2f0587cba247f60246a0ca11fe25fb733eabc3de12d1965fc07efab87c84" +dependencies = [ + "atk-sys", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "pango-sys", + "system-deps 6.2.2", +] + +[[package]] +name = "gtk3-macros" +version = "0.15.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "684c0456c086e8e7e9af73ec5b84e35938df394712054550e81558d21c44ab0d" +dependencies = [ + "anyhow", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap 2.10.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17da50a276f1e01e0ba6c029e47b7100754904ee8a278f886546e98575380785" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.3.1", + "indexmap 2.10.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" + +[[package]] +name = "heck" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[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 = "html5ever" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" +dependencies = [ + "log", + "mac", + "markup5ever", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.15", +] + +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa 1.0.15", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.3.1", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http 1.3.1", + "http-body 1.0.1", + "pin-project-lite", +] + +[[package]] +name = "http-range" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" + +[[package]] +name = "http-range-header" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" + +[[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 = "hyper" +version = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa 1.0.15", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.11", + "http 1.3.1", + "http-body 1.0.1", + "httparse", + "httpdate", + "itoa 1.0.15", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper 0.14.32", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-util" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "hyper 1.6.0", + "libc", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +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 = "ico" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc50b891e4acf8fe0e71ef88ec43ad82ee07b3810ad09de10f1d01f072ed4b98" +dependencies = [ + "byteorder", + "png", +] + +[[package]] +name = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "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 = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "ignore" +version = "0.4.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3d782a365a015e0f5c04902246139249abf769125006fbe7649e2ee88169b4a" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + +[[package]] +name = "image" +version = "0.24.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-traits", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +dependencies = [ + "equivalent", + "hashbrown 0.15.4", + "serde", +] + +[[package]] +name = "infer" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f551f8c3a39f68f986517db0d1759de85881894fdc7db798bd2a9df9cb04b7fc" +dependencies = [ + "cfb", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "javascriptcore-rs" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf053e7843f2812ff03ef5afe34bb9c06ffee120385caad4f6b9967fcd37d41c" +dependencies = [ + "bitflags 1.3.2", + "glib", + "javascriptcore-rs-sys", +] + +[[package]] +name = "javascriptcore-rs-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "905fbb87419c5cde6e3269537e4ea7d46431f3008c5d057e915ef3f115e7793c" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", +] + +[[package]] +name = "jni" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "039022cdf4d7b1cf548d31f60ae783138e5fd42013f6271049d7df7afadef96c" +dependencies = [ + "cesu8", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", +] + +[[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 2.0.104", +] + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b1fb8864823fad91877e6caea0baca82e49e8db50f8e5c9f9a453e27d3330fc" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "jsonptr" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" +dependencies = [ + "fluent-uri", + "serde", + "serde_json", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "kuchikiki" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e4755b7b995046f510a7520c42b2fed58b77bd94d5a87a8eb43d2fd126da8" +dependencies = [ + "cssparser", + "html5ever", + "indexmap 1.9.3", + "matches", + "selectors", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libappindicator" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2d3cb96d092b4824cb306c9e544c856a4cb6210c1081945187f7f1924b47e8" +dependencies = [ + "glib", + "gtk", + "gtk-sys", + "libappindicator-sys", + "log", +] + +[[package]] +name = "libappindicator-sys" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1b3b6681973cea8cc3bce7391e6d7d5502720b80a581c9a95c9cbaf592826aa" +dependencies = [ + "gtk-sys", + "libloading", + "once_cell", +] + +[[package]] +name = "libc" +version = "0.2.174" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "libredox" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" +dependencies = [ + "bitflags 2.9.1", + "libc", + "plain", + "redox_syscall 0.7.5", +] + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + +[[package]] +name = "lock_api" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "mac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "markup5ever" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" +dependencies = [ + "log", + "phf 0.10.1", + "phf_codegen 0.10.0", + "string_cache", + "string_cache_codegen", + "tendril", +] + +[[package]] +name = "matchers" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" +dependencies = [ + "regex-automata", +] + +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] +name = "mio" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +dependencies = [ + "libc", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", +] + +[[package]] +name = "mockito" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7760e0e418d9b7e5777c0374009ca4c93861b9066f18cb334a20ce50ab63aa48" +dependencies = [ + "assert-json-diff", + "bytes", + "colored", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "hyper 1.6.0", + "hyper-util", + "log", + "rand 0.9.1", + "regex", + "serde_json", + "serde_urlencoded", + "similar", + "tokio", +] + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "ndk" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags 1.3.2", + "jni-sys 0.3.1", + "ndk-sys", + "num_enum", + "thiserror 1.0.69", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" +dependencies = [ + "jni-sys 0.3.1", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + +[[package]] +name = "normalize-line-endings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" + +[[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.59.0", +] + +[[package]] +name = "num-conv" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" + +[[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.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] + +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "objc_id" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" +dependencies = [ + "objc", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "open" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2078c0039e6a54a0c42c28faa984e115fb4c2d5bf2208f77d1961002df8576f8" +dependencies = [ + "pathdiff", + "windows-sys 0.42.0", +] + +[[package]] +name = "openssl" +version = "0.10.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" +dependencies = [ + "bitflags 2.9.1", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "pango" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e4045548659aee5313bde6c582b0d83a627b7904dd20dc2d9ef0895d414e4f" +dependencies = [ + "bitflags 1.3.2", + "glib", + "libc", + "once_cell", + "pango-sys", +] + +[[package]] +name = "pango-sys" +version = "0.15.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2a00081cde4661982ed91d80ef437c20eacaf6aa1a5962c0279ae194662c3aa" +dependencies = [ + "glib-sys", + "gobject-sys", + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "parking_lot" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.5.13", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_macros 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", +] + +[[package]] +name = "phf" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +dependencies = [ + "phf_shared 0.10.0", +] + +[[package]] +name = "phf" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +dependencies = [ + "phf_macros 0.11.3", + "phf_shared 0.11.3", +] + +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_codegen" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" +dependencies = [ + "phf_generator 0.10.0", + "phf_shared 0.10.0", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + +[[package]] +name = "phf_generator" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +dependencies = [ + "phf_shared 0.10.0", + "rand 0.8.5", +] + +[[package]] +name = "phf_generator" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +dependencies = [ + "phf_shared 0.11.3", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "phf_macros" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +dependencies = [ + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +dependencies = [ + "siphasher 0.3.11", +] + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher 1.0.3", +] + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "plist" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "092791278e026273c1b65bbdcfbba3a300f2994c896bd01ab01da613c29c46f1" +dependencies = [ + "base64 0.22.1", + "indexmap 2.10.0", + "quick-xml", + "serde", + "time", +] + +[[package]] +name = "png" +version = "0.17.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +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 = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "predicates" +version = "3.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ada8f2932f28a27ee7b70dd6c1c39ea0675c55a36879ab92f3a715eaa1e63cfe" +dependencies = [ + "anstyle", + "difflib", + "float-cmp", + "normalize-line-endings", + "predicates-core", + "regex", +] + +[[package]] +name = "predicates-core" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cad38746f3166b4031b1a0d39ad9f954dd291e7854fcc0eed52ee41a0b50d144" + +[[package]] +name = "predicates-tree" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0de1b847b39c8131db0467e9df1ff60e6d0562ab8e9a16e568ad0fdb372e2f2" +dependencies = [ + "predicates-core", + "termtree", +] + +[[package]] +name = "pretty_assertions" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" +dependencies = [ + "diff", + "yansi", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quick-xml" +version = "0.39.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "721da970c312655cde9b4ffe0547f20a8494866a4af5ff51f18b7c633d0c870b" +dependencies = [ + "memchr", +] + [[package]] -name = "mime_guess" -version = "2.0.5" +name = "quote" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ - "mime", - "unicase", + "proc-macro2", ] [[package]] -name = "miniz_oxide" -version = "0.8.9" +name = "r-efi" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "adler2", + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", ] [[package]] -name = "mio" -version = "1.0.4" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "wasi 0.11.1+wasi-snapshot-preview1", - "windows-sys 0.59.0", + "rand_chacha 0.3.1", + "rand_core 0.6.4", ] [[package]] -name = "mockito" -version = "1.7.0" +name = "rand" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7760e0e418d9b7e5777c0374009ca4c93861b9066f18cb334a20ce50ab63aa48" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ - "assert-json-diff", + "rand_chacha 0.9.0", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "raw-window-handle" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" + +[[package]] +name = "redox_syscall" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_syscall" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4666a1a60d8412eab19d94f6d13dcc9cea0a5ef4fdf6a5db306537413c661b1b" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", "bytes", - "colored", + "encoding_rs", + "futures-core", "futures-util", - "http 1.3.1", - "http-body 1.0.1", - "http-body-util", - "hyper 1.6.0", - "hyper-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper-tls", + "ipnet", + "js-sys", "log", - "rand 0.9.1", - "regex", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", "serde_json", "serde_urlencoded", - "similar", + "sync_wrapper 0.1.2", + "system-configuration", "tokio", + "tokio-native-tls", + "tokio-socks", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg 0.50.0", ] [[package]] -name = "native-tls" -version = "0.2.14" +name = "reserve-port" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +checksum = "21918d6644020c6f6ef1993242989bf6d4952d2e025617744f184c02df51c356" dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "thiserror 2.0.12", ] [[package]] -name = "nix" -version = "0.29.0" +name = "rust-multipart-rfc7578_2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +checksum = "03b748410c0afdef2ebbe3685a6a862e2ee937127cdaae623336a459451c8d57" dependencies = [ - "bitflags 2.9.1", - "cfg-if", - "cfg_aliases", - "libc", + "bytes", + "futures-core", + "futures-util", + "http 0.2.12", + "mime", + "mime_guess", + "rand 0.8.5", + "thiserror 1.0.69", ] [[package]] -name = "nu-ansi-term" -version = "0.46.0" +name = "rustc-demangle" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" + +[[package]] +name = "rustc_version" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "overload", - "winapi", + "semver", ] [[package]] -name = "num-conv" -version = "0.1.0" +name = "rustix" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] [[package]] -name = "num-traits" -version = "0.2.19" +name = "rustls-pemfile" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "autocfg", + "base64 0.21.7", ] [[package]] -name = "object" -version = "0.36.7" +name = "rustversion" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" -dependencies = [ - "memchr", -] +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] -name = "once_cell" -version = "1.21.3" +name = "ryu" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] -name = "openssl" -version = "0.10.73" +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" dependencies = [ - "bitflags 2.9.1", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", + "winapi-util", ] [[package]] -name = "openssl-macros" -version = "0.1.1" +name = "schannel" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "windows-sys 0.59.0", ] [[package]] -name = "openssl-probe" -version = "0.1.6" +name = "schemars" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] [[package]] -name = "openssl-sys" -version = "0.9.109" +name = "schemars" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", + "dyn-clone", + "ref-cast", + "serde", + "serde_json", ] [[package]] -name = "overload" -version = "0.1.1" +name = "scoped-tls" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] -name = "parking_lot" -version = "0.12.4" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" -dependencies = [ - "lock_api", - "parking_lot_core", -] +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] -name = "parking_lot_core" -version = "0.9.11" +name = "secp256k1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", + "secp256k1-sys", ] [[package]] -name = "percent-encoding" -version = "2.3.1" +name = "secp256k1-sys" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", +] [[package]] -name = "pin-project" -version = "1.1.10" +name = "security-framework" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "pin-project-internal", + "bitflags 2.9.1", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", ] [[package]] -name = "pin-project-internal" -version = "1.1.10" +name = "security-framework-sys" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ - "proc-macro2", - "quote", - "syn", + "core-foundation-sys", + "libc", ] [[package]] -name = "pin-project-lite" -version = "0.2.16" +name = "selectors" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" +checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" +dependencies = [ + "bitflags 1.3.2", + "cssparser", + "derive_more", + "fxhash", + "log", + "matches", + "phf 0.8.0", + "phf_codegen 0.8.0", + "precomputed-hash", + "servo_arc", + "smallvec", + "thin-slice", +] [[package]] -name = "pin-utils" -version = "0.1.0" +name = "semver" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" +dependencies = [ + "serde", + "serde_core", +] [[package]] -name = "pkg-config" -version = "0.3.32" +name = "serde" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] [[package]] -name = "potential_utf" -version = "0.1.2" +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ - "zerovec", + "serde_derive", ] [[package]] -name = "powerfmt" -version = "0.2.0" +name = "serde_derive" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] [[package]] -name = "ppv-lite86" -version = "0.2.21" +name = "serde_json" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ - "zerocopy", + "indexmap 2.10.0", + "itoa 1.0.15", + "memchr", + "serde", + "serde_core", + "zmij", ] [[package]] -name = "pretty_assertions" -version = "1.4.1" +name = "serde_path_to_error" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ae130e2f271fbc2ac3a40fb1d07180839cdbbe443c7a27e1e3c13c5cac0116d" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" dependencies = [ - "diff", - "yansi", + "itoa 1.0.15", + "serde", ] [[package]] -name = "proc-macro2" -version = "1.0.95" +name = "serde_repr" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" dependencies = [ - "unicode-ident", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] -name = "quote" -version = "1.0.40" +name = "serde_spanned" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" dependencies = [ - "proc-macro2", + "serde", ] [[package]] -name = "r-efi" -version = "5.3.0" +name = "serde_urlencoded" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa 1.0.15", + "ryu", + "serde", +] [[package]] -name = "rand" -version = "0.8.5" +name = "serde_with" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "f05839ce67618e14a09b286535c0d9c94e85ef25469b0e13cb4f844e5593eb19" dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.10.0", + "schemars 0.9.0", + "schemars 1.2.1", + "serde_core", + "serde_json", + "serde_with_macros", + "time", ] [[package]] -name = "rand" -version = "0.9.1" +name = "serde_with_macros" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +checksum = "cf2ebbe86054f9b45bc3881e865683ccfaccce97b9b4cb53f3039d67f355a334" dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.3", + "darling", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "serialize-to-javascript" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5" dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", + "serde", + "serde_json", + "serialize-to-javascript-impl", ] [[package]] -name = "rand_chacha" -version = "0.9.0" +name = "serialize-to-javascript-impl" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d" dependencies = [ - "ppv-lite86", - "rand_core 0.9.3", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] -name = "rand_core" -version = "0.6.4" +name = "servo_arc" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" dependencies = [ - "getrandom 0.2.16", + "nodrop", + "stable_deref_trait", ] [[package]] -name = "rand_core" -version = "0.9.3" +name = "sha2" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ - "getrandom 0.3.3", + "cfg-if", + "cpufeatures", + "digest", ] [[package]] -name = "redox_syscall" -version = "0.5.13" +name = "sha3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" dependencies = [ - "bitflags 2.9.1", + "digest", + "keccak", ] [[package]] -name = "regex" -version = "1.11.1" +name = "sharded-slab" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", + "lazy_static", ] [[package]] -name = "regex-automata" -version = "0.1.10" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "regex-automata" -version = "0.4.9" +name = "signal-hook-registry" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.5", + "libc", ] [[package]] -name = "regex-syntax" -version = "0.6.29" +name = "simd-adler32" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" [[package]] -name = "regex-syntax" -version = "0.8.5" +name = "similar" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" +checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" [[package]] -name = "reqwest" -version = "0.11.27" +name = "siphasher" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2 0.3.26", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.32", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration", - "tokio", - "tokio-native-tls", - "tokio-socks", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] -name = "reserve-port" -version = "2.3.0" +name = "siphasher" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21918d6644020c6f6ef1993242989bf6d4952d2e025617744f184c02df51c356" -dependencies = [ - "thiserror 2.0.12", -] +checksum = "8ee5873ec9cce0195efcb7a4e9507a04cd49aec9c83d0389df45b1ef7ba2e649" [[package]] -name = "rust-multipart-rfc7578_2" -version = "0.6.1" +name = "slab" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b748410c0afdef2ebbe3685a6a862e2ee937127cdaae623336a459451c8d57" -dependencies = [ - "bytes", - "futures-core", - "futures-util", - "http 0.2.12", - "mime", - "mime_guess", - "rand 0.8.5", - "thiserror 1.0.69", -] +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] -name = "rustc-demangle" -version = "0.1.25" +name = "smallvec" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] -name = "rustix" -version = "1.0.7" +name = "socket2" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ - "bitflags 2.9.1", - "errno", "libc", - "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "soup2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "b2b4d76501d8ba387cf0fefbe055c3e0a59891d09f0f995ae4e4b16f6b60f3c0" dependencies = [ - "base64", + "bitflags 1.3.2", + "gio", + "glib", + "libc", + "once_cell", + "soup2-sys", ] [[package]] -name = "rustversion" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" - -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - -[[package]] -name = "schannel" -version = "0.1.27" +name = "soup2-sys" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +checksum = "009ef427103fcb17f802871647a7fa6c60cbb654b4c4e4c0ac60a31c5f6dc9cf" dependencies = [ - "windows-sys 0.59.0", + "bitflags 1.3.2", + "gio-sys", + "glib-sys", + "gobject-sys", + "libc", + "system-deps 5.0.0", ] [[package]] -name = "scopeguard" +name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] -name = "secp256k1" -version = "0.27.0" +name = "state" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" dependencies = [ - "secp256k1-sys", + "loom", ] [[package]] -name = "secp256k1-sys" -version = "0.8.1" +name = "string_cache" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" dependencies = [ - "cc", + "new_debug_unreachable", + "parking_lot", + "phf_shared 0.11.3", + "precomputed-hash", + "serde", ] [[package]] -name = "security-framework" -version = "2.11.1" +name = "string_cache_codegen" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" dependencies = [ - "bitflags 2.9.1", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", + "phf_generator 0.11.3", + "phf_shared 0.11.3", + "proc-macro2", + "quote", ] [[package]] -name = "security-framework-sys" -version = "2.14.0" +name = "strsim" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" -dependencies = [ - "core-foundation-sys", - "libc", -] +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "serde" -version = "1.0.219" +name = "syn" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "serde_derive", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "serde_derive" -version = "1.0.219" +name = "syn" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", - "syn", + "unicode-ident", ] [[package]] -name = "serde_json" -version = "1.0.140" +name = "sync_wrapper" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] -name = "serde_path_to_error" -version = "0.1.17" +name = "sync_wrapper" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ - "itoa", - "serde", + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] -name = "serde_urlencoded" -version = "0.7.1" +name = "system-configuration" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", ] [[package]] -name = "sha3" -version = "0.10.8" +name = "system-configuration-sys" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ - "digest", - "keccak", + "core-foundation-sys", + "libc", ] [[package]] -name = "sharded-slab" -version = "0.1.7" +name = "system-deps" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +checksum = "18db855554db7bd0e73e06cf7ba3df39f97812cb11d3f75e71c39bf45171797e" dependencies = [ - "lazy_static", + "cfg-expr 0.9.1", + "heck 0.3.3", + "pkg-config", + "toml 0.5.11", + "version-compare 0.0.11", ] [[package]] -name = "shlex" -version = "1.3.0" +name = "system-deps" +version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" +dependencies = [ + "cfg-expr 0.15.8", + "heck 0.5.0", + "pkg-config", + "toml 0.8.23", + "version-compare 0.2.1", +] [[package]] -name = "signal-hook-registry" -version = "1.4.5" +name = "tao" +version = "0.16.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +checksum = "1bf915e6c7112402f7b88a064cfbd264f851052df07fdc3a2abd3038b0cc434a" dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "cc", + "cocoa", + "core-foundation", + "core-graphics", + "crossbeam-channel", + "dirs-next", + "dispatch", + "gdk", + "gdk-pixbuf", + "gdk-sys", + "gdkwayland-sys", + "gdkx11-sys", + "gio", + "glib", + "glib-sys", + "gtk", + "image", + "instant", + "jni", + "lazy_static", + "libappindicator", "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "objc", + "once_cell", + "parking_lot", + "png", + "raw-window-handle", + "scopeguard", + "serde", + "tao-macros", + "unicode-segmentation", + "uuid", + "windows 0.39.0", + "windows-implement 0.39.0", + "x11-dl", ] [[package]] -name = "similar" -version = "2.7.0" +name = "tao-macros" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbb5d9659141646ae647b42fe094daf6c6192d1620870b449d9557f748b2daa" +checksum = "f4e16beb8b2ac17db28eab8bca40e62dbfbb34c0fcdc6d9826b11b7b5d047dfd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] [[package]] -name = "slab" -version = "0.4.10" +name = "tar" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" +checksum = "22692a6476a21fa75fdfc11d452fda482af402c008cdbaf3476414e122040973" +dependencies = [ + "filetime", + "libc", + "xattr", +] [[package]] -name = "smallvec" -version = "1.15.1" +name = "target-lexicon" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] -name = "socket2" -version = "0.5.10" +name = "tauri" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" +checksum = "3ae1f57c291a6ab8e1d2e6b8ad0a35ff769c9925deb8a89de85425ff08762d0c" dependencies = [ - "libc", - "windows-sys 0.52.0", + "anyhow", + "cocoa", + "dirs-next", + "dunce", + "embed_plist", + "encoding_rs", + "flate2", + "futures-util", + "getrandom 0.2.16", + "glib", + "glob", + "gtk", + "heck 0.5.0", + "http 0.2.12", + "ignore", + "log", + "objc", + "once_cell", + "open", + "percent-encoding", + "plist", + "rand 0.8.5", + "raw-window-handle", + "regex", + "semver", + "serde", + "serde_json", + "serde_repr", + "serialize-to-javascript", + "state", + "tar", + "tauri-macros", + "tauri-runtime", + "tauri-runtime-wry", + "tauri-utils", + "tempfile", + "thiserror 1.0.69", + "tokio", + "url", + "uuid", + "webkit2gtk", + "webview2-com", + "windows 0.39.0", ] [[package]] -name = "stable_deref_trait" -version = "1.2.0" +name = "tauri-build" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +checksum = "2db08694eec06f53625cfc6fff3a363e084e5e9a238166d2989996413c346453" +dependencies = [ + "anyhow", + "cargo_toml", + "dirs-next", + "heck 0.5.0", + "json-patch", + "semver", + "serde", + "serde_json", + "tauri-utils", + "tauri-winres", + "walkdir", +] [[package]] -name = "syn" -version = "2.0.104" +name = "tauri-codegen" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +checksum = "53438d78c4a037ffe5eafa19e447eea599bedfb10844cb08ec53c2471ac3ac3f" dependencies = [ + "base64 0.21.7", + "brotli", + "ico", + "json-patch", + "plist", + "png", "proc-macro2", "quote", - "unicode-ident", + "regex", + "semver", + "serde", + "serde_json", + "sha2", + "tauri-utils", + "thiserror 1.0.69", + "time", + "uuid", + "walkdir", ] [[package]] -name = "sync_wrapper" -version = "0.1.2" +name = "tauri-macros" +version = "1.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "233988ac08c1ed3fe794cd65528d48d8f7ed4ab3895ca64cdaa6ad4d00c45c0b" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 1.0.109", + "tauri-codegen", + "tauri-utils", +] [[package]] -name = "sync_wrapper" -version = "1.0.2" +name = "tauri-runtime" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +checksum = "8066855882f00172935e3fa7d945126580c34dcbabab43f5d4f0c2398a67d47b" +dependencies = [ + "gtk", + "http 0.2.12", + "http-range", + "rand 0.8.5", + "raw-window-handle", + "serde", + "serde_json", + "tauri-utils", + "thiserror 1.0.69", + "url", + "uuid", + "webview2-com", + "windows 0.39.0", +] [[package]] -name = "synstructure" -version = "0.13.2" +name = "tauri-runtime-wry" +version = "0.14.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +checksum = "ce361fec1e186705371f1c64ae9dd2a3a6768bc530d0a2d5e75a634bb416ad4d" dependencies = [ - "proc-macro2", - "quote", - "syn", + "cocoa", + "gtk", + "percent-encoding", + "rand 0.8.5", + "raw-window-handle", + "tauri-runtime", + "tauri-utils", + "uuid", + "webkit2gtk", + "webview2-com", + "windows 0.39.0", + "wry", ] [[package]] -name = "system-configuration" -version = "0.5.1" +name = "tauri-utils" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "c357952645e679de02cd35007190fcbce869b93ffc61b029f33fe02648453774" dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", + "brotli", + "ctor", + "dunce", + "glob", + "heck 0.5.0", + "html5ever", + "infer", + "json-patch", + "kuchikiki", + "log", + "memchr", + "phf 0.11.3", + "proc-macro2", + "quote", + "semver", + "serde", + "serde_json", + "serde_with", + "thiserror 1.0.69", + "url", + "walkdir", + "windows-version", ] [[package]] -name = "system-configuration-sys" -version = "0.5.0" +name = "tauri-winres" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "5993dc129e544393574288923d1ec447c857f3f644187f4fbf7d9a875fbfc4fb" dependencies = [ - "core-foundation-sys", - "libc", + "embed-resource", + "toml 0.7.8", ] [[package]] @@ -1708,6 +4069,29 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "tendril" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +dependencies = [ + "futf", + "mac", + "utf-8", +] + +[[package]] +name = "termtree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" + +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" + [[package]] name = "thiserror" version = "1.0.69" @@ -1734,7 +4118,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", ] [[package]] @@ -1745,7 +4129,7 @@ checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", ] [[package]] @@ -1759,30 +4143,30 @@ dependencies = [ [[package]] name = "time" -version = "0.3.41" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" dependencies = [ "deranged", - "itoa", + "itoa 1.0.15", "num-conv", "powerfmt", - "serde", + "serde_core", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.4" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" [[package]] name = "time-macros" -version = "0.2.22" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" dependencies = [ "num-conv", "time-core", @@ -1824,7 +4208,7 @@ checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", ] [[package]] @@ -1849,6 +4233,28 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-stream" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-test" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6d24790a10a7af737693a3e8f1d03faef7e6ca0cc99aae5066f533766de545" +dependencies = [ + "futures-core", + "tokio", + "tokio-stream", +] + [[package]] name = "tokio-util" version = "0.7.15" @@ -1862,6 +4268,81 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.10.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap 2.10.0", + "serde", + "serde_spanned", + "toml_datetime", + "toml_write", + "winnow 0.7.15", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + [[package]] name = "torpc" version = "0.1.0" @@ -1870,6 +4351,7 @@ dependencies = [ "axum", "axum-test", "chrono", + "dotenvy", "hex", "mockito", "nix", @@ -1881,7 +4363,7 @@ dependencies = [ "serde_json", "sha3", "tempfile", - "thiserror 1.0.69", + "thiserror 2.0.12", "tokio", "tower 0.4.13", "tower-http", @@ -1890,6 +4372,62 @@ dependencies = [ "uuid", ] +[[package]] +name = "torpc-proxy-cli" +version = "0.1.0" +dependencies = [ + "anyhow", + "assert_cmd", + "clap", + "daemonize", + "predicates", + "tempfile", + "tokio", + "tokio-socks", + "torpc-proxy-core", + "tracing", + "tracing-subscriber", + "windows-service", +] + +[[package]] +name = "torpc-proxy-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "bytes", + "http-body-util", + "hyper 1.6.0", + "hyper-util", + "rand 0.8.5", + "serde", + "serde_json", + "tempfile", + "thiserror 2.0.12", + "tokio", + "tokio-socks", + "tokio-test", + "toml 0.8.23", + "tracing", +] + +[[package]] +name = "torpc-proxy-gui" +version = "0.1.0" +dependencies = [ + "anyhow", + "dirs", + "serde", + "serde_json", + "tauri", + "tauri-build", + "tokio", + "tokio-socks", + "torpc-proxy-core", + "tracing", + "tracing-subscriber", +] + [[package]] name = "tower" version = "0.4.13" @@ -1980,7 +4518,7 @@ checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", ] [[package]] @@ -2006,14 +4544,14 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +checksum = "2054a14f5307d601f88daf0553e1cbf472acc4f2c51afab632431cdcd72124d5" dependencies = [ "matchers", "nu-ansi-term", "once_cell", - "regex", + "regex-automata", "sharded-slab", "smallvec", "thread_local", @@ -2046,6 +4584,12 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" +[[package]] +name = "unicode-segmentation" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + [[package]] name = "url" version = "2.5.4" @@ -2055,43 +4599,107 @@ dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "utf8_iter" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +dependencies = [ + "getrandom 0.3.3", + "js-sys", + "serde", + "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 = "version-compare" +version = "0.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c18c859eead79d8b95d09e4678566e8d70105c4e7b251f707a03df32442661b" + +[[package]] +name = "version-compare" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c2856837ef78f57382f06b2b8563a2f512f7185d732608fd9176cb3b8edf0e" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] -name = "uuid" -version = "1.17.0" +name = "vswhom" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" dependencies = [ - "getrandom 0.3.3", - "js-sys", - "serde", - "wasm-bindgen", + "libc", + "vswhom-sys", ] [[package]] -name = "valuable" -version = "0.1.1" +name = "vswhom-sys" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" +dependencies = [ + "cc", + "libc", +] [[package]] -name = "vcpkg" -version = "0.2.15" +name = "wait-timeout" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" +dependencies = [ + "libc", +] [[package]] -name = "version_check" -version = "0.9.5" +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "want" @@ -2102,6 +4710,12 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" @@ -2139,7 +4753,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 2.0.104", "wasm-bindgen-shared", ] @@ -2174,7 +4788,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2198,6 +4812,97 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webkit2gtk" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8f859735e4a452aeb28c6c56a852967a8a76c8eb1cc32dbf931ad28a13d6370" +dependencies = [ + "bitflags 1.3.2", + "cairo-rs", + "gdk", + "gdk-sys", + "gio", + "gio-sys", + "glib", + "glib-sys", + "gobject-sys", + "gtk", + "gtk-sys", + "javascriptcore-rs", + "libc", + "once_cell", + "soup2", + "webkit2gtk-sys", +] + +[[package]] +name = "webkit2gtk-sys" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d76ca6ecc47aeba01ec61e480139dda143796abcae6f83bcddf50d6b5b1dcf3" +dependencies = [ + "atk-sys", + "bitflags 1.3.2", + "cairo-sys-rs", + "gdk-pixbuf-sys", + "gdk-sys", + "gio-sys", + "glib-sys", + "gobject-sys", + "gtk-sys", + "javascriptcore-rs-sys", + "libc", + "pango-sys", + "pkg-config", + "soup2-sys", + "system-deps 6.2.2", +] + +[[package]] +name = "webview2-com" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4a769c9f1a64a8734bde70caafac2b96cada12cd4aefa49196b3a386b8b4178" +dependencies = [ + "webview2-com-macros", + "webview2-com-sys", + "windows 0.39.0", + "windows-implement 0.39.0", +] + +[[package]] +name = "webview2-com-macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaebe196c01691db62e9e4ca52c5ef1e4fd837dcae27dae3ada599b5a8fd05ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "webview2-com-sys" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aac48ef20ddf657755fdcda8dfed2a7b4fc7e4581acce6fe9b88c3d64f29dee7" +dependencies = [ + "regex", + "serde", + "serde_json", + "thiserror 1.0.69", + "windows 0.39.0", + "windows-bindgen", + "windows-metadata", +] + +[[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" @@ -2214,25 +4919,77 @@ 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.60.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.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1c4bd0a50ac6020f65184721f758dba47bb9fbc2133df715ec74a237b26794a" +dependencies = [ + "windows-implement 0.39.0", + "windows_aarch64_msvc 0.39.0", + "windows_i686_gnu 0.39.0", + "windows_i686_msvc 0.39.0", + "windows_x86_64_gnu 0.39.0", + "windows_x86_64_msvc 0.39.0", +] + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-bindgen" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68003dbd0e38abc0fb85b939240f4bce37c43a5981d3df37ccbaaa981b47cb41" +dependencies = [ + "windows-metadata", + "windows-tokens", +] + [[package]] name = "windows-core" version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement", + "windows-implement 0.60.0", "windows-interface", - "windows-link", + "windows-link 0.1.3", "windows-result", "windows-strings", ] +[[package]] +name = "windows-implement" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba01f98f509cb5dc05f4e5fc95e535f78260f15fea8fe1a8abdd08f774f1cee7" +dependencies = [ + "syn 1.0.109", + "windows-tokens", +] + [[package]] name = "windows-implement" version = "0.60.0" @@ -2241,7 +4998,7 @@ checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", ] [[package]] @@ -2252,7 +5009,7 @@ checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", ] [[package]] @@ -2261,13 +5018,36 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-metadata" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" + [[package]] name = "windows-result" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-link", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-service" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24d6bcc7f734a4091ecf8d7a64c5f7d7066f45585c1861eba06449909609c8a" +dependencies = [ + "bitflags 2.9.1", + "widestring", + "windows-sys 0.52.0", ] [[package]] @@ -2276,7 +5056,22 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" dependencies = [ - "windows-link", + "windows-link 0.1.3", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +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]] @@ -2362,6 +5157,27 @@ dependencies = [ "windows_x86_64_msvc 0.53.0", ] +[[package]] +name = "windows-tokens" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f838de2fe15fe6bac988e74b798f26499a8b21a9d97edec321e79b28d1d7f597" + +[[package]] +name = "windows-version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4060a1da109b9d0326b7262c8e12c84df67cc0dbc9e33cf49e01ccc2eb63631" +dependencies = [ + "windows-link 0.2.1", +] + +[[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.48.5" @@ -2380,6 +5196,18 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +[[package]] +name = "windows_aarch64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec7711666096bd4096ffa835238905bb33fb87267910e154b18b44eaabb340f2" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -2398,6 +5226,18 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +[[package]] +name = "windows_i686_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763fc57100a5f7042e3057e7e8d9bdd7860d330070251a73d003563a3bb49e1b" + +[[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.48.5" @@ -2428,6 +5268,18 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +[[package]] +name = "windows_i686_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc7cbfe58828921e10a9f446fcaaf649204dcfe6c1ddd712c5eebae6bda1106" + +[[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.48.5" @@ -2446,6 +5298,18 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +[[package]] +name = "windows_x86_64_gnu" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6868c165637d653ae1e8dc4d82c25d4f97dd6605eaa8d784b5c6e0ab2a252b65" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -2464,6 +5328,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +[[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.48.5" @@ -2482,6 +5352,18 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +[[package]] +name = "windows_x86_64_msvc" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e4d40883ae9cae962787ca76ba76390ffa29214667a111db9e0a1ad8377e809" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -2500,6 +5382,24 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -2510,6 +5410,16 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "winreg" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "wit-bindgen-rt" version = "0.39.0" @@ -2525,6 +5435,75 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" +[[package]] +name = "wry" +version = "0.24.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a2a144c3ab5e83e04724bc8e67cea552ffae413185fda459fafdae173fd985d" +dependencies = [ + "base64 0.13.1", + "block", + "cocoa", + "core-graphics", + "crossbeam-channel", + "dunce", + "gdk", + "gio", + "glib", + "gtk", + "html5ever", + "http 0.2.12", + "kuchikiki", + "libc", + "log", + "objc", + "objc_id", + "once_cell", + "serde", + "serde_json", + "sha2", + "soup2", + "tao", + "thiserror 1.0.69", + "url", + "webkit2gtk", + "webkit2gtk-sys", + "webview2-com", + "windows 0.39.0", + "windows-implement 0.39.0", +] + +[[package]] +name = "x11" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "502da5464ccd04011667b11c435cb992822c2c0dbde1770c988480d312a0db2e" +dependencies = [ + "libc", + "pkg-config", +] + +[[package]] +name = "x11-dl" +version = "2.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38735924fedd5314a6e548792904ed8c6de6636285cb9fec04d5b1db85c1516f" +dependencies = [ + "libc", + "once_cell", + "pkg-config", +] + +[[package]] +name = "xattr" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e45ad4206f6d2479085147f02bc2ef834ac85886624a23575ae137c8aa8156" +dependencies = [ + "libc", + "rustix", +] + [[package]] name = "yansi" version = "1.0.1" @@ -2551,7 +5530,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", "synstructure", ] @@ -2572,7 +5551,7 @@ checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", ] [[package]] @@ -2592,7 +5571,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", "synstructure", ] @@ -2626,5 +5605,11 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.104", ] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index c884293..d9985b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,49 +1,119 @@ -[package] -name = "torpc" +[workspace] +# Single repo-wide workspace. Pre-consolidation there were two unrelated +# workspaces (daemon at root, proxy under `torpc-proxy/`) with diverging +# `tokio` and `thiserror` versions — this unifies them so a single +# `cargo build`/`clippy`/`test` exercises everything and the lockfile +# resolves once. +members = [ + "torpc-proxy/torpc-proxy-core", + "torpc-proxy/torpc-proxy-cli", + "torpc-proxy/torpc-proxy-gui", +] +resolver = "2" + +[workspace.package] version = "0.1.0" edition = "2021" +authors = ["ToRPC Contributors"] +license = "MIT" +repository = "https://github.com/CPerezz/torpc" -[dependencies] -# Async runtime -tokio = { version = "1.35", features = ["full"] } +[workspace.dependencies] +# Async + foundational +tokio = { version = "1.40", features = ["full"] } +anyhow = "1.0" +thiserror = "2.0" -# Web framework -axum = "0.7" -tower = { version = "0.4", features = ["limit"] } -tower-http = { version = "0.5", features = ["fs", "trace", "set-header", "limit", "timeout", "cors"] } +# Logging +tracing = "0.1" +tracing-subscriber = { version = "0.3", features = ["env-filter"] } # Serialization serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" +toml = "0.8" + +# HTTP/networking (proxy side) +hyper = { version = "1.5", features = ["server", "client", "http1", "http2"] } +hyper-util = { version = "0.1", features = ["client", "client-legacy", "http1", "http2", "tokio", "server"] } +http-body-util = "0.1" +bytes = "1.7" +tokio-socks = "0.5" + +# CLI +clap = { version = "4.5", features = ["derive"] } + +# Random (used by both daemon UUIDs and proxy discovery tokens) +rand = "0.8" + +[workspace.lints.clippy] +# Workspace-wide clippy guidance can be added here as the codebase +# stabilizes. Empty for now to avoid surprise CI breakages on the +# initial consolidation. + +# ----------------------------------------------------------------------------- +# Daemon (the root crate) +# ----------------------------------------------------------------------------- + +[package] +name = "torpc" +version.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +description = "Privacy-focused Ethereum RPC proxy served as a Tor hidden service" -# HTTP client +[dependencies] +# Daemon HTTP stack — separate from the proxy's hyper-direct usage. axum +# 0.7 is on hyper 1.x internally, so the workspace's hyper line is shared +# transitively even though the daemon doesn't depend on hyper by name. +axum = "0.7" +tower = { version = "0.4", features = ["limit"] } +tower-http = { version = "0.5", features = ["fs", "trace", "set-header", "limit", "timeout", "cors"] } reqwest = { version = "0.11", features = ["json", "socks"] } -# Logging -tracing = "0.1" -tracing-subscriber = { version = "0.3", features = ["env-filter"] } +# Foundations (shared with proxy crates via workspace) +tokio = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +anyhow = { workspace = true } +thiserror = { workspace = true } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } +rand = { workspace = true } -# Utilities -uuid = { version = "1.6", features = ["v4", "serde"] } -anyhow = "1.0" -thiserror = "1.0" +# Daemon-only once_cell = "1.19" chrono = { version = "0.4", features = ["serde"] } +uuid = { version = "1.6", features = ["v4", "serde"] } -# Cryptography for MEV +# MEV crypto — secp256k1 0.27 is on a shared transitive curve with the +# proxy's tokio-socks; no need to bump. secp256k1 = { version = "0.27", features = ["recovery"] } sha3 = "0.10" hex = "0.4" -rand = "0.8" + +# Loads `.env` at startup so operators who `cp .env.example .env` get their +# config applied without needing systemd EnvironmentFile= or `set -a; source`. +dotenvy = "0.15" [dev-dependencies] -# Testing mockito = "1.2" -tempfile = "3.8" +tempfile = "3.10" axum-test = "14.0" + +[target.'cfg(unix)'.dev-dependencies] # Send real signals (SIGTERM, SIGINT) to spawned daemon subprocesses in # integration tests. `Child::kill()` only sends SIGKILL, which bypasses # the graceful-shutdown path we want to verify. -[target.'cfg(unix)'.dev-dependencies] nix = { version = "0.29", features = ["signal"] } +# ----------------------------------------------------------------------------- +# Profiles (apply workspace-wide) +# ----------------------------------------------------------------------------- + +[profile.release] +opt-level = 3 +lto = true +strip = true +codegen-units = 1 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8c8d055 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 ToRPC Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Makefile b/Makefile index 701af93..5bdf9ba 100644 --- a/Makefile +++ b/Makefile @@ -17,11 +17,11 @@ SERVICES_STARTED_BY_MAKEFILE := .makefile_started_services # to additionally exercise the ignored set. .PHONY: test test: - @echo "$(BLUE)Running fast tests (no services required)...$(NC)" - @RUST_LOG=warn cargo test --tests || \ + @echo "$(BLUE)Running fast tests across the whole workspace (no services required)...$(NC)" + @RUST_LOG=warn cargo test --workspace --tests || \ (echo "$(RED)✗ Fast tests failed$(NC)" && exit 1) @echo "$(BLUE)Running lib unit tests...$(NC)" - @RUST_LOG=warn cargo test --lib || \ + @RUST_LOG=warn cargo test --workspace --lib || \ (echo "$(RED)✗ Lib tests failed$(NC)" && exit 1) @echo "$(GREEN)✓ Fast test suite passed$(NC)" diff --git a/README.md b/README.md index 551bac5..d210b0a 100644 --- a/README.md +++ b/README.md @@ -1,891 +1,325 @@ -# TorPC - Anonymous Ethereum RPC Access via Tor +# TorPC -
+Privacy-focused Ethereum JSON-RPC proxy served as a Tor hidden service, with +optional MEV-protected sends via Flashbots. -![TorPC](https://img.shields.io/badge/TorPC-Anonymous%20RPC-purple?style=for-the-badge) -![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge&logo=rust&logoColor=white) -![Tor](https://img.shields.io/badge/Tor-7E4798?style=for-the-badge&logo=Tor-Browser&logoColor=white) -![Ethereum](https://img.shields.io/badge/Ethereum-3C3C3D?style=for-the-badge&logo=Ethereum&logoColor=white) +There are two binaries in this workspace: -**Anonymous Ethereum RPC access through Tor with MEV protection** +- **`torpc`** — the daemon. Runs alongside a Geth node, exposes a Tor + hidden service that filters JSON-RPC, rate-limits, and optionally signs + bundles for Flashbots. Operators run this. +- **`torpc-proxy`** — the local client proxy. A wallet user runs this on + their own machine; it listens on `127.0.0.1:8545`, forwards each request + through Tor to the configured `.onion`, and returns the response. -[Features](#features) • [Quick Start](#quick-start) • [Installation](#installation) • [Usage](#usage) • [Security](#security) +> **Status**: working but not yet release-distributed. Build from source. -
- -## 🌟 Overview - -TorPC provides a privacy-preserving gateway to interact with Ethereum nodes through the Tor network. It acts as a reverse proxy that: - -- **Routes all RPC calls through Tor** for complete anonymity -- **Protects against MEV** by routing transactions through Flashbots -- **Filters dangerous RPC methods** to prevent wallet exposure -- **Rate limits requests** per Tor circuit to prevent abuse -- **Provides a simple web interface** for testing - -### Architecture - -``` -User → Tor Network → .onion address → TorPC Proxy → Geth Node - ↓ - Flashbots Relay -``` - -## 📋 System Requirements +--- -### Operating Systems -- ✅ **Linux** (Ubuntu 20.04+, Debian 11+, Fedora 35+) -- ✅ **macOS** (10.15 Catalina or later) -- ✅ **Windows** (via WSL2) +## Roles -### Software Prerequisites -- **Rust** 1.70 or later -- **Geth** (go-ethereum) 1.10+ -- **Tor** 0.4.5+ -- **Foundry** (for testing) - latest version +| Role | Goal | Path | +|---|---|---| +| Operator | Run a Tor-fronted RPC, optionally protect sends via Flashbots | [Operator Setup](#operator-setup) | +| Wallet user | Route a wallet through someone else's TorPC `.onion` | [Wallet User Setup](#wallet-user-setup) | +| Developer | Hack on TorPC | [Development](#development) | -### Hardware Requirements -- **RAM**: 4GB minimum (8GB recommended) -- **Storage**: 10GB free space -- **Network**: Stable internet connection +--- -## 🚀 Quick Start +## Operator Setup -### One-Line Install (Linux/macOS) +### Prerequisites -```bash -curl -sSL https://raw.githubusercontent.com/yourusername/torpc/main/install.sh | bash -``` +- **Rust** 1.70+ (`rustup default stable`) +- **Geth** 1.10+ (or any Ethereum execution client speaking JSON-RPC) +- **Tor** 0.4.5+ (`apt install tor`, `brew install tor`, etc.) +- Linux/macOS. Windows works under WSL2. -### Manual Quick Setup +### Build ```bash -# 1. Clone the repository -git clone https://github.com/yourusername/torpc.git +git clone https://github.com/CPerezz/torpc.git cd torpc - -# 2. Check prerequisites -./scripts/check-prerequisites.sh - -# 3. Build the project -cargo build --release - -# 4. Start all services -./scripts/start-all-dev.sh - -# This script automatically starts: -# - Geth development node -# - Tor hidden service -# - TorPC proxy server -# No need to run 'cargo run' separately! - -# 5. Get your .onion address -cat data/tor/torpc/hostname +cargo build --release --bin torpc ``` -Your anonymous RPC endpoint will be available at: `http://YOUR-ONION-ADDRESS.onion/rpc` - -### Understanding start-all-dev.sh - -The `start-all-dev.sh` script is a convenient way to start all services with one command. It: +The daemon binary lands in `target/release/torpc`. -1. **Starts Geth** in development mode with a pre-funded account -2. **Generates test blockchain data** (if needed) including: - - Funded test accounts - - Deployed smart contracts - - Sample transactions -3. **Starts Tor** and waits for the .onion address generation -4. **Builds TorPC** (if needed) in release mode -5. **Starts TorPC** proxy server on port 8080 +### Configure -After running this script, all services are running in the background. You can: -- Access the web interface at `http://localhost:8080` -- View logs with the commands shown at the end of the script output -- Stop everything with `./scripts/stop-all.sh` +The daemon reads its config from environment variables. Every var (with +defaults and effects) is documented in [`.env.example`](.env.example) — copy +it to `.env` and edit in place; `dotenvy` auto-loads it at startup. -## 🛠️ Detailed Installation +The most common knobs: -### Step 1: Install Rust +```dotenv +GETH_URL=http://127.0.0.1:8545 # Upstream Ethereum node +BIND_ADDR=127.0.0.1:8080 # Tor hidden service forwards here +RUST_LOG=info # Use `debug` to see the .onion address -```bash -# Install rustup (Rust installer) -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - -# Add Rust to PATH -source $HOME/.cargo/env - -# Verify installation -rustc --version -cargo --version +# Optional: Flashbots MEV protection. Without a signing key, sendBundle +# returns JSON-RPC -32004 instead of silently faking a bundle hash. +# FLASHBOTS_SIGNING_KEY=<64-hex-chars-no-0x> +# FLASHBOTS_RELAY_URL=https://relay.flashbots.net ``` -### Step 2: Install Geth - -#### Option A: Using Package Manager +### Tor -**Ubuntu/Debian:** -```bash -sudo add-apt-repository -y ppa:ethereum/ethereum -sudo apt-get update -sudo apt-get install ethereum -``` - -**macOS:** -```bash -brew tap ethereum/ethereum -brew install ethereum -``` +The hidden service config lives at [`configs/torrc`](configs/torrc). The +daemon parses it on startup and **refuses to start** if it disables anonymity +(`HiddenServiceSingleHopMode 1` or `HiddenServiceNonAnonymousMode 1`) — set +`TORPC_ALLOW_NON_ANONYMOUS=1` to override (CI/benchmarks only; never in +production). -**Fedora:** ```bash -sudo dnf install ethereum -``` - -#### Option B: Download Binary - -```bash -# Download latest Geth -wget https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.13.5-916d6a44.tar.gz - -# Extract -tar -xvf geth-linux-amd64-*.tar.gz - -# Move to PATH -sudo mv geth-linux-amd64-*/geth /usr/local/bin/ - -# Verify -geth version -``` - -### Step 3: Install Tor - -**Ubuntu/Debian:** -```bash -sudo apt update -sudo apt install tor +# First-time setup: generate the hidden service identity +mkdir -p data/tor/torpc && chmod 700 data/tor/torpc +tor -f configs/torrc +# After Tor bootstraps (~30-60s): +cat data/tor/torpc/hostname +# 3g2upl4pq6kufc4m7v5jzvfncqvhv5bak6d2nprpz7hgbc6jvdnq5jqd.onion ``` -**macOS:** -```bash -brew install tor -``` +The daemon does **not** print the .onion at INFO log level (it leaks into +syslog/log shippers). Use `RUST_LOG=debug` or `cat` the hostname file. -**Fedora:** -```bash -sudo dnf install tor -``` +### Run -### Step 4: Install Foundry (for testing) +For local development, use the bundled scripts that start everything: ```bash -# Install Foundry -curl -L https://foundry.paradigm.xyz | bash - -# Follow the instructions to add foundryup to your PATH, then: -foundryup - -# Verify installation -cast --version -forge --version +./scripts/start-all-dev.sh # Geth --dev + Tor + daemon +./scripts/stop-all.sh # Graceful shutdown ``` -## 🏃 Running TorPC - -### Method 1: Using Helper Scripts (Recommended) - -**Important:** The scripts require bash. Either make them executable or run with bash: +For production, ship via systemd. Templates live in +[`deploy/systemd-example/`](deploy/systemd-example/): ```bash -# Make scripts executable (one-time setup) -chmod +x scripts/*.sh - -# Then run directly: -./scripts/start-all-dev.sh - -# OR run with bash explicitly: -bash scripts/start-all-dev.sh - -# Start with verbose logging -bash scripts/start-all-dev.sh --verbose - -# Start with full debug mode -bash scripts/start-all-dev.sh --debug +# Render and install (asks for the deploy paths): +sudo deploy/systemd-example/install-systemd.sh +sudo systemctl daemon-reload +sudo systemctl enable --now torpc-tor torpc-daemon -# Or start services individually: -bash scripts/start-geth-dev.sh # Start Geth in development mode -bash scripts/start-tor.sh # Start Tor hidden service -cargo run --release # Start TorPC proxy +# Logs and status +sudo journalctl -u torpc-daemon -f +sudo systemctl status torpc-daemon ``` -**Note:** Do NOT use `sh scripts/start-all-dev.sh` as it will use the wrong shell interpreter. +The unit ships with `NoNewPrivileges`, `ProtectSystem=strict`, `PrivateTmp`, +and `RestrictAddressFamilies` — read each `.service.template` before +installing. -### Method 2: Manual Setup +### Observability -#### 1. Start Geth Development Node +`/health` and `/metrics` live on a **separate localhost-only listener** +(default `127.0.0.1:9001`, set via `ADMIN_BIND_ADDR`). They are NOT +reachable through the Tor hidden service — the .onion forwards only to +`BIND_ADDR`. This is deliberate: those endpoints leak component state, +request volume, uptime, and version, none of which should be visible to +anonymous Tor visitors. ```bash -# Create data directory -mkdir -p data/geth-dev - -# Start Geth -geth --dev \ - --http \ - --http.addr 127.0.0.1 \ - --http.port 8545 \ - --http.api eth,net,web3,personal,miner,txpool,debug \ - --http.corsdomain "*" \ - --datadir ./data/geth-dev \ - --mine -``` - -#### 2. Configure and Start Tor - -```bash -# Create Tor data directory -mkdir -p data/tor/torpc -chmod 700 data/tor/torpc - -# Start Tor with our configuration -tor -f configs/torrc -``` - -#### 3. Start TorPC Proxy +curl http://127.0.0.1:9001/metrics | jq +# { +# "security_metrics": { +# "blocked_requests_total": 0, +# "invalid_methods": 0, +# "rate_limit_hits": 0, +# ... +# }, +# "circuits": { "geth": "closed", "mev_relay": "disabled" } +# } -> **Note**: If you used `./scripts/start-all-dev.sh`, TorPC is already running! -> The script automatically builds and starts TorPC for you. -> Only run the commands below if you're starting services manually. - -```bash -# Build and run TorPC (only if not using start-all-dev.sh) -cargo build --release -./target/release/torpc - -# Or with custom settings: -GETH_URL=http://127.0.0.1:8545 \ -BIND_ADDR=127.0.0.1:8080 \ -RUST_LOG=info \ -./target/release/torpc +curl http://127.0.0.1:9001/health +# { "status": "ok", "uptime_seconds": 1234, ... } ``` -### Method 3: Using Docker +For remote scraping (Prometheus, etc.), use an SSH tunnel or terminate +inside your reverse proxy with auth. The daemon refuses to bind +`ADMIN_BIND_ADDR` to a non-loopback address. -```bash -# Build Docker image -docker build -t torpc . +--- -# Run with Docker Compose -docker-compose up -d +## Wallet User Setup -# View logs -docker-compose logs -f -``` +> **Heads up**: there are no pre-built binaries yet. You'll need a Rust +> toolchain to build the client proxy. -### Method 4: Systemd Services (Production) +### Build ```bash -# Install service files -sudo cp services/*.service /etc/systemd/system/ - -# Enable services -sudo systemctl enable torpc-geth torpc-tor torpc-proxy - -# Start all services -sudo systemctl start torpc-geth torpc-tor torpc-proxy - -# Check status -sudo systemctl status torpc-* +git clone https://github.com/CPerezz/torpc.git +cd torpc +cargo build --release -p torpc-proxy-cli +# Binary at: target/release/torpc-proxy ``` -## 🛑 Stopping Services +### Configure -### Graceful Shutdown (Recommended) +You need: +- A running Tor daemon on your machine (`brew install tor && tor &` or your + distro's package — Tor Browser counts but uses port `9150` instead of `9050`). +- The operator's `.onion` address. -```bash -# Stop all services gracefully (waits for processes to terminate) -./scripts/stop-all.sh +Create `torpc-proxy.toml` next to the binary (or pass `--config /path/to.toml`): -# Stop with custom timeout (default is 30 seconds) -./scripts/stop-all.sh --timeout 60 +```toml +listen_addr = "127.0.0.1:8545" +tor_proxy = "127.0.0.1:9050" # 9150 if you're using Tor Browser +onion_endpoint = "your-operator.onion:80" ``` -### Force Shutdown +### Run ```bash -# Immediately kill all processes (use if graceful shutdown fails) -./scripts/stop-all.sh --force +./target/release/torpc-proxy start --config torpc-proxy.toml ``` -### Manual Process Management +The proxy strips wallet-fingerprinting headers (User-Agent, Origin, Cookie, +Authorization, Sec-CH-UA-*, etc.) before forwarding through Tor, replacing +them with a synthetic `User-Agent: torpc-proxy/`. This is the +point of the proxy — without it, your MetaMask/Coinbase/Rabby UA gives +you up on every request. -```bash -# Check for running processes -pgrep -f "geth.*--dev" -pgrep -f "tor -f configs/torrc" -pgrep -f "target/release/torpc" +### Point your wallet -# Kill specific processes manually -kill -9 +In MetaMask / Coinbase Wallet / Rabby / Trust Wallet: +- Add a custom RPC network +- RPC URL: `http://127.0.0.1:8545` +- Chain ID: `1` (Ethereum mainnet) — or whatever the operator's upstream + is configured for +- Currency Symbol: `ETH` -# Check if ports are freed -lsof -ti:8545 # Geth RPC port -lsof -ti:8546 # Geth WebSocket port -``` +--- -The enhanced stop script will: -- ✅ Wait for processes to terminate gracefully -- ✅ Use force kill if graceful shutdown fails -- ✅ Verify all processes are actually terminated -- ✅ Check that ports are freed -- ✅ Report accurate success/failure status -- ✅ Handle multiple Geth instances properly +## Configuration reference + +[`.env.example`](.env.example) documents every variable the daemon reads. +Highlights: + +| Variable | Default | Effect | +|---|---|---| +| `GETH_URL` | `http://127.0.0.1:8545` | Upstream JSON-RPC | +| `BIND_ADDR` | `127.0.0.1:8080` | Tor-facing listener (the hidden service forwards here) | +| `ADMIN_BIND_ADDR` | `127.0.0.1:9001` | Localhost-only listener for `/health` and `/metrics` | +| `RUST_LOG` | `info` | tracing-subscriber filter | +| `MAX_REQUEST_SIZE` | `1048576` | Body-size cap (1 MiB) | +| `RATE_LIMIT_REQUESTS` | `100` | Per-(IP, source-port) bucket per window | +| `RATE_LIMIT_WINDOW` | `60` | Window in seconds | +| `WRITE_RATE_LIMIT_REQUESTS` | `10` | Tighter bucket for `eth_sendRawTransaction`/`eth_sendBundle` | +| `MAX_CONCURRENT_CONNECTIONS` | `256` | Router-wide in-flight cap | +| `STRICT_SECURITY_HEADERS` | `true` | When `true`, no CORS. Default. | +| `FLASHBOTS_SIGNING_KEY` | unset | Enables MEV protection when set | +| `FLASHBOTS_RELAY_URL` | `https://relay.flashbots.net` | Mainnet by default | +| `TORPC_ALLOW_NON_ANONYMOUS` | unset | Override anonymity check (CI only) | -## 🧅 Understanding Tor Hidden Services +--- -### How It Works +## Threat model + +**This protects against**: +- Network observers (ISP, VPN provider, RPC operator) seeing wallet→RPC + request contents and metadata. Tor circuits hide the user's IP. +- The upstream RPC operator fingerprinting users via wallet-specific + headers (User-Agent, Origin, Sec-CH-UA-*) — the client proxy strips these. +- The upstream RPC operator linking transactions to a specific wallet via + HTTP headers — same mechanism. +- Method-level abuse (rate limits + a strict allow-list of JSON-RPC methods + blocks `eth_accounts`, `personal_*`, `admin_*`, etc.). +- Front-running for MEV-protected sends — `eth_sendRawTransaction` on + `/rpc/flashbots` routes to Flashbots with EIP-191 auth. + +**This does NOT protect against**: +- A malicious daemon operator. They see your raw JSON-RPC requests + (including transaction contents). The trust boundary is the operator, + same as any RPC. +- Traffic-correlation attacks against Tor itself (a global passive + adversary, etc.). +- A malicious wallet (the wallet sees keys and signs txs locally). +- Smart-contract MEV (sandwich attacks at the protocol level — Flashbots + helps with sequencing, not contract-level exposure). +- Side channels in the operator's environment (Geth logs, OS journal, etc.) + if the operator doesn't lock those down. + +The daemon goes to some lengths to avoid leaking operator identity to +anonymous Tor visitors: +- No `Server` or `X-Service` response header +- Geth error bodies (which include version strings) are not forwarded +- Per-tx routing decisions and bundle hashes are below INFO log level +- The .onion address is below INFO log level +- Strict CSP, no CORS by default -1. **Automatic .onion Address Generation**: When Tor starts, it automatically generates a unique .onion address -2. **Private Key Storage**: The private key is stored in `data/tor/torpc/` -3. **No DNS Required**: .onion addresses work without any DNS configuration -4. **End-to-End Encryption**: All traffic is encrypted through the Tor network +--- -### Getting Your .onion Address +## Development -```bash -# After starting Tor, get your address: -cat data/tor/torpc/hostname +### Layout -# Example output: -# 3g2upl4pq6kufc4m7v5jzvfncqvhv5bak6d2nprpz7hgbc6jvdnq5jqd.onion ``` - -### Custom Vanity Addresses (Optional) - -Generate a custom .onion address starting with specific characters: - -```bash -# Install mkp224o -git clone https://github.com/cathugger/mkp224o.git -cd mkp224o -./autogen.sh -./configure -make - -# Generate address starting with "torpc" -./mkp224o torpc - -# Copy generated keys to TorPC -cp -r generated_address/* ../data/tor/torpc/ +torpc/ +├── src/ # Daemon +│ ├── main.rs, app.rs, proxy.rs, ... +│ └── mev/ # Flashbots auth + retry + circuit breaker +├── torpc-proxy/ # Client workspace members +│ ├── torpc-proxy-core/ +│ ├── torpc-proxy-cli/ +│ └── torpc-proxy-gui/ # Tauri desktop UI +├── tests/ # Daemon integration tests +├── static/ # Operator-facing wallet onboarding UI +├── configs/torrc # Tor hidden service config +├── deploy/systemd-example/ # Templated systemd units +└── scripts/ # Dev convenience scripts ``` -### Testing Tor Connectivity +### Test ```bash -# Test using torsocks and curl -torsocks curl http://YOUR-ONION-ADDRESS.onion/ - -# Test RPC endpoint -torsocks curl -X POST http://YOUR-ONION-ADDRESS.onion/rpc \ - -H "Content-Type: application/json" \ - -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' +make test # Fast suite, no daemons. ~140 tests in <30s. +make test-with-services # Brings up Geth + Tor + daemon, runs the whole set. ``` -## 🧪 Testing & Verification +CI runs `make test`, `cargo fmt --check`, `cargo clippy --workspace +--all-targets -- -D warnings`, and `cargo audit` (signal-only for now). -### 1. Generate Test Blockchain Data +### Local dev loop ```bash -# Run the test data generation script -./scripts/generate-test-data.sh - -# Run with verbose output -./scripts/generate-test-data.sh --verbose - -# Run with debug mode for troubleshooting -./scripts/generate-test-data.sh --debug - -# This will: -# - Create test accounts with ETH -# - Deploy smart contracts -# - Generate 100+ blocks with transactions -# - Output test account details -``` - -### 2. Test Using Web Interface - -1. Open your browser (regular or Tor Browser) -2. Navigate to `http://localhost:8080` or `http://YOUR-ONION-ADDRESS.onion` -3. Use the interactive interface to test RPC calls - -### 3. Test Using Command Line +# In one terminal: +./scripts/start-all-dev.sh -```bash -# Test local endpoint +# In another: curl -X POST http://localhost:8080/rpc \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' -# Test through Tor -torsocks curl -X POST http://YOUR-ONION-ADDRESS.onion/rpc \ - -H "Content-Type: application/json" \ - -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0x742d35Cc6634C0532925a3b844Bc9e7595f7777","latest"],"id":1}' - -# Test MEV protection endpoint -torsocks curl -X POST http://YOUR-ONION-ADDRESS.onion/rpc/flashbots \ - -H "Content-Type: application/json" \ - -d '{"jsonrpc":"2.0","method":"eth_sendRawTransaction","params":["0xRAW_TX_HEX"],"id":1}' -``` - -### 4. Test Using Foundry Cast - -```bash -# Set RPC URL -export ETH_RPC_URL=http://localhost:8080/rpc - -# Get latest block -cast block-number - -# Get account balance -cast balance 0x742d35Cc6634C0532925a3b844Bc9e7595f7777 - -# Send transaction (will route through Flashbots) -cast send --private-key $PRIVATE_KEY --value 0.1ether $TO_ADDRESS --rpc-url http://localhost:8080/rpc/flashbots -``` - -### 5. Run Integration Tests - -```bash -# Run all tests -cargo test - -# Run specific test suites -cargo test --test integration -cargo test whitelist -cargo test proxy - -# Run with verbose output -RUST_LOG=debug cargo test -- --nocapture -``` - -## ⚙️ Configuration - -### Environment Variables - -```bash -# Geth connection -GETH_URL=http://127.0.0.1:8545 # Geth RPC endpoint -FLASHBOTS_URL=https://relay.flashbots.net # Flashbots relay - -# Server settings -BIND_ADDR=127.0.0.1:8080 # Proxy bind address -RUST_LOG=info # Log level (trace/debug/info/warn/error) - -# Rate limiting -RATE_LIMIT_REQUESTS=60 # Max requests per window -RATE_LIMIT_WINDOW=60 # Window duration in seconds - -# Security settings -MAX_REQUEST_SIZE=524288 # Max request body size (default: 512KB) -REQUEST_TIMEOUT=30 # Request timeout in seconds -STRICT_SECURITY_HEADERS=false # Enable strict security (no CORS) - -# Tor settings (if using SOCKS) -TOR_SOCKS_PROXY=127.0.0.1:9050 # Tor SOCKS proxy address -``` - -### Configuration Files - -#### `configs/torrc` - Tor Configuration - -```ini -# Hidden service settings -HiddenServiceDir ./data/tor/torpc/ -HiddenServicePort 80 127.0.0.1:8080 -HiddenServiceVersion 3 - -# Performance -HiddenServiceMaxStreams 100 -HiddenServiceMaxStreamsCloseCircuit 1 - -# Security -SocksPort 0 # Disable SOCKS if only using hidden service - -# Logging -Log notice file ./data/tor/tor.log -DataDirectory ./data/tor -``` - -#### Rate Limiting Configuration - -Edit `src/rate_limit.rs` to adjust rate limiting: - -```rust -pub struct RateLimitConfig { - pub max_requests: u32, // Default: 60 - pub window_duration: Duration, // Default: 60 seconds -} -``` - -## 📖 Usage Examples - -### Basic RPC Calls - -```bash -# Get current block number -curl -X POST http://localhost:8080/rpc \ +# Through Tor (after Tor bootstraps): +torsocks curl -X POST http://$(cat data/tor/torpc/hostname)/rpc \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' - -# Get account balance -curl -X POST http://localhost:8080/rpc \ - -H "Content-Type: application/json" \ - -d '{ - "jsonrpc":"2.0", - "method":"eth_getBalance", - "params":["0x742d35Cc6634C0532925a3b844Bc9e7595f7777", "latest"], - "id":1 - }' - -# Estimate gas -curl -X POST http://localhost:8080/rpc \ - -H "Content-Type: application/json" \ - -d '{ - "jsonrpc":"2.0", - "method":"eth_estimateGas", - "params":[{ - "from": "0x742d35Cc6634C0532925a3b844Bc9e7595f7777", - "to": "0x742d35Cc6634C0532925a3b844Bc9e7595f8888", - "value": "0x9184e72a" - }], - "id":1 - }' -``` - -### MEV-Protected Transactions - -```bash -# Send transaction through Flashbots -curl -X POST http://localhost:8080/rpc/flashbots \ - -H "Content-Type: application/json" \ - -d '{ - "jsonrpc":"2.0", - "method":"eth_sendRawTransaction", - "params":["0xf86c0185..."], # Your signed transaction - "id":1 - }' -``` - -### Batch Requests - -```bash -# Send multiple requests in one call -curl -X POST http://localhost:8080/rpc \ - -H "Content-Type: application/json" \ - -d '[ - {"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}, - {"jsonrpc":"2.0","method":"net_version","params":[],"id":2}, - {"jsonrpc":"2.0","method":"eth_gasPrice","params":[],"id":3} - ]' -``` - -## 🔒 Security Features & Configuration - -### Security Headers - -TorPC implements comprehensive security headers to protect against common web attacks: - -```bash -# Security headers applied to all responses: -# - X-Content-Type-Options: nosniff (prevents MIME type sniffing) -# - X-Frame-Options: DENY (prevents clickjacking) -# - X-XSS-Protection: 0 (disables legacy XSS filter) -# - Referrer-Policy: no-referrer (prevents onion address leaks) -# - Content-Security-Policy: default-src 'none' (strict CSP for API) -# - Cache-Control: no-store, no-cache, must-revalidate -# - Server header sanitized to prevent fingerprinting -``` - -### Request Size Limits - -Protection against DoS attacks through configurable request size limits: - -```bash -# Default: 512KB (sufficient for most Ethereum RPC requests) -export MAX_REQUEST_SIZE=524288 - -# For batch operations: 2MB -export MAX_REQUEST_SIZE=2097152 - -# Request timeout (default: 30 seconds) -export REQUEST_TIMEOUT=30 - -# Strict security headers (disables CORS) -export STRICT_SECURITY_HEADERS=true -``` - -### CORS Configuration - -By default, TorPC allows CORS for maximum compatibility: - -```bash -# Standard mode (with CORS - default) -export STRICT_SECURITY_HEADERS=false - -# Strict mode (no CORS - recommended for production) -export STRICT_SECURITY_HEADERS=true -``` - -## 🔒 Security Best Practices - -### 1. Firewall Configuration - -```bash -# Block external access to Geth and TorPC -sudo ufw deny 8545/tcp # Block Geth -sudo ufw deny 8080/tcp # Block TorPC direct access - -# Allow only localhost connections -sudo iptables -A INPUT -p tcp --dport 8545 -s 127.0.0.1 -j ACCEPT -sudo iptables -A INPUT -p tcp --dport 8545 -j DROP -sudo iptables -A INPUT -p tcp --dport 8080 -s 127.0.0.1 -j ACCEPT -sudo iptables -A INPUT -p tcp --dport 8080 -j DROP -``` - -### 2. Tor Circuit Isolation - -Each connection through Tor uses a separate circuit, ensuring: -- No correlation between different users -- Isolated rate limiting per circuit -- Enhanced privacy - -### 3. Key Security - -```bash -# Secure Tor keys -chmod 700 data/tor/torpc -chmod 600 data/tor/torpc/hs_ed25519_secret_key - -# Backup your keys securely -cp -r data/tor/torpc /secure/backup/location/ -``` - -### 4. Operational Security - -- ✅ **DO**: Always use Tor Browser or torsocks for anonymous access -- ✅ **DO**: Regularly update all components -- ✅ **DO**: Monitor logs for suspicious activity -- ❌ **DON'T**: Share your .onion address publicly unless intended -- ❌ **DON'T**: Run on a VPS that requires KYC -- ❌ **DON'T**: Use the same .onion for multiple services - -## 🔧 Troubleshooting - -### Common Issues - -#### Geth Won't Start - -```bash -# Check if port is already in use -lsof -i :8545 - -# Kill existing process -kill -9 $(lsof -t -i:8545) - -# Check Geth logs -tail -f data/geth-dev/geth.log ``` -#### Tor Connection Failed +The static UI at serves two templates depending +on the request `Host` header: -```bash -# Check Tor status -systemctl status tor - -# Check Tor logs -tail -f data/tor/tor.log - -# Verify torrc syntax -tor --verify-config -f configs/torrc - -# Check permissions -ls -la data/tor/torpc/ -``` +- **Operator dashboard** (`Host: 127.0.0.1:8080` or any non-`.onion`): + endpoint reference, JSON-RPC test panel, self-test wallet flows. This + is what the operator sees when they `curl` or browse the bind address + directly. +- **Wallet-onboarding flow** (`Host: .onion`): install-the- + client step gated by a JS probe of `localhost:8545`, then a wallet + picker (MetaMask / Coinbase Wallet / Rabby / Trust Wallet) with copy- + to-clipboard RPC URL and per-wallet "Add network" buttons. This is + what visitors see when they reach the daemon through Tor. -#### TorPC Build Errors - -```bash -# Update Rust -rustup update - -# Clean and rebuild -cargo clean -cargo build --release - -# Check dependencies -cargo tree -``` - -#### Rate Limiting Issues - -```bash -# Increase rate limits -export RATE_LIMIT_REQUESTS=120 -export RATE_LIMIT_WINDOW=60 - -# Or modify in code and rebuild -``` - -### Debug Mode - -```bash -# Enable debug logging -RUST_LOG=debug ./target/release/torpc - -# Enable Tor debug logs -echo "Log debug file ./data/tor/debug.log" >> configs/torrc -``` - -### Performance Issues - -1. **Slow Responses**: - - Check Geth sync status: `cast block-number` - - Verify Tor circuit health - - Consider increasing rate limits - -2. **High Memory Usage**: - - Limit Geth cache: `--cache 1024` - - Reduce Tor MaxStreams - -3. **Connection Drops**: - - Check firewall rules - - Verify Tor is running - - Monitor system resources - -## 📚 Advanced Topics - -### Custom RPC Method Whitelisting - -Edit `src/whitelist.rs` to modify allowed methods: - -```rust -const ALLOWED_METHODS: &[&str] = &[ - // Add your custom methods here - "eth_blockNumber", - "eth_getBalance", - // ... -]; -``` - -### Flashbots Integration - -The `/rpc/flashbots` endpoint automatically routes transactions to prevent MEV: - -1. `eth_sendRawTransaction` → Flashbots Relay -2. Other methods → Local Geth node - -To add Flashbots authentication: -```rust -// In src/proxy.rs -headers.insert("X-Flashbots-Signature", signature); -``` - -### Monitoring & Metrics - -```bash -# Add Prometheus metrics (coming soon) -cargo add prometheus - -# Export metrics endpoint -METRICS_ADDR=127.0.0.1:9090 -``` - -### Docker Deployment - -```dockerfile -# Dockerfile -FROM rust:1.70 as builder -WORKDIR /app -COPY . . -RUN cargo build --release - -FROM debian:bullseye-slim -RUN apt-get update && apt-get install -y tor geth -COPY --from=builder /app/target/release/torpc /usr/local/bin/ -COPY configs /etc/torpc/ -CMD ["torpc"] -``` - -```yaml -# docker-compose.yml -version: '3.8' -services: - geth: - image: ethereum/client-go:latest - command: --dev --http --http.addr 0.0.0.0 - volumes: - - geth-data:/data - - tor: - image: osminogin/tor-simple - volumes: - - tor-data:/var/lib/tor - - ./configs/torrc:/etc/tor/torrc - - torpc: - build: . - depends_on: - - geth - - tor - environment: - - GETH_URL=http://geth:8545 - ports: - - "8080:8080" - -volumes: - geth-data: - tor-data: -``` - -## 🤝 Contributing - -We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines. - -### Development Setup - -```bash -# Fork and clone -git clone https://github.com/yourusername/torpc.git -cd torpc - -# Create feature branch -git checkout -b feature/your-feature - -# Install dev dependencies -cargo install cargo-watch cargo-audit - -# Run in watch mode -cargo watch -x run - -# Run tests on change -cargo watch -x test -``` - -## 📜 License - -This project is licensed under the MIT License - see [LICENSE](LICENSE) for details. - -## 🙏 Acknowledgments - -- [Tor Project](https://www.torproject.org/) for anonymous networking -- [Ethereum Foundation](https://ethereum.org/) for the blockchain -- [Flashbots](https://flashbots.net/) for MEV protection -- [Rust Community](https://www.rust-lang.org/) for the amazing ecosystem +Source-of-truth templates are `static/index_operator.html` and +`static/index_user.html`; routing lives in `src/app.rs::serve_root`. --- -
- -**Built with 🦀 Rust and 🧅 Tor for a more private Ethereum** +## License -[Report Bug](https://github.com/yourusername/torpc/issues) • [Request Feature](https://github.com/yourusername/torpc/issues) +MIT — see [LICENSE](LICENSE). -
\ No newline at end of file +Built with 🦀 Rust and 🧅 Tor. diff --git a/src/app.rs b/src/app.rs index f76fb09..703fc7f 100644 --- a/src/app.rs +++ b/src/app.rs @@ -26,6 +26,9 @@ use tower_http::set_header::SetResponseHeaderLayer; use tower_http::trace::TraceLayer; use tracing::{error, info}; +use axum::http::HeaderMap; +use axum::response::Html; + use crate::mev::mev_handler::{handle_flashbots_with_mev, MevProxyState}; use crate::mev::{create_mev_client, MevConfig}; use crate::proxy::{self, handle_rpc, ProxyState}; @@ -35,6 +38,42 @@ use crate::security::{ SecurityConfig, STATIC_CSP, }; +/// Operator dashboard — test panel + self-test wallet flows + endpoint +/// reference. Served when the visitor reaches the daemon by `127.0.0.1`, +/// LAN, or any non-`.onion` host. +const INDEX_OPERATOR_HTML: &str = include_str!("../static/index_operator.html"); + +/// Wallet-onboarding flow — install-the-client step + wallet picker, gated +/// by a JS probe of `localhost:8545`. Served when the `Host` header ends +/// in `.onion`, i.e. the visitor reached us through Tor. +const INDEX_USER_HTML: &str = include_str!("../static/index_user.html"); + +/// Pick which `index_*.html` template to return based on the request `Host`. +/// `.onion` host → user-facing wallet-onboarding template; anything else → +/// operator dashboard. +/// +/// Ports are stripped before suffix matching, so an operator binding to a +/// non-default port still sees the operator template, and Tor Browser +/// hitting `:80` sees the user template. +/// +/// Spoofing concern: an attacker on the operator's LAN can send +/// `Host: foo.onion` and force the user template. They get an install- +/// the-client page that exposes no operator state — the JS probe runs in +/// *their* browser against *their* localhost. Not a leak. +async fn serve_root(headers: HeaderMap) -> Html<&'static str> { + let host = headers + .get(axum::http::header::HOST) + .and_then(|h| h.to_str().ok()) + .unwrap_or(""); + let hostname = host.split(':').next().unwrap_or("").to_ascii_lowercase(); + + if hostname.ends_with(".onion") { + Html(INDEX_USER_HTML) + } else { + Html(INDEX_OPERATOR_HTML) + } +} + /// All operator-configurable knobs the daemon needs at startup. Construct /// via `from_env()` for production or by literal in tests. #[derive(Clone, Debug)] @@ -42,6 +81,11 @@ pub struct AppConfig { pub geth_url: String, pub flashbots_url: String, pub bind_addr: String, + /// Bind address for the admin listener (`/health`, `/metrics`). Kept on + /// a separate socket from `bind_addr` so admin endpoints are not + /// reachable through the Tor hidden service — the .onion forwards only + /// to `bind_addr`. Default `127.0.0.1:9001`. + pub admin_bind_addr: String, /// Hex-encoded private key used to sign Flashbots auth headers. `None` /// disables MEV protection (bundles return a JSON-RPC error rather than @@ -71,12 +115,13 @@ impl AppConfig { std::env::var("GETH_URL").unwrap_or_else(|_| "http://127.0.0.1:8545".to_string()); let flashbots_url = std::env::var("FLASHBOTS_URL") .unwrap_or_else(|_| "https://relay.flashbots.net".to_string()); - let bind_addr = - std::env::var("BIND_ADDR").unwrap_or_else(|_| "127.0.0.1:8080".to_string()); + let bind_addr = std::env::var("BIND_ADDR").unwrap_or_else(|_| "127.0.0.1:8080".to_string()); + let admin_bind_addr = + std::env::var("ADMIN_BIND_ADDR").unwrap_or_else(|_| "127.0.0.1:9001".to_string()); let mev_signing_key = std::env::var("FLASHBOTS_SIGNING_KEY").ok(); - let mev_relay_url = std::env::var("FLASHBOTS_RELAY_URL") - .unwrap_or_else(|_| flashbots_url.clone()); + let mev_relay_url = + std::env::var("FLASHBOTS_RELAY_URL").unwrap_or_else(|_| flashbots_url.clone()); let mev_request_timeout = Duration::from_secs(env_u64("FLASHBOTS_REQUEST_TIMEOUT", 5)); let rate_limit = RateLimitConfig { @@ -97,6 +142,7 @@ impl AppConfig { geth_url, flashbots_url, bind_addr, + admin_bind_addr, mev_signing_key, mev_relay_url, mev_request_timeout, @@ -117,6 +163,7 @@ impl AppConfig { geth_url, flashbots_url: "http://127.0.0.1:1".to_string(), bind_addr: "127.0.0.1:0".to_string(), + admin_bind_addr: "127.0.0.1:0".to_string(), mev_signing_key: None, mev_relay_url: "http://127.0.0.1:1".to_string(), mev_request_timeout: Duration::from_secs(2), @@ -135,11 +182,25 @@ impl AppConfig { } } -/// What `build_app` returns. Holding the cleanup `JoinHandle` lets callers -/// abort the rate-limiter cleanup task on shutdown — the task otherwise -/// runs until the runtime drops. +/// What `build_app` returns. Two routers (one Tor-facing, one operator-only) +/// share the same `MevProxyState` so `/metrics` reflects live activity from +/// the public router. The cleanup `JoinHandle` lets callers abort the +/// rate-limiter cleanup task on shutdown. +/// +/// **Why two routers?** `/health` and `/metrics` leak operator-side state +/// (component circuit-breaker status, request volume counters, uptime, +/// version) and have no consumer over Tor. Splitting them onto a separate +/// localhost-bound listener means anyone reaching the .onion sees a 404 +/// for those paths. pub struct BuiltApp { + /// Tor-facing router: `/rpc`, `/rpc/flashbots`, static UI, full security + /// middleware stack. This is what `bind_addr` listens on. pub app: Router, + /// Operator-only router: `/health`, `/metrics`. Bound to `admin_bind_addr` + /// (default 127.0.0.1:9001). Carries security headers but skips the + /// JSON-RPC timeout / body-limit / rate-limit layers — those are noise + /// for a localhost admin surface. + pub admin_app: Router, pub cleanup_task: tokio::task::JoinHandle<()>, } @@ -189,7 +250,10 @@ pub async fn build_app(config: AppConfig) -> anyhow::Result { }; match create_mev_client(mev_config) { Ok(client) => { - info!("MEV protection enabled with relay: {}", config.mev_relay_url); + info!( + "MEV protection enabled with relay: {}", + config.mev_relay_url + ); Arc::new(MevProxyState { base_state: base_state.clone(), mev_client: Some(client), @@ -223,10 +287,18 @@ pub async fn build_app(config: AppConfig) -> anyhow::Result { } }); - // ----- Router assembly -------------------------------------------------- + // ----- Public (Tor-facing) router --------------------------------------- + // /health and /metrics deliberately live on the admin router, NOT here. + // Reaching them through the .onion would leak component state, request + // volume, uptime, and version to anonymous Tor visitors. Path resolution + // is route-tree based — they will 404 on this router. + // + // GET / serves one of two templates based on the request `Host` header: + // visitors via .onion get `index_user.html`; operators on LAN/loopback + // get `index_operator.html`. Static assets (app.js, helpers, style.css) + // are served by ServeDir as the fallback. let app = Router::new() - .route("/health", get(health_check)) - .route("/metrics", get(security_metrics)) + .route("/", get(serve_root)) .route( "/rpc", post({ @@ -249,8 +321,8 @@ pub async fn build_app(config: AppConfig) -> anyhow::Result { rate_limiter.clone(), rate_limit_middleware, )) - .nest_service("/", ServeDir::new(&config.static_dir)) - .with_state(mev_state) + .fallback_service(ServeDir::new(&config.static_dir)) + .with_state(mev_state.clone()) .layer(ConcurrencyLimitLayer::new(config.max_concurrent)) .layer(DefaultBodyLimit::max(config.security.max_body_size)) .layer(middleware::from_fn_with_state( @@ -259,16 +331,31 @@ pub async fn build_app(config: AppConfig) -> anyhow::Result { )) .layer(middleware::from_fn(security_headers_middleware)) // Static CSP — see `STATIC_CSP` in `security.rs` for rationale on - // why this is no longer built from runtime env. Operators who - // customise the discovery server's port and want the wallet - // auto-detect to pass CSP must override via a reverse proxy. + // why this is no longer built from runtime env. .layer(SetResponseHeaderLayer::overriding( axum::http::header::CONTENT_SECURITY_POLICY, axum::http::HeaderValue::from_static(STATIC_CSP), )) .layer(TraceLayer::new_for_http()); - Ok(BuiltApp { app, cleanup_task }) + // ----- Admin (localhost-only) router ----------------------------------- + // Shares `mev_state` with the public router so `/metrics` reflects live + // counters incremented by request handling. We deliberately skip the + // JSON-RPC timeout, body-limit, and rate-limit middlewares — those are + // designed for adversarial inputs and add no value on a localhost + // operator surface. Security headers stay on for defense in depth. + let admin_app = Router::new() + .route("/health", get(health_check)) + .route("/metrics", get(security_metrics)) + .with_state(mev_state) + .layer(middleware::from_fn(security_headers_middleware)) + .layer(TraceLayer::new_for_http()); + + Ok(BuiltApp { + app, + admin_app, + cleanup_task, + }) } fn env_u64(name: &str, default: u64) -> u64 { diff --git a/src/error.rs b/src/error.rs index 1585dc1..fc1622e 100644 --- a/src/error.rs +++ b/src/error.rs @@ -11,31 +11,31 @@ use crate::rpc_types::JsonRpcResponse; pub enum ProxyError { #[error("Invalid JSON-RPC request: {0}")] InvalidRequest(String), - + #[error("Method not allowed: {0}")] MethodNotAllowed(String), - + #[error("Rate limit exceeded")] RateLimitExceeded, - + #[error("Upstream connection error: {0}")] UpstreamError(String), - + #[error("JSON parsing error: {0}")] JsonError(String), - + #[error("HTTP request error: {0}")] HttpError(String), - + #[error("Internal server error: {0}")] InternalError(String), - + #[error("MEV relay error: {0}")] MevRelayError(String), - + #[error("Bundle simulation failed: {0}")] BundleSimulationError(String), - + #[error("Flashbots authentication failed")] FlashbotsAuthError, } @@ -44,27 +44,22 @@ impl ProxyError { /// Convert to JSON-RPC error code pub fn to_json_rpc_code(&self) -> i64 { match self { - ProxyError::InvalidRequest(_) => -32600, // Invalid Request + ProxyError::InvalidRequest(_) => -32600, // Invalid Request ProxyError::MethodNotAllowed(_) => -32601, // Method not found - ProxyError::RateLimitExceeded => -32000, // Server error - ProxyError::JsonError(_) => -32700, // Parse error - ProxyError::UpstreamError(_) => -32001, // Server error - ProxyError::HttpError(_) => -32002, // Server error - ProxyError::InternalError(_) => -32603, // Internal error - ProxyError::MevRelayError(_) => -32003, // MEV relay error + ProxyError::RateLimitExceeded => -32000, // Server error + ProxyError::JsonError(_) => -32700, // Parse error + ProxyError::UpstreamError(_) => -32001, // Server error + ProxyError::HttpError(_) => -32002, // Server error + ProxyError::InternalError(_) => -32603, // Internal error + ProxyError::MevRelayError(_) => -32003, // MEV relay error ProxyError::BundleSimulationError(_) => -32004, // Bundle simulation error - ProxyError::FlashbotsAuthError => -32005, // Authentication error + ProxyError::FlashbotsAuthError => -32005, // Authentication error } } - + /// Convert to JSON-RPC error response pub fn to_json_rpc_response(&self, id: Option) -> JsonRpcResponse { - JsonRpcResponse::error( - id, - self.to_json_rpc_code(), - self.to_string(), - None, - ) + JsonRpcResponse::error(id, self.to_json_rpc_code(), self.to_string(), None) } } @@ -77,9 +72,9 @@ impl IntoResponse for ProxyError { ProxyError::JsonError(_) => StatusCode::BAD_REQUEST, _ => StatusCode::INTERNAL_SERVER_ERROR, }; - + let error_response = self.to_json_rpc_response(None); - + (status_code, Json(error_response)).into_response() } } @@ -113,10 +108,7 @@ mod tests { ProxyError::MethodNotAllowed("eth_accounts".to_string()).to_json_rpc_code(), -32601 ); - assert_eq!( - ProxyError::RateLimitExceeded.to_json_rpc_code(), - -32000 - ); + assert_eq!(ProxyError::RateLimitExceeded.to_json_rpc_code(), -32000); assert_eq!( ProxyError::JsonError("Parse error".to_string()).to_json_rpc_code(), -32700 @@ -127,14 +119,13 @@ mod tests { fn test_error_to_json_rpc_response() { let error = ProxyError::MethodNotAllowed("eth_accounts".to_string()); let response = error.to_json_rpc_response(Some(json!(1))); - + assert_eq!(response.jsonrpc, "2.0"); assert!(response.result.is_none()); assert!(response.error.is_some()); - + let rpc_error = response.error.unwrap(); assert_eq!(rpc_error.code, -32601); assert_eq!(rpc_error.message, "Method not allowed: eth_accounts"); } - -} \ No newline at end of file +} diff --git a/src/geth_client.rs b/src/geth_client.rs index 63dce8b..fbcc962 100644 --- a/src/geth_client.rs +++ b/src/geth_client.rs @@ -1,6 +1,6 @@ +use anyhow::Result; use reqwest::Client; use serde_json::json; -use anyhow::Result; use crate::rpc_types::{JsonRpcRequest, JsonRpcResponse}; @@ -16,10 +16,10 @@ impl GethClient { .timeout(std::time::Duration::from_secs(10)) .build() .expect("Failed to create HTTP client"); - + Self { client, url } } - + /// Test basic connectivity by calling eth_blockNumber pub async fn test_connectivity(&self) -> Result { let request = JsonRpcRequest { @@ -28,30 +28,26 @@ impl GethClient { params: None, id: Some(json!(1)), }; - - let response = self.client - .post(&self.url) - .json(&request) - .send() - .await?; - + + let response = self.client.post(&self.url).json(&request).send().await?; + if !response.status().is_success() { anyhow::bail!("Geth returned status: {}", response.status()); } - + let json_response: JsonRpcResponse = response.json().await?; - + if let Some(error) = json_response.error { anyhow::bail!("RPC error: {}", error.message); } - + if let Some(result) = json_response.result { Ok(result.to_string()) } else { anyhow::bail!("No result in response"); } } - + /// Get the chain ID pub async fn get_chain_id(&self) -> Result { let request = JsonRpcRequest { @@ -60,15 +56,11 @@ impl GethClient { params: None, id: Some(json!(1)), }; - - let response = self.client - .post(&self.url) - .json(&request) - .send() - .await?; - + + let response = self.client.post(&self.url).json(&request).send().await?; + let json_response: JsonRpcResponse = response.json().await?; - + if let Some(result) = json_response.result { Ok(result.to_string()) } else { @@ -81,45 +73,50 @@ impl GethClient { mod tests { use super::*; use mockito::Server; - + #[tokio::test] async fn test_connectivity_success() { let mut server = Server::new_async().await; - let _m = server.mock("POST", "/") + let _m = server + .mock("POST", "/") .with_status(200) .with_header("content-type", "application/json") .with_body(r#"{"jsonrpc":"2.0","result":"0x123","id":1}"#) .create(); - + let client = GethClient::new(server.url()); let result = client.test_connectivity().await.unwrap(); assert_eq!(result, "\"0x123\""); } - + #[tokio::test] async fn test_connectivity_error() { let mut server = Server::new_async().await; - let _m = server.mock("POST", "/") + let _m = server + .mock("POST", "/") .with_status(200) .with_header("content-type", "application/json") - .with_body(r#"{"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not found"},"id":1}"#) + .with_body( + r#"{"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not found"},"id":1}"#, + ) .create(); - + let client = GethClient::new(server.url()); let result = client.test_connectivity().await; assert!(result.is_err()); assert!(result.unwrap_err().to_string().contains("Method not found")); } - + #[tokio::test] async fn test_get_chain_id() { let mut server = Server::new_async().await; - let _m = server.mock("POST", "/") + let _m = server + .mock("POST", "/") .with_status(200) .with_header("content-type", "application/json") .with_body(r#"{"jsonrpc":"2.0","result":"0x539","id":1}"#) .create(); - + let client = GethClient::new(server.url()); let result = client.get_chain_id().await.unwrap(); assert_eq!(result, "\"0x539\""); // 1337 in hex (dev chain ID) @@ -130,14 +127,13 @@ mod tests { #[cfg(not(test))] pub async fn test_geth_connection() -> Result<()> { use tracing::info; - - let url = std::env::var("GETH_URL") - .unwrap_or_else(|_| "http://127.0.0.1:8545".to_string()); - + + let url = std::env::var("GETH_URL").unwrap_or_else(|_| "http://127.0.0.1:8545".to_string()); + info!("Testing Geth connection at: {}", url); - + let client = GethClient::new(url); - + // Test connectivity match client.test_connectivity().await { Ok(block_number) => { @@ -147,7 +143,7 @@ pub async fn test_geth_connection() -> Result<()> { anyhow::bail!("❌ Failed to connect to Geth: {}", e); } } - + // Get chain ID match client.get_chain_id().await { Ok(chain_id) => { @@ -157,6 +153,6 @@ pub async fn test_geth_connection() -> Result<()> { anyhow::bail!("Failed to get chain ID: {}", e); } } - + Ok(()) -} \ No newline at end of file +} diff --git a/src/lib.rs b/src/lib.rs index 7dc70cd..b52effb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,4 +7,4 @@ pub mod rate_limit; pub mod rpc_types; pub mod security; pub mod tor; -pub mod whitelist; \ No newline at end of file +pub mod whitelist; diff --git a/src/main.rs b/src/main.rs index 4c4f1d3..5f132fc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,15 +1,16 @@ //! ToRPC daemon entry point. //! -//! Almost all logic lives in `torpc::app::build_app`. This file is just the -//! thin shell that parses env, builds the production router, binds the -//! socket, and serves with graceful shutdown. Keeping it small means -//! integration tests (`tests/daemon_e2e_test.rs`) can drive the same -//! `build_app` directly without re-implementing layer ordering. +//! Almost all logic lives in `torpc::app::build_app`. This file is the +//! thin shell that parses env, builds the production routers, binds two +//! sockets (public Tor-facing + admin localhost), and serves both with a +//! shared graceful shutdown. Keeping it small means integration tests +//! (`tests/daemon_e2e_test.rs`) can drive the same `build_app` directly +//! without re-implementing layer ordering. use std::net::SocketAddr; use anyhow::Context; -use tracing::info; +use tracing::{debug, info, warn}; use tracing_subscriber::EnvFilter; use torpc::app::{build_app, AppConfig}; @@ -49,55 +50,110 @@ async fn main() -> anyhow::Result<()> { .with_target(false) .init(); + // Load `.env` if present. Operators who used to do `cp .env.example .env` + // and then `cargo run` previously had no env vars applied — the daemon + // never sourced the file. `dotenvy` is a no-op when the file is absent, + // so this is safe in systemd / docker setups that inject env directly. + let _ = dotenvy::dotenv(); + info!("Starting TorPC proxy server"); let config = AppConfig::from_env(); let bind_addr = config.bind_addr.clone(); + let admin_bind_addr = config.admin_bind_addr.clone(); let built = build_app(config).await?; - // Tor advisory output (best-effort; never blocks startup). + // Tor configuration check. When `configs/torrc` is present, anonymity- + // disabling flags now fail the daemon hard (set TORPC_ALLOW_NON_ANONYMOUS=1 + // to override for benchmarks/CI). When torrc is absent, this is a no-op. let tor_service = TorService::new(); - if let Err(e) = tor_service.check_configuration() { - info!("Tor configuration issue: {}", e); - info!("Run ./scripts/setup-tor.sh to configure Tor"); - } else { - match tor_service.get_hostname() { - Ok(Some(hostname)) => { - info!("🧅 Tor hidden service available at: http://{}", hostname); - info!(" RPC endpoint: http://{}/rpc", hostname); - info!(" Flashbots endpoint: http://{}/rpc/flashbots", hostname); - } - Ok(None) => { - info!("Tor is configured but not running yet"); - info!("Start Tor with: ./scripts/start-tor.sh"); - } - Err(e) => info!("Could not read Tor hostname: {}", e), + tor_service + .check_configuration() + .context("Tor configuration check failed; see error above for the offending line")?; + match tor_service.get_hostname() { + // The .onion hostname is the operator's public-facing identity. At + // INFO level it shows up in journalctl / syslog / log shippers, + // which makes accidental disclosure surprisingly easy. Keep it + // behind RUST_LOG=debug; operators who want it can `cat + // data/tor/torpc/hostname`. + Ok(Some(_)) => { + debug!("Tor hidden service hostname resolved (cat data/tor/torpc/hostname to view)") } + Ok(None) => info!("Tor is configured but not running yet"), + Err(e) => warn!("Could not read Tor hostname: {}", e), } - let addr: SocketAddr = bind_addr + let public_addr: SocketAddr = bind_addr + .parse() + .with_context(|| format!("invalid BIND_ADDR: {bind_addr}"))?; + let admin_addr: SocketAddr = admin_bind_addr .parse() - .with_context(|| format!("invalid BIND_ADDR: {}", bind_addr))?; - info!("Server listening on {}", addr); - info!("Access the web interface at http://{}", addr); + .with_context(|| format!("invalid ADMIN_BIND_ADDR: {admin_bind_addr}"))?; + + // Defense in depth: refuse to serve admin endpoints on a non-loopback + // address. Operators wanting remote scrape should reverse-proxy + // through their own auth or use an SSH tunnel. + if !admin_addr.ip().is_loopback() { + anyhow::bail!( + "ADMIN_BIND_ADDR ({admin_addr}) must be a loopback address; \ + /health and /metrics expose operator state and are not safe \ + on a public interface" + ); + } - let listener = tokio::net::TcpListener::bind(addr) + let public_listener = tokio::net::TcpListener::bind(public_addr) .await - .with_context(|| format!("failed to bind {}", addr))?; - - axum::serve( - listener, - built - .app - .into_make_service_with_connect_info::(), - ) - .with_graceful_shutdown(shutdown_signal()) - .await - .context("server task failed")?; + .with_context(|| format!("failed to bind {public_addr}"))?; + let admin_listener = tokio::net::TcpListener::bind(admin_addr) + .await + .with_context(|| format!("failed to bind {admin_addr}"))?; + + info!("Public server listening on {} (Tor-facing)", public_addr); + info!( + "Admin server listening on {} (localhost-only: /health, /metrics)", + admin_addr + ); + info!("Access the web interface at http://{}", public_addr); + + // Both serve loops watch the same shutdown channel. When SIGINT/SIGTERM + // fires, we send once and both loops complete their graceful shutdown. + // tokio::sync::broadcast is enough for this two-receiver case and avoids + // pulling in `tokio-util::sync::CancellationToken` for a single use. + let (shutdown_tx, _) = tokio::sync::broadcast::channel::<()>(1); + + let mut public_rx = shutdown_tx.subscribe(); + let public_app = built.app; + let public_handle = tokio::spawn(async move { + axum::serve( + public_listener, + public_app.into_make_service_with_connect_info::(), + ) + .with_graceful_shutdown(async move { + let _ = public_rx.recv().await; + }) + .await + }); + + let mut admin_rx = shutdown_tx.subscribe(); + let admin_app = built.admin_app; + let admin_handle = tokio::spawn(async move { + axum::serve(admin_listener, admin_app.into_make_service()) + .with_graceful_shutdown(async move { + let _ = admin_rx.recv().await; + }) + .await + }); + + shutdown_signal().await; + let _ = shutdown_tx.send(()); // Stop the rate-limiter cleanup task so the runtime exits cleanly. built.cleanup_task.abort(); + let (public_res, admin_res) = tokio::join!(public_handle, admin_handle); + public_res.context("public server task panicked")??; + admin_res.context("admin server task panicked")??; + info!("Server stopped cleanly"); Ok(()) } diff --git a/src/mev/auth.rs b/src/mev/auth.rs index ef7f2e0..ac99f80 100644 --- a/src/mev/auth.rs +++ b/src/mev/auth.rs @@ -1,5 +1,5 @@ //! Flashbots authentication using EIP-191 signatures -//! +//! //! This module implements the X-Flashbots-Signature authentication scheme //! required for submitting bundles to Flashbots relays. @@ -14,26 +14,26 @@ pub enum AuthError { /// Invalid private key format #[error("Invalid private key: {0}")] InvalidKey(String), - + /// Signature generation failed #[error("Failed to sign message: {0}")] SigningError(String), - + /// Hex encoding/decoding error #[error("Hex encoding error: {0}")] HexError(#[from] hex::FromHexError), } /// Handles Flashbots authentication using EIP-191 signatures -/// +/// /// # Security Note /// The signing key is used only for authentication, not for transactions. /// Any Ethereum key can be used - it doesn't need to hold funds. -/// +/// /// # For Developers /// The authenticator signs the entire JSON-RPC request body to prove /// the request hasn't been tampered with in transit. -/// +/// /// # Example /// ```rust /// let auth = FlashbotsAuthenticator::new("your-private-key-hex")?; @@ -53,89 +53,93 @@ pub struct FlashbotsAuthenticator { impl FlashbotsAuthenticator { /// Create a new authenticator with the given private key - /// + /// /// # Arguments /// * `private_key_hex` - Private key in hex format (with or without 0x prefix) - /// + /// /// # Returns /// * `Ok(FlashbotsAuthenticator)` - Configured authenticator /// * `Err(AuthError)` - If the private key is invalid pub fn new(private_key_hex: &str) -> Result { let secp = Arc::new(Secp256k1::new()); - + // Remove 0x prefix if present - let key_hex = private_key_hex.strip_prefix("0x").unwrap_or(private_key_hex); - + let key_hex = private_key_hex + .strip_prefix("0x") + .unwrap_or(private_key_hex); + // Parse private key let key_bytes = hex::decode(key_hex)?; - let signing_key = SecretKey::from_slice(&key_bytes) - .map_err(|e| AuthError::InvalidKey(e.to_string()))?; - + let signing_key = + SecretKey::from_slice(&key_bytes).map_err(|e| AuthError::InvalidKey(e.to_string()))?; + // Derive public key and address let public_key = signing_key.public_key(&secp); let public_key_bytes = public_key.serialize_uncompressed(); - + // Ethereum address is last 20 bytes of keccak256(public_key) let mut hasher = Keccak256::new(); hasher.update(&public_key_bytes[1..]); // Skip the 0x04 prefix let hash = hasher.finalize(); let address_bytes = &hash[12..]; // Last 20 bytes let signer_address = format!("0x{}", hex::encode(address_bytes)); - + Ok(Self { secp, signing_key, signer_address, }) } - + /// Get the signer's Ethereum address - /// + /// /// # Returns /// The 0x-prefixed Ethereum address derived from the signing key pub fn address(&self) -> &str { &self.signer_address } - + /// Sign a request body and return the X-Flashbots-Signature header value - /// + /// /// # Format /// Returns: "0xAddress:0xSignature" - /// + /// /// # Example /// ```rust /// let body = r#"{"jsonrpc":"2.0","method":"eth_sendBundle",...}"#; /// let signature = auth.sign_request(body)?; /// // Returns: "0x1234...abcd:0x5678...ef01" /// ``` - /// + /// /// # Arguments /// * `body` - The complete JSON-RPC request body to sign - /// + /// /// # Returns /// * `Ok(String)` - The formatted signature header value /// * `Err(AuthError)` - If signing fails pub fn sign_request(&self, body: &str) -> Result { // EIP-191 personal message format let message_to_sign = self.create_eip191_message(body); - + // Hash the message let mut hasher = Keccak256::new(); hasher.update(&message_to_sign); let hash = hasher.finalize(); - + // Sign the hash - let message = Message::from_slice(&hash) - .map_err(|e| AuthError::SigningError(e.to_string()))?; - - let signature = self.secp.sign_ecdsa_recoverable(&message, &self.signing_key); + let message = + Message::from_slice(&hash).map_err(|e| AuthError::SigningError(e.to_string()))?; + + let signature = self + .secp + .sign_ecdsa_recoverable(&message, &self.signing_key); let (recovery_id, signature_bytes) = signature.serialize_compact(); // Format signature as Ethereum does (v = recovery_id + 27) let mut eth_signature = [0u8; 65]; eth_signature[..64].copy_from_slice(&signature_bytes); eth_signature[64] = recovery_id.to_i32() as u8 + 27; - + // Format as "0xAddress:0xSignature" Ok(format!( "{}:0x{}", @@ -143,9 +147,9 @@ impl FlashbotsAuthenticator { hex::encode(eth_signature) )) } - + /// Create an EIP-191 formatted message - /// + /// /// # Format /// "\x19Ethereum Signed Message:\n" fn create_eip191_message(&self, body: &str) -> Vec { @@ -159,18 +163,18 @@ impl FlashbotsAuthenticator { #[cfg(test)] mod tests { use super::*; - + #[test] fn test_authenticator_creation() { // Test key (DO NOT USE IN PRODUCTION) let key = "1111111111111111111111111111111111111111111111111111111111111111"; let auth = FlashbotsAuthenticator::new(key).unwrap(); - + // Verify address derivation assert!(auth.address().starts_with("0x")); assert_eq!(auth.address().len(), 42); // 0x + 40 hex chars } - + #[test] fn test_authenticator_with_0x_prefix() { // Test that 0x prefix is handled correctly @@ -178,15 +182,15 @@ mod tests { let auth = FlashbotsAuthenticator::new(key).unwrap(); assert!(auth.address().starts_with("0x")); } - + #[test] fn test_signature_format() { let key = "1111111111111111111111111111111111111111111111111111111111111111"; let auth = FlashbotsAuthenticator::new(key).unwrap(); - + let body = r#"{"jsonrpc":"2.0","method":"eth_sendBundle","params":[],"id":1}"#; let signature = auth.sign_request(body).unwrap(); - + // Verify format: address:signature let parts: Vec<&str> = signature.split(':').collect(); assert_eq!(parts.len(), 2); @@ -194,16 +198,16 @@ mod tests { assert!(parts[1].starts_with("0x")); assert_eq!(parts[1].len(), 132); // 0x + 65 bytes * 2 hex chars } - + #[test] fn test_invalid_key() { let result = FlashbotsAuthenticator::new("invalid-hex"); assert!(result.is_err()); - + let result = FlashbotsAuthenticator::new("00"); // Too short assert!(result.is_err()); } - + #[test] fn test_deterministic_signatures() { let key = "1111111111111111111111111111111111111111111111111111111111111111"; @@ -236,7 +240,11 @@ mod tests { let header = auth.sign_request(body).unwrap(); let (addr, sig_hex) = header.split_once(':').expect("address:signature header"); let sig_bytes = hex::decode(sig_hex.trim_start_matches("0x")).unwrap(); - assert_eq!(sig_bytes.len(), 65, "Flashbots requires 65-byte EIP-191 signature"); + assert_eq!( + sig_bytes.len(), + 65, + "Flashbots requires 65-byte EIP-191 signature" + ); // Reconstruct the same EIP-191 hash the authenticator signed let prefix = format!("\x19Ethereum Signed Message:\n{}", body.len()); @@ -265,4 +273,4 @@ mod tests { assert_eq!(recovered, addr, "recovered address must match signer"); assert_eq!(recovered, auth.address()); } -} \ No newline at end of file +} diff --git a/src/mev/client.rs b/src/mev/client.rs index 81bb896..85c53cf 100644 --- a/src/mev/client.rs +++ b/src/mev/client.rs @@ -1,30 +1,30 @@ //! MEV relay client for submitting bundles to Flashbots -//! +//! //! This module provides the main client interface for MEV protection, //! handling bundle submission, authentication, and retry logic. -use std::sync::Arc; -use std::time::Duration; use reqwest::{Client, StatusCode}; use serde_json::Value; +use std::sync::Arc; +use std::time::Duration; use tracing::{debug, info}; -use crate::error::ProxyError; -use crate::rpc_types::JsonRpcRequest; use super::auth::FlashbotsAuthenticator; use super::retry::{CircuitBreaker, RetryPolicy}; use super::types::{Bundle, MevConfig, SendBundleRequest}; +use crate::error::ProxyError; +use crate::rpc_types::JsonRpcRequest; /// MEV relay client for submitting bundles to Flashbots -/// +/// /// Handles connection pooling, authentication, and retry logic for /// reliable bundle submission to MEV relays. -/// +/// /// # For Proxy Operators /// Configure via environment variables: /// - `FLASHBOTS_RELAY_URL`: Relay endpoint (defaults to mainnet) /// - `FLASHBOTS_SIGNING_KEY`: Private key for authentication -/// +/// /// # Example /// ```rust /// let config = MevConfig { @@ -32,7 +32,7 @@ use super::types::{Bundle, MevConfig, SendBundleRequest}; /// signing_key: "your-private-key".to_string(), /// ..Default::default() /// }; -/// +/// /// let client = MevRelayClient::new(config)?; /// let bundle_hash = client.send_bundle(bundle).await?; /// ``` @@ -51,10 +51,10 @@ pub struct MevRelayClient { impl MevRelayClient { /// Create a new MEV relay client - /// + /// /// # Arguments /// * `config` - MEV relay configuration - /// + /// /// # Returns /// * `Ok(MevRelayClient)` - Configured client /// * `Err(ProxyError)` - If configuration is invalid @@ -65,18 +65,18 @@ impl MevRelayClient { .pool_idle_timeout(Duration::from_secs(90)) .pool_max_idle_per_host(10) .build() - .map_err(|e| ProxyError::InternalError(format!("Failed to create HTTP client: {}", e)))?; - + .map_err(|e| ProxyError::InternalError(format!("Failed to create HTTP client: {e}")))?; + // Create authenticator let authenticator = FlashbotsAuthenticator::new(&config.signing_key) - .map_err(|e| ProxyError::InternalError(format!("Invalid signing key: {}", e)))?; - + .map_err(|e| ProxyError::InternalError(format!("Invalid signing key: {e}")))?; + info!( "MEV client initialized with relay: {} and signer: {}", config.relay_url, authenticator.address() ); - + Ok(Self { http_client, config, @@ -85,37 +85,37 @@ impl MevRelayClient { retry_policy: RetryPolicy::default(), }) } - + /// Transform a raw transaction into a bundle for the next block - /// + /// /// # For Library Developers /// Converts eth_sendRawTransaction format to eth_sendBundle format /// targeting the next block for inclusion. - /// + /// /// # Arguments /// * `raw_tx` - Signed transaction in hex format /// * `current_block` - Current block number - /// + /// /// # Returns /// Bundle configured for next block submission pub fn create_bundle_from_tx(&self, raw_tx: String, current_block: u64) -> Bundle { let target_block = current_block + self.config.blocks_ahead; - + Bundle { txs: vec![raw_tx], - block_number: format!("0x{:x}", target_block), + block_number: format!("0x{target_block:x}"), min_timestamp: None, max_timestamp: None, } } - + /// Submit a bundle to the MEV relay - /// + /// /// Handles authentication, retry logic, and circuit breaking. - /// + /// /// # Arguments /// * `bundle` - Bundle to submit - /// + /// /// # Returns /// * `Ok(bundle_hash)` - Unique identifier for tracking /// * `Err(ProxyError)` - If submission fails @@ -123,34 +123,42 @@ impl MevRelayClient { // Check circuit breaker if !self.circuit_breaker.can_proceed().await { return Err(ProxyError::UpstreamError( - "MEV relay circuit breaker is open - too many failures".to_string() + "MEV relay circuit breaker is open - too many failures".to_string(), )); } - + // Create request let request = SendBundleRequest::new(bundle.clone(), 1); let body = serde_json::to_string(&request) - .map_err(|e| ProxyError::InternalError(format!("Failed to serialize bundle: {}", e)))?; - + .map_err(|e| ProxyError::InternalError(format!("Failed to serialize bundle: {e}")))?; + // Attempt with retries let mut last_error = None; - + for attempt in 0..self.retry_policy.max_attempts { if attempt > 0 { let delay = self.retry_policy.calculate_delay(attempt - 1); - debug!("Retrying bundle submission after {:?} (attempt {})", delay, attempt + 1); + debug!( + "Retrying bundle submission after {:?} (attempt {})", + delay, + attempt + 1 + ); tokio::time::sleep(delay).await; } - + match self.send_bundle_attempt(&body).await { Ok(bundle_hash) => { self.circuit_breaker.record_success().await; - info!("Bundle submitted successfully: {}", bundle_hash); + // Bundle hash is a correlatable identifier for a real + // user's transaction. INFO-level logs flow into syslog / + // log shippers by default; downgrade so operators have to + // opt in via RUST_LOG=debug. + debug!("Bundle submitted successfully: {}", bundle_hash); return Ok(bundle_hash); } Err(e) => { last_error = Some(e); - + // Check if error is retryable if let Some(ref error) = last_error { if !self.retry_policy.should_retry(&error.to_string()) { @@ -161,38 +169,43 @@ impl MevRelayClient { } } } - + // All retries exhausted self.circuit_breaker.record_failure().await; - Err(last_error.unwrap_or_else(|| + Err(last_error.unwrap_or_else(|| { ProxyError::UpstreamError("Bundle submission failed after all retries".to_string()) - )) + })) } - + /// Single attempt to send a bundle async fn send_bundle_attempt(&self, body: &str) -> Result { // Sign the request - let signature = self.authenticator.sign_request(body) - .map_err(|e| ProxyError::InternalError(format!("Failed to sign request: {}", e)))?; - + let signature = self + .authenticator + .sign_request(body) + .map_err(|e| ProxyError::InternalError(format!("Failed to sign request: {e}")))?; + debug!("Sending bundle to {} with signature", self.config.relay_url); - + // Send request - let response = self.http_client + let response = self + .http_client .post(&self.config.relay_url) .header("Content-Type", "application/json") .header("X-Flashbots-Signature", signature) .body(body.to_string()) .send() .await - .map_err(|e| ProxyError::UpstreamError(format!("Network error: {}", e)))?; - + .map_err(|e| ProxyError::UpstreamError(format!("Network error: {e}")))?; + let status = response.status(); - let response_text = response.text().await + let response_text = response + .text() + .await .unwrap_or_else(|_| "Failed to read response body".to_string()); - + debug!("Relay response: {} - {}", status, response_text); - + // Parse response if status.is_success() { self.parse_bundle_response(&response_text) @@ -200,67 +213,67 @@ impl MevRelayClient { Err(self.map_relay_error(status, &response_text)) } } - + /// Parse successful bundle response fn parse_bundle_response(&self, response_text: &str) -> Result { - let response: Value = serde_json::from_str(response_text) - .map_err(|e| ProxyError::UpstreamError( - format!("Invalid JSON response from relay: {}", e) - ))?; - + let response: Value = serde_json::from_str(response_text).map_err(|e| { + ProxyError::UpstreamError(format!("Invalid JSON response from relay: {e}")) + })?; + // Handle JSON-RPC response format if let Some(error) = response.get("error") { - let error_msg = error.get("message") + let error_msg = error + .get("message") .and_then(|m| m.as_str()) .unwrap_or("Unknown error"); - - return Err(ProxyError::UpstreamError( - format!("Relay error: {}", error_msg) - )); + + return Err(ProxyError::UpstreamError(format!( + "Relay error: {error_msg}" + ))); } - + // Extract bundle hash from result let bundle_hash = response .get("result") .and_then(|r| r.get("bundleHash")) .and_then(|h| h.as_str()) - .ok_or_else(|| ProxyError::UpstreamError( - "Missing bundleHash in response".to_string() - ))?; - + .ok_or_else(|| { + ProxyError::UpstreamError("Missing bundleHash in response".to_string()) + })?; + Ok(bundle_hash.to_string()) } - + /// Map relay HTTP errors to ProxyError fn map_relay_error(&self, status: StatusCode, body: &str) -> ProxyError { match status { StatusCode::UNAUTHORIZED => ProxyError::InternalError( - "Flashbots authentication failed - check signing key".to_string() + "Flashbots authentication failed - check signing key".to_string(), ), StatusCode::BAD_REQUEST => { // Try to extract error message if let Ok(json) = serde_json::from_str::(body) { - if let Some(error_msg) = json.get("error") + if let Some(error_msg) = json + .get("error") .and_then(|e| e.get("message")) - .and_then(|m| m.as_str()) { - return ProxyError::InvalidRequest( - format!("Bundle validation failed: {}", error_msg) - ); + .and_then(|m| m.as_str()) + { + return ProxyError::InvalidRequest(format!( + "Bundle validation failed: {error_msg}" + )); } } ProxyError::InvalidRequest("Invalid bundle format".to_string()) } - StatusCode::TOO_MANY_REQUESTS => ProxyError::UpstreamError( - "MEV relay rate limit exceeded".to_string() - ), - _ => ProxyError::UpstreamError( - format!("MEV relay error {}: {}", status, body) - ), + StatusCode::TOO_MANY_REQUESTS => { + ProxyError::UpstreamError("MEV relay rate limit exceeded".to_string()) + } + _ => ProxyError::UpstreamError(format!("MEV relay error {status}: {body}")), } } - + /// Handle eth_sendRawTransaction by converting to bundle - /// + /// /// # For Library Developers /// This is the main entry point from the proxy for MEV protection. /// Transforms a regular transaction into a Flashbots bundle. @@ -270,24 +283,28 @@ impl MevRelayClient { current_block: u64, ) -> Result { // Extract raw transaction from params - let raw_tx = request.params + let raw_tx = request + .params .as_ref() .and_then(|p| p.as_array()) .and_then(|arr| arr.first()) .and_then(|v| v.as_str()) - .ok_or_else(|| ProxyError::InvalidRequest( - "Missing transaction data in params".to_string() - ))?; - + .ok_or_else(|| { + ProxyError::InvalidRequest("Missing transaction data in params".to_string()) + })?; + // Create and submit bundle let bundle = self.create_bundle_from_tx(raw_tx.to_string(), current_block); - info!("Converting transaction to bundle for block {}", bundle.block_number); - + info!( + "Converting transaction to bundle for block {}", + bundle.block_number + ); + self.send_bundle(bundle).await } - + /// Handle eth_sendBundle directly - /// + /// /// # For Library Developers /// Processes pre-formatted bundle submissions from advanced users. /// Non-blocking summary of the relay circuit-breaker state, used by @@ -299,18 +316,15 @@ impl MevRelayClient { pub async fn handle_send_bundle(&self, request: &JsonRpcRequest) -> Result { // Extract bundle from params - let bundle_json = request.params + let bundle_json = request + .params .as_ref() .and_then(|p| p.as_array()) .and_then(|arr| arr.first()) - .ok_or_else(|| ProxyError::InvalidRequest( - "Missing bundle in params".to_string() - ))?; + .ok_or_else(|| ProxyError::InvalidRequest("Missing bundle in params".to_string()))?; let bundle: Bundle = serde_json::from_value(bundle_json.clone()) - .map_err(|e| ProxyError::InvalidRequest( - format!("Invalid bundle format: {}", e) - ))?; + .map_err(|e| ProxyError::InvalidRequest(format!("Invalid bundle format: {e}")))?; self.send_bundle(bundle).await } @@ -324,67 +338,69 @@ pub fn create_mev_client(config: MevConfig) -> Result, Proxy #[cfg(test)] mod tests { use super::*; - + fn test_config() -> MevConfig { MevConfig { relay_url: "https://relay-sepolia.flashbots.net".to_string(), - signing_key: "1111111111111111111111111111111111111111111111111111111111111111".to_string(), + signing_key: "1111111111111111111111111111111111111111111111111111111111111111" + .to_string(), request_timeout: Duration::from_secs(5), blocks_ahead: 1, } } - + #[test] fn test_bundle_creation() { let config = test_config(); let client = MevRelayClient::new(config).unwrap(); - + let raw_tx = "0xf86b...".to_string(); let bundle = client.create_bundle_from_tx(raw_tx.clone(), 1000); - + assert_eq!(bundle.txs.len(), 1); assert_eq!(bundle.txs[0], raw_tx); assert_eq!(bundle.block_number, "0x3e9"); // 1001 in hex assert!(bundle.min_timestamp.is_none()); assert!(bundle.max_timestamp.is_none()); } - + #[test] fn test_parse_bundle_response() { let config = test_config(); let client = MevRelayClient::new(config).unwrap(); - + // Success response let response = r#"{"jsonrpc":"2.0","result":{"bundleHash":"0xabc123"},"id":1}"#; let result = client.parse_bundle_response(response); assert_eq!(result.unwrap(), "0xabc123"); - + // Error response - let error_response = r#"{"jsonrpc":"2.0","error":{"code":-32000,"message":"Bundle failed"},"id":1}"#; + let error_response = + r#"{"jsonrpc":"2.0","error":{"code":-32000,"message":"Bundle failed"},"id":1}"#; let result = client.parse_bundle_response(error_response); assert!(result.is_err()); assert!(result.unwrap_err().to_string().contains("Bundle failed")); } - + #[test] fn test_map_relay_errors() { let config = test_config(); let client = MevRelayClient::new(config).unwrap(); - + // Unauthorized let error = client.map_relay_error(StatusCode::UNAUTHORIZED, ""); assert!(matches!(error, ProxyError::InternalError(_))); assert!(error.to_string().contains("authentication")); - + // Bad request with JSON error let body = r#"{"error":{"message":"Invalid bundle"}}"#; let error = client.map_relay_error(StatusCode::BAD_REQUEST, body); assert!(matches!(error, ProxyError::InvalidRequest(_))); assert!(error.to_string().contains("Invalid bundle")); - + // Rate limit let error = client.map_relay_error(StatusCode::TOO_MANY_REQUESTS, ""); assert!(matches!(error, ProxyError::UpstreamError(_))); assert!(error.to_string().contains("rate limit")); } -} \ No newline at end of file +} diff --git a/src/mev/mev_handler.rs b/src/mev/mev_handler.rs index 64a4c16..3bf47d2 100644 --- a/src/mev/mev_handler.rs +++ b/src/mev/mev_handler.rs @@ -1,18 +1,18 @@ //! MEV request handler module -//! +//! //! This module provides MEV-aware request handling that integrates //! with the proxy module without circular dependency issues. -use std::sync::Arc; use axum::{extract::State, Json}; -use tracing::{info, warn}; +use std::sync::Arc; +use tracing::{debug, warn}; +use super::client::MevRelayClient; use crate::{ error::{ProxyError, ProxyResult}, - proxy::{ProxyState, proxy_to_geth}, + proxy::{proxy_to_geth, ProxyState}, rpc_types::{JsonRpcRequest, JsonRpcResponse}, }; -use super::client::MevRelayClient; /// MEV-aware state wrapper pub struct MevProxyState { @@ -44,20 +44,26 @@ pub async fn handle_flashbots_with_mev( params: None, id: Some(serde_json::json!(1)), }; - + let block_resp = proxy_to_geth(&state.base_state, block_req).await?; - let block_hex = block_resp.result + let block_hex = block_resp + .result .as_ref() .and_then(|v| v.as_str()) - .ok_or_else(|| ProxyError::InternalError("Failed to get block number".to_string()))?; - + .ok_or_else(|| { + ProxyError::InternalError("Failed to get block number".to_string()) + })?; + let current_block = u64::from_str_radix(block_hex.trim_start_matches("0x"), 16) - .map_err(|e| ProxyError::InternalError(format!("Invalid block number: {}", e)))?; - - // Submit via MEV client - info!("Submitting transaction via MEV relay"); - let bundle_hash = mev_client.handle_send_raw_transaction(&request, current_block).await?; - + .map_err(|e| ProxyError::InternalError(format!("Invalid block number: {e}")))?; + + // Submit via MEV client. Logged at debug to keep per-tx + // routing decisions out of default operator logs. + debug!("Submitting transaction via MEV relay"); + let bundle_hash = mev_client + .handle_send_raw_transaction(&request, current_block) + .await?; + // Return bundle hash as if it were a transaction hash Ok(Json(JsonRpcResponse { jsonrpc: "2.0".to_string(), @@ -68,9 +74,9 @@ pub async fn handle_flashbots_with_mev( } "eth_sendBundle" => { // Direct bundle submission - info!("Submitting bundle via MEV relay"); + debug!("Submitting bundle via MEV relay"); let bundle_hash = mev_client.handle_send_bundle(&request).await?; - + Ok(Json(JsonRpcResponse { jsonrpc: "2.0".to_string(), result: Some(serde_json::json!({ @@ -91,4 +97,4 @@ pub async fn handle_flashbots_with_mev( warn!("MEV client not configured, using standard handler"); crate::proxy::handle_flashbots(State(state.base_state.clone()), Json(request)).await } -} \ No newline at end of file +} diff --git a/src/mev/mod.rs b/src/mev/mod.rs index a1d9bfc..2ab27a8 100644 --- a/src/mev/mod.rs +++ b/src/mev/mod.rs @@ -1,24 +1,24 @@ //! MEV (Maximum Extractable Value) protection module -//! +//! //! This module provides integration with Flashbots and other MEV relay services //! to protect users from sandwich attacks and provide private transaction submission. -//! +//! //! # Overview -//! +//! //! MEV protection works by submitting transactions directly to block builders //! through private relays instead of the public mempool. This prevents: //! - Front-running attacks //! - Sandwich attacks //! - Transaction censorship -//! +//! //! # For Proxy Operators -//! +//! //! To enable MEV protection, configure the following environment variables: //! - `FLASHBOTS_RELAY_URL`: MEV relay endpoint (defaults to Flashbots mainnet) //! - `FLASHBOTS_SIGNING_KEY`: Private key for authentication (any Ethereum key) -//! +//! //! # Architecture -//! +//! //! The module is organized as follows: //! - `client` - Main MEV relay client with connection pooling //! - `auth` - Flashbots authentication using EIP-191 signatures @@ -34,4 +34,4 @@ pub mod types; // Re-export main types for convenience pub use auth::{AuthError, FlashbotsAuthenticator}; pub use client::{create_mev_client, MevRelayClient}; -pub use types::{Bundle, BundleResponse, MevConfig}; \ No newline at end of file +pub use types::{Bundle, BundleResponse, MevConfig}; diff --git a/src/mev/retry.rs b/src/mev/retry.rs index c3e5579..2ce2f0a 100644 --- a/src/mev/retry.rs +++ b/src/mev/retry.rs @@ -1,29 +1,29 @@ //! Retry logic and circuit breaker for MEV relay resilience -//! +//! //! This module provides fault tolerance mechanisms to handle //! transient failures and prevent cascading failures when //! communicating with MEV relays. +use rand::{thread_rng, Rng}; use std::sync::Arc; use std::time::{Duration, Instant}; use tokio::sync::Mutex; -use rand::{thread_rng, Rng}; use tracing::{debug, warn}; use super::types::CircuitState; /// Implements exponential backoff with jitter for retrying failed requests -/// +/// /// # For Library Developers /// Used internally by MevRelayClient to handle transient failures. /// Not exposed in public API. -/// +/// /// # Retry Strategy /// - Initial delay: 100ms /// - Max delay: 5s /// - Jitter: ±25% to prevent thundering herd /// - Max attempts: 3 -/// +/// /// # Example /// ```rust /// let policy = RetryPolicy::default(); @@ -63,30 +63,30 @@ impl Default for RetryPolicy { impl RetryPolicy { /// Calculate delay for a given attempt number with exponential backoff - /// + /// /// # Arguments /// * `attempt` - Zero-based attempt number - /// + /// /// # Returns /// Duration to wait before next attempt pub fn calculate_delay(&self, attempt: u32) -> Duration { // Exponential backoff: delay * 2^attempt let base_delay = self.initial_delay.as_millis() as f64 * (2_u32.pow(attempt) as f64); - + // Cap at max delay let capped_delay = base_delay.min(self.max_delay.as_millis() as f64); - + // Add jitter (±jitter_factor) let mut rng = thread_rng(); let jitter_range = capped_delay * self.jitter_factor; let jitter = rng.gen_range(-jitter_range..=jitter_range); let final_delay = (capped_delay + jitter).max(0.0) as u64; - + Duration::from_millis(final_delay) } - + /// Determine if an error is retryable - /// + /// /// # For Library Developers /// Network errors and timeouts are retryable. /// Authentication and validation errors are not. @@ -95,45 +95,46 @@ impl RetryPolicy { if error.contains("authentication") || error.contains("unauthorized") { return false; } - + // Don't retry validation errors if error.contains("invalid") || error.contains("malformed") { return false; } - + // Retry network and timeout errors - if error.contains("timeout") || - error.contains("connection") || - error.contains("network") || - error.contains("temporarily unavailable") { + if error.contains("timeout") + || error.contains("connection") + || error.contains("network") + || error.contains("temporarily unavailable") + { return true; } - + // Default: retry on generic errors true } } /// Circuit breaker to prevent cascading failures -/// +/// /// # For Library Developers /// Tracks consecutive failures and temporarily disables requests /// when a threshold is reached. -/// +/// /// # State Transitions /// - Closed -> Open: After 5 consecutive failures /// - Open -> HalfOpen: After 30 seconds /// - HalfOpen -> Closed: After 1 success /// - HalfOpen -> Open: After 1 failure -/// +/// /// # Example /// ```rust /// let breaker = CircuitBreaker::new(); -/// +/// /// if !breaker.can_proceed().await { /// return Err("Circuit breaker open"); /// } -/// +/// /// match make_request().await { /// Ok(response) => { /// breaker.record_success().await; @@ -154,6 +155,12 @@ pub struct CircuitBreaker { recovery_timeout: Duration, } +impl Default for CircuitBreaker { + fn default() -> Self { + Self::new() + } +} + impl CircuitBreaker { /// Create a new circuit breaker with default settings (threshold 5, recovery 30s). pub fn new() -> Self { @@ -167,7 +174,9 @@ impl CircuitBreaker { /// * `recovery_timeout` - How long to remain Open before lazily flipping to HalfOpen. pub fn with_config(failure_threshold: u32, recovery_timeout: Duration) -> Self { Self { - state: Arc::new(Mutex::new(CircuitState::Closed { consecutive_failures: 0 })), + state: Arc::new(Mutex::new(CircuitState::Closed { + consecutive_failures: 0, + })), failure_threshold, recovery_timeout, } @@ -204,12 +213,16 @@ impl CircuitBreaker { match *state { CircuitState::HalfOpen => { debug!("Circuit breaker closing after successful recovery"); - *state = CircuitState::Closed { consecutive_failures: 0 }; + *state = CircuitState::Closed { + consecutive_failures: 0, + }; } // From Closed{n}, success resets the counter — we count *consecutive* // failures, so a single success is enough to wipe the slate. CircuitState::Closed { .. } => { - *state = CircuitState::Closed { consecutive_failures: 0 }; + *state = CircuitState::Closed { + consecutive_failures: 0, + }; } // From Open we shouldn't normally see successes (can_proceed gates them // off), but if one slips through (a request started before the breaker @@ -225,18 +238,26 @@ impl CircuitBreaker { let mut state = self.state.lock().await; match *state { - CircuitState::Closed { consecutive_failures } => { + CircuitState::Closed { + consecutive_failures, + } => { let next = consecutive_failures + 1; if next >= self.failure_threshold { warn!("Circuit breaker opened after {} consecutive failures", next); - *state = CircuitState::Open { opened_at: Instant::now() }; + *state = CircuitState::Open { + opened_at: Instant::now(), + }; } else { - *state = CircuitState::Closed { consecutive_failures: next }; + *state = CircuitState::Closed { + consecutive_failures: next, + }; } } CircuitState::HalfOpen => { warn!("Circuit breaker reopening after failed recovery attempt"); - *state = CircuitState::Open { opened_at: Instant::now() }; + *state = CircuitState::Open { + opened_at: Instant::now(), + }; } // Already Open — additional failures don't change the open timestamp; // the recovery timeout still measures from when we first opened. @@ -265,7 +286,7 @@ impl CircuitBreaker { } /// Tracks consecutive failures for circuit breaker logic -/// +/// /// # For Library Developers /// This is a simpler alternative implementation that just tracks /// consecutive failures without the full state machine. @@ -281,17 +302,17 @@ impl ConsecutiveFailureTracker { threshold, } } - + pub async fn record_success(&self) { *self.failures.lock().await = 0; } - + pub async fn record_failure(&self) -> bool { let mut failures = self.failures.lock().await; *failures += 1; *failures >= self.threshold } - + pub async fn should_open(&self) -> bool { *self.failures.lock().await >= self.threshold } @@ -300,78 +321,80 @@ impl ConsecutiveFailureTracker { #[cfg(test)] mod tests { use super::*; - + #[test] fn test_retry_delay_calculation() { let policy = RetryPolicy::default(); - + // Test exponential backoff let delay0 = policy.calculate_delay(0); let delay1 = policy.calculate_delay(1); let delay2 = policy.calculate_delay(2); - + // Each delay should be roughly double the previous (minus jitter) - assert!(delay0.as_millis() >= 75); // 100ms - 25% + assert!(delay0.as_millis() >= 75); // 100ms - 25% assert!(delay0.as_millis() <= 125); // 100ms + 25% - - assert!(delay1.as_millis() >= 150); // 200ms - 25% + + assert!(delay1.as_millis() >= 150); // 200ms - 25% assert!(delay1.as_millis() <= 250); // 200ms + 25% - - assert!(delay2.as_millis() >= 300); // 400ms - 25% + + assert!(delay2.as_millis() >= 300); // 400ms - 25% assert!(delay2.as_millis() <= 500); // 400ms + 25% } - + #[test] fn test_max_delay_cap() { let policy = RetryPolicy::default(); - + // Very high attempt number should cap at max_delay let delay = policy.calculate_delay(10); assert!(delay.as_millis() <= 6250); // 5000ms + 25% } - + #[test] fn test_should_retry() { let policy = RetryPolicy::default(); - + // Retryable errors assert!(policy.should_retry("connection timeout")); assert!(policy.should_retry("network error")); assert!(policy.should_retry("temporarily unavailable")); - + // Non-retryable errors assert!(!policy.should_retry("authentication failed")); assert!(!policy.should_retry("unauthorized")); assert!(!policy.should_retry("invalid request")); assert!(!policy.should_retry("malformed JSON")); } - + #[tokio::test] async fn test_circuit_breaker_state_transitions() { let breaker = CircuitBreaker::with_config(2, Duration::from_millis(100)); - + // Initially closed assert!(breaker.can_proceed().await); - + // First failure - still closed (threshold is 2) breaker.record_failure().await; assert!(breaker.can_proceed().await); - + // Second failure - should open breaker.record_failure().await; assert!(!breaker.can_proceed().await); - + // Wait for recovery timeout tokio::time::sleep(Duration::from_millis(150)).await; - + // Should transition to half-open assert!(breaker.can_proceed().await); - + // Success in half-open closes circuit breaker.record_success().await; assert!(matches!( breaker.state().await, - CircuitState::Closed { consecutive_failures: 0 } + CircuitState::Closed { + consecutive_failures: 0 + } )); } @@ -387,8 +410,7 @@ mod tests { breaker.record_failure().await; assert!( breaker.can_proceed().await, - "after {} failures (threshold 5) breaker must still be Closed", - i + "after {i} failures (threshold 5) breaker must still be Closed" ); assert!( matches!(breaker.state().await, CircuitState::Closed { consecutive_failures: c } if c == i), @@ -398,7 +420,10 @@ mod tests { // 5th failure crosses threshold — should now Open. breaker.record_failure().await; - assert!(!breaker.can_proceed().await, "breaker must be Open at threshold"); + assert!( + !breaker.can_proceed().await, + "breaker must be Open at threshold" + ); assert!(matches!(breaker.state().await, CircuitState::Open { .. })); } @@ -459,13 +484,17 @@ mod tests { breaker.record_failure().await; assert!(matches!( breaker.state().await, - CircuitState::Closed { consecutive_failures: 2 } + CircuitState::Closed { + consecutive_failures: 2 + } )); breaker.record_success().await; assert!(matches!( breaker.state().await, - CircuitState::Closed { consecutive_failures: 0 } + CircuitState::Closed { + consecutive_failures: 0 + } )); } @@ -476,10 +505,10 @@ mod tests { // Record failures assert!(!tracker.record_failure().await); // 1 assert!(!tracker.record_failure().await); // 2 - assert!(tracker.record_failure().await); // 3 - threshold reached + assert!(tracker.record_failure().await); // 3 - threshold reached // Success resets counter tracker.record_success().await; assert!(!tracker.should_open().await); } -} \ No newline at end of file +} diff --git a/src/mev/types.rs b/src/mev/types.rs index 5876b7c..fd21832 100644 --- a/src/mev/types.rs +++ b/src/mev/types.rs @@ -1,5 +1,5 @@ //! MEV-specific types for Flashbots bundle submission -//! +//! //! This module contains all the data structures used for MEV protection //! and bundle submission to Flashbots relays. @@ -7,15 +7,15 @@ use serde::{Deserialize, Serialize}; use std::time::Instant; /// Represents a bundle of transactions to be submitted to Flashbots -/// +/// /// A bundle is a collection of transactions that must be executed atomically /// in the exact order specified. Bundles are the core primitive of Flashbots /// and enable MEV protection and extraction strategies. -/// +/// /// # For Developers /// This struct is used internally by the MEV client to format transaction /// submissions according to Flashbots specifications. -/// +/// /// # Example /// ```rust /// let bundle = Bundle { @@ -30,18 +30,18 @@ pub struct Bundle { /// List of signed transactions in hex format (0x-prefixed) /// Order matters - transactions execute in array order pub txs: Vec, - + /// Target block number for inclusion (hex format) /// Bundle will only be considered for this specific block #[serde(rename = "blockNumber")] pub block_number: String, - + /// Optional: Minimum Unix timestamp for bundle inclusion /// Bundle won't be included before this time /// Use case: Time-sensitive arbitrage, auction participation #[serde(rename = "minTimestamp", skip_serializing_if = "Option::is_none")] pub min_timestamp: Option, - + /// Optional: Maximum Unix timestamp for bundle inclusion /// Bundle won't be included after this time /// Use case: Prevent stale trades, deadline enforcement @@ -50,7 +50,7 @@ pub struct Bundle { } /// Request format for eth_sendBundle JSON-RPC method -/// +/// /// # For Library Developers /// This wraps the bundle with additional metadata required by the /// Flashbots relay API specification. @@ -58,13 +58,13 @@ pub struct Bundle { pub struct SendBundleRequest { /// JSON-RPC version (always "2.0") pub jsonrpc: String, - + /// Method name (always "eth_sendBundle") pub method: String, - + /// Parameters array containing the bundle pub params: Vec, - + /// Request ID for correlation pub id: u64, } @@ -82,7 +82,7 @@ impl SendBundleRequest { } /// Response from Flashbots relay after bundle submission -/// +/// /// # For Developers /// Parse this response to determine if bundle was accepted and /// monitor simulation results for debugging failed bundles. @@ -92,14 +92,14 @@ pub struct BundleResponse { /// Use this to track bundle status #[serde(rename = "bundleHash")] pub bundle_hash: String, - + /// Optional simulation results if relay simulated the bundle #[serde(skip_serializing_if = "Option::is_none")] pub simulation: Option, } /// Results from bundle simulation -/// +/// /// # For Developers /// When a bundle fails simulation, these results help identify /// the issue (e.g., insufficient gas, reverted transaction). @@ -107,15 +107,15 @@ pub struct BundleResponse { pub struct SimulationResult { /// Whether all transactions in the bundle succeeded pub success: bool, - + /// Error message if simulation failed #[serde(skip_serializing_if = "Option::is_none")] pub error: Option, - + /// Total gas used by all transactions #[serde(rename = "totalGasUsed", skip_serializing_if = "Option::is_none")] pub gas_used: Option, - + /// Coinbase payment if bundle includes miner tips #[serde(rename = "coinbaseDiff", skip_serializing_if = "Option::is_none")] pub coinbase_diff: Option, @@ -155,7 +155,7 @@ pub enum CircuitState { } /// Configuration for MEV relay client -/// +/// /// # For Proxy Operators /// Configure MEV protection behavior through environment variables /// or configuration files. @@ -163,13 +163,13 @@ pub enum CircuitState { pub struct MevConfig { /// Relay endpoint URL (e.g., "https://relay.flashbots.net") pub relay_url: String, - + /// Private key for signing authentication headers (hex format) pub signing_key: String, - + /// Maximum time to wait for relay response pub request_timeout: std::time::Duration, - + /// Number of blocks ahead to target for bundle inclusion /// Default: 1 (next block) pub blocks_ahead: u64, @@ -199,11 +199,10 @@ mod tests { min_timestamp: Some(1625097600), max_timestamp: None, }; - + let json = serde_json::to_string(&bundle).unwrap(); assert!(json.contains("\"blockNumber\":\"0x1234\"")); assert!(json.contains("\"minTimestamp\":1625097600")); assert!(!json.contains("maxTimestamp")); // Should be omitted when None } - -} \ No newline at end of file +} diff --git a/src/proxy.rs b/src/proxy.rs index 5c0e4d9..4eb04f6 100644 --- a/src/proxy.rs +++ b/src/proxy.rs @@ -2,7 +2,7 @@ use axum::{extract::State, Json}; use reqwest::Client; use std::sync::Arc; use std::time::{Duration, Instant}; -use tracing::{debug, error, info, warn}; +use tracing::{debug, error, warn}; use crate::{ error::{ProxyError, ProxyResult}, @@ -67,7 +67,7 @@ impl ProxyState { let geth_client = Client::builder() .timeout(std::time::Duration::from_secs(30)) .build() - .map_err(|e| ProxyError::InternalError(format!("HTTP client init failed: {}", e)))?; + .map_err(|e| ProxyError::InternalError(format!("HTTP client init failed: {e}")))?; let write_method_limiter = Arc::new(RateLimiter::new(RateLimitConfig { max_requests: WRITE_METHOD_DEFAULT_REQUESTS, @@ -127,11 +127,12 @@ pub async fn handle_rpc( Json(request): Json, ) -> ProxyResult> { debug!("Received RPC request: method={}", request.method); - + // Validate request - request.validate() + request + .validate() .map_err(|e| ProxyError::InvalidRequest(e.to_string()))?; - + // Check if method is allowed if !is_method_allowed(&request.method) { state.metrics.increment_invalid_methods(); @@ -160,11 +161,12 @@ pub async fn handle_flashbots( Json(request): Json, ) -> ProxyResult> { debug!("Received Flashbots RPC request: method={}", request.method); - + // Validate request - request.validate() + request + .validate() .map_err(|e| ProxyError::InvalidRequest(e.to_string()))?; - + // Check if method is allowed if !is_method_allowed(&request.method) { state.metrics.increment_invalid_methods(); @@ -184,7 +186,10 @@ pub async fn handle_flashbots( let response = match request.method.as_str() { "eth_sendRawTransaction" | "eth_sendBundle" => { - info!("Routing transaction to Flashbots"); + // Volume-of-tx oracle if logged at INFO — operators with log + // shippers (journald → Loki, etc.) accidentally publish per-tx + // signal upstream. Keep below default verbosity. + debug!("Routing transaction to Flashbots"); proxy_to_flashbots(&state, request).await? } _ => { @@ -221,23 +226,32 @@ pub async fn proxy_to_geth( let response = match response_result { Ok(resp) => resp, Err(e) => { + // Log the full reqwest error locally; surface only a generic + // string to the caller. Tor visitors must not see Geth/network + // version strings. error!("Failed to send request to Geth: {}", e); state.geth_circuit.record_failure().await; - return Err(ProxyError::UpstreamError(format!( - "Geth connection failed: {}", - e - ))); + return Err(ProxyError::UpstreamError( + "upstream unavailable".to_string(), + )); } }; if !response.status().is_success() { let status = response.status(); let body = response.text().await.unwrap_or_default(); + // Log the upstream body locally so operators can debug. Don't echo + // it: Geth error bodies leak version, EIP support, and internal paths. error!("Geth returned error status {}: {}", status, body); - state.geth_circuit.record_failure().await; + // Only break the circuit on 5xx and connect failures. 4xx is usually + // a client-shaped error (bad params, etc.) and shouldn't trip the + // operator's upstream-availability signal. + if status.is_server_error() { + state.geth_circuit.record_failure().await; + } return Err(ProxyError::UpstreamError(format!( - "Geth returned status {}: {}", - status, body + "upstream returned status {}", + status.as_u16() ))); } @@ -247,8 +261,7 @@ pub async fn proxy_to_geth( error!("Failed to parse Geth response: {}", e); state.geth_circuit.record_failure().await; return Err(ProxyError::UpstreamError(format!( - "Failed to parse response: {}", - e + "Failed to parse response: {e}" ))); } }; @@ -273,7 +286,8 @@ async fn proxy_to_flashbots( return Ok(JsonRpcResponse::error( request.id, -32004, - "MEV protection not configured: set FLASHBOTS_SIGNING_KEY to enable bundle submission".to_string(), + "MEV protection not configured: set FLASHBOTS_SIGNING_KEY to enable bundle submission" + .to_string(), None, )); } @@ -289,7 +303,7 @@ mod tests { use serde_json::json; fn create_test_state(server_url: String) -> ProxyState { - ProxyState::new(server_url.clone(), format!("{}/flashbots", server_url)) + ProxyState::new(server_url.clone(), format!("{server_url}/flashbots")) .expect("ProxyState::new must succeed in tests") } @@ -307,12 +321,10 @@ mod tests { // Reads are unlimited (the per-port limiter handles them, not this). for _ in 0..50 { - assert!( - state - .check_write_method_rate_limit("eth_blockNumber") - .await - .is_ok() - ); + assert!(state + .check_write_method_rate_limit("eth_blockNumber") + .await + .is_ok()); } } @@ -347,24 +359,25 @@ mod tests { #[tokio::test] async fn test_handle_rpc_valid_request() { let mut server = Server::new_async().await; - let _m = server.mock("POST", "/") + let _m = server + .mock("POST", "/") .with_status(200) .with_header("content-type", "application/json") .with_body(r#"{"jsonrpc":"2.0","result":"0x123","id":1}"#) .create(); - + let state = Arc::new(create_test_state(server.url())); - + let request = JsonRpcRequest { jsonrpc: "2.0".to_string(), method: "eth_blockNumber".to_string(), params: None, id: Some(json!(1)), }; - + let result = handle_rpc(State(state), Json(request)).await; assert!(result.is_ok()); - + let response = result.unwrap().0; assert_eq!(response.result, Some(json!("0x123"))); } @@ -373,17 +386,17 @@ mod tests { async fn test_handle_rpc_blocked_method() { let server = Server::new_async().await; let state = Arc::new(create_test_state(server.url())); - + let request = JsonRpcRequest { jsonrpc: "2.0".to_string(), method: "eth_accounts".to_string(), params: None, id: Some(json!(1)), }; - + let result = handle_rpc(State(state), Json(request)).await; assert!(result.is_err()); - + match result.unwrap_err() { ProxyError::MethodNotAllowed(method) => { assert_eq!(method, "eth_accounts"); @@ -400,7 +413,8 @@ mod tests { #[tokio::test] async fn test_handle_flashbots_raw_tx_falls_back_to_geth() { let mut server = Server::new_async().await; - let _m = server.mock("POST", "/") + let _m = server + .mock("POST", "/") .with_status(200) .with_header("content-type", "application/json") .with_body(r#"{"jsonrpc":"2.0","result":"0xhash","id":1}"#) @@ -434,8 +448,13 @@ mod tests { id: Some(json!(7)), }; - let response = handle_flashbots(State(state), Json(request)).await.unwrap().0; - let err = response.error.expect("expected JSON-RPC error when MEV not configured"); + let response = handle_flashbots(State(state), Json(request)) + .await + .unwrap() + .0; + let err = response + .error + .expect("expected JSON-RPC error when MEV not configured"); assert_eq!(err.code, -32004); assert!(err.message.contains("MEV protection not configured")); assert_eq!(response.id, Some(json!(7))); @@ -445,17 +464,17 @@ mod tests { async fn test_invalid_json_rpc_version() { let server = Server::new_async().await; let state = Arc::new(create_test_state(server.url())); - + let request = JsonRpcRequest { jsonrpc: "1.0".to_string(), method: "eth_blockNumber".to_string(), params: None, id: Some(json!(1)), }; - + let result = handle_rpc(State(state), Json(request)).await; assert!(result.is_err()); - + match result.unwrap_err() { ProxyError::InvalidRequest(msg) => { assert!(msg.contains("jsonrpc version")); @@ -463,4 +482,4 @@ mod tests { _ => panic!("Expected InvalidRequest error"), } } -} \ No newline at end of file +} diff --git a/src/rate_limit.rs b/src/rate_limit.rs index b7304f3..0a41b5e 100644 --- a/src/rate_limit.rs +++ b/src/rate_limit.rs @@ -45,12 +45,12 @@ impl RateLimiter { requests: Arc::new(Mutex::new(HashMap::new())), } } - + /// Check if a request should be allowed pub async fn check_rate_limit(&self, identifier: &str) -> bool { let mut requests = self.requests.lock().await; let now = Instant::now(); - + match requests.get_mut(identifier) { Some((count, window_start)) => { // Check if we're still in the same window @@ -70,20 +70,18 @@ impl RateLimiter { requests.insert(identifier.to_string(), (1, now)); } } - + true } - + /// Clean up old entries (call periodically) pub async fn cleanup(&self) { let mut requests = self.requests.lock().await; let now = Instant::now(); - + // Remove entries older than 2x the window duration let cutoff = self.config.window_duration * 2; - requests.retain(|_, (_, window_start)| { - now.duration_since(*window_start) < cutoff - }); + requests.retain(|_, (_, window_start)| now.duration_since(*window_start) < cutoff); } } @@ -127,7 +125,7 @@ pub async fn rate_limit_middleware( #[cfg(test)] mod tests { use super::*; - + #[tokio::test] async fn test_rate_limiter_allows_under_limit() { let config = RateLimitConfig { @@ -135,16 +133,17 @@ mod tests { window_duration: Duration::from_secs(1), }; let limiter = RateLimiter::new(config); - + // Should allow up to 5 requests for i in 0..5 { assert!( limiter.check_rate_limit("test").await, - "Request {} should be allowed", i + 1 + "Request {} should be allowed", + i + 1 ); } } - + #[tokio::test] async fn test_rate_limiter_blocks_over_limit() { let config = RateLimitConfig { @@ -152,16 +151,16 @@ mod tests { window_duration: Duration::from_secs(1), }; let limiter = RateLimiter::new(config); - + // Allow first 3 requests for _ in 0..3 { assert!(limiter.check_rate_limit("test").await); } - + // 4th request should be blocked assert!(!limiter.check_rate_limit("test").await); } - + #[tokio::test] async fn test_rate_limiter_resets_after_window() { let config = RateLimitConfig { @@ -169,19 +168,19 @@ mod tests { window_duration: Duration::from_millis(100), }; let limiter = RateLimiter::new(config); - + // Use up the limit assert!(limiter.check_rate_limit("test").await); assert!(limiter.check_rate_limit("test").await); assert!(!limiter.check_rate_limit("test").await); - + // Wait for window to expire tokio::time::sleep(Duration::from_millis(150)).await; - + // Should be allowed again assert!(limiter.check_rate_limit("test").await); } - + #[tokio::test] async fn test_rate_limiter_different_identifiers() { let config = RateLimitConfig { @@ -189,17 +188,17 @@ mod tests { window_duration: Duration::from_secs(1), }; let limiter = RateLimiter::new(config); - + // Different identifiers should have separate limits assert!(limiter.check_rate_limit("user1").await); assert!(limiter.check_rate_limit("user2").await); assert!(limiter.check_rate_limit("user3").await); - + // But each is limited individually assert!(!limiter.check_rate_limit("user1").await); assert!(!limiter.check_rate_limit("user2").await); } - + #[tokio::test] async fn test_cleanup_removes_old_entries() { let config = RateLimitConfig { @@ -207,24 +206,24 @@ mod tests { window_duration: Duration::from_millis(50), }; let limiter = RateLimiter::new(config); - + // Add some entries assert!(limiter.check_rate_limit("old").await); assert!(limiter.check_rate_limit("new").await); - + // Wait for entries to become old tokio::time::sleep(Duration::from_millis(150)).await; - + // Add a fresh entry assert!(limiter.check_rate_limit("fresh").await); - + // Run cleanup limiter.cleanup().await; - + // Check internal state let requests = limiter.requests.lock().await; assert!(!requests.contains_key("old")); assert!(!requests.contains_key("new")); assert!(requests.contains_key("fresh")); } -} \ No newline at end of file +} diff --git a/src/rpc_types.rs b/src/rpc_types.rs index 4701f88..b5d598a 100644 --- a/src/rpc_types.rs +++ b/src/rpc_types.rs @@ -116,7 +116,6 @@ mod tests { assert_eq!(empty_method.validate(), Err("Method cannot be empty")); } - #[test] fn test_serialization_roundtrip() { let request = JsonRpcRequest { diff --git a/src/security.rs b/src/security.rs index 1bbcf92..fc295e8 100644 --- a/src/security.rs +++ b/src/security.rs @@ -81,11 +81,7 @@ fn first_env_var(names: &[&str]) -> Option { } if let (Some(idx), true) = (found_at, names.len() > 1) { if idx > 0 { - tracing::warn!( - "{} is deprecated; prefer {}", - names[idx], - names[0] - ); + tracing::warn!("{} is deprecated; prefer {}", names[idx], names[0]); } } value @@ -178,7 +174,10 @@ pub async fn add_security_headers(request: Request, next: Next) -> Response { let mut response = next.run(request).await; let headers = response.headers_mut(); - headers.insert("X-Content-Type-Options", HeaderValue::from_static("nosniff")); + headers.insert( + "X-Content-Type-Options", + HeaderValue::from_static("nosniff"), + ); headers.insert("X-Frame-Options", HeaderValue::from_static("DENY")); headers.insert("X-XSS-Protection", HeaderValue::from_static("0")); headers.insert("Referrer-Policy", HeaderValue::from_static("no-referrer")); @@ -188,9 +187,11 @@ pub async fn add_security_headers(request: Request, next: Next) -> Response { ); headers.insert("Pragma", HeaderValue::from_static("no-cache")); headers.insert("Expires", HeaderValue::from_static("0")); + // Strip identifying headers. Earlier revisions added an `X-Service: TorPC` + // banner here, defeating the point: anyone scanning .onion services could + // identify a TorPC node with a single HEAD request. headers.remove("Server"); - headers.insert("X-Service", HeaderValue::from_static("TorPC")); - + response } @@ -208,7 +209,9 @@ pub async fn add_security_headers(request: Request, next: Next) -> Response { /// Privacy note: every field returned here must be safe to share with an /// anonymous Tor client. The fields below are deliberately vanilla. pub async fn health_check( - axum::extract::State(state): axum::extract::State>, + axum::extract::State(state): axum::extract::State< + std::sync::Arc, + >, ) -> Result, StatusCode> { Ok(axum::Json(json!({ "status": "ok", @@ -228,7 +231,9 @@ pub async fn health_check( /// MEV relay (when configured). This is where component-state observability /// lives now that `/health` is intentionally minimal. pub async fn security_metrics( - axum::extract::State(state): axum::extract::State>, + axum::extract::State(state): axum::extract::State< + std::sync::Arc, + >, ) -> Result, StatusCode> { let geth_circuit = state.base_state.geth_circuit.state_summary(); let (mev_relay_status, mev_circuit) = match &state.mev_client { @@ -355,12 +360,12 @@ mod tests { "should never get here" } - let app = Router::new() - .route("/slow", get(slow_handler)) - .layer(axum::middleware::from_fn_with_state( + let app = Router::new().route("/slow", get(slow_handler)).layer( + axum::middleware::from_fn_with_state( Duration::from_millis(50), json_rpc_timeout_middleware, - )); + ), + ); let server = TestServer::new(app).unwrap(); let response = server.get("/slow").await; @@ -405,26 +410,26 @@ mod tests { let config = SecurityConfig::from_env(); assert_eq!(config.max_body_size, 1024 * 1024); assert_eq!(config.request_timeout.as_secs(), 30); - assert_eq!(config.strict_headers, true); + assert!(config.strict_headers); // Test with environment variables set std::env::set_var("MAX_BODY_SIZE", "2097152"); // 2MB std::env::set_var("REQUEST_TIMEOUT", "60"); std::env::set_var("STRICT_HEADERS", "false"); - + let env_config = SecurityConfig::from_env(); assert_eq!(env_config.max_body_size, 2097152); assert_eq!(env_config.request_timeout.as_secs(), 60); - assert_eq!(env_config.strict_headers, false); - + assert!(!env_config.strict_headers); + // Test with invalid values (should fall back to defaults) std::env::set_var("MAX_BODY_SIZE", "invalid"); std::env::set_var("REQUEST_TIMEOUT", "invalid"); - + let fallback_config = SecurityConfig::from_env(); assert_eq!(fallback_config.max_body_size, 1024 * 1024); // Default assert_eq!(fallback_config.request_timeout.as_secs(), 30); // Default - + // Clean up environment variables std::env::remove_var("MAX_BODY_SIZE"); std::env::remove_var("REQUEST_TIMEOUT"); @@ -433,4 +438,4 @@ mod tests { // Note: Direct testing of add_security_headers requires mocking Next // which is complex. These are tested in integration tests instead. -} \ No newline at end of file +} diff --git a/src/tor.rs b/src/tor.rs index 76dabf1..1082378 100644 --- a/src/tor.rs +++ b/src/tor.rs @@ -1,6 +1,6 @@ +use anyhow::{Context, Result}; use std::fs; use std::path::Path; -use anyhow::{Context, Result}; use tracing::{info, warn}; /// Tor service configuration and utilities @@ -16,7 +16,7 @@ impl TorService { config_path: "./configs/torrc".to_string(), } } - + /// Check if Tor is properly configured. /// /// In addition to verifying the torrc file and data directory, this @@ -32,8 +32,16 @@ impl TorService { /// administrator that did `chmod 755 data/tor/torpc/` can't accidentally /// expose the service key to other users. pub fn check_configuration(&self) -> Result<()> { + // No torrc → operator is running torpc without a hidden service + // (e.g. for local dev or behind their own reverse proxy). Skip the + // anonymity audit and the data-dir setup; it would be both useless + // and intrusive (creating ./data/tor/torpc out of thin air). if !Path::new(&self.config_path).exists() { - anyhow::bail!("Tor configuration file not found at: {}", self.config_path); + info!( + "torrc not found at {}; skipping Tor configuration check", + self.config_path + ); + return Ok(()); } // Refuse to start if torrc disables anonymity, unless explicitly @@ -51,8 +59,7 @@ impl TorService { let val = tokens.next().unwrap_or(""); let is_anonymity_disabling = matches!( (key, val), - ("HiddenServiceSingleHopMode", "1") - | ("HiddenServiceNonAnonymousMode", "1") + ("HiddenServiceSingleHopMode", "1") | ("HiddenServiceNonAnonymousMode", "1") ); if is_anonymity_disabling { if allow_override { @@ -78,8 +85,7 @@ impl TorService { let data_dir = Path::new("./data/tor/torpc"); if !data_dir.exists() { warn!("Tor data directory doesn't exist, creating it..."); - fs::create_dir_all(data_dir) - .context("Failed to create Tor data directory")?; + fs::create_dir_all(data_dir).context("Failed to create Tor data directory")?; } #[cfg(unix)] @@ -90,8 +96,8 @@ impl TorService { .context("Failed to set Tor directory permissions to 0700")?; // Verify the bits actually stuck — some filesystems silently // ignore mode changes (e.g. SMB mounts). - let metadata = fs::metadata(data_dir) - .context("Failed to read Tor data directory metadata")?; + let metadata = + fs::metadata(data_dir).context("Failed to read Tor data directory metadata")?; let mode = metadata.permissions().mode() & 0o777; if mode != 0o700 { anyhow::bail!( @@ -106,44 +112,44 @@ impl TorService { info!("Tor configuration verified"); Ok(()) } - + /// Get the .onion hostname if available pub fn get_hostname(&self) -> Result> { let hostname_path = Path::new(&self.hostname_path); - + if !hostname_path.exists() { info!("Hostname file not found - Tor service may not be running yet"); return Ok(None); } - + let hostname = fs::read_to_string(hostname_path) .context("Failed to read hostname file")? .trim() .to_string(); - + if hostname.is_empty() { return Ok(None); } - + // Validate it looks like a .onion address if !hostname.ends_with(".onion") { anyhow::bail!("Invalid hostname format: {}", hostname); } - + Ok(Some(hostname)) } - + /// Get the full onion URL for a given path pub fn get_onion_url(&self, path: &str) -> Result> { match self.get_hostname()? { Some(hostname) => { - let url = format!("http://{}{}", hostname, path); + let url = format!("http://{hostname}{path}"); Ok(Some(url)) } None => Ok(None), } } - + /// Check if Tor appears to be running by looking for the hostname file pub fn is_running(&self) -> bool { Path::new(&self.hostname_path).exists() @@ -159,85 +165,85 @@ impl Default for TorService { #[cfg(test)] mod tests { use super::*; - use tempfile::TempDir; use std::fs; - + use tempfile::TempDir; + #[test] fn test_get_hostname_missing_file() { let tor = TorService { hostname_path: "/nonexistent/path/hostname".to_string(), config_path: "./configs/torrc".to_string(), }; - + let result = tor.get_hostname().unwrap(); assert!(result.is_none()); } - + #[test] fn test_get_hostname_valid() { let temp_dir = TempDir::new().unwrap(); let hostname_path = temp_dir.path().join("hostname"); - + fs::write(&hostname_path, "test3xamplee2onion.onion\n").unwrap(); - + let tor = TorService { hostname_path: hostname_path.to_str().unwrap().to_string(), config_path: "./configs/torrc".to_string(), }; - + let result = tor.get_hostname().unwrap(); assert_eq!(result, Some("test3xamplee2onion.onion".to_string())); } - + #[test] fn test_get_hostname_invalid_format() { let temp_dir = TempDir::new().unwrap(); let hostname_path = temp_dir.path().join("hostname"); - + fs::write(&hostname_path, "not-an-onion-address").unwrap(); - + let tor = TorService { hostname_path: hostname_path.to_str().unwrap().to_string(), config_path: "./configs/torrc".to_string(), }; - + let result = tor.get_hostname(); assert!(result.is_err()); } - + #[test] fn test_get_onion_url() { let temp_dir = TempDir::new().unwrap(); let hostname_path = temp_dir.path().join("hostname"); - + fs::write(&hostname_path, "test3xamplee2onion.onion\n").unwrap(); - + let tor = TorService { hostname_path: hostname_path.to_str().unwrap().to_string(), config_path: "./configs/torrc".to_string(), }; - + let url = tor.get_onion_url("/rpc").unwrap(); assert_eq!(url, Some("http://test3xamplee2onion.onion/rpc".to_string())); } - + #[test] fn test_is_running() { let temp_dir = TempDir::new().unwrap(); let hostname_path = temp_dir.path().join("hostname"); - + let tor = TorService { hostname_path: hostname_path.to_str().unwrap().to_string(), config_path: "./configs/torrc".to_string(), }; - + // Not running initially assert!(!tor.is_running()); - + // Create hostname file fs::write(&hostname_path, "test.onion").unwrap(); - + // Should appear as running assert!(tor.is_running()); } -} \ No newline at end of file +} diff --git a/src/whitelist.rs b/src/whitelist.rs index fdbf2f8..d665f01 100644 --- a/src/whitelist.rs +++ b/src/whitelist.rs @@ -1,10 +1,10 @@ -use std::collections::HashSet; use once_cell::sync::Lazy; +use std::collections::HashSet; /// List of allowed RPC methods static ALLOWED_METHODS: Lazy> = Lazy::new(|| { let mut methods = HashSet::new(); - + // Read-only methods methods.insert("eth_blockNumber"); methods.insert("eth_getBalance"); @@ -32,20 +32,20 @@ static ALLOWED_METHODS: Lazy> = Lazy::new(|| { methods.insert("eth_feeHistory"); methods.insert("eth_maxPriorityFeePerGas"); methods.insert("eth_getLogs"); - + // Network info methods.insert("net_version"); methods.insert("net_listening"); methods.insert("net_peerCount"); - + // Web3 methods methods.insert("web3_clientVersion"); methods.insert("web3_sha3"); - + // Write methods we allow methods.insert("eth_sendRawTransaction"); methods.insert("eth_sendBundle"); // Flashbots bundle submission - + methods }); @@ -105,4 +105,4 @@ mod tests { assert!(!is_method_allowed("")); assert!(!is_method_allowed(" ")); } -} \ No newline at end of file +} diff --git a/static/app.js b/static/app.js index 6919f44..6968ba9 100644 --- a/static/app.js +++ b/static/app.js @@ -22,12 +22,19 @@ const torInfo = document.getElementById("tor-info"); window.addEventListener("DOMContentLoaded", () => { + // Each setup function early-returns when its DOM isn't present, so a + // single app.js drives both `index_operator.html` (test panel + + // self-test wallet sections) and `index_user.html` (wallet picker + // gated by a localhost client probe). checkStatus(); setupMethodSelector(); + setupClientProbe(); + setupWalletPicker(); WALLETS.forEach(wireWallet); }); async function checkStatus() { + if (!statusElement) return; // operator template only try { const response = await fetch("/rpc", { method: "POST", @@ -54,6 +61,104 @@ } } + // --------------------------------------------------------------------- + // User template: probe the local TorPC client and gate Step 2. + // + // The user template (`index_user.html`) is served when the visitor + // reaches the daemon via .onion. They don't have a co-located proxy at + // localhost:8545 unless they've installed the client. Probing it tells + // them whether they're ready for Step 2 without waiting for a wallet + // request to silently fail. + // + // Tor Browser at the Safest security level disables JS — for those + // users the `