diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b065b11..27728a3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -43,3 +43,60 @@ jobs:
- if: runner.os == 'Linux'
uses: ./.github/actions/linux-deps
- run: cargo test --workspace --locked
+ # The lint job runs on Linux; Windows-only code needs its own pass.
+ - if: runner.os == 'Windows'
+ run: cargo clippy --workspace --all-targets --locked -- -D warnings
+
+ askpass-release-windows:
+ # The release exe is a GUI-subsystem program, unlike the debug build the test job uses;
+ # ssh runs it as SSH_ASKPASS and reads the answer from its stdout.
+ name: askpass (windows release build)
+ runs-on: windows-latest
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
+ - name: Rust toolchain (from rust-toolchain.toml)
+ run: rustup toolchain install || rustup show
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
+ with:
+ key: release
+ - name: ssh-keygen opens a key through the release exe as askpass
+ shell: bash
+ run: |
+ set -o pipefail
+ # Once with the ssh-keygen on PATH (Git for Windows' MSYS build) and once with Windows'
+ # own OpenSSH, which starts askpass differently (posix_spawnp) and is what most users run.
+ for keygen in "" 'C:\Windows\System32\OpenSSH\ssh-keygen.exe'; do
+ REDSHELL_TEST_SSH_KEYGEN="$keygen" cargo test --release --locked -p redshell-app --test askpass -- --nocapture 2>&1 | tee askpass.log
+ # The test skips itself without a usable ssh-keygen; here that must not pass silently.
+ if grep -q "skipped:" askpass.log; then echo "::error::the askpass test was skipped"; exit 1; fi
+ done
+
+ server-arm64:
+ # The server's crates on the architecture of a Raspberry Pi.
+ name: test (server, linux arm64)
+ runs-on: ubuntu-22.04-arm
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
+ - name: Rust toolchain (from rust-toolchain.toml)
+ run: rustup toolchain install || rustup show
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
+ - run: cargo test --locked -p redshell-server -p redshell-protocol -p redshell-terminal -p redshell-remote -p redshell-core
+
+ web:
+ name: web (typecheck, lint, test, build)
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: web
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
+ - uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
+ with:
+ node-version: 24
+ cache: npm
+ cache-dependency-path: web/package-lock.json
+ - run: npm ci
+ - run: npm run typecheck
+ - run: npm run lint
+ - run: npm test
+ - run: npm run build
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4fe43f4..5f0b988 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -247,8 +247,99 @@ jobs:
name: ${{ matrix.name }}
path: dist/*
+ server:
+ # redshell-server with the RedShell Remote PWA embedded: a tarball everywhere and a .deb
+ # (with the per-user systemd unit) on Linux. The aarch64 build is the one for a Raspberry Pi
+ # (64-bit Raspberry Pi OS). Linux builds run on 22.04 so the binaries need glibc 2.35.
+ needs: version
+ name: server (${{ matrix.name }})
+ permissions:
+ contents: read
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - name: linux-x86_64
+ os: ubuntu-22.04
+ targets: x86_64-unknown-linux-gnu
+ deb-arch: amd64
+ - name: linux-aarch64
+ os: ubuntu-22.04-arm
+ targets: aarch64-unknown-linux-gnu
+ deb-arch: arm64
+ - name: macos-universal
+ os: macos-15-intel
+ targets: aarch64-apple-darwin x86_64-apple-darwin
+ runs-on: ${{ matrix.os }}
+ env:
+ TARGETS: ${{ matrix.targets }}
+ BASE_NAME: redshell-server-${{ github.event.inputs.tag || github.ref_name }}-${{ matrix.name }}
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
+ - uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
+ with:
+ node-version: 24
+ cache: npm
+ cache-dependency-path: web/package-lock.json
+ - name: Build the PWA
+ working-directory: web
+ run: |
+ npm ci
+ npm run build
+ test -f dist/index.html
+ - name: Rust toolchain (from rust-toolchain.toml)
+ shell: bash
+ run: |
+ rustup toolchain install || rustup show
+ rustup target add $TARGETS
+ - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
+ with:
+ key: server-${{ matrix.name }}
+ - name: Build
+ shell: bash
+ run: |
+ set -euo pipefail
+ for target in $TARGETS; do
+ cargo build --release --locked --target "$target" -p redshell-server
+ done
+ mkdir -p out
+ set -- $TARGETS
+ if [ $# -gt 1 ]; then
+ lipo -create $(printf 'target/%s/release/redshell-server ' "$@") -output out/redshell-server
+ lipo -info out/redshell-server
+ else
+ cp "target/$1/release/redshell-server" out/redshell-server
+ fi
+ # The PWA must be in the binary, not the placeholder page.
+ if ! grep -q "manifest.webmanifest" out/redshell-server; then
+ echo "::error::the PWA was not embedded"
+ exit 1
+ fi
+ out/redshell-server --version
+ - name: Package
+ shell: bash
+ run: |
+ set -euo pipefail
+ mkdir -p dist "$BASE_NAME"
+ cp out/redshell-server README.md LICENSE CHANGELOG.md docs/REMOTE.md "$BASE_NAME/"
+ cp "packaging/server/redshell-server@.service" "$BASE_NAME/"
+ tar -czf "dist/$BASE_NAME.tar.gz" "$BASE_NAME"
+ if [ -n "${{ matrix.deb-arch }}" ]; then
+ scripts/package-server-deb.sh out/redshell-server "${TAG#v}" "${{ matrix.deb-arch }}" "dist/$BASE_NAME.deb"
+ dpkg-deb -I "dist/$BASE_NAME.deb" | head -5
+ fi
+ cd dist
+ for file in *; do
+ if command -v sha256sum >/dev/null; then sha256sum "$file"; else shasum -a 256 "$file"; fi > "$file.sha256"
+ done
+ ls -la
+ - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
+ with:
+ name: server-${{ matrix.name }}
+ path: dist/*
+
publish:
- needs: [version, build]
+ needs: [version, build, server]
permissions:
contents: write
# Publish whatever built, so one stuck runner doesn't block a release; re-run
diff --git a/.gitignore b/.gitignore
index bd003ec..9ae4076 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,6 @@ target/
*.db
*.db-journal
.DS_Store
+web/node_modules
+web/dist
+web/dev-dist
diff --git a/CHANGELOG.md b/CHANGELOG.md
index cf3259d..8c98e3a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,36 +4,103 @@ All notable changes to this project are documented here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and versions follow
[Semantic Versioning](https://semver.org/).
-## [Unreleased]
+## [0.0.3] - 2026-12-04
+
+This release adds `redshell-server`, which keeps shells and coding agents running on an
+always-on machine such as a Raspberry Pi, for the desktop and for RedShell Remote, the web app it
+serves to phones. SSH hosts also get a home in the app: an editor instead of `config.toml`,
+password dialogs backed by the system keychain, port forwards and a file browser.
+
+**Upgrading from 0.0.2.** `ssh.askpass` is on by default: with OpenSSH 8.4 or newer, ssh's
+password, passphrase and host key prompts now appear in a RedShell dialog instead of the
+terminal, and older clients, such as the OpenSSH 8.1 that ships with Windows 10, keep prompting
+in the terminal. Set `ssh.askpass = false` to keep the terminal prompts everywhere. A host in
+`[[ssh.hosts]]` whose `name` is also a `Host` alias in `~/.ssh/config` now connects through the
+alias (while `ssh.import_ssh_config` is on), so the alias's `IdentityFile`, `ProxyJump` and other
+options apply under the fields set in RedShell; rename the entry if it was meant to bypass the
+alias. Entries RedShell adds to `config.toml` now list their keys in the order of the settings,
+starting with an SSH host's `name`, and leave empty host fields out; existing entries are not
+touched, so this is cosmetic.
### Added
-- SSH hosts are added and edited in a dialog instead of `config.toml`: *Add SSH Host…* (also the
- "+" next to the sidebar's SSH hosts) and *Edit SSH Host…* in the command palette, a right-click
- menu on each host in the sidebar to connect, edit, duplicate or delete it, and an edit button
- (Alt+E) in the *Connect to SSH Host* picker.
-- Hosts can be put in groups, which the sidebar lists them under and the host picker shows.
-- Editing a host from `~/.ssh/config` keeps the changes in RedShell and leaves the file alone;
- *Reset to ~/.ssh/config* drops them again.
-- RedShell asks for SSH passwords, key passphrases and new host keys itself and can remember
- passwords and passphrases in the system keychain (`ssh.askpass`, OpenSSH 8.4 or newer). Each
- question shows in the window of the tab that asks, one at a time over any open dialog, and
- security key prompts show as a notice until they are done.
-- The host editor shows whether a host's password is saved in the keychain and changes or
- removes it; renaming or deleting a host takes its password along.
+- SSH hosts are added and edited in a dialog: *Add SSH Host…* (also the "+" next to the
+ sidebar's SSH hosts), *Edit SSH Host…*, a right-click menu on each host in the sidebar to
+ connect, edit, duplicate or delete it, and Alt+E in the *Connect to SSH Host* picker.
+- Hosts can be put in groups, which the sidebar and the host picker show. Editing a host from
+ `~/.ssh/config` keeps the changes in RedShell and leaves the file alone; *Reset to
+ ~/.ssh/config* drops them.
+- RedShell asks for SSH passwords, passphrases and new host keys in its own dialog and can keep
+ passwords and passphrases in the system keychain (`ssh.askpass`, OpenSSH 8.4 or newer), also
+ for native tmux attach. The host editor shows, changes or removes a host's saved password.
- *Install Key on Server…* adds your public key to a host's `authorized_keys`, as `ssh-copy-id`
does, and creates an ed25519 key first if you have none.
-- SSH hosts carry port forwards (local, remote and SOCKS) that run as background tunnels: start
- and stop them from a host's *Port Forwarding* menu or *SSH Tunnels…*, open them with RedShell
- (`auto_start`), and see which hosts have one up in the sidebar. A failed tunnel says why and
- stays down until you start it again; quitting closes them all.
-- The host editor has a *Port forwarding* section, a *Forward agent* switch (`forward_agent`) and
- a *Startup command* run after login, before the shell or the `attach_session` session.
-- *Browse Files…* shows an SSH host's files over SFTP: from a host's menu, an SSH tab's menu, the
- folder button (Alt+F) in the *Connect to SSH Host* picker or *Browse SSH Host Files…* in the
- command palette. It sorts by name, size or date, downloads files and folders, uploads picked or
- dropped files, creates, renames and deletes, copies paths and opens a terminal in the folder
- shown. Transfers show progress, can be cancelled and keep going while you browse elsewhere or
- after the dialog closes.
+- Port forwards (local, remote and SOCKS) on SSH hosts, run as background tunnels: start and stop
+ them from a host's *Port Forwarding* menu or *SSH Tunnels…*, open them with RedShell
+ (`auto_start`), and see in the sidebar which hosts have one up.
+- The host editor sets agent forwarding (`forward_agent`) and a startup command that runs after
+ login, before the shell or the `attach_session` session.
+- *Browse Files…* shows an SSH host's files over SFTP (from a host's or an SSH tab's menu, Alt+F
+ in the host picker, or *Browse SSH Host Files…*): download, upload by picking or dropping,
+ create, rename, delete, and open a terminal in the folder. Transfers outlive the dialog.
+- `redshell-server` keeps shells, coding agents and SSH sessions running on an always-on machine,
+ set up in a `[server]` section of its `config.toml` ([docs/REMOTE.md](docs/REMOTE.md)). Releases
+ carry it for Linux (`.deb` with a per-user systemd unit, and `.tar.gz`) and for macOS.
+- Behind Tailscale Serve or cloudflared on the same machine, the server trusts the proxy's
+ `X-Forwarded-For` without any `trusted_proxies`, so each client meets its own sign-in backoff.
+- The server signs in with a password, with backoff, or a passkey (Face ID, Touch ID, Windows
+ Hello, a security key). Browsers and devices are listed with when they were last seen and can be
+ revoked, an account can turn password sign-in off, and `redshell-server user` manages accounts.
+- Claude Code permission requests can be answered from any connected client or in Claude Code's
+ own dialog, whichever comes first, and Claude Code and Codex report when they work, wait for
+ input or finish. A Codex `notify` program of your own still runs.
+- Web Push notifications when an agent asks for approval, waits for input or finishes, and when
+ a program fails or raises a notification, chosen per browser and held back while you are
+ typing into that session.
+- RedShell Remote, the web app the server serves, for phones and browsers: an inbox of sessions
+ that need you, terminals with a key bar and a composer, approval sheets with diffs, new sessions
+ in any folder, passkeys, notifications and the server's SSH hosts, in two columns on wide screens.
+- The desktop connects to RedShell servers: add them under *Settings → Servers* (`[remote]` in
+ `config.toml`) and sign in with a password or a short code you approve in a signed-in browser,
+ which says whether the request came from your own address. The token stays in the keychain.
+- A *Servers* section in the sidebar lists a server's sessions with what their agents are doing.
+ They open as tabs that only detach when closed and come back on the next start, with an agent's
+ pending approval above the terminal.
+- *Send to Server* in an SSH host's menu copies the host to a server, without its identity file,
+ through the server's hosts API, which edits its `config.toml` in place and keeps the comments.
+- `redshell-protocol`, the wire types shared by the server, the desktop and (as TypeScript)
+ RedShell Remote.
+
+### Changed
+- `ssh.askpass` is on by default, so ssh's prompts appear in RedShell's dialog where OpenSSH 8.4 or
+ newer is installed.
+- A saved host named after a `~/.ssh/config` alias connects through the alias, with the fields
+ set in RedShell passed on top (`-p`, `-l`, `HostName`).
+- New entries in `config.toml` list their keys in the order of the settings, and SSH hosts leave
+ empty fields out.
+- Shift+Tab moves back through dialogs and lists, as Tab moves on.
+
+### Fixed
+- Native tmux tabs get the right size on tmux 3.2, which ignores per-window sizes.
+- Hosts listed from `ssh.ssh_config_path` connect: ssh now reads that file too (`-F`).
+
+### Security
+- `redshell-server` accepts browser requests only from its own origin (exactly `public_url` when
+ that is https), needs `X-RedShell: 1` on every request that changes something (protocol
+ version 2), and sends HSTS whenever clients reach it over https.
+- Adding or removing a passkey, turning passkey-only on or off, approving a pairing and signing
+ out another browser or device need a re-authentication within the last five minutes.
+- Turning passkey-only on ends the password's sign-ins, a password change drops pairing approvals
+ still waiting, and `user passwd` lists the passkeys that still sign in and takes
+ `--revoke-passkeys`.
+- Strangers cannot fill the server's memory, log or connections: passkey sign-ins are stateless,
+ limits count IPv6 by /64, bodies, names, pairing requests and connections are bounded, and slow
+ clients time out. The sign-in backoff stops at 15 minutes per address and 2 per name.
+- Push messages go only to public https endpoints on port 443, and *Browse Files…* skips
+ downloaded names that could leave the target folder.
+- RedShell Remote asks "Confirm it's you" (a passkey or the password) before a change that needs
+ a re-authentication and then makes the change, and its pairing page warns that approving signs
+ the device in as you, with the address the request came from and a warning when that is
+ another network.
## [0.0.2] - 2026-12-01
@@ -213,5 +280,6 @@ First public preview.
themes; settings UI for fonts, opacity, background image, cursor, safety, history and
keybindings; hot-reloaded `config.toml`.
+[0.0.3]: https://github.com/redstone-md/RedShell/compare/v0.0.2...v0.0.3
[0.0.2]: https://github.com/redstone-md/RedShell/compare/v0.0.1...v0.0.2
[0.0.1]: https://github.com/redstone-md/RedShell/releases/tag/v0.0.1
diff --git a/Cargo.lock b/Cargo.lock
index d6308c9..2f1293a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8,6 +8,26 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
+[[package]]
+name = "aead"
+version = "0.5.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0"
+dependencies = [
+ "crypto-common 0.1.7",
+ "generic-array",
+]
+
+[[package]]
+name = "aead"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1973cfbc1a2daf9cf550e74e1f088c28e7f7d8c1e1418fb6c9dc5184b7e84c99"
+dependencies = [
+ "crypto-common 0.2.2",
+ "inout 0.2.6",
+]
+
[[package]]
name = "aes"
version = "0.8.4"
@@ -31,6 +51,54 @@ dependencies = [
"cpufeatures 0.3.1",
]
+[[package]]
+name = "aes-gcm"
+version = "0.10.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1"
+dependencies = [
+ "aead 0.5.2",
+ "aes 0.8.4",
+ "cipher 0.4.4",
+ "ctr 0.9.2",
+ "ghash 0.5.1",
+ "subtle",
+]
+
+[[package]]
+name = "aes-gcm"
+version = "0.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f2b8006a0c83f52b62ba44a97b58bf76fe2f70a329e588f67f89691d93d498f"
+dependencies = [
+ "aead 0.6.1",
+ "aes 0.9.4",
+ "cipher 0.5.2",
+ "ctr 0.10.1",
+ "ctutils",
+ "ghash 0.6.0",
+]
+
+[[package]]
+name = "aes-keywrap"
+version = "0.9.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf71a903b87eeef4903e7077cc9689f0c8449e093395db09dc48d1a39934e770"
+dependencies = [
+ "aes 0.9.4",
+ "byteorder",
+]
+
+[[package]]
+name = "aes-kw"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41ac571010bd60765c56085a4f1d412012a9be2663b1a2f2b19b49318653fd0d"
+dependencies = [
+ "aes 0.9.4",
+ "const-oid 0.10.3",
+]
+
[[package]]
name = "ahash"
version = "0.8.15"
@@ -61,7 +129,7 @@ version = "0.26.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bda177466b9524d59f1b12f0dd30b68696788e9992a7e959021c4a0ed96fcf59"
dependencies = [
- "base64",
+ "base64 0.22.1",
"bitflags 2.13.2",
"home",
"libc",
@@ -189,6 +257,15 @@ version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bc62ac97cc33321f50863d514c3bc38a453947a8f9e781137e47c7401020aed"
+[[package]]
+name = "arc-swap"
+version = "1.9.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "84a22b5d51209f6de83d37a0b33d320acb8da88823e42a94c075140708f032a5"
+dependencies = [
+ "rustversion",
+]
+
[[package]]
name = "arg_enum_proc_macro"
version = "0.3.4"
@@ -200,6 +277,30 @@ dependencies = [
"syn 2.0.119",
]
+[[package]]
+name = "argon2"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072"
+dependencies = [
+ "base64ct",
+ "blake2 0.10.6",
+ "cpufeatures 0.2.17",
+ "password-hash 0.5.0",
+]
+
+[[package]]
+name = "argon2"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "134c52ddac6d63c576bef8168db10c83c49c26444ecbc68060fef078925a901c"
+dependencies = [
+ "base64ct",
+ "blake2 0.11.0",
+ "cpufeatures 0.3.1",
+ "password-hash 0.6.1",
+]
+
[[package]]
name = "arrayref"
version = "0.3.9"
@@ -286,6 +387,45 @@ dependencies = [
"zbus",
]
+[[package]]
+name = "asn1-rs"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7f43a50ac4fdca5df8e885c21b835997f0a1cdee65494a6847694a98652d9d8"
+dependencies = [
+ "asn1-rs-derive",
+ "asn1-rs-impl",
+ "displaydoc",
+ "nom 7.1.3",
+ "num-traits",
+ "rusticata-macros",
+ "thiserror 2.0.21",
+ "time",
+]
+
+[[package]]
+name = "asn1-rs-derive"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3109e49b1e4909e9db6515a30c633684d68cdeaa252f215214cb4fa1a5bfee2c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+ "synstructure 0.13.2",
+]
+
+[[package]]
+name = "asn1-rs-impl"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
[[package]]
name = "async-broadcast"
version = "0.7.2"
@@ -487,6 +627,28 @@ dependencies = [
"wasm-bindgen-futures",
]
+[[package]]
+name = "async-stream"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476"
+dependencies = [
+ "async-stream-impl",
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-stream-impl"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
[[package]]
name = "async-task"
version = "4.7.1"
@@ -578,12 +740,120 @@ dependencies = [
"arrayvec",
]
+[[package]]
+name = "axum"
+version = "0.8.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90"
+dependencies = [
+ "axum-core",
+ "base64 0.22.1",
+ "bytes",
+ "form_urlencoded",
+ "futures-util",
+ "http",
+ "http-body",
+ "http-body-util",
+ "hyper",
+ "hyper-util",
+ "itoa",
+ "matchit",
+ "memchr",
+ "mime",
+ "percent-encoding",
+ "pin-project-lite",
+ "serde_core",
+ "serde_json",
+ "serde_path_to_error",
+ "serde_urlencoded",
+ "sha1 0.10.7",
+ "sync_wrapper",
+ "tokio",
+ "tokio-tungstenite",
+ "tower",
+ "tower-layer",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "axum-core"
+version = "0.5.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1"
+dependencies = [
+ "bytes",
+ "futures-core",
+ "http",
+ "http-body",
+ "http-body-util",
+ "mime",
+ "pin-project-lite",
+ "sync_wrapper",
+ "tower-layer",
+ "tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "axum-server"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3766086d344b8f8d2a9cf6fb211b581de5b160e052d7bc75a92e58cc41909054"
+dependencies = [
+ "arc-swap",
+ "bytes",
+ "either",
+ "fs-err",
+ "http",
+ "http-body",
+ "hyper",
+ "hyper-util",
+ "pin-project-lite",
+ "rustls",
+ "rustls-pki-types",
+ "socket2",
+ "tokio",
+ "tokio-rustls",
+ "tower-service",
+]
+
+[[package]]
+name = "base16ct"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf"
+
+[[package]]
+name = "base16ct"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fd307490d624467aa6f74b0eabb77633d1f758a7b25f12bceb0b22e08d9726f6"
+
+[[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 = "base64"
+version = "0.23.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
+
+[[package]]
+name = "base64ct"
+version = "1.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06"
+
[[package]]
name = "bindgen"
version = "0.71.1"
@@ -604,6 +874,12 @@ dependencies = [
"syn 2.0.119",
]
+[[package]]
+name = "binstring"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1c05f270702529040b45d3389e1245bc21c5e5df78b2a509e1e3d7bcd47a18e"
+
[[package]]
name = "bit-set"
version = "0.8.0"
@@ -707,6 +983,34 @@ dependencies = [
"profiling",
]
+[[package]]
+name = "blake2"
+version = "0.10.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe"
+dependencies = [
+ "digest 0.10.7",
+]
+
+[[package]]
+name = "blake2"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b5d4d889834ee8ecfc0f8426ad30faf7cdcb10f741a8e6d7224d95325479f6f"
+dependencies = [
+ "digest 0.11.3",
+]
+
+[[package]]
+name = "blake2b_simd"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3560a7b1951efe814fcd721938313adc56753ca39f4b23847d7e9a2402f5dbff"
+dependencies = [
+ "arrayvec",
+ "constant_time_eq",
+]
+
[[package]]
name = "block"
version = "0.1.6"
@@ -729,6 +1033,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa"
dependencies = [
"hybrid-array",
+ "zeroize",
]
[[package]]
@@ -771,6 +1076,15 @@ dependencies = [
"piper",
]
+[[package]]
+name = "bs58"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4"
+dependencies = [
+ "tinyvec",
+]
+
[[package]]
name = "bstr"
version = "1.14.0"
@@ -882,7 +1196,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eadd868a2ce9ca38de7eeafdcec9c7065ef89b42b32f0839278d55f35c54d1ff"
dependencies = [
"heck 0.4.1",
- "indexmap",
+ "indexmap 2.14.2",
"log",
"proc-macro2",
"quote",
@@ -981,6 +1295,7 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8cf2a2c93cd704877c0858356ed03480ff301ee950b43f1cbe4573b088bfa6c"
dependencies = [
+ "block-buffer 0.12.1",
"crypto-common 0.2.2",
"inout 0.2.6",
]
@@ -997,41 +1312,92 @@ dependencies = [
]
[[package]]
-name = "cmov"
-version = "0.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a"
-
-[[package]]
-name = "cocoa"
-version = "0.25.0"
+name = "clap"
+version = "4.6.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c"
+checksum = "50066ca966813ca8957ee15361752f19424a8ff620dbe9c8993d9f99d99b04b3"
dependencies = [
- "bitflags 1.3.2",
- "block",
- "cocoa-foundation 0.1.2",
- "core-foundation 0.9.4",
- "core-graphics 0.23.2",
- "foreign-types",
- "libc",
- "objc",
+ "clap_builder",
+ "clap_derive",
]
[[package]]
-name = "cocoa"
-version = "0.26.0"
+name = "clap_builder"
+version = "4.6.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f79398230a6e2c08f5c9760610eb6924b52aa9e7950a619602baba59dcbbdbb2"
+checksum = "a0ed97c96ef4efb3cc84e09fa388df4463e7cc3224ec38d7b1d9e45749333590"
dependencies = [
- "bitflags 2.13.2",
- "block",
- "cocoa-foundation 0.2.0",
- "core-foundation 0.10.0",
- "core-graphics 0.24.0",
- "foreign-types",
- "libc",
- "objc",
+ "anstream",
+ "anstyle",
+ "clap_lex",
+ "strsim",
+]
+
+[[package]]
+name = "clap_derive"
+version = "4.6.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4c174f11f949b9ca8c60580925e282b9cbd5454750e506f08648b2038080cd7"
+dependencies = [
+ "heck 0.5.0",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.10",
+]
+
+[[package]]
+name = "clap_lex"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e0921b3876b3a1df8a1c9f912e7f94342458022c2e84288015893d83c4d62a79"
+
+[[package]]
+name = "cmov"
+version = "0.5.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a"
+
+[[package]]
+name = "coarsetime"
+version = "0.1.38"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eae63702c5627c75addbfb1ea9d1b3842205a6ffd43e4cce884a2a9eb1828fd7"
+dependencies = [
+ "libc",
+ "wasix",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "cocoa"
+version = "0.25.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6140449f97a6e97f9511815c5632d84c8aacf8ac271ad77c559218161a1373c"
+dependencies = [
+ "bitflags 1.3.2",
+ "block",
+ "cocoa-foundation 0.1.2",
+ "core-foundation 0.9.4",
+ "core-graphics 0.23.2",
+ "foreign-types",
+ "libc",
+ "objc",
+]
+
+[[package]]
+name = "cocoa"
+version = "0.26.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f79398230a6e2c08f5c9760610eb6924b52aa9e7950a619602baba59dcbbdbb2"
+dependencies = [
+ "bitflags 2.13.2",
+ "block",
+ "cocoa-foundation 0.2.0",
+ "core-foundation 0.10.0",
+ "core-graphics 0.24.0",
+ "foreign-types",
+ "libc",
+ "objc",
]
[[package]]
@@ -1122,6 +1488,12 @@ dependencies = [
"crossbeam-utils",
]
+[[package]]
+name = "const-oid"
+version = "0.9.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
+
[[package]]
name = "const-oid"
version = "0.10.3"
@@ -1147,6 +1519,12 @@ dependencies = [
"tiny-keccak",
]
+[[package]]
+name = "constant_time_eq"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b"
+
[[package]]
name = "convert_case"
version = "0.4.0"
@@ -1399,6 +1777,35 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
+[[package]]
+name = "crypto-bigint"
+version = "0.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76"
+dependencies = [
+ "generic-array",
+ "rand_core 0.6.4",
+ "subtle",
+ "zeroize",
+]
+
+[[package]]
+name = "crypto-bigint"
+version = "0.7.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "914c195c4d7fbc5ed7f88d14cbf85914d5c664967658d43404b263913a477e82"
+dependencies = [
+ "cpubits",
+ "ctutils",
+ "getrandom 0.4.3",
+ "hybrid-array",
+ "num-traits",
+ "rand_core 0.10.1",
+ "serdect",
+ "subtle",
+ "zeroize",
+]
+
[[package]]
name = "crypto-common"
version = "0.1.7"
@@ -1416,9 +1823,74 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
dependencies = [
+ "getrandom 0.4.3",
+ "hybrid-array",
+ "rand_core 0.10.1",
+]
+
+[[package]]
+name = "crypto-glue"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "57d90fe73514cb72a4ad8568a184472dfb4c2ffa65409a8e85720b83202cec83"
+dependencies = [
+ "aes 0.9.4",
+ "aes-gcm 0.11.1",
+ "aes-kw",
+ "argon2 0.6.0",
+ "base64 0.23.1",
+ "cbc 0.2.1",
+ "cipher 0.5.2",
+ "const-oid 0.10.3",
+ "crypto-common 0.2.2",
+ "cts",
+ "der 0.8.3",
+ "digest 0.11.3",
+ "ecdsa 0.17.0",
+ "elliptic-curve 0.14.3",
+ "hex",
+ "hkdf 0.13.0",
+ "hmac 0.13.0",
"hybrid-array",
+ "kbkdf",
+ "md5",
+ "p256 0.14.0",
+ "p384 0.14.0",
+ "p521",
+ "pbkdf2 0.13.0",
+ "pkcs8 0.11.0",
+ "rand 0.10.4",
+ "rsa",
+ "sec1 0.8.1",
+ "serde",
+ "sha1 0.11.0",
+ "sha2 0.11.2",
+ "signature 3.0.0",
+ "spki 0.8.1",
+ "subtle",
+ "tracing",
+ "uuid",
+ "wasm-bindgen",
+ "x509-cert",
+ "zeroize",
+]
+
+[[package]]
+name = "crypto-primes"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3633a51a39c69ebbaa4feaa694bd83d241e4093901c84a0963b19d9bb3f0cf8f"
+dependencies = [
+ "crypto-bigint 0.7.11",
+ "rand_core 0.10.1",
]
+[[package]]
+name = "ct-codecs"
+version = "1.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8fd9f3db6f2cfef61c10613071955154ffdc9e515daebff26de4b54e35038fdd"
+
[[package]]
name = "ctor"
version = "0.4.3"
@@ -1435,6 +1907,33 @@ version = "0.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2931af7e13dc045d8e9d26afccc6fa115d64e115c9c84b1166288b46f6782c2"
+[[package]]
+name = "ctr"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835"
+dependencies = [
+ "cipher 0.4.4",
+]
+
+[[package]]
+name = "ctr"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baaca1c4b237092596f64d571e9db6ce4109c4ef9742e27590f1709594461f21"
+dependencies = [
+ "cipher 0.5.2",
+]
+
+[[package]]
+name = "cts"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6ae47d18aa4f3701bc9b644cf9a74a45e6eace39feabeab15864728aa1e45a9"
+dependencies = [
+ "cipher 0.5.2",
+]
+
[[package]]
name = "ctutils"
version = "0.4.8"
@@ -1442,6 +1941,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "261af4dc7a06ea8a527a8717d8cbba3417530d6ea14e1edb3de6b67806be474f"
dependencies = [
"cmov",
+ "subtle",
]
[[package]]
@@ -1450,6 +1950,40 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f27ae1dd37df86211c42e150270f82743308803d90a6f6e6651cd730d5e1732f"
+[[package]]
+name = "darling"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec"
+dependencies = [
+ "darling_core",
+ "darling_macro",
+]
+
+[[package]]
+name = "darling_core"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff"
+dependencies = [
+ "ident_case",
+ "proc-macro2",
+ "quote",
+ "strsim",
+ "syn 3.0.10",
+]
+
+[[package]]
+name = "darling_macro"
+version = "0.24.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785"
+dependencies = [
+ "darling_core",
+ "quote",
+ "syn 3.0.10",
+]
+
[[package]]
name = "dashmap"
version = "6.2.1"
@@ -1464,6 +1998,12 @@ dependencies = [
"parking_lot_core",
]
+[[package]]
+name = "data-encoding"
+version = "2.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06"
+
[[package]]
name = "data-url"
version = "0.3.2"
@@ -1476,6 +2016,64 @@ version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac6b926516df9c60bfa16e107b21086399f8285a44ca9711344b9e553c5146e2"
+[[package]]
+name = "der"
+version = "0.7.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
+dependencies = [
+ "const-oid 0.9.6",
+ "pem-rfc7468 0.7.0",
+ "zeroize",
+]
+
+[[package]]
+name = "der"
+version = "0.8.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6a996a108feb8b427a6e12fcf6af4aa83409b79d72c15337d7741368131ee004"
+dependencies = [
+ "const-oid 0.10.3",
+ "der_derive",
+ "flagset",
+ "pem-rfc7468 1.0.0",
+ "zeroize",
+]
+
+[[package]]
+name = "der-parser"
+version = "10.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "07da5016415d5a3c4dd39b11ed26f915f52fc4e0dc197d87908bc916e51bc1a6"
+dependencies = [
+ "asn1-rs",
+ "displaydoc",
+ "nom 7.1.3",
+ "num-bigint",
+ "num-traits",
+ "rusticata-macros",
+]
+
+[[package]]
+name = "der_derive"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "59600e2c2d636fde9b65e99cc6445ac770c63d3628195ff39932b8d6d7409903"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "deranged"
+version = "0.5.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e9de72ce2ad1f90dc62fa25f0f430ef85eb4b0d8fa0be4f30373bc40a21d28e"
+dependencies = [
+ "serde_core",
+]
+
[[package]]
name = "derive_more"
version = "0.99.20"
@@ -1496,6 +2094,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [
"block-buffer 0.10.4",
+ "const-oid 0.9.6",
"crypto-common 0.1.7",
"subtle",
]
@@ -1507,9 +2106,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
dependencies = [
"block-buffer 0.12.1",
- "const-oid",
+ "const-oid 0.10.3",
"crypto-common 0.2.2",
"ctutils",
+ "zeroize",
]
[[package]]
@@ -1655,12 +2255,105 @@ version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555"
+[[package]]
+name = "ecdsa"
+version = "0.16.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca"
+dependencies = [
+ "der 0.7.10",
+ "digest 0.10.7",
+ "elliptic-curve 0.13.8",
+ "rfc6979 0.4.0",
+ "signature 2.2.0",
+ "spki 0.7.3",
+]
+
+[[package]]
+name = "ecdsa"
+version = "0.17.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0681a4fc24c767085329728d8dfba959af91228aa4610cca4f8ce317ba46ae0"
+dependencies = [
+ "der 0.8.3",
+ "digest 0.11.3",
+ "elliptic-curve 0.14.3",
+ "rfc6979 0.6.0",
+ "signature 3.0.0",
+ "spki 0.8.1",
+ "zeroize",
+]
+
+[[package]]
+name = "ece-native"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6911cc97c62febd8cbcb2cb49ed21c58ccd418a80c43f20df4973ee08484e65d"
+dependencies = [
+ "aes-gcm 0.10.3",
+ "hkdf 0.12.4",
+ "sha2 0.10.9",
+]
+
+[[package]]
+name = "ed25519-compact"
+version = "2.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9547879431a90e352a35863a54416d92898a787b9af09e6ae2e09a96bd78be80"
+dependencies = [
+ "ct-codecs",
+ "getrandom 0.4.3",
+]
+
[[package]]
name = "either"
version = "1.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be"
+[[package]]
+name = "elliptic-curve"
+version = "0.13.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47"
+dependencies = [
+ "base16ct 0.2.0",
+ "crypto-bigint 0.5.5",
+ "digest 0.10.7",
+ "ff 0.13.1",
+ "generic-array",
+ "group 0.13.0",
+ "hkdf 0.12.4",
+ "pem-rfc7468 0.7.0",
+ "pkcs8 0.10.2",
+ "rand_core 0.6.4",
+ "sec1 0.7.3",
+ "subtle",
+ "zeroize",
+]
+
+[[package]]
+name = "elliptic-curve"
+version = "0.14.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "900f37e7e18d74a2347389af6cd69e3a30d5cc9e697f40004865679aa75e9c7c"
+dependencies = [
+ "base16ct 1.0.0",
+ "crypto-bigint 0.7.11",
+ "crypto-common 0.2.2",
+ "digest 0.11.3",
+ "ff 0.14.0",
+ "group 0.14.0",
+ "hkdf 0.13.0",
+ "hybrid-array",
+ "pem-rfc7468 1.0.0",
+ "pkcs8 0.11.0",
+ "rand_core 0.10.1",
+ "sec1 0.8.1",
+ "subtle",
+ "zeroize",
+]
+
[[package]]
name = "embed-resource"
version = "3.0.12"
@@ -1735,7 +2428,7 @@ dependencies = [
"anstream",
"anstyle",
"env_filter",
- "jiff",
+ "jiff 1.0.3",
"log",
]
@@ -1889,6 +2582,32 @@ dependencies = [
"simd-adler32",
]
+[[package]]
+name = "ff"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393"
+dependencies = [
+ "rand_core 0.6.4",
+ "subtle",
+]
+
+[[package]]
+name = "ff"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1f686ab92a9fb0eaf188f6c6c87b89490baa6fdb0db4544ba4dc47f7942489f"
+dependencies = [
+ "rand_core 0.10.1",
+ "subtle",
+]
+
+[[package]]
+name = "fiat-crypto"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "64cd1e32ddd350061ae6edb1b082d7c54915b5c672c389143b9a63403a109f24"
+
[[package]]
name = "filedescriptor"
version = "0.8.3"
@@ -1916,6 +2635,12 @@ version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e44f110d1777dc6559a51e7d45083945ded4f1bf3305494350f693b6d20b9c8"
+[[package]]
+name = "flagset"
+version = "0.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b7ac824320a75a52197e8f2d787f6a38b6718bb6897a35142d749af3c0e8f4fe"
+
[[package]]
name = "flate2"
version = "1.1.11"
@@ -2068,6 +2793,16 @@ dependencies = [
"pkg-config",
]
+[[package]]
+name = "fs-err"
+version = "3.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5c95b673b8f6f7235229ae11c5642d81b04c2e64c1e2fb417bc0cf73ca45f29"
+dependencies = [
+ "autocfg",
+ "tokio",
+]
+
[[package]]
name = "futf"
version = "0.1.5"
@@ -2202,6 +2937,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
dependencies = [
"typenum",
"version_check",
+ "zeroize",
]
[[package]]
@@ -2253,6 +2989,25 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "ghash"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1"
+dependencies = [
+ "opaque-debug",
+ "polyval 0.6.2",
+]
+
+[[package]]
+name = "ghash"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2eecf2d5dc9b66b732b97707a0210906b1d30523eb773193ab777c0c84b3e8d5"
+dependencies = [
+ "polyval 0.7.3",
+]
+
[[package]]
name = "gif"
version = "0.14.2"
@@ -2413,7 +3168,7 @@ dependencies = [
"rand 0.9.5",
"raw-window-handle",
"resvg",
- "schemars",
+ "schemars 1.2.3",
"seahash",
"serde",
"serde_json",
@@ -2462,7 +3217,7 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae39dc6d3d201be97e4bc08d96dbef2bc5b5c3d5734e05786e8cc3043342351c"
dependencies = [
- "indexmap",
+ "indexmap 2.14.2",
"rustc-hash 2.1.3",
]
@@ -2582,7 +3337,7 @@ dependencies = [
"nix 0.29.0",
"regex",
"rust-embed",
- "schemars",
+ "schemars 1.2.3",
"serde",
"serde_json",
"serde_json_lenient",
@@ -2613,6 +3368,28 @@ version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12101ecc8225ea6d675bc70263074eab6169079621c2186fe0c66590b2df9681"
+[[package]]
+name = "group"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63"
+dependencies = [
+ "ff 0.13.1",
+ "rand_core 0.6.4",
+ "subtle",
+]
+
+[[package]]
+name = "group"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7fd1a1c7a5206c5b7a3f5a0d7ccd3ff85d0c8f5133d62a02680255b0004af5f4"
+dependencies = [
+ "ff 0.14.0",
+ "rand_core 0.10.1",
+ "subtle",
+]
+
[[package]]
name = "h2"
version = "0.4.21"
@@ -2625,7 +3402,7 @@ dependencies = [
"futures-core",
"futures-sink",
"http",
- "indexmap",
+ "indexmap 2.14.2",
"slab",
"tokio",
"tokio-util",
@@ -2644,6 +3421,12 @@ dependencies = [
"zerocopy",
]
+[[package]]
+name = "hashbrown"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
+
[[package]]
name = "hashbrown"
version = "0.14.5"
@@ -2751,6 +3534,35 @@ dependencies = [
"digest 0.11.3",
]
+[[package]]
+name = "hmac-sha1-compact"
+version = "1.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5286b48a73829e3541cd9f533359c01150f7879e2716796eda0631ad5fe7e668"
+dependencies = [
+ "digest 0.11.3",
+]
+
+[[package]]
+name = "hmac-sha256"
+version = "1.1.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ad320b3b96fb2a455a0726d16efe0a5afdbd34b71dea5bc53b05ea057714d4e"
+dependencies = [
+ "digest 0.10.7",
+ "digest 0.11.3",
+]
+
+[[package]]
+name = "hmac-sha512"
+version = "1.1.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66de62217b456dfbbba2bed965a134a4df57c48f0eac4c772018aee528e72244"
+dependencies = [
+ "digest 0.10.7",
+ "digest 0.11.3",
+]
+
[[package]]
name = "home"
version = "0.5.12"
@@ -2799,13 +3611,23 @@ version = "1.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
+[[package]]
+name = "httpdate"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
+
[[package]]
name = "hybrid-array"
version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17"
dependencies = [
+ "ctutils",
+ "serde",
+ "subtle",
"typenum",
+ "zeroize",
]
[[package]]
@@ -2822,6 +3644,7 @@ dependencies = [
"http",
"http-body",
"httparse",
+ "httpdate",
"itoa",
"pin-project-lite",
"smallvec",
@@ -2843,6 +3666,7 @@ dependencies = [
"tokio",
"tokio-rustls",
"tower-service",
+ "webpki-roots",
]
[[package]]
@@ -2851,6 +3675,7 @@ version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff"
dependencies = [
+ "base64 0.23.1",
"bytes",
"futures-channel",
"futures-util",
@@ -2858,7 +3683,9 @@ dependencies = [
"http-body",
"httparse",
"hyper",
+ "ipnet",
"libc",
+ "percent-encoding",
"pin-project-lite",
"socket2",
"tokio",
@@ -2973,6 +3800,12 @@ dependencies = [
"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.1.0"
@@ -3040,6 +3873,17 @@ version = "1.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e44b0a4eaa4c82f441d50a963f2d5f05a787240aeee097597033e72accfd22f"
+[[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.14.2"
@@ -3168,62 +4012,190 @@ version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bd1574e617a9a6c1f8f8181bd7e841e1f20e4277607ef28945765188d6284d4"
+[[package]]
+name = "jiff"
+version = "0.2.46"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "175dc66334db3b9ab9985bf8b61cfed50dc16d20964bb47f9e479adcae984a7f"
+dependencies = [
+ "jiff-core 0.1.8",
+ "jiff-static 0.2.46",
+ "jiff-tzdb-platform 0.1.3",
+ "log",
+ "portable-atomic",
+ "portable-atomic-util",
+ "serde_core",
+ "windows-link 0.2.1",
+]
+
[[package]]
name = "jiff"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "107f2e89536b6818514025f6787b0d94d819e54fe3b40365275fc753de485b3f"
dependencies = [
- "jiff-core",
- "jiff-static",
+ "jiff-core 1.0.2",
+ "jiff-static 1.0.3",
+ "jiff-tzdb-platform 1.0.0",
"js-sys",
"log",
"portable-atomic",
"portable-atomic-util",
"serde_core",
"wasm-bindgen",
+ "windows-link 0.2.1",
+]
+
+[[package]]
+name = "jiff-core"
+version = "0.1.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e599b80292e597019b8b3e392de3f4bea2959ddfb8c7dff60e035e9e311a2c1b"
+dependencies = [
+ "log",
+]
+
+[[package]]
+name = "jiff-core"
+version = "1.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d44c923edf2bf456a982253f1a9ee1f6e89e421dffd0065d9b9a581da0def58f"
+dependencies = [
+ "log",
+]
+
+[[package]]
+name = "jiff-static"
+version = "0.2.46"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c7b1af7547d47354bc438d797e3854601bde8f8d185780c5ba4ab27afa54f1ba"
+dependencies = [
+ "jiff-core 0.1.8",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "jiff-static"
+version = "1.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4996f71e569e3a3e32b925c28ef8f0027dc30bb1d594b33eeda409eea185f5c8"
+dependencies = [
+ "jiff-core 1.0.2",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.10",
+]
+
+[[package]]
+name = "jiff-tzdb"
+version = "0.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0980fca2cc272465bd60e82397607ba9f33add9e48defd77923301bbd03808f2"
+
+[[package]]
+name = "jiff-tzdb"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12e71a1b68a875a44a33bb7a1dd84392cb77145a3367a552a3cfe6a4f5cf3afc"
+
+[[package]]
+name = "jiff-tzdb-platform"
+version = "0.1.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8"
+dependencies = [
+ "jiff-tzdb 0.1.10",
+]
+
+[[package]]
+name = "jiff-tzdb-platform"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc65b284afcfa8f6cf189c7274c805505314a7ab975c60e1f548bff56525420e"
+dependencies = [
+ "jiff-tzdb 1.0.0",
+]
+
+[[package]]
+name = "jobserver"
+version = "0.1.35"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"
+dependencies = [
+ "getrandom 0.4.3",
+ "libc",
+]
+
+[[package]]
+name = "js-sys"
+version = "0.3.107"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a"
+dependencies = [
+ "cfg-if",
+ "futures-util",
+ "wasm-bindgen",
]
[[package]]
-name = "jiff-core"
-version = "1.0.2"
+name = "jwt-simple"
+version = "0.12.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d44c923edf2bf456a982253f1a9ee1f6e89e421dffd0065d9b9a581da0def58f"
+checksum = "06a4207b9d1f423858853fb9ee8b34aebc2b661f3b446ca4efda46c4b3700a2f"
dependencies = [
- "log",
+ "anyhow",
+ "binstring",
+ "blake2b_simd",
+ "coarsetime",
+ "ct-codecs",
+ "ed25519-compact",
+ "hmac-sha1-compact",
+ "hmac-sha256",
+ "hmac-sha512",
+ "k256",
+ "p256 0.13.2",
+ "p384 0.13.1",
+ "rand 0.8.8",
+ "serde",
+ "serde_json",
+ "superboring",
+ "thiserror 2.0.21",
+ "zeroize",
]
[[package]]
-name = "jiff-static"
-version = "1.0.3"
+name = "k256"
+version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4996f71e569e3a3e32b925c28ef8f0027dc30bb1d594b33eeda409eea185f5c8"
+checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b"
dependencies = [
- "jiff-core",
- "proc-macro2",
- "quote",
- "syn 3.0.10",
+ "cfg-if",
+ "ecdsa 0.16.9",
+ "elliptic-curve 0.13.8",
+ "once_cell",
+ "sha2 0.10.9",
+ "signature 2.2.0",
]
[[package]]
-name = "jobserver"
-version = "0.1.35"
+name = "kbkdf"
+version = "0.1.0-rc.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3"
+checksum = "90ac93c9768b8d587407881c98b0c3a5d3e3049daa73408ebe5bfb1ab1cb9c84"
dependencies = [
- "getrandom 0.4.3",
- "libc",
+ "digest 0.11.3",
]
[[package]]
-name = "js-sys"
-version = "0.3.107"
+name = "keccak"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8dc09d2154098bbf4ef54eab6b117a3c24cbbffe94046b16ee6d6d4510584d3a"
+checksum = "d8f198d1db720e4940b5a493201d199d9f24f568f8f746bd13706243a2f71598"
dependencies = [
"cfg-if",
- "futures-util",
- "wasm-bindgen",
+ "cpufeatures 0.3.1",
]
[[package]]
@@ -3466,6 +4438,12 @@ dependencies = [
"libc",
]
+[[package]]
+name = "matchit"
+version = "0.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3"
+
[[package]]
name = "maybe-rayon"
version = "0.1.1"
@@ -3486,6 +4464,12 @@ dependencies = [
"digest 0.10.7",
]
+[[package]]
+name = "md5"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ebb8d8732c6a6df3d8f032a82911cfc747e00efb95cc46e8d0acd5b5b88570c"
+
[[package]]
name = "memchr"
version = "2.8.3"
@@ -3593,6 +4577,33 @@ dependencies = [
"windows-sys 0.61.2",
]
+[[package]]
+name = "ml-dsa"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6f6d49c3f3f0e10e18ca975ffda66f8da0ec36521c1d911adcbc521bf0743f5c"
+dependencies = [
+ "const-oid 0.10.3",
+ "crypto-common 0.2.2",
+ "ctutils",
+ "hybrid-array",
+ "module-lattice",
+ "pkcs8 0.11.0",
+ "shake",
+ "signature 3.0.0",
+]
+
+[[package]]
+name = "module-lattice"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c4a1e412c8ee83a1c678f427806219c49c96b2511b9f07497514f0e43fb26155"
+dependencies = [
+ "ctutils",
+ "hybrid-array",
+ "num-traits",
+]
+
[[package]]
name = "moxcms"
version = "0.8.1"
@@ -3645,7 +4656,7 @@ dependencies = [
"half",
"hashbrown 0.15.5",
"hexf-parse",
- "indexmap",
+ "indexmap 2.14.2",
"log",
"num-traits",
"once_cell",
@@ -3800,6 +4811,12 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "num-conv"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"
+
[[package]]
name = "num-derive"
version = "0.4.2"
@@ -3997,6 +5014,15 @@ dependencies = [
"memchr",
]
+[[package]]
+name = "oid-registry"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "12f40cff3dde1b6087cc5d5f5d4d65712f34016a03ed60e9c08dcc392736b5b7"
+dependencies = [
+ "asn1-rs",
+]
+
[[package]]
name = "once_cell"
version = "1.21.4"
@@ -4033,7 +5059,7 @@ dependencies = [
"md-5",
"num",
"num-bigint-dig",
- "pbkdf2",
+ "pbkdf2 0.12.2",
"rand 0.9.5",
"serde",
"sha2 0.10.9",
@@ -4044,6 +5070,12 @@ dependencies = [
"zvariant",
]
+[[package]]
+name = "opaque-debug"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381"
+
[[package]]
name = "open"
version = "5.4.5"
@@ -4076,6 +5108,71 @@ dependencies = [
"pin-project-lite",
]
+[[package]]
+name = "p256"
+version = "0.13.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b"
+dependencies = [
+ "ecdsa 0.16.9",
+ "elliptic-curve 0.13.8",
+ "primeorder 0.13.6",
+ "sha2 0.10.9",
+]
+
+[[package]]
+name = "p256"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2c9239b2dbc807adbbe147e8cf72ea7450c3a0aabe62cb8e75ff4ec22e1f72a"
+dependencies = [
+ "ecdsa 0.17.0",
+ "elliptic-curve 0.14.3",
+ "primefield",
+ "primeorder 0.14.0",
+ "sha2 0.11.2",
+]
+
+[[package]]
+name = "p384"
+version = "0.13.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6"
+dependencies = [
+ "ecdsa 0.16.9",
+ "elliptic-curve 0.13.8",
+ "primeorder 0.13.6",
+ "sha2 0.10.9",
+]
+
+[[package]]
+name = "p384"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d17b851e6b3e378ab4ecb07fa2ed23f4d15f075735f8fec9fa1e7bdce5f8301f"
+dependencies = [
+ "ecdsa 0.17.0",
+ "elliptic-curve 0.14.3",
+ "fiat-crypto",
+ "primefield",
+ "primeorder 0.14.0",
+ "sha2 0.11.2",
+]
+
+[[package]]
+name = "p521"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ad64cc32c2dc466317c12ee5853e61f159f9eab1fe7efade0395dc2e7b43449"
+dependencies = [
+ "base16ct 1.0.0",
+ "ecdsa 0.17.0",
+ "elliptic-curve 0.14.3",
+ "primefield",
+ "primeorder 0.14.0",
+ "sha2 0.11.2",
+]
+
[[package]]
name = "parking"
version = "2.2.1"
@@ -4105,6 +5202,27 @@ dependencies = [
"windows-link 0.2.1",
]
+[[package]]
+name = "password-hash"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166"
+dependencies = [
+ "base64ct",
+ "rand_core 0.6.4",
+ "subtle",
+]
+
+[[package]]
+name = "password-hash"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aab41826031698d6ffcd9cff78ef56ef998e39dc7e5067cdfebe373842d4723b"
+dependencies = [
+ "getrandom 0.4.3",
+ "phc",
+]
+
[[package]]
name = "paste"
version = "1.0.15"
@@ -4146,12 +5264,51 @@ dependencies = [
"hmac 0.12.1",
]
+[[package]]
+name = "pbkdf2"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "112d82ceb8c5bf524d9af484d4e4970c9fd5a0cc15ba14ad93dccd28873b0629"
+dependencies = [
+ "digest 0.11.3",
+ "hmac 0.13.0",
+]
+
+[[package]]
+name = "pem-rfc7468"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
+dependencies = [
+ "base64ct",
+]
+
+[[package]]
+name = "pem-rfc7468"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a6305423e0e7738146434843d1694d621cce767262b2a86910beab705e4493d9"
+dependencies = [
+ "base64ct",
+]
+
[[package]]
name = "percent-encoding"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
+[[package]]
+name = "phc"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "44dc769b75f93afdddd8c7fa12d685292ddeff1e66f7f0f3a234cf1818afe892"
+dependencies = [
+ "base64ct",
+ "ctutils",
+ "getrandom 0.4.3",
+]
+
[[package]]
name = "pico-args"
version = "0.5.0"
@@ -4201,6 +5358,55 @@ dependencies = [
"futures-io",
]
+[[package]]
+name = "pkcs1"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6250dd7321adbe93d12b750aee0ced159fd13e77f625edcdf1cb6f83cd99f650"
+dependencies = [
+ "der 0.8.3",
+ "spki 0.8.1",
+]
+
+[[package]]
+name = "pkcs5"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "63d440a804ec8d6fafbb6b84471e013286658d373248927692ab3366686220ca"
+dependencies = [
+ "aes 0.9.4",
+ "aes-gcm 0.11.1",
+ "cbc 0.2.1",
+ "der 0.8.3",
+ "pbkdf2 0.13.0",
+ "rand_core 0.10.1",
+ "scrypt",
+ "sha2 0.11.2",
+ "spki 0.8.1",
+]
+
+[[package]]
+name = "pkcs8"
+version = "0.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7"
+dependencies = [
+ "der 0.7.10",
+ "spki 0.7.3",
+]
+
+[[package]]
+name = "pkcs8"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "451913da69c775a56034ea8d9003d27ee8948e12443eae7c038ba100a4f21cb7"
+dependencies = [
+ "der 0.8.3",
+ "pkcs5",
+ "rand_core 0.10.1",
+ "spki 0.8.1",
+]
+
[[package]]
name = "pkg-config"
version = "0.3.34"
@@ -4253,6 +5459,29 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7"
+[[package]]
+name = "polyval"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25"
+dependencies = [
+ "cfg-if",
+ "cpufeatures 0.2.17",
+ "opaque-debug",
+ "universal-hash 0.5.1",
+]
+
+[[package]]
+name = "polyval"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0fa31d631f2b2cb2a544d0aa321ce847a94764d701ca2becc411138b93d49cd"
+dependencies = [
+ "cpubits",
+ "cpufeatures 0.3.1",
+ "universal-hash 0.6.1",
+]
+
[[package]]
name = "portable-atomic"
version = "1.15.0"
@@ -4315,6 +5544,12 @@ dependencies = [
"zerovec",
]
+[[package]]
+name = "powerfmt"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4a6394b9e965e73d0a289ee54f589087e2c676aedf60885baf52c76b771e4958"
+
[[package]]
name = "ppv-lite86"
version = "0.2.21"
@@ -4334,6 +5569,42 @@ dependencies = [
"syn 2.0.119",
]
+[[package]]
+name = "primefield"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c555a6e4eb7d4e158fcb028c835c3b8642206ddc279b5c6b202ef9a8bdb592f4"
+dependencies = [
+ "crypto-bigint 0.7.11",
+ "crypto-common 0.2.2",
+ "ff 0.14.0",
+ "rand_core 0.10.1",
+ "subtle",
+ "zeroize",
+]
+
+[[package]]
+name = "primeorder"
+version = "0.13.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6"
+dependencies = [
+ "elliptic-curve 0.13.8",
+]
+
+[[package]]
+name = "primeorder"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c9f42978c78a00e3d68f69fc03e57a234debae69da4020a4fb588fcdcd07b06"
+dependencies = [
+ "elliptic-curve 0.14.3",
+ "once_cell",
+ "primefield",
+ "serdect",
+ "wnaf",
+]
+
[[package]]
name = "proc-macro-crate"
version = "3.5.0"
@@ -4562,6 +5833,16 @@ dependencies = [
"rand_core 0.9.5",
]
+[[package]]
+name = "rand_chacha"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3e6af7f3e25ded52c41df4e0b1af2d047e45896c2f3281792ed68a1c243daedb"
+dependencies = [
+ "ppv-lite86",
+ "rand_core 0.10.1",
+]
+
[[package]]
name = "rand_core"
version = "0.6.4"
@@ -4741,7 +6022,7 @@ dependencies = [
[[package]]
name = "redshell-agents"
-version = "0.0.2"
+version = "0.0.3"
dependencies = [
"redshell-core",
"which 8.0.6",
@@ -4749,7 +6030,7 @@ dependencies = [
[[package]]
name = "redshell-app"
-version = "0.0.2"
+version = "0.0.3"
dependencies = [
"anyhow",
"apple-native-keyring-store",
@@ -4768,16 +6049,21 @@ dependencies = [
"redshell-core",
"redshell-history",
"redshell-plugin",
+ "redshell-protocol",
"redshell-remote",
+ "redshell-server",
"redshell-terminal",
"redshell-theme",
"redshell-ui",
+ "rustls",
+ "rustls-native-certs",
"semver",
"serde",
"serde_json",
"shlex 1.3.0",
"tempfile",
"tokio",
+ "tokio-tungstenite",
"uuid",
"which 8.0.6",
"windows 0.61.3",
@@ -4789,13 +6075,15 @@ dependencies = [
[[package]]
name = "redshell-core"
-version = "0.0.2"
+version = "0.0.3"
dependencies = [
"anyhow",
"dirs 6.0.0",
+ "redshell-protocol",
"semver",
"serde",
"serde_json",
+ "shlex 1.3.0",
"tempfile",
"toml 0.9.12+spec-1.1.0",
"toml_edit 0.25.21+spec-1.1.0",
@@ -4805,7 +6093,7 @@ dependencies = [
[[package]]
name = "redshell-history"
-version = "0.0.2"
+version = "0.0.3"
dependencies = [
"anyhow",
"chrono",
@@ -4823,7 +6111,7 @@ dependencies = [
[[package]]
name = "redshell-plugin"
-version = "0.0.2"
+version = "0.0.3"
dependencies = [
"anyhow",
"crossbeam-channel",
@@ -4834,36 +6122,94 @@ dependencies = [
"serde",
"serde_json",
"tempfile",
- "toml 0.9.12+spec-1.1.0",
+ "toml 0.9.12+spec-1.1.0",
+]
+
+[[package]]
+name = "redshell-protocol"
+version = "0.0.3"
+dependencies = [
+ "serde",
+ "serde_json",
+ "ts-rs",
+]
+
+[[package]]
+name = "redshell-remote"
+version = "0.0.3"
+dependencies = [
+ "anyhow",
+ "chrono",
+ "crossbeam-channel",
+ "dirs 6.0.0",
+ "libc",
+ "log",
+ "parking_lot",
+ "redshell-core",
+ "russh-sftp",
+ "serde",
+ "serde_json",
+ "tempfile",
+ "thiserror 2.0.21",
+ "tokio",
+ "uuid",
+ "which 8.0.6",
+ "windows-sys 0.61.2",
+ "zeroize",
]
[[package]]
-name = "redshell-remote"
-version = "0.0.2"
+name = "redshell-server"
+version = "0.0.3"
dependencies = [
"anyhow",
- "chrono",
+ "argon2 0.5.3",
+ "axum",
+ "axum-server",
+ "base64 0.22.1",
+ "clap",
"crossbeam-channel",
"dirs 6.0.0",
+ "env_logger",
+ "futures-util",
+ "hmac 0.12.1",
+ "http-body-util",
+ "hyper",
+ "hyper-util",
"libc",
"log",
"parking_lot",
+ "rand_core 0.6.4",
+ "redshell-agents",
"redshell-core",
- "russh-sftp",
+ "redshell-protocol",
+ "redshell-remote",
+ "redshell-terminal",
+ "reqwest",
+ "rpassword",
+ "rusqlite",
+ "rust-embed",
+ "rustls",
"serde",
"serde_json",
+ "sha2 0.10.9",
"tempfile",
"thiserror 2.0.21",
"tokio",
+ "tokio-tungstenite",
+ "toml 0.9.12+spec-1.1.0",
+ "tower-http",
+ "url",
"uuid",
- "which 8.0.6",
- "windows-sys 0.61.2",
- "zeroize",
+ "web-push-native",
+ "webauthn-authenticator-rs",
+ "webauthn-rs",
+ "webauthn-rs-proto",
]
[[package]]
name = "redshell-terminal"
-version = "0.0.2"
+version = "0.0.3"
dependencies = [
"alacritty_terminal",
"anyhow",
@@ -4878,7 +6224,7 @@ dependencies = [
[[package]]
name = "redshell-theme"
-version = "0.0.2"
+version = "0.0.3"
dependencies = [
"anyhow",
"gpui",
@@ -4888,7 +6234,7 @@ dependencies = [
[[package]]
name = "redshell-ui"
-version = "0.0.2"
+version = "0.0.3"
dependencies = [
"gpui",
"redshell-core",
@@ -4945,6 +6291,44 @@ version = "0.8.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d902046e6a28a1e4c3cab97258a0ce11e994903f01c2d97a9447a0b3df85f4f6"
+[[package]]
+name = "reqwest"
+version = "0.12.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147"
+dependencies = [
+ "base64 0.22.1",
+ "bytes",
+ "futures-core",
+ "http",
+ "http-body",
+ "http-body-util",
+ "hyper",
+ "hyper-rustls",
+ "hyper-util",
+ "js-sys",
+ "log",
+ "percent-encoding",
+ "pin-project-lite",
+ "quinn",
+ "rustls",
+ "rustls-pki-types",
+ "serde",
+ "serde_json",
+ "serde_urlencoded",
+ "sync_wrapper",
+ "tokio",
+ "tokio-rustls",
+ "tower",
+ "tower-http",
+ "tower-service",
+ "url",
+ "wasm-bindgen",
+ "wasm-bindgen-futures",
+ "web-sys",
+ "webpki-roots",
+]
+
[[package]]
name = "resvg"
version = "0.45.1"
@@ -4959,6 +6343,26 @@ dependencies = [
"usvg",
]
+[[package]]
+name = "rfc6979"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2"
+dependencies = [
+ "hmac 0.12.1",
+ "subtle",
+]
+
+[[package]]
+name = "rfc6979"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b4a459cddafb3fe76b31fd8f1108007566c40301feb64dc7b54656eb7388172b"
+dependencies = [
+ "crypto-bigint 0.7.11",
+ "hmac 0.13.0",
+]
+
[[package]]
name = "rgb"
version = "0.8.53"
@@ -4988,6 +6392,48 @@ version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c20b6793b5c2fa6553b250154b78d6d0db37e72700ae35fad9387a46f487c97"
+[[package]]
+name = "rpassword"
+version = "7.5.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1fa2c5d9304b618df61ff17f3d3485c6e1854a3d94902a49abbb8d43dfbe0464"
+dependencies = [
+ "libc",
+ "rtoolbox",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "rsa"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "23e77fd77e0dea28b3011fd62d15445b7de7959333b0276d930e03be0f755699"
+dependencies = [
+ "const-oid 0.10.3",
+ "crypto-bigint 0.7.11",
+ "crypto-common 0.2.2",
+ "crypto-primes",
+ "digest 0.11.3",
+ "hmac 0.13.0",
+ "pkcs1",
+ "pkcs8 0.11.0",
+ "rand_core 0.10.1",
+ "sha2 0.11.2",
+ "signature 3.0.0",
+ "spki 0.8.1",
+ "zeroize",
+]
+
+[[package]]
+name = "rtoolbox"
+version = "0.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a1efe12a1469752d0e6ff5ebec0b6ef4924cc5c4c71046b0ec730040535819d"
+dependencies = [
+ "libc",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "rusqlite"
version = "0.37.0"
@@ -5012,7 +6458,7 @@ dependencies = [
"bytes",
"dashmap",
"gloo-timers 0.4.1",
- "jiff",
+ "jiff 1.0.3",
"log",
"serde",
"serde_bytes",
@@ -5043,6 +6489,7 @@ dependencies = [
"proc-macro2",
"quote",
"rust-embed-utils",
+ "shellexpand",
"syn 2.0.119",
"walkdir",
]
@@ -5054,6 +6501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "915e33dccbe7deb2b8a342dc4c517503fe85e0230ddbae40a4fb0220493dad9b"
dependencies = [
"globset",
+ "mime_guess",
"sha2 0.11.2",
"walkdir",
]
@@ -5079,6 +6527,15 @@ dependencies = [
"semver",
]
+[[package]]
+name = "rusticata-macros"
+version = "4.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632"
+dependencies = [
+ "nom 7.1.3",
+]
+
[[package]]
name = "rustix"
version = "0.38.44"
@@ -5219,6 +6676,16 @@ version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f"
+[[package]]
+name = "salsa20"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2f874456e72520ff1375a06c588eaf074b0f01f9e9e1aada45bd9b7954a6e42c"
+dependencies = [
+ "cfg-if",
+ "cipher 0.5.2",
+]
+
[[package]]
name = "same-file"
version = "1.0.6"
@@ -5237,6 +6704,18 @@ dependencies = [
"windows-sys 0.61.2",
]
+[[package]]
+name = "schemars"
+version = "0.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f"
+dependencies = [
+ "dyn-clone",
+ "ref-cast",
+ "serde",
+ "serde_json",
+]
+
[[package]]
name = "schemars"
version = "1.2.3"
@@ -5244,7 +6723,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab508826f74a77ca9d5aba6ff19b522583ee3eaf28a19384ff3d0e5835fadf6e"
dependencies = [
"dyn-clone",
- "indexmap",
+ "indexmap 2.14.2",
"ref-cast",
"schemars_derive",
"serde",
@@ -5298,12 +6777,52 @@ dependencies = [
"once_cell",
]
+[[package]]
+name = "scrypt"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d87af57419b594aa23fa95f09f0e06d80d84ba01c26148c43844cad6ff4485f0"
+dependencies = [
+ "cfg-if",
+ "pbkdf2 0.13.0",
+ "salsa20",
+ "sha2 0.11.2",
+]
+
[[package]]
name = "seahash"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b"
+[[package]]
+name = "sec1"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc"
+dependencies = [
+ "base16ct 0.2.0",
+ "der 0.7.10",
+ "generic-array",
+ "pkcs8 0.10.2",
+ "subtle",
+ "zeroize",
+]
+
+[[package]]
+name = "sec1"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d56d437c2f19203ce5f7122e507831de96f3d2d4d3be5af44a0b0a09d8a80e4d"
+dependencies = [
+ "base16ct 1.0.0",
+ "ctutils",
+ "der 0.8.3",
+ "hybrid-array",
+ "subtle",
+ "zeroize",
+]
+
[[package]]
name = "secret-service"
version = "5.2.0"
@@ -5378,6 +6897,16 @@ dependencies = [
"serde_core",
]
+[[package]]
+name = "serde_cbor_2"
+version = "0.13.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34aec2709de9078e077090abd848e967abab63c9fb3fdb5d4799ad359d8d482c"
+dependencies = [
+ "half",
+ "serde",
+]
+
[[package]]
name = "serde_core"
version = "1.0.229"
@@ -5425,7 +6954,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
dependencies = [
"foldhash 0.2.0",
- "indexmap",
+ "indexmap 2.14.2",
"itoa",
"memchr",
"serde",
@@ -5439,13 +6968,24 @@ version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e033097bf0d2b59a62b42c18ebbb797503839b26afdda2c4e1415cb6c813540"
dependencies = [
- "indexmap",
+ "indexmap 2.14.2",
"itoa",
"memchr",
"ryu",
"serde",
]
+[[package]]
+name = "serde_path_to_error"
+version = "0.1.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457"
+dependencies = [
+ "itoa",
+ "serde",
+ "serde_core",
+]
+
[[package]]
name = "serde_repr"
version = "0.1.21"
@@ -5487,6 +7027,50 @@ dependencies = [
"serde",
]
+[[package]]
+name = "serde_with"
+version = "3.25.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56cb1ca7c93ae63d6439b5250f6b6b040f7e121f32e5dd2f5d523dd4149b3204"
+dependencies = [
+ "base64 0.23.1",
+ "bs58",
+ "chrono",
+ "hex",
+ "indexmap 1.9.3",
+ "indexmap 2.14.2",
+ "jiff 0.2.46",
+ "jiff 1.0.3",
+ "schemars 0.9.0",
+ "schemars 1.2.3",
+ "serde_core",
+ "serde_json",
+ "serde_with_macros",
+ "time",
+]
+
+[[package]]
+name = "serde_with_macros"
+version = "3.25.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cff15a7c864bbec77d9586ca6822bc7c369bdf19e9243134a62b0b51ce26b31f"
+dependencies = [
+ "darling",
+ "proc-macro2",
+ "quote",
+ "syn 3.0.10",
+]
+
+[[package]]
+name = "serdect"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66cf8fedced2fcf12406bcb34223dffb92eaf34908ede12fed414c82b7f00b3e"
+dependencies = [
+ "base16ct 1.0.0",
+ "serde",
+]
+
[[package]]
name = "serial2"
version = "0.2.39"
@@ -5498,6 +7082,28 @@ dependencies = [
"windows-sys 0.61.2",
]
+[[package]]
+name = "sha1"
+version = "0.10.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a978451301f4db1d02937a4ab3ccce137717b81826e79b7d49ffe3244a13c3b8"
+dependencies = [
+ "cfg-if",
+ "cpufeatures 0.2.17",
+ "digest 0.10.7",
+]
+
+[[package]]
+name = "sha1"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214"
+dependencies = [
+ "cfg-if",
+ "cpufeatures 0.3.1",
+ "digest 0.11.3",
+]
+
[[package]]
name = "sha1_smol"
version = "1.0.1"
@@ -5526,6 +7132,17 @@ dependencies = [
"digest 0.11.3",
]
+[[package]]
+name = "shake"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "09057cb2149ad4cbd2da1e26b351f9a4c354219421229c69c3063e6f61947c4a"
+dependencies = [
+ "digest 0.11.3",
+ "keccak",
+ "sponge-cursor",
+]
+
[[package]]
name = "shared_library"
version = "0.1.9"
@@ -5542,6 +7159,15 @@ version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc6fe69c597f9c37bfeeeeeb33da3530379845f10be461a66d16d03eca2ded77"
+[[package]]
+name = "shellexpand"
+version = "3.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "32824fab5e16e6c4d86dc1ba84489390419a39f97699852b66480bb87d297ed8"
+dependencies = [
+ "dirs 6.0.0",
+]
+
[[package]]
name = "shlex"
version = "1.3.0"
@@ -5574,6 +7200,26 @@ dependencies = [
"libc",
]
+[[package]]
+name = "signature"
+version = "2.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de"
+dependencies = [
+ "digest 0.10.7",
+ "rand_core 0.6.4",
+]
+
+[[package]]
+name = "signature"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28d567dcbaf0049cb8ac2608a76cd95ff9e4412e1899d389ee400918ca7537f5"
+dependencies = [
+ "digest 0.11.3",
+ "rand_core 0.10.1",
+]
+
[[package]]
name = "simd-adler32"
version = "0.3.10"
@@ -5689,6 +7335,34 @@ dependencies = [
"bitflags 2.13.2",
]
+[[package]]
+name = "spki"
+version = "0.7.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d"
+dependencies = [
+ "base64ct",
+ "der 0.7.10",
+]
+
+[[package]]
+name = "spki"
+version = "0.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ef958a98b9d5da290cfc78946e9f3e61e1e62a18db0d92cac0b83cc161491a9"
+dependencies = [
+ "base64ct",
+ "der 0.8.3",
+ "digest 0.11.3",
+ "sha2 0.11.2",
+]
+
+[[package]]
+name = "sponge-cursor"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3a0219bd7d979d58245a4f41f695e1ac9f8befdffadd7f61f1bae9e39abc6620"
+
[[package]]
name = "stable_deref_trait"
version = "1.2.1"
@@ -5744,6 +7418,12 @@ dependencies = [
"float-cmp",
]
+[[package]]
+name = "strsim"
+version = "0.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
+
[[package]]
name = "strum"
version = "0.26.3"
@@ -5793,6 +7473,23 @@ version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292"
+[[package]]
+name = "superboring"
+version = "0.1.18"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "180c01a1d6c13ab0576bcd041ebfe0b66c455fa605de35909f3cee3f5bbf730f"
+dependencies = [
+ "aes-gcm 0.11.1",
+ "aes-keywrap",
+ "getrandom 0.4.3",
+ "hmac-sha1-compact",
+ "hmac-sha256",
+ "hmac-sha512",
+ "ml-dsa",
+ "rand 0.10.4",
+ "rsa",
+]
+
[[package]]
name = "sval"
version = "2.22.0"
@@ -5941,6 +7638,17 @@ dependencies = [
"futures-core",
]
+[[package]]
+name = "synstructure"
+version = "0.13.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
[[package]]
name = "synstructure"
version = "0.14.0"
@@ -6119,6 +7827,36 @@ dependencies = [
"zune-jpeg",
]
+[[package]]
+name = "time"
+version = "0.3.55"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134"
+dependencies = [
+ "deranged",
+ "num-conv",
+ "powerfmt",
+ "serde_core",
+ "time-core",
+ "time-macros",
+]
+
+[[package]]
+name = "time-core"
+version = "0.1.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109"
+
+[[package]]
+name = "time-macros"
+version = "0.2.32"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85"
+dependencies = [
+ "num-conv",
+ "time-core",
+]
+
[[package]]
name = "tiny-keccak"
version = "2.0.2"
@@ -6170,6 +7908,27 @@ version = "1.13.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee"
+[[package]]
+name = "tls_codec"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0de2e01245e2bb89d6f05801c564fa27624dbd7b1846859876c7dad82e90bf6b"
+dependencies = [
+ "tls_codec_derive",
+ "zeroize",
+]
+
+[[package]]
+name = "tls_codec_derive"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
[[package]]
name = "tokio"
version = "1.54.1"
@@ -6219,6 +7978,34 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "tokio-stream"
+version = "0.1.19"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a3d06f0b082ba57c26b79407372e57cf2a1e28124f78e9479fe80322cf53420b"
+dependencies = [
+ "futures-core",
+ "pin-project-lite",
+ "tokio",
+ "tokio-util",
+]
+
+[[package]]
+name = "tokio-tungstenite"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f72a05e828585856dacd553fba484c242c46e391fb0e58917c942ee9202915c"
+dependencies = [
+ "futures-util",
+ "log",
+ "rustls",
+ "rustls-native-certs",
+ "rustls-pki-types",
+ "tokio",
+ "tokio-rustls",
+ "tungstenite",
+]
+
[[package]]
name = "tokio-util"
version = "0.7.20"
@@ -6252,7 +8039,7 @@ version = "0.9.12+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863"
dependencies = [
- "indexmap",
+ "indexmap 2.14.2",
"serde_core",
"serde_spanned 1.1.3",
"toml_datetime 0.7.5+spec-1.1.0",
@@ -6267,7 +8054,7 @@ version = "1.2.3+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26b1f26e9485c1fa43ee89fe76e9f3fb9e2e52bb227f8594b4d687496b83d073"
dependencies = [
- "indexmap",
+ "indexmap 2.14.2",
"serde_core",
"serde_spanned 1.1.3",
"toml_datetime 1.1.3+spec-1.1.0",
@@ -6309,7 +8096,7 @@ version = "0.22.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a"
dependencies = [
- "indexmap",
+ "indexmap 2.14.2",
"serde",
"serde_spanned 0.6.9",
"toml_datetime 0.6.11",
@@ -6323,7 +8110,7 @@ version = "0.25.21+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88497dab46de5bf343ec66b05c251e48c6213f3e9170c70a70a823f7abe886a4"
dependencies = [
- "indexmap",
+ "indexmap 2.14.2",
"toml_datetime 1.1.3+spec-1.1.0",
"toml_parser",
"toml_writer",
@@ -6364,6 +8151,25 @@ dependencies = [
"tokio",
"tower-layer",
"tower-service",
+ "tracing",
+]
+
+[[package]]
+name = "tower-http"
+version = "0.6.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840"
+dependencies = [
+ "bitflags 2.13.2",
+ "bytes",
+ "futures-util",
+ "http",
+ "http-body",
+ "pin-project-lite",
+ "tower",
+ "tower-layer",
+ "tower-service",
+ "url",
]
[[package]]
@@ -6384,6 +8190,7 @@ version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
dependencies = [
+ "log",
"pin-project-lite",
"tracing-attributes",
"tracing-core",
@@ -6415,6 +8222,29 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
+[[package]]
+name = "ts-rs"
+version = "12.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "756050066659291d47a554a9f558125db17428b073c5ffce1daf5dcb0f7231d8"
+dependencies = [
+ "serde_json",
+ "thiserror 2.0.21",
+ "ts-rs-macros",
+]
+
+[[package]]
+name = "ts-rs-macros"
+version = "12.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38d90eea51bc7988ef9e674bf80a85ba6804739e535e9cab48e4bb34a8b652aa"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+ "termcolor",
+]
+
[[package]]
name = "ttf-parser"
version = "0.20.0"
@@ -6436,6 +8266,24 @@ dependencies = [
"core_maths",
]
+[[package]]
+name = "tungstenite"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6c01152af293afb9c7c2a57e4b559c5620b421f6d133261c60dd2d0cdb38e6b8"
+dependencies = [
+ "bytes",
+ "data-encoding",
+ "http",
+ "httparse",
+ "log",
+ "rand 0.9.5",
+ "rustls",
+ "rustls-pki-types",
+ "sha1 0.10.7",
+ "thiserror 2.0.21",
+]
+
[[package]]
name = "typeid"
version = "1.0.3"
@@ -6507,6 +8355,15 @@ version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f"
+[[package]]
+name = "unicode-normalization"
+version = "0.1.26"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "75cd3fb03d5288b3ba9a1ee103ac7e9cbb59f0b03d64f8ddfcc04dd42758a85d"
+dependencies = [
+ "tinyvec",
+]
+
[[package]]
name = "unicode-properties"
version = "0.1.5"
@@ -6537,6 +8394,26 @@ version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca718471876992059f251e33aafc334346ada08042b7661dd1fe313a9bced557"
+[[package]]
+name = "universal-hash"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea"
+dependencies = [
+ "crypto-common 0.1.7",
+ "subtle",
+]
+
+[[package]]
+name = "universal-hash"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f4987bdc12753382e0bec4a65c50738ffaabc998b9cdd1f952fb5f39b0048a96"
+dependencies = [
+ "crypto-common 0.2.2",
+ "ctutils",
+]
+
[[package]]
name = "untrusted"
version = "0.9.0"
@@ -6562,7 +8439,7 @@ version = "0.45.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80be9b06fbae3b8b303400ab20778c80bbaf338f563afe567cf3c9eea17b47ef"
dependencies = [
- "base64",
+ "base64 0.22.1",
"data-url",
"flate2",
"fontdb 0.23.0",
@@ -6756,6 +8633,15 @@ dependencies = [
"wit-bindgen",
]
+[[package]]
+name = "wasix"
+version = "0.13.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae86f02046da16a333a9129d31451423e1657737ecdafed4193838a5f54c5cfe"
+dependencies = [
+ "wasi",
+]
+
[[package]]
name = "wasm-bindgen"
version = "0.2.130"
@@ -6921,6 +8807,23 @@ dependencies = [
"pkg-config",
]
+[[package]]
+name = "web-push-native"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7628c93e39aeee4c0bca50ae333052b4f174c653e8fca1d0a8e34f9bc4879c0c"
+dependencies = [
+ "aes-gcm 0.10.3",
+ "base64ct",
+ "ece-native",
+ "hkdf 0.13.0",
+ "http",
+ "jwt-simple",
+ "p256 0.13.2",
+ "serde",
+ "sha2 0.11.2",
+]
+
[[package]]
name = "web-sys"
version = "0.3.107"
@@ -6941,6 +8844,111 @@ dependencies = [
"wasm-bindgen",
]
+[[package]]
+name = "webauthn-attestation-ca"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "29cf6bdd3a9dba27c82ccb27df26fe7d98d7593c0c45ddddf85166a117b50301"
+dependencies = [
+ "crypto-glue",
+ "serde",
+ "serde_with",
+ "tracing",
+ "uuid",
+]
+
+[[package]]
+name = "webauthn-authenticator-rs"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4bf162a8f7b5d6cd5448576d3468ae151428480a6f7d1a381ed84eaa3c8c5566"
+dependencies = [
+ "async-stream",
+ "async-trait",
+ "base64 0.21.7",
+ "bitflags 1.3.2",
+ "crypto-glue",
+ "futures",
+ "hex",
+ "nom 7.1.3",
+ "num-derive",
+ "num-traits",
+ "serde",
+ "serde_bytes",
+ "serde_cbor_2",
+ "serde_json",
+ "thiserror 1.0.69",
+ "tokio",
+ "tokio-stream",
+ "tracing",
+ "unicode-normalization",
+ "url",
+ "uuid",
+ "webauthn-rs-core",
+ "webauthn-rs-proto",
+]
+
+[[package]]
+name = "webauthn-rs"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "13a354e6b2ef6edc62835901fc18dd413b1370d624c8cd1aa328493bd809249b"
+dependencies = [
+ "serde",
+ "tracing",
+ "url",
+ "uuid",
+ "webauthn-rs-core",
+]
+
+[[package]]
+name = "webauthn-rs-core"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d13e555c106095051abd70415b88546a0d3757a7990e05b4659b4fba19e46ac"
+dependencies = [
+ "base64 0.21.7",
+ "crypto-glue",
+ "der-parser",
+ "hex",
+ "nom 7.1.3",
+ "rand 0.10.4",
+ "rand_chacha 0.10.0",
+ "serde",
+ "serde_cbor_2",
+ "serde_json",
+ "serde_with",
+ "thiserror 1.0.69",
+ "tracing",
+ "url",
+ "uuid",
+ "webauthn-attestation-ca",
+ "webauthn-rs-proto",
+ "x509-parser",
+]
+
+[[package]]
+name = "webauthn-rs-proto"
+version = "0.6.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5555714098cd069e3c8b31e58ac14250b9ae185e949c21416bccb55ce8ac8a5c"
+dependencies = [
+ "base64 0.21.7",
+ "serde",
+ "serde_json",
+ "serde_with",
+ "url",
+]
+
+[[package]]
+name = "webpki-roots"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7265c9301c16a8711c992c2d8da90ee77ef54b1ed51482d6dfeb00dc756b1297"
+dependencies = [
+ "rustls-pki-types",
+]
+
[[package]]
name = "weezl"
version = "0.1.12"
@@ -7537,6 +9545,18 @@ version = "0.57.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
+[[package]]
+name = "wnaf"
+version = "0.14.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "795ca18b3fdb5e62bf982199278341ddcf7ebf7d32e25e212ad05d496e95f6fa"
+dependencies = [
+ "ff 0.14.0",
+ "group 0.14.0",
+ "hybrid-array",
+ "primefield",
+]
+
[[package]]
name = "writeable"
version = "0.6.4"
@@ -7583,6 +9603,37 @@ version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea6fc2961e4ef194dcbfe56bb845534d0dc8098940c7e5c012a258bfec6701bd"
+[[package]]
+name = "x509-cert"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e9f58ad685a2945c7c063f5d69b5c27105d75bb85c740380d8fc64e79a098417"
+dependencies = [
+ "const-oid 0.10.3",
+ "der 0.8.3",
+ "sha1 0.11.0",
+ "signature 3.0.0",
+ "spki 0.8.1",
+ "tls_codec",
+]
+
+[[package]]
+name = "x509-parser"
+version = "0.18.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d43b0f71ce057da06bc0851b23ee24f3f86190b07203dd8f567d0b706a185202"
+dependencies = [
+ "asn1-rs",
+ "data-encoding",
+ "der-parser",
+ "lazy_static",
+ "nom 7.1.3",
+ "oid-registry",
+ "rusticata-macros",
+ "thiserror 2.0.21",
+ "time",
+]
+
[[package]]
name = "xattr"
version = "0.2.3"
@@ -7693,7 +9744,7 @@ dependencies = [
"proc-macro2",
"quote",
"syn 3.0.10",
- "synstructure",
+ "synstructure 0.14.0",
]
[[package]]
@@ -7822,7 +9873,7 @@ version = "0.12.15-zed"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac2d05756ff48539950c3282ad7acf3817ad3f08797c205ad1c34a2ce03b9970"
dependencies = [
- "base64",
+ "base64 0.22.1",
"bytes",
"encoding_rs",
"futures-core",
@@ -7946,7 +9997,7 @@ dependencies = [
"proc-macro2",
"quote",
"syn 3.0.10",
- "synstructure",
+ "synstructure 0.14.0",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index e0a6411..f893e39 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -10,11 +10,13 @@ members = [
"crates/redshell-plugin",
"crates/redshell-ui",
"crates/redshell-app",
+ "crates/redshell-protocol",
+ "crates/redshell-server",
]
default-members = ["crates/redshell-app"]
[workspace.package]
-version = "0.0.2"
+version = "0.0.3"
edition = "2024"
license = "MIT"
repository = "https://github.com/redstone-md/RedShell"
@@ -29,6 +31,7 @@ redshell-remote = { path = "crates/redshell-remote" }
redshell-agents = { path = "crates/redshell-agents" }
redshell-plugin = { path = "crates/redshell-plugin" }
redshell-ui = { path = "crates/redshell-ui" }
+redshell-protocol = { path = "crates/redshell-protocol" }
gpui = "0.2.2"
alacritty_terminal = "0.26.0"
diff --git a/README.md b/README.md
index 612f3a0..499b675 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,12 @@ after a restart and keeps your SSH hosts, tmux sessions and AI coding agents a k
> сохранением комментариев. Терминал спрашивает перед закрытием, только когда можно потерять
> работу (Enter и Esc в диалоге *отменяют*), сам подхватывает интеграцию с bash, zsh, fish и
> PowerShell и раз в день проверяет, не вышла ли новая версия. Есть плагины (Rust, `plugin.toml`
-> или хук-процесс на любом языке) и темы shadcn/tweakcn (CSS вставляется как есть).
+> или хук-процесс на любом языке) и темы shadcn/tweakcn (CSS вставляется как есть). SSH-хосты
+> редактируются в диалоге, пароли спрашиваются в окне RedShell и хранятся в системной связке
+> ключей, есть проброс портов и файловый браузер по SFTP. `redshell-server` держит оболочки и
+> агентов на всегда включённой машине, например на Raspberry Pi: десктоп открывает их как вкладки,
+> а с телефона они доступны через RedShell Remote, веб-приложение с push-уведомлениями и ответами
+> на запросы разрешений Claude Code.
## Why RedShell
@@ -85,11 +90,13 @@ into a remote tmux or screen session. The session manager lists, attaches, creat
sessions on this computer, on any SSH host and, on Windows, through a native tmux build or WSL. It
lists a host in one connection and shows what it found last time while it asks again, and the
sidebar's tmux section also lists the sessions on the SSH hosts you have tabs open on, checking each
-about once a minute. RedShell asks for passwords, key passphrases and new host keys in its
-own dialog, in the window of the tab that connects, and can remember them in the system keychain
-(Windows Credential Manager, the macOS keychain or the Secret Service on Linux), where the host
-editor also saves, changes or removes a host's password; this needs OpenSSH 8.4 or newer, and
-older clients keep prompting in the terminal (see `ssh.askpass` in [docs/CONFIG.md](docs/CONFIG.md)).
+about once a minute.
+
+RedShell asks for passwords, key passphrases and new host keys in its own dialog, in the window of
+the tab that connects, and can remember passwords and passphrases in the system keychain (Windows
+Credential Manager, the macOS keychain or the Secret Service on Linux), where the host editor also
+saves, changes or removes a host's password. This needs OpenSSH 8.4 or newer; older clients keep
+prompting in the terminal (see [`ssh.askpass`](docs/CONFIG.md#passwords-and-passphrases)).
*Install Key on Server…* in a host's menu or editor does what `ssh-copy-id` does, which Windows
lacks: it adds your public key to the host's `authorized_keys`, creating a key first if you have
none.
@@ -129,6 +136,30 @@ agent repaints its screen, and mouse drags reach agents that track the mouse the
agent runs on an SSH host, *Paste Image* uploads a screenshot from your clipboard and types its
path into the prompt, [as described below](#pasting-images-into-remote-agents).
+### Sessions that keep running elsewhere
+
+`redshell-server` keeps shells and agents running on an always-on machine such as a Raspberry Pi,
+and RedShell opens them as ordinary tabs once you add the server under *Settings → Servers* and
+sign in, with a password or by approving a short code from a browser. The sidebar lists each
+server's sessions with what their agents are doing, an agent's permission request shows above its
+terminal with *Allow*, *Deny* and *Answer in terminal*, and closing a tab only detaches, so the
+session is still there from your phone or tomorrow morning.
+
+On a phone you reach the same sessions through RedShell Remote, the web app the server serves,
+which you add to the home screen. Its inbox puts the agents that wait for you first, a Claude Code
+permission request opens as a sheet with the command or the diff, and whichever device answers
+first wins. The terminal has a key bar and a composer made for a thumb, push notifications tell
+you when an agent needs approval, waits for input or finishes, and you sign in with a passkey
+(Face ID, Touch ID, Windows Hello, a security key) or a password. The server is one small binary
+that idles at about 10 MB of memory, and [REMOTE.md](docs/REMOTE.md) explains installing it and
+reaching it through Tailscale or a Cloudflare tunnel.
+
+
+
+
+
+
+
### Asks before you lose work
Closing a tab asks while a program is running in it, and closing a window or quitting asks when
@@ -203,6 +234,20 @@ RedShell checks GitHub for a newer release once a day and tells you when there i
download and install it yourself. Turn this off with `updates.check = false` (see
[docs/CONFIG.md](docs/CONFIG.md#updates)).
+**RedShell Server.** Releases also carry `redshell-server` for Linux on x86_64 and on aarch64
+(64-bit Raspberry Pi OS), each as a `.deb` and a `.tar.gz`, and for macOS as a `.tar.gz`. On a
+Raspberry Pi, install the package and start the server as your own user, so that sessions see your
+files, SSH keys and agent sign-ins, then open the one-time setup link it logs on the first start:
+
+```sh
+sudo apt install ./redshell-server--linux-aarch64.deb
+sudo systemctl enable --now redshell-server@$USER
+sudo journalctl -u redshell-server@$USER
+```
+
+[REMOTE.md](docs/REMOTE.md) covers the other ways to install it and how to reach it from your
+phone over HTTPS, which passkeys and push notifications need.
+
## Build
```sh
@@ -338,11 +383,17 @@ crates/
redshell-theme shadcn token model, tweakcn CSS importer (oklch/hsl/hex), registry
redshell-terminal PTY + VT engine, input/mouse encoding, render snapshots, OSC 7/9;9/133
redshell-history SQLite + FTS5 recorder, search, restore, asciicast export
- redshell-remote SSH profiles, ~/.ssh/config, tmux/screen over local/SSH/WSL
+ redshell-remote SSH hosts, askpass, tunnels, SFTP, tmux/screen over local/SSH/WSL
redshell-agents AI agent detection and launch profiles
redshell-plugin Plugin trait, plugin.toml manifests, JSON-lines hook processes
redshell-ui shadcn-style GPUI components (Button, Input, Modal, Toast, …) and Lucide icons
- redshell-app the application (workspace, terminal view, palette, settings)
+ redshell-app the application (workspace, terminal view, palette, settings, server tabs)
+ redshell-protocol wire types shared by the server, the desktop and RedShell Remote
+ redshell-server headless server: sessions, accounts, passkeys, push, agent hooks, hosts API
+web/ RedShell Remote, the web app the server serves (React, TypeScript)
+shell-integration/ the scripts that report a shell's folder and prompts
+packaging/ the server's systemd unit
+examples/plugins/ an example plugin
```
[Architecture](docs/ARCHITECTURE.md) explains how the crates fit together. Screenshots are taken
diff --git a/assets/icon/redshell-badge.svg b/assets/icon/redshell-badge.svg
new file mode 100644
index 0000000..74e85f6
--- /dev/null
+++ b/assets/icon/redshell-badge.svg
@@ -0,0 +1,7 @@
+
diff --git a/assets/icon/redshell-maskable.svg b/assets/icon/redshell-maskable.svg
new file mode 100644
index 0000000..6c5aff3
--- /dev/null
+++ b/assets/icon/redshell-maskable.svg
@@ -0,0 +1,19 @@
+
diff --git a/crates/redshell-app/Cargo.toml b/crates/redshell-app/Cargo.toml
index ef2eca2..f82e8b8 100644
--- a/crates/redshell-app/Cargo.toml
+++ b/crates/redshell-app/Cargo.toml
@@ -20,6 +20,7 @@ redshell-remote.workspace = true
redshell-agents.workspace = true
redshell-plugin.workspace = true
redshell-ui.workspace = true
+redshell-protocol.workspace = true
gpui.workspace = true
anyhow.workspace = true
log.workspace = true
@@ -40,7 +41,12 @@ shlex = "1.3"
# The HTTP client gpui already builds (through gpui_http_client), with features it already
# enables, so the update check compiles nothing new. Keep the version in step with gpui's.
reqwest = { package = "zed-reqwest", version = "0.12.15-zed", default-features = false, features = ["rustls-tls-native-roots"] }
-tokio = { version = "1", default-features = false, features = ["rt"] }
+tokio = { version = "1", default-features = false, features = ["rt", "net", "time", "macros"] }
+# The WebSocket to RedShell servers (src/remote/), over the rustls with ring that
+# the HTTP client already builds: no OpenSSL.
+tokio-tungstenite = { version = "0.29", default-features = false, features = ["connect", "rustls-tls-native-roots"] }
+rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
+rustls-native-certs = "0.8"
# The OS keychain that keeps SSH passwords and passphrases (src/secrets.rs), with one
# store per platform below.
keyring-core = "1"
@@ -71,6 +77,9 @@ embed-resource = "3"
[dev-dependencies]
tempfile.workspace = true
+# The client tests run a real server in-process.
+redshell-server = { path = "../redshell-server" }
+tokio = { version = "1", features = ["rt-multi-thread", "macros", "net", "io-util", "time"] }
# Installers built by cargo-packager (pinned in .github/workflows/release.yml): NSIS setup
# on Windows, .deb and AppImage on Linux, a .dmg holding RedShell.app on macOS. The version
diff --git a/crates/redshell-app/src/closing.rs b/crates/redshell-app/src/closing.rs
index 611ef88..d8edec3 100644
--- a/crates/redshell-app/src/closing.rs
+++ b/crates/redshell-app/src/closing.rs
@@ -15,7 +15,8 @@ pub struct Work {
pub tabs: usize,
/// Live panes whose session ends with them.
pub sessions: usize,
- /// Live multiplexer panes: closing only detaches from their session.
+ /// Live multiplexer and server panes: closing only detaches from their
+ /// session.
pub detached: usize,
/// Panes in which a program other than an idle shell runs.
pub programs: usize,
@@ -36,7 +37,7 @@ impl Work {
/// What closing one tab (or pane) made of `views` would end.
pub fn of(views: &[Entity], cx: &App) -> Self {
let live: Vec<_> = views.iter().map(|v| v.read(cx)).filter(|v| v.is_alive()).collect();
- let detached = live.iter().filter(|v| v.kind() == LaunchKind::Multiplexer).count();
+ let detached = live.iter().filter(|v| matches!(v.kind(), LaunchKind::Multiplexer | LaunchKind::Remote)).count();
Self {
tabs: usize::from(!live.is_empty()),
sessions: live.len() - detached,
@@ -69,8 +70,8 @@ impl Work {
}
match self.detached {
0 => {}
- 1 => parts.push("A tmux or screen session only detaches and keeps running.".to_owned()),
- n => parts.push(format!("{n} tmux or screen sessions only detach and keep running.")),
+ 1 => parts.push("A tmux, screen or server session only detaches and keeps running.".to_owned()),
+ n => parts.push(format!("{n} tmux, screen or server sessions only detach and keep running.")),
}
parts.extend(kept.sentence().map(str::to_owned));
parts.join(" ")
@@ -139,9 +140,12 @@ mod tests {
);
assert_eq!(
(BUSY + TMUX).summary(Kept::Tabs),
- "A program is running and will be stopped. 2 sessions will end. A tmux or screen session only \
- detaches and keeps running. Your tabs come back next time, with their output."
+ "A program is running and will be stopped. 2 sessions will end. A tmux, screen or server session \
+ only detaches and keeps running. Your tabs come back next time, with their output."
+ );
+ assert_eq!(
+ (TMUX + TMUX).summary(Kept::Nothing),
+ "2 tmux, screen or server sessions only detach and keep running."
);
- assert_eq!((TMUX + TMUX).summary(Kept::Nothing), "2 tmux or screen sessions only detach and keep running.");
}
}
diff --git a/crates/redshell-app/src/confirm.rs b/crates/redshell-app/src/confirm.rs
index 4ba11dd..fe1acb5 100644
--- a/crates/redshell-app/src/confirm.rs
+++ b/crates/redshell-app/src/confirm.rs
@@ -49,6 +49,13 @@ pub enum ConfirmAction {
browser: gpui::Entity,
paths: Vec,
},
+ /// Kill a session on a RedShell server.
+ KillServerSession(redshell_app::remote::SessionRef),
+ /// Replace server `server`'s host of that name with `host`.
+ ReplaceServerHost {
+ server: String,
+ host: Box,
+ },
/// Delete a recorded session; `reopen` is the list to return to.
DeleteSession {
session: redshell_core::SessionId,
diff --git a/crates/redshell-app/src/forward_list.rs b/crates/redshell-app/src/forward_list.rs
index f25fb40..7224a33 100644
--- a/crates/redshell-app/src/forward_list.rs
+++ b/crates/redshell-app/src/forward_list.rs
@@ -8,7 +8,7 @@
use gpui::prelude::*;
use gpui::{AnyElement, App, Context, Entity, FocusHandle, SharedString, Subscription, Window, div, px};
-use redshell_core::settings::ForwardKind;
+use redshell_core::settings::{ForwardKind, ssh};
use redshell_ui::{
Button, ButtonSize, ButtonVariant, IconName, InputEvent, Segmented, Switch, TextInput, ThemeExt, alpha, space,
};
@@ -187,8 +187,9 @@ impl ForwardList {
fn render_row(&self, index: usize, form: &ForwardForm, cx: &mut Context) -> AnyElement {
let t = cx.theme();
let ui = *t.ui();
- let (forward, problems) = form.parse();
- let (title, detail) = match (&forward.label, problems.is_empty()) {
+ let forward = form.parse();
+ let complete = ssh::forward_errors(std::slice::from_ref(&forward)).is_empty();
+ let (title, detail) = match (&forward.label, complete) {
(_, false) => ("Incomplete".to_owned(), None),
(Some(label), true) => (label.clone(), Some(forward.route())),
(None, true) => (forward.route(), None),
diff --git a/crates/redshell-app/src/host_upload.rs b/crates/redshell-app/src/host_upload.rs
new file mode 100644
index 0000000..7b4da86
--- /dev/null
+++ b/crates/redshell-app/src/host_upload.rs
@@ -0,0 +1,102 @@
+//! Sending a saved SSH host to a RedShell server, so sessions there can
+//! reach it too: the host menu's "Send to Server" lists the servers this
+//! computer is signed in to.
+//!
+//! What is sent is the host as this computer connects to it (a host saved
+//! over `~/.ssh/config` has the file's entry under it), minus its identity
+//! file: that path, and the key in it, are this computer's, and the server
+//! connects with its own keys. A host of that name on the server is only
+//! replaced once the user says so.
+//!
+//! This is a child module of `workspace` so it can confirm and show toasts.
+
+use redshell_app::remote::{ApiFailure, runtime};
+use redshell_core::settings::SshHost;
+use redshell_core::settings::ssh_wire::to_wire;
+use redshell_protocol::{self as wire, ErrorCode, HostOrigin};
+use redshell_ui::MenuEntry;
+
+use super::*;
+use crate::servers::{Server, Servers};
+use crate::ssh_hosts::HostBook;
+
+impl Workspace {
+ /// The "Send to Server" submenu of host `name`, while signed in to a
+ /// server.
+ pub(super) fn send_host_menu(&self, name: &str, cx: &mut Context) -> Option {
+ let ws = cx.entity().downgrade();
+ let servers: Vec = Servers::all(cx)
+ .iter()
+ .filter(|s| s.signed_in())
+ .map(|server| {
+ let (name, key) = (name.to_owned(), server.key.clone());
+ let send = tab_bar::on_workspace(&ws, move |this, window, cx| this.send_host(&name, &key, window, cx));
+ MenuEntry::new(server.name.clone(), send)
+ })
+ .collect();
+ (!servers.is_empty()).then(|| MenuEntry::submenu("Send to Server", servers).icon(IconName::Cloud))
+ }
+
+ /// Sends host `name` to server `key`, asking before it replaces one.
+ fn send_host(&mut self, name: &str, key: &str, window: &mut Window, cx: &mut Context) {
+ let Some(host) = sendable(&HostBook::load(cx), name) else { return };
+ let Some(api) = Servers::get(key, cx).and_then(Server::api) else { return };
+ let sending = runtime::spawn(async move { api.create_host(&host).await.map_err(|err| (err, host)) });
+ let key = key.to_owned();
+ cx.spawn_in(window, async move |this, cx| {
+ let sent = sending.await;
+ this.update_in(cx, |this, window, cx| match sent {
+ Ok(host) => this.host_sent(&host.name, &key, cx),
+ Err((ApiFailure::Refused(error), host)) if error.code == ErrorCode::Conflict => {
+ let server = Servers::get(&key, cx).map(|s| s.name.clone()).unwrap_or_default();
+ this.confirm(
+ format!("Replace “{}” on {server}?", host.name),
+ format!("{server} has a host of that name already. It gets this computer's settings instead."),
+ "Replace",
+ ConfirmAction::ReplaceServerHost { server: key.clone(), host: Box::new(host) },
+ None,
+ window,
+ cx,
+ );
+ }
+ Err((err, _)) => this.host_not_sent(err, cx),
+ })
+ .ok();
+ })
+ .detach();
+ }
+
+ /// Replaces the host of that name on server `key` with `host`.
+ pub(super) fn replace_server_host(&mut self, key: String, host: wire::SshHost, cx: &mut Context) {
+ let Some(api) = Servers::get(&key, cx).and_then(Server::api) else { return };
+ let sending = runtime::spawn(async move { api.replace_host(&host.name, &host).await });
+ cx.spawn(async move |this, cx| {
+ let sent = sending.await;
+ this.update(cx, |this, cx| match sent {
+ Ok(host) => this.host_sent(&host.name, &key, cx),
+ Err(err) => this.host_not_sent(err, cx),
+ })
+ .ok();
+ })
+ .detach();
+ }
+
+ fn host_sent(&mut self, name: &str, key: &str, cx: &mut Context) {
+ let server = Servers::get(key, cx).map(|s| s.name.clone()).unwrap_or_default();
+ let detail = "It connects with its own keys; nothing secret was sent.".to_owned();
+ self.toasts.push(ToastKind::Success, format!("Sent “{name}” to {server}"), Some(detail));
+ cx.notify();
+ }
+
+ fn host_not_sent(&mut self, err: ApiFailure, cx: &mut Context) {
+ self.toasts.push(ToastKind::Error, "Could not send the host", Some(err.to_string()));
+ cx.notify();
+ }
+}
+
+/// Host `name` as it is sent: as this computer connects to it, without
+/// its identity file.
+fn sendable(book: &HostBook, name: &str) -> Option {
+ let host = SshHost { identity_file: None, ..book.resolved(name)? };
+ Some(to_wire(&host, HostOrigin::Redshell))
+}
diff --git a/crates/redshell-app/src/lib.rs b/crates/redshell-app/src/lib.rs
index a14fb4b..4675de9 100644
--- a/crates/redshell-app/src/lib.rs
+++ b/crates/redshell-app/src/lib.rs
@@ -1,7 +1,8 @@
//! The parts of RedShell that run without a window: the SSH askpass broker,
-//! how its questions are routed to windows, and the keychain (reachable
-//! from integration tests).
+//! how its questions are routed to windows, the keychain, and the clients
+//! of RedShell servers (reachable from integration tests).
pub mod askpass;
pub mod prompt_queue;
+pub mod remote;
pub mod secrets;
diff --git a/crates/redshell-app/src/main.rs b/crates/redshell-app/src/main.rs
index 762ad17..cd1ad1f 100644
--- a/crates/redshell-app/src/main.rs
+++ b/crates/redshell-app/src/main.rs
@@ -19,6 +19,8 @@ mod plugins_view;
mod prompt_dialog;
mod restore;
mod search;
+mod server_dialogs;
+mod servers;
mod settings_view;
mod sftp_view;
mod ssh_hosts;
@@ -33,6 +35,7 @@ use gpui::{App, AppContext as _, Application, Window, WindowOptions};
use redshell_core::AppEvent;
use redshell_ui::TitleBar;
+use crate::servers::Servers;
use crate::state::{AppState, after_settings_change, window_background_appearance};
use crate::tunnels::Tunnels;
use crate::workspace::Workspace;
@@ -75,6 +78,8 @@ fn main() {
Workspace::answer_askpass_requests(cx);
Tunnels::init(cx);
Workspace::follow_tunnels(cx);
+ Servers::init(cx);
+ Workspace::follow_servers(cx);
after_settings_change(cx);
cx.global_mut::().emit(AppEvent::Started { version: env!("CARGO_PKG_VERSION").into() });
diff --git a/crates/redshell-app/src/overlays.rs b/crates/redshell-app/src/overlays.rs
index 433fca5..39653bf 100644
--- a/crates/redshell-app/src/overlays.rs
+++ b/crates/redshell-app/src/overlays.rs
@@ -211,11 +211,40 @@ impl Workspace {
/// Asks for a new title of the active tab (empty: automatic again).
pub(super) fn open_rename(&mut self, window: &mut Window, cx: &mut Context) {
+ // A server session's tab is named by naming the session, for every device.
+ let remote = self.active_view().and_then(|v| redshell_app::remote::SessionRef::parse(&v.read(cx).profile.id));
+ if let Some(target) = remote {
+ return self.open_rename_remote(target, window, cx);
+ }
let Some(tab) = self.tabs.get(self.active) else { return };
- let tab_id = tab.id;
- let current = tab.title(cx);
+ let (tab_id, current) = (tab.id, tab.title(cx));
+ self.ask_name(Renaming::Tab(tab_id), current, "Tab title (empty = automatic)", window, cx);
+ }
+
+ /// Asks for a new name of server session `target`.
+ pub(super) fn open_rename_remote(
+ &mut self,
+ target: redshell_app::remote::SessionRef,
+ window: &mut Window,
+ cx: &mut Context,
+ ) {
+ let server = crate::servers::Servers::get(&target.server, cx);
+ let session = server.and_then(|s| s.session(&target.session));
+ let current = session.map(crate::servers::Server::session_title).unwrap_or_default();
+ self.ask_name(Renaming::Session(target), current, "Session name (empty = its title)", window, cx);
+ }
+
+ /// The rename dialog for `renaming`, starting from `current`.
+ fn ask_name(
+ &mut self,
+ renaming: Renaming,
+ current: String,
+ placeholder: &'static str,
+ window: &mut Window,
+ cx: &mut Context,
+ ) {
let input = cx.new(|cx| {
- let mut i = TextInput::new(cx).placeholder("Tab title (empty = automatic)");
+ let mut i = TextInput::new(cx).placeholder(placeholder);
i.set_value(current, cx);
i.select_all(cx);
i
@@ -223,16 +252,20 @@ impl Workspace {
input.read(cx).focus(window);
let sub = cx.subscribe_in(&input, window, |this, input, ev: &InputEvent, window, cx| match ev {
InputEvent::Submit => {
- let title = input.read(cx).value().trim().to_owned();
- if let Some(Overlay::Rename(_, tab_id)) = this.overlay {
- this.rename_tab(tab_id, &title, window, cx);
+ let name = input.read(cx).value().trim().to_owned();
+ match this.overlay.as_ref() {
+ Some(Overlay::Rename(_, Renaming::Tab(tab_id))) => this.rename_tab(*tab_id, &name, window, cx),
+ Some(Overlay::Rename(_, Renaming::Session(target))) => {
+ this.rename_remote(target.clone(), &name, cx)
+ }
+ _ => {}
}
this.close_overlay(window, cx);
}
InputEvent::Cancel => this.close_overlay(window, cx),
_ => {}
});
- self.set_overlay(Overlay::Rename(input, tab_id), Some(sub), window, cx);
+ self.set_overlay(Overlay::Rename(input, renaming), Some(sub), window, cx);
}
/// Gives tab `tab_id` the name `title`, or its automatic title back when
@@ -260,6 +293,7 @@ impl Workspace {
}
SettingsEvent::ImportTheme => this.import_theme_from_clipboard(cx),
SettingsEvent::RevealConfig => this.run_command("settings.reveal", window, cx),
+ SettingsEvent::Notice(title, detail) => this.toasts.push(ToastKind::Info, title.clone(), detail.clone()),
});
self.set_overlay(Overlay::Settings(view), Some(sub), window, cx);
}
diff --git a/crates/redshell-app/src/picker.rs b/crates/redshell-app/src/picker.rs
index dcbe6f2..3716d5d 100644
--- a/crates/redshell-app/src/picker.rs
+++ b/crates/redshell-app/src/picker.rs
@@ -32,6 +32,8 @@ pub enum PickerKind {
FileHosts,
/// Every port forward of every host; Enter starts or stops its tunnel.
Tunnels,
+ /// What a RedShell server can start a session from.
+ ServerProfiles,
}
#[derive(Debug, Clone, Default)]
diff --git a/crates/redshell-app/src/remote/api.rs b/crates/redshell-app/src/remote/api.rs
new file mode 100644
index 0000000..ac7b4ce
--- /dev/null
+++ b/crates/redshell-app/src/remote/api.rs
@@ -0,0 +1,200 @@
+//! The server's REST API (`/api/*`, see `docs/REMOTE.md`), with the wire
+//! types of `redshell-protocol`. Every call needs the tokio runtime: run
+//! it through [`super::runtime::spawn`].
+
+use std::fmt;
+use std::time::Duration;
+
+use redshell_protocol::{
+ ApiError, ApprovalAnswer, CreateSessionRequest, ErrorCode, PairRequest, PairStarted, PairStatus, Profile,
+ RenameSessionRequest, ServerInfo, SessionInfo, SignInRequest, SignInResponse, SshHost,
+};
+use reqwest::{Method, Url};
+use serde::Serialize;
+use serde::de::DeserializeOwned;
+use zeroize::Zeroizing;
+
+use super::ServerUrl;
+
+const REQUEST_TIMEOUT: Duration = Duration::from_secs(20);
+
+/// Why a call failed.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub enum ApiFailure {
+ /// The server answered with an error.
+ Refused(ApiError),
+ /// No answer: the network, the name, TLS, or a timeout.
+ Unreachable(String),
+ /// An answer this client can't read.
+ Unexpected(String),
+}
+
+impl ApiFailure {
+ /// The server's error code, when it answered with one.
+ pub fn code(&self) -> Option {
+ match self {
+ Self::Refused(error) => Some(error.code),
+ _ => None,
+ }
+ }
+}
+
+impl fmt::Display for ApiFailure {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ match self {
+ Self::Refused(error) => f.write_str(&error.message),
+ Self::Unreachable(why) => write!(f, "Can't reach the server: {why}"),
+ Self::Unexpected(why) => write!(f, "Unexpected answer from the server: {why}"),
+ }
+ }
+}
+
+impl std::error::Error for ApiFailure {}
+
+/// `err` and its causes, as one line.
+pub(crate) fn describe(err: &(dyn std::error::Error + 'static)) -> String {
+ let mut text = err.to_string();
+ let mut source = err.source();
+ while let Some(cause) = source {
+ let line = cause.to_string();
+ if !text.contains(&line) {
+ text = format!("{text}: {line}");
+ }
+ source = cause.source();
+ }
+ text
+}
+
+/// A REST client for one server, signed in with a device token or not.
+#[derive(Clone)]
+pub struct Api {
+ url: ServerUrl,
+ http: reqwest::Client,
+ token: Option>,
+}
+
+impl Api {
+ pub fn new(url: ServerUrl, token: Option>) -> Self {
+ let http = reqwest::Client::builder()
+ .user_agent(concat!("RedShell/", env!("CARGO_PKG_VERSION")))
+ .timeout(REQUEST_TIMEOUT)
+ .build()
+ .unwrap_or_default();
+ Self { url, http, token }
+ }
+
+ pub fn url(&self) -> &ServerUrl {
+ &self.url
+ }
+
+ /// What the server is and whether it needs setting up; open to all.
+ pub async fn info(&self) -> Result {
+ self.call(Method::GET, &["auth", "info"], None::<&()>).await
+ }
+
+ /// Signs in as this device with a name and password; the response
+ /// carries the device token.
+ pub async fn sign_in(&self, request: &SignInRequest) -> Result {
+ self.call(Method::POST, &["auth", "sign-in"], Some(request)).await
+ }
+
+ /// Revokes this device's token on the server.
+ pub async fn sign_out(&self) -> Result<(), ApiFailure> {
+ self.call_empty(Method::POST, &["auth", "sign-out"], None::<&()>).await
+ }
+
+ /// Asks for a pairing request: a code to type in a signed-in browser.
+ pub async fn start_pairing(&self, request: &PairRequest) -> Result {
+ self.call(Method::POST, &["pair"], Some(request)).await
+ }
+
+ /// Where pairing request `started` is; approved once, with the token.
+ pub async fn poll_pairing(&self, started: &PairStarted) -> Result {
+ let request = self.http.get(self.url.api(&["pair", &started.id])).bearer_auth(&started.poll_secret);
+ read(request.send().await).await
+ }
+
+ pub async fn profiles(&self) -> Result, ApiFailure> {
+ self.call(Method::GET, &["profiles"], None::<&()>).await
+ }
+
+ pub async fn sessions(&self) -> Result, ApiFailure> {
+ self.call(Method::GET, &["sessions"], None::<&()>).await
+ }
+
+ pub async fn create_session(&self, request: &CreateSessionRequest) -> Result {
+ self.call(Method::POST, &["sessions"], Some(request)).await
+ }
+
+ /// Names session `id`, or gives it its title back with `None`.
+ pub async fn rename_session(&self, id: &str, name: Option) -> Result {
+ self.call(Method::PATCH, &["sessions", id], Some(&RenameSessionRequest { name })).await
+ }
+
+ /// Kills session `id`.
+ pub async fn kill_session(&self, id: &str) -> Result<(), ApiFailure> {
+ self.call_empty(Method::DELETE, &["sessions", id], None::<&()>).await
+ }
+
+ pub async fn answer_approval(&self, id: &str, answer: &ApprovalAnswer) -> Result<(), ApiFailure> {
+ self.call_empty(Method::POST, &["approvals", id], Some(answer)).await
+ }
+
+ /// Saves a new SSH host; `conflict` when one has its name.
+ pub async fn create_host(&self, host: &SshHost) -> Result {
+ self.call(Method::POST, &["hosts"], Some(host)).await
+ }
+
+ /// Saves `host` over the server's host `name`.
+ pub async fn replace_host(&self, name: &str, host: &SshHost) -> Result {
+ self.call(Method::PUT, &["hosts", name], Some(host)).await
+ }
+
+ async fn call(
+ &self,
+ method: Method,
+ path: &[&str],
+ body: Option<&impl Serialize>,
+ ) -> Result {
+ read(self.request(method, self.url.api(path), body)?.send().await).await
+ }
+
+ /// A call answered with `{}`.
+ async fn call_empty(&self, method: Method, path: &[&str], body: Option<&impl Serialize>) -> Result<(), ApiFailure> {
+ self.call::(method, path, body).await.map(drop)
+ }
+
+ fn request(
+ &self,
+ method: Method,
+ url: Url,
+ body: Option<&impl Serialize>,
+ ) -> Result {
+ let mut request = self
+ .http
+ .request(method, url)
+ .header(redshell_protocol::CHANGE_HEADER, redshell_protocol::CHANGE_HEADER_VALUE);
+ if let Some(token) = &self.token {
+ request = request.bearer_auth(token.as_str());
+ }
+ if let Some(body) = body {
+ let json = serde_json::to_vec(body).map_err(|err| ApiFailure::Unexpected(err.to_string()))?;
+ request = request.header(reqwest::header::CONTENT_TYPE, "application/json").body(json);
+ }
+ Ok(request)
+ }
+}
+
+/// The JSON body of a response, or the error it reports.
+async fn read(sent: reqwest::Result) -> Result {
+ let response = sent.map_err(|err| ApiFailure::Unreachable(describe(&err)))?;
+ let status = response.status();
+ let body = response.bytes().await.map_err(|err| ApiFailure::Unreachable(describe(&err)))?;
+ if status.is_success() {
+ return serde_json::from_slice(&body).map_err(|err| ApiFailure::Unexpected(err.to_string()));
+ }
+ match serde_json::from_slice::(&body) {
+ Ok(error) => Err(ApiFailure::Refused(error)),
+ Err(_) => Err(ApiFailure::Unexpected(format!("HTTP {status}"))),
+ }
+}
diff --git a/crates/redshell-app/src/remote/client.rs b/crates/redshell-app/src/remote/client.rs
new file mode 100644
index 0000000..77c70a1
--- /dev/null
+++ b/crates/redshell-app/src/remote/client.rs
@@ -0,0 +1,628 @@
+//! The WebSocket of one server (`/api/ws`): the session list, agent
+//! activity, and the terminal streams of attached sessions, over one
+//! connection that comes back by itself.
+//!
+//! A [`ServerClient`] runs on the client runtime. Once it has a device
+//! token it connects, subscribes to sessions and events, and keeps the
+//! connection up: a dropped connection is retried with exponential backoff
+//! and jitter ([`backoff`]). After every (re)connect the server lists its
+//! sessions; then every attachment is attached again and starts over from
+//! a fresh snapshot, and those whose session is no longer listed end. An
+//! attachment made while connected waits for its session to be listed (a
+//! session just started may not be yet).
+//! The server closing the socket with 4001, or refusing the upgrade with
+//! 401, means the token was revoked: the client stops until it gets a new
+//! one.
+//!
+//! Terminal bytes never leave the client's thread on their way to an
+//! attachment's [`Sink`]; everything else comes out as [`Event`]s.
+
+use std::collections::{BTreeMap, HashMap};
+use std::sync::atomic::{AtomicU64, Ordering};
+use std::sync::{Arc, OnceLock};
+use std::time::Duration;
+
+use futures::channel::mpsc::{UnboundedReceiver, UnboundedSender, unbounded};
+use futures::{SinkExt as _, StreamExt as _};
+use redshell_protocol::{ClientMessage, PROTOCOL_VERSION, ServerMessage, Snapshot, User, frame, unframe};
+use tokio::time::Instant;
+use tokio_tungstenite::tungstenite::client::IntoClientRequest as _;
+use tokio_tungstenite::tungstenite::handshake::client::Request;
+use tokio_tungstenite::tungstenite::http::{HeaderValue, StatusCode, header};
+use tokio_tungstenite::tungstenite::protocol::CloseFrame;
+use tokio_tungstenite::tungstenite::{self, Message};
+use tokio_tungstenite::{Connector, MaybeTlsStream, WebSocketStream};
+use zeroize::Zeroizing;
+
+use super::api::describe;
+use super::{ServerUrl, runtime};
+
+/// The close code of a socket whose credential was revoked.
+pub const CLOSE_UNAUTHORIZED: u16 = 4001;
+const CONNECT_TIMEOUT: Duration = Duration::from_secs(15);
+/// The server pings every 30 seconds; a connection silent for longer than
+/// two of those is gone.
+const SILENCE: Duration = Duration::from_secs(75);
+const BASE_DELAY: Duration = Duration::from_millis(500);
+const MAX_DELAY: Duration = Duration::from_secs(10);
+
+/// Identifies one attachment of a client.
+pub type AttachmentId = u64;
+
+/// Where an attached session's terminal goes. Called on the client's
+/// thread, in the order the server sent things; dropped when the
+/// attachment ends.
+pub trait Sink: Send + 'static {
+ /// Reset the terminal, size it to `snapshot.cols` × `snapshot.rows` and
+ /// write `snapshot.data`.
+ fn snapshot(&mut self, snapshot: &Snapshot);
+ /// Program output.
+ fn output(&mut self, bytes: &[u8]);
+ /// The session took another size.
+ fn resized(&mut self, cols: u16, rows: u16);
+}
+
+/// Where the connection is.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub enum Status {
+ /// No token: nothing to connect with.
+ SignedOut,
+ Connecting,
+ Connected {
+ user: User,
+ },
+ /// The connection failed or dropped; the next attempt is on its way.
+ Reconnecting {
+ error: String,
+ },
+ /// The server refused the token: the device was revoked.
+ Unauthorized,
+ /// The server speaks protocol version `server`, not this client's.
+ ProtocolMismatch {
+ server: u32,
+ },
+}
+
+#[derive(Debug, Clone)]
+pub enum Event {
+ Status(Status),
+ /// The session list, approvals, agent events and errors, as the server
+ /// sent them.
+ Message(Box),
+ /// An attachment ended without being detached: its session is gone.
+ Ended {
+ attachment: AttachmentId,
+ session: String,
+ },
+}
+
+enum Command {
+ Token(Option>),
+ Attach { id: AttachmentId, session: String, size: Option<(u16, u16)>, sink: Box },
+ Detach(AttachmentId),
+ Input(AttachmentId, Vec),
+ Resize(AttachmentId, u16, u16),
+ Send(ClientMessage),
+}
+
+/// The handle of one server's connection; clones share it. The connection
+/// ends when the last handle is dropped.
+#[derive(Clone)]
+pub struct ServerClient {
+ commands: UnboundedSender,
+ ids: Arc,
+}
+
+impl ServerClient {
+ /// Starts the client for `url`, signed out; its events come out of the
+ /// receiver.
+ pub fn start(url: ServerUrl) -> (Self, UnboundedReceiver) {
+ let (commands, receiver) = unbounded();
+ let (events, events_out) = unbounded();
+ let connection = Connection {
+ url,
+ commands: receiver,
+ events,
+ token: None,
+ attachments: BTreeMap::new(),
+ channels: HashMap::new(),
+ listed: None,
+ };
+ runtime::detach(connection.run());
+ (Self { commands, ids: Arc::new(AtomicU64::new(1)) }, events_out)
+ }
+
+ /// Connects with `token`, or disconnects with `None`.
+ pub fn set_token(&self, token: Option>) {
+ self.command(Command::Token(token));
+ }
+
+ /// Streams `session` into `sink` from the next (re)connect on, at
+ /// `size` when known (else the session's own).
+ pub fn attach(&self, session: &str, size: Option<(u16, u16)>, sink: Box) -> AttachmentId {
+ let id = self.ids.fetch_add(1, Ordering::Relaxed);
+ self.command(Command::Attach { id, session: session.to_owned(), size, sink });
+ id
+ }
+
+ /// Stops streaming; the session keeps running.
+ pub fn detach(&self, id: AttachmentId) {
+ self.command(Command::Detach(id));
+ }
+
+ /// Input for an attached session. Dropped while it is not attached.
+ pub fn input(&self, id: AttachmentId, bytes: &[u8]) {
+ self.command(Command::Input(id, bytes.to_vec()));
+ }
+
+ /// The size the attachment's view wants.
+ pub fn resize(&self, id: AttachmentId, cols: u16, rows: u16) {
+ self.command(Command::Resize(id, cols, rows));
+ }
+
+ /// Sends `message` while connected.
+ pub fn send(&self, message: ClientMessage) {
+ self.command(Command::Send(message));
+ }
+
+ fn command(&self, command: Command) {
+ // Only fails once the connection task ended with the runtime.
+ let _ = self.commands.unbounded_send(command);
+ }
+}
+
+/// The delay before reconnect attempt `attempt` (from 0): exponential up
+/// to [`MAX_DELAY`], with the upper half random so clients spread out.
+/// `random` is in `0.0..=1.0`.
+pub fn backoff(attempt: u32, random: f64) -> Duration {
+ let ceiling = BASE_DELAY.saturating_mul(1 << attempt.min(16)).min(MAX_DELAY);
+ ceiling / 2 + ceiling.mul_f64(random.clamp(0.0, 1.0)) / 2
+}
+
+fn random() -> f64 {
+ getrandom::u32().map_or(0.5, |n| f64::from(n) / f64::from(u32::MAX))
+}
+
+type Socket = WebSocketStream>;
+
+struct Attachment {
+ session: String,
+ /// The size its view wants, once it said.
+ size: Option<(u16, u16)>,
+ channel: Option,
+ /// `attach` was sent on this connection and not answered yet.
+ requested: bool,
+ sink: Box,
+}
+
+/// Why a connection ended, and so what comes next.
+enum Ending {
+ /// Every handle is gone.
+ Stopped,
+ /// The token changed: connect again now (or wait for one).
+ Retry,
+ Unauthorized,
+ Mismatch(u32),
+ Lost(String),
+}
+
+/// What handling a command asks of the connection.
+enum Next {
+ Continue,
+ /// The token changed.
+ Reconnect,
+}
+
+struct Connection {
+ url: ServerUrl,
+ commands: UnboundedReceiver,
+ events: UnboundedSender,
+ token: Option>,
+ /// In the order they were made, which is the order `attached` answers.
+ attachments: BTreeMap,
+ channels: HashMap,
+ /// The sessions the server listed on this connection, with their size.
+ listed: Option>,
+}
+
+impl Connection {
+ async fn run(mut self) {
+ let mut attempt = 0;
+ loop {
+ if self.token.is_none() && !self.wait(None).await {
+ return;
+ }
+ if attempt == 0 {
+ self.status(Status::Connecting);
+ }
+ let connected = match self.request() {
+ Ok(request) => connect(request).await,
+ Err(ending) => Err(ending),
+ };
+ let ending = match connected {
+ Ok(socket) => {
+ let (ending, greeted) = self.serve(socket).await;
+ if greeted {
+ attempt = 0;
+ }
+ ending
+ }
+ Err(ending) => ending,
+ };
+ self.disconnected();
+ match ending {
+ Ending::Stopped => return,
+ Ending::Retry => attempt = 0,
+ Ending::Unauthorized => {
+ self.token = None;
+ self.status(Status::Unauthorized);
+ attempt = 0;
+ }
+ Ending::Mismatch(server) => {
+ self.token = None;
+ self.status(Status::ProtocolMismatch { server });
+ attempt = 0;
+ }
+ Ending::Lost(error) => {
+ self.status(Status::Reconnecting { error });
+ let delay = backoff(attempt, random());
+ attempt = attempt.saturating_add(1);
+ if !self.wait(Some(delay)).await {
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ /// Handles commands while offline, until `delay` passed (or, without
+ /// one, a token came) or the token changed; `false` once every handle
+ /// is gone.
+ async fn wait(&mut self, delay: Option) -> bool {
+ let until = delay.map(|d| Instant::now() + d);
+ loop {
+ let command = match until {
+ Some(until) => tokio::select! {
+ command = self.commands.next() => command,
+ () = tokio::time::sleep_until(until) => return true,
+ },
+ None => self.commands.next().await,
+ };
+ let Some(command) = command else { return false };
+ if let Next::Reconnect = self.command(command, &mut Vec::new())
+ && self.token.is_some()
+ {
+ return true;
+ }
+ }
+ }
+
+ /// The upgrade request, signed with the token.
+ fn request(&self) -> Result {
+ let token = self.token.as_ref().ok_or(Ending::Retry)?;
+ let mut request = self.url.websocket().as_str().into_client_request().map_err(|e| lost(&e))?;
+ let bearer = HeaderValue::from_str(&format!("Bearer {}", token.as_str())).map_err(|e| lost(&e))?;
+ request.headers_mut().insert(header::AUTHORIZATION, bearer);
+ request
+ .headers_mut()
+ .insert(header::USER_AGENT, HeaderValue::from_static(concat!("RedShell/", env!("CARGO_PKG_VERSION"))));
+ Ok(request)
+ }
+
+ /// Runs one connection until it ends; also says whether the server
+ /// greeted this client (so the backoff starts over).
+ async fn serve(&mut self, socket: Socket) -> (Ending, bool) {
+ let (mut write, mut read) = socket.split();
+ let mut out = vec![json(&ClientMessage::Subscribe { sessions: true, events: true })];
+ let mut greeted = false;
+ let mut deadline = Instant::now() + SILENCE;
+ loop {
+ for message in out.drain(..) {
+ if let Err(err) = write.feed(message).await {
+ return (Ending::Lost(describe(&err)), greeted);
+ }
+ }
+ if let Err(err) = write.flush().await {
+ return (Ending::Lost(describe(&err)), greeted);
+ }
+ tokio::select! {
+ incoming = read.next() => {
+ deadline = Instant::now() + SILENCE;
+ match incoming {
+ Some(Ok(Message::Text(text))) => match serde_json::from_str::(&text) {
+ Ok(message) => {
+ if let Err(ending) = self.receive(message, &mut out, &mut greeted) {
+ let _ = write.send(Message::Close(None)).await;
+ return (ending, greeted);
+ }
+ }
+ Err(err) => log::warn!("{}: unreadable message: {err}", self.url),
+ },
+ Some(Ok(Message::Binary(bytes))) => self.output(&bytes),
+ Some(Ok(Message::Close(frame))) => return (closed(frame), greeted),
+ // Pings are answered on the next flush, at the top of the loop.
+ Some(Ok(_)) => {}
+ Some(Err(err)) => return (Ending::Lost(describe(&err)), greeted),
+ None => return (Ending::Lost("the connection closed".into()), greeted),
+ }
+ }
+ command = self.commands.next() => {
+ let Some(command) = command else {
+ let _ = write.send(Message::Close(None)).await;
+ return (Ending::Stopped, greeted);
+ };
+ match self.command(command, &mut out) {
+ Next::Continue if greeted => self.attach_listed(&mut out, false),
+ Next::Continue => {}
+ Next::Reconnect => {
+ let _ = write.send(Message::Close(None)).await;
+ return (Ending::Retry, greeted);
+ }
+ }
+ }
+ () = tokio::time::sleep_until(deadline) => {
+ return (Ending::Lost("the server stopped answering".into()), greeted);
+ }
+ }
+ }
+ }
+
+ /// Applies a command; messages it sends go to `out` (dropped offline).
+ fn command(&mut self, command: Command, out: &mut Vec) -> Next {
+ match command {
+ Command::Token(token) => {
+ if token.is_none() {
+ self.status(Status::SignedOut);
+ }
+ self.token = token;
+ return Next::Reconnect;
+ }
+ Command::Attach { id, session, size, sink } => {
+ self.attachments.insert(id, Attachment { session, size, channel: None, requested: false, sink });
+ }
+ Command::Detach(id) => {
+ if let Some(channel) = self.attachments.remove(&id).and_then(|a| a.channel) {
+ self.channels.remove(&channel);
+ out.push(json(&ClientMessage::Detach { channel }));
+ }
+ }
+ Command::Input(id, bytes) => {
+ if let Some(channel) = self.attachments.get(&id).and_then(|a| a.channel) {
+ out.push(Message::Binary(frame(channel, &bytes).into()));
+ }
+ }
+ Command::Resize(id, cols, rows) => {
+ if let Some(attachment) = self.attachments.get_mut(&id) {
+ attachment.size = Some((cols, rows));
+ if let Some(channel) = attachment.channel {
+ out.push(json(&ClientMessage::Resize { channel, cols, rows }));
+ }
+ }
+ }
+ Command::Send(message) => out.push(json(&message)),
+ }
+ Next::Continue
+ }
+
+ /// Handles a message from the server; `Err` ends the connection.
+ fn receive(&mut self, message: ServerMessage, out: &mut Vec, greeted: &mut bool) -> Result<(), Ending> {
+ match message {
+ ServerMessage::Hello { protocol_version, user } => {
+ if protocol_version != PROTOCOL_VERSION {
+ return Err(Ending::Mismatch(protocol_version));
+ }
+ *greeted = true;
+ self.status(Status::Connected { user });
+ }
+ ServerMessage::Sessions { sessions } => {
+ self.listed = Some(sessions.iter().map(|s| (s.id.clone(), (s.cols, s.rows))).collect());
+ self.attach_listed(out, true);
+ self.emit(Event::Message(Box::new(ServerMessage::Sessions { sessions })));
+ }
+ ServerMessage::SessionUpdated { session } => {
+ if let Some(listed) = &mut self.listed {
+ listed.insert(session.id.clone(), (session.cols, session.rows));
+ }
+ // A session started a moment ago may be attached before it is listed.
+ self.attach_listed(out, false);
+ self.emit(Event::Message(Box::new(ServerMessage::SessionUpdated { session })));
+ }
+ ServerMessage::SessionRemoved { id } => {
+ if let Some(listed) = &mut self.listed {
+ listed.remove(&id);
+ }
+ // Attached ones hear `detached`; those still waiting end here.
+ let waiting: Vec<_> = self
+ .attachments
+ .iter()
+ .filter(|(_, a)| a.session == id && a.channel.is_none())
+ .map(|(id, _)| *id)
+ .collect();
+ for attachment in waiting {
+ self.end(attachment);
+ }
+ self.emit(Event::Message(Box::new(ServerMessage::SessionRemoved { id })));
+ }
+ ServerMessage::Attached { channel, session, snapshot } => {
+ let waiting = self
+ .attachments
+ .iter_mut()
+ .find(|(_, a)| a.requested && a.channel.is_none() && a.session == session.id);
+ match waiting {
+ Some((id, attachment)) => {
+ attachment.channel = Some(channel);
+ attachment.requested = false;
+ attachment.sink.snapshot(&snapshot);
+ self.channels.insert(channel, *id);
+ }
+ // Detached while the attach was on its way.
+ None => out.push(json(&ClientMessage::Detach { channel })),
+ }
+ }
+ ServerMessage::Snapshot { channel, snapshot } => {
+ if let Some(attachment) = self.on_channel(channel) {
+ attachment.sink.snapshot(&snapshot);
+ }
+ }
+ ServerMessage::Resized { channel, cols, rows } => {
+ if let Some(attachment) = self.on_channel(channel) {
+ attachment.sink.resized(cols, rows);
+ }
+ }
+ ServerMessage::Detached { channel } => {
+ if let Some(id) = self.channels.remove(&channel) {
+ self.end(id);
+ }
+ }
+ other => self.emit(Event::Message(Box::new(other))),
+ }
+ Ok(())
+ }
+
+ /// Sends `attach` for every attachment not attached on this connection
+ /// whose session the server listed. With `end_unlisted` (the server just
+ /// listed all its sessions) the others end; otherwise they wait for
+ /// their session to be listed.
+ fn attach_listed(&mut self, out: &mut Vec, end_unlisted: bool) {
+ let Some(listed) = &self.listed else { return };
+ let mut gone = Vec::new();
+ for (id, attachment) in self.attachments.iter_mut().filter(|(_, a)| !a.requested && a.channel.is_none()) {
+ match listed.get(&attachment.session) {
+ Some(&own) => {
+ attachment.requested = true;
+ let (cols, rows) = attachment.size.unwrap_or(own);
+ out.push(json(&ClientMessage::Attach { session: attachment.session.clone(), cols, rows }));
+ }
+ None if end_unlisted => gone.push(*id),
+ None => {}
+ }
+ }
+ for id in gone {
+ self.end(id);
+ }
+ }
+
+ fn on_channel(&mut self, channel: u16) -> Option<&mut Attachment> {
+ let id = self.channels.get(&channel)?;
+ self.attachments.get_mut(id)
+ }
+
+ fn output(&mut self, bytes: &[u8]) {
+ if let Some((channel, bytes)) = unframe(bytes)
+ && let Some(attachment) = self.on_channel(channel)
+ {
+ attachment.sink.output(bytes);
+ }
+ }
+
+ /// Ends an attachment the server let go of; its sink is dropped.
+ fn end(&mut self, id: AttachmentId) {
+ if let Some(attachment) = self.attachments.remove(&id) {
+ self.emit(Event::Ended { attachment: id, session: attachment.session });
+ }
+ }
+
+ /// Forgets the connection's channels: the next one attaches everything again.
+ fn disconnected(&mut self) {
+ self.listed = None;
+ self.channels.clear();
+ for attachment in self.attachments.values_mut() {
+ attachment.channel = None;
+ attachment.requested = false;
+ }
+ }
+
+ fn status(&self, status: Status) {
+ self.emit(Event::Status(status));
+ }
+
+ fn emit(&self, event: Event) {
+ // Nobody listening any more is fine: the app is going away.
+ let _ = self.events.unbounded_send(event);
+ }
+}
+
+/// Opens the WebSocket; a refused token is [`Ending::Unauthorized`].
+async fn connect(request: Request) -> Result {
+ let connector = Connector::Rustls(tls_config().map_err(|e| lost(&e))?);
+ let connecting = tokio_tungstenite::connect_async_tls_with_config(request, None, true, Some(connector));
+ match tokio::time::timeout(CONNECT_TIMEOUT, connecting).await {
+ Err(_) => Err(Ending::Lost("the server did not answer in time".into())),
+ Ok(Ok((socket, _))) => Ok(socket),
+ Ok(Err(tungstenite::Error::Http(response))) if response.status() == StatusCode::UNAUTHORIZED => {
+ Err(Ending::Unauthorized)
+ }
+ Ok(Err(err)) => Err(lost(&err)),
+ }
+}
+
+fn lost(err: &(dyn std::error::Error + 'static)) -> Ending {
+ Ending::Lost(describe(err))
+}
+
+fn json(message: &ClientMessage) -> Message {
+ // Client messages are plain data: they always serialize.
+ Message::Text(serde_json::to_string(message).unwrap_or_default().into())
+}
+
+/// Why the server closed the socket.
+fn closed(frame: Option) -> Ending {
+ match frame {
+ Some(frame) if u16::from(frame.code) == CLOSE_UNAUTHORIZED => Ending::Unauthorized,
+ Some(frame) if !frame.reason.is_empty() => {
+ Ending::Lost(format!("the server closed the connection: {}", frame.reason))
+ }
+ _ => Ending::Lost("the server closed the connection".into()),
+ }
+}
+
+/// TLS for `wss://`: rustls with ring and the system's root certificates.
+fn tls_config() -> Result, rustls::Error> {
+ static CONFIG: OnceLock> = OnceLock::new();
+ if let Some(config) = CONFIG.get() {
+ return Ok(config.clone());
+ }
+ let mut roots = rustls::RootCertStore::empty();
+ let native = rustls_native_certs::load_native_certs();
+ for err in &native.errors {
+ log::warn!("reading the system's certificates: {err}");
+ }
+ let (_added, _ignored) = roots.add_parsable_certificates(native.certs);
+ let config = rustls::ClientConfig::builder_with_provider(Arc::new(rustls::crypto::ring::default_provider()))
+ .with_safe_default_protocol_versions()?
+ .with_root_certificates(roots)
+ .with_no_client_auth();
+ Ok(CONFIG.get_or_init(|| Arc::new(config)).clone())
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn backoff_doubles_up_to_ten_seconds_with_jitter() {
+ assert_eq!(backoff(0, 0.0), Duration::from_millis(250));
+ assert_eq!(backoff(0, 1.0), Duration::from_millis(500));
+ assert_eq!(backoff(1, 0.0), Duration::from_millis(500));
+ assert_eq!(backoff(3, 1.0), Duration::from_secs(4));
+ for attempt in [5, 20, u32::MAX] {
+ assert_eq!(backoff(attempt, 0.0), Duration::from_secs(5));
+ assert_eq!(backoff(attempt, 1.0), Duration::from_secs(10));
+ }
+ }
+
+ #[test]
+ fn tls_uses_ring_and_the_system_roots() {
+ let config = tls_config().unwrap();
+ assert!(Arc::ptr_eq(&config, &tls_config().unwrap()), "built once");
+ assert!(config.crypto_provider().cipher_suites.iter().all(|s| s.suite() != rustls::CipherSuite::Unknown(0)));
+ }
+
+ #[test]
+ fn closes_with_4001_mean_signed_out() {
+ let frame = |code: u16, reason: &str| Some(CloseFrame { code: code.into(), reason: reason.to_owned().into() });
+ assert!(matches!(closed(frame(4001, "signed out")), Ending::Unauthorized));
+ assert!(matches!(closed(frame(1001, "going away")), Ending::Lost(why) if why.contains("going away")));
+ assert!(matches!(closed(None), Ending::Lost(_)));
+ }
+}
diff --git a/crates/redshell-app/src/remote/mod.rs b/crates/redshell-app/src/remote/mod.rs
new file mode 100644
index 0000000..e5ab01e
--- /dev/null
+++ b/crates/redshell-app/src/remote/mod.rs
@@ -0,0 +1,86 @@
+//! The desktop's side of RedShell servers (`redshell-server`), without any
+//! window: their addresses ([`ServerUrl`]), the REST API ([`Api`]) and the
+//! WebSocket that streams sessions and agent activity ([`ServerClient`]),
+//! all running on one tokio thread ([`runtime`]). The app builds the
+//! server list, the sign-in dialogs and the tabs on top of this.
+
+pub mod api;
+pub mod client;
+pub mod runtime;
+mod url;
+
+pub use api::{Api, ApiFailure};
+pub use client::{AttachmentId, Event, ServerClient, Sink, Status};
+pub use url::{ServerUrl, UrlError};
+
+/// A session on a server, as the profile id of the tab showing it names
+/// it (`remote:#`), so the tab can be found and
+/// attached again after a restart.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub struct SessionRef {
+ /// The server's address ([`ServerUrl::as_str`]).
+ pub server: String,
+ pub session: String,
+}
+
+impl SessionRef {
+ const PREFIX: &str = "remote:";
+
+ pub fn new(server: &str, session: &str) -> Self {
+ Self { server: server.to_owned(), session: session.to_owned() }
+ }
+
+ pub fn profile_id(&self) -> String {
+ format!("{}{}#{}", Self::PREFIX, self.server, self.session)
+ }
+
+ /// The session a profile id names. An address has no `#`, so the first
+ /// one ends it.
+ pub fn parse(id: &str) -> Option {
+ let (server, session) = id.strip_prefix(Self::PREFIX)?.split_once('#')?;
+ (!server.is_empty() && !session.is_empty()).then(|| Self::new(server, session))
+ }
+}
+
+/// What this computer calls itself when it signs in to a server, as the
+/// server lists it under the account: `RedShell on `.
+pub fn device_name() -> String {
+ let from_command = || {
+ let output = std::process::Command::new("hostname").output().ok()?;
+ String::from_utf8(output.stdout).ok()
+ };
+ let host = std::env::var("COMPUTERNAME")
+ .ok()
+ .or_else(from_command)
+ .map(|name| name.trim().to_owned())
+ .filter(|name| !name.is_empty());
+ format!("RedShell on {}", host.as_deref().unwrap_or(platform()))
+}
+
+/// This computer's system, as a pairing request shows it.
+pub fn platform() -> &'static str {
+ if cfg!(target_os = "macos") {
+ "macOS"
+ } else if cfg!(windows) {
+ "Windows"
+ } else {
+ "Linux"
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn session_refs_round_trip_through_profile_ids() {
+ let on_a_port = SessionRef::new("http://127.0.0.1:4747", "k3#x");
+ assert_eq!(on_a_port.profile_id(), "remote:http://127.0.0.1:4747#k3#x");
+ assert_eq!(SessionRef::parse(&on_a_port.profile_id()), Some(on_a_port));
+ let behind_a_path = SessionRef::new("https://example.com/redshell", "s1");
+ assert_eq!(SessionRef::parse(&behind_a_path.profile_id()), Some(behind_a_path));
+ for other in ["ssh:box", "remote:", "remote:https://box", "remote:#s1", "remote:https://box#"] {
+ assert_eq!(SessionRef::parse(other), None, "{other}");
+ }
+ }
+}
diff --git a/crates/redshell-app/src/remote/runtime.rs b/crates/redshell-app/src/remote/runtime.rs
new file mode 100644
index 0000000..97e4c19
--- /dev/null
+++ b/crates/redshell-app/src/remote/runtime.rs
@@ -0,0 +1,39 @@
+//! The tokio runtime server clients run on: one thread, started on first
+//! use, for the rest of the process. Requests and WebSockets need tokio,
+//! which GPUI's executors are not; their results come back as ordinary
+//! futures any executor can await.
+
+use std::future::Future;
+use std::sync::OnceLock;
+
+use tokio::runtime::{Builder, Handle};
+
+fn handle() -> &'static Handle {
+ static HANDLE: OnceLock = OnceLock::new();
+ HANDLE.get_or_init(|| {
+ let runtime = Builder::new_current_thread().enable_all().build().expect("starting the server client runtime");
+ let handle = runtime.handle().clone();
+ std::thread::Builder::new()
+ .name("redshell-servers".into())
+ .spawn(move || runtime.block_on(std::future::pending::<()>()))
+ .expect("starting the server client thread");
+ handle
+ })
+}
+
+/// Runs `future` on the runtime; the result can be awaited anywhere.
+pub fn spawn(future: impl Future