Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
httpd: Copy auth url to clipboard when --no-open passed
✗ CI failure Sebastian Martinez committed 2 years ago
commit d77f6f4d4b2e5a5c629ffeccbe874361f37a6a30
parent f17df8822954871875468ddac13c3d3c9200eea8
1 failed (1 total) View logs
3 files changed +266 -0
modified Cargo.lock
@@ -193,6 +193,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"

[[package]]
+
name = "arboard"
+
version = "3.3.2"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "a2041f1943049c7978768d84e6d0fd95de98b76d6c4727b09e78ec253d29fa58"
+
dependencies = [
+
 "clipboard-win",
+
 "core-graphics",
+
 "image",
+
 "log",
+
 "objc",
+
 "objc-foundation",
+
 "objc_id",
+
 "parking_lot",
+
 "thiserror",
+
 "windows-sys 0.48.0",
+
 "x11rb",
+
]
+

+
[[package]]
name = "arc-swap"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -380,6 +399,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"

[[package]]
+
name = "block"
+
version = "0.1.6"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
+

+
[[package]]
name = "block-buffer"
version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -443,6 +468,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"

[[package]]
+
name = "bytemuck"
+
version = "1.15.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15"
+

+
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -527,6 +558,21 @@ dependencies = [
]

[[package]]
+
name = "clipboard-win"
+
version = "5.3.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "d517d4b86184dbb111d3556a10f1c8a04da7428d2987bf1081602bf11c3aa9ee"
+
dependencies = [
+
 "error-code",
+
]
+

+
[[package]]
+
name = "color_quant"
+
version = "1.1.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
+

+
[[package]]
name = "colorchoice"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -549,12 +595,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"

[[package]]
+
name = "core-foundation"
+
version = "0.9.4"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f"
+
dependencies = [
+
 "core-foundation-sys",
+
 "libc",
+
]
+

+
[[package]]
name = "core-foundation-sys"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f"

[[package]]
+
name = "core-graphics"
+
version = "0.23.1"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212"
+
dependencies = [
+
 "bitflags 1.3.2",
+
 "core-foundation",
+
 "core-graphics-types",
+
 "foreign-types",
+
 "libc",
+
]
+

+
[[package]]
+
name = "core-graphics-types"
+
version = "0.1.2"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33"
+
dependencies = [
+
 "bitflags 1.3.2",
+
 "core-foundation",
+
 "libc",
+
]
+

+
[[package]]
name = "cpufeatures"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -807,6 +887,12 @@ dependencies = [
]

[[package]]
+
name = "error-code"
+
version = "3.2.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b"
+

+
[[package]]
name = "escargot"
version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -843,6 +929,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"

[[package]]
+
name = "fdeflate"
+
version = "0.3.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10"
+
dependencies = [
+
 "simd-adler32",
+
]
+

+
[[package]]
name = "ff"
version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -881,6 +976,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"

[[package]]
+
name = "foreign-types"
+
version = "0.5.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965"
+
dependencies = [
+
 "foreign-types-macros",
+
 "foreign-types-shared",
+
]
+

+
[[package]]
+
name = "foreign-types-macros"
+
version = "0.2.3"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
+
dependencies = [
+
 "proc-macro2",
+
 "quote",
+
 "syn 2.0.48",
+
]
+

+
[[package]]
+
name = "foreign-types-shared"
+
version = "0.3.1"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b"
+

+
[[package]]
name = "form_urlencoded"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -949,6 +1071,16 @@ dependencies = [
]

[[package]]
+
name = "gethostname"
+
version = "0.4.3"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818"
+
dependencies = [
+
 "libc",
+
 "windows-targets 0.48.5",
+
]
+

+
[[package]]
name = "getrandom"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1575,6 +1707,21 @@ dependencies = [
]

[[package]]
+
name = "image"
+
version = "0.24.7"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711"
+
dependencies = [
+
 "bytemuck",
+
 "byteorder",
+
 "color_quant",
+
 "num-rational",
+
 "num-traits",
+
 "png",
+
 "tiff",
+
]
+

+
[[package]]
name = "indexmap"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1639,6 +1786,12 @@ dependencies = [
]

[[package]]
+
name = "jpeg-decoder"
+
version = "0.3.1"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0"
+

+
[[package]]
name = "js-sys"
version = "0.3.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1759,6 +1912,15 @@ dependencies = [
]

[[package]]
+
name = "malloc_buf"
+
version = "0.0.6"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
+
dependencies = [
+
 "libc",
+
]
+

+
[[package]]
name = "matchers"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1821,6 +1983,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
dependencies = [
 "adler",
+
 "simd-adler32",
]

[[package]]
@@ -1949,6 +2112,17 @@ dependencies = [
]

[[package]]
+
name = "num-rational"
+
version = "0.4.1"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0"
+
dependencies = [
+
 "autocfg",
+
 "num-integer",
+
 "num-traits",
+
]
+

+
[[package]]
name = "num-traits"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1984,6 +2158,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef"

[[package]]
+
name = "objc"
+
version = "0.2.7"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
+
dependencies = [
+
 "malloc_buf",
+
]
+

+
[[package]]
+
name = "objc-foundation"
+
version = "0.1.1"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"
+
dependencies = [
+
 "block",
+
 "objc",
+
 "objc_id",
+
]
+

+
[[package]]
+
name = "objc_id"
+
version = "0.1.1"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b"
+
dependencies = [
+
 "objc",
+
]
+

+
[[package]]
name = "object"
version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2156,6 +2359,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb"

[[package]]
+
name = "png"
+
version = "0.17.10"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64"
+
dependencies = [
+
 "bitflags 1.3.2",
+
 "crc32fast",
+
 "fdeflate",
+
 "flate2",
+
 "miniz_oxide",
+
]
+

+
[[package]]
name = "poly1305"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2477,6 +2693,7 @@ name = "radicle-httpd"
version = "0.9.0"
dependencies = [
 "anyhow",
+
 "arboard",
 "axum",
 "axum-auth",
 "axum-server",
@@ -2935,6 +3152,12 @@ dependencies = [
]

[[package]]
+
name = "simd-adler32"
+
version = "0.3.7"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe"
+

+
[[package]]
name = "similar"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3217,6 +3440,17 @@ dependencies = [
]

[[package]]
+
name = "tiff"
+
version = "0.9.1"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e"
+
dependencies = [
+
 "flate2",
+
 "jpeg-decoder",
+
 "weezl",
+
]
+

+
[[package]]
name = "time"
version = "0.3.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3751,6 +3985,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b"

[[package]]
+
name = "weezl"
+
version = "0.1.8"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082"
+

+
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3942,6 +4182,23 @@ dependencies = [
]

[[package]]
+
name = "x11rb"
+
version = "0.13.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a"
+
dependencies = [
+
 "gethostname",
+
 "rustix",
+
 "x11rb-protocol",
+
]
+

+
[[package]]
+
name = "x11rb-protocol"
+
version = "0.13.0"
+
source = "registry+https://github.com/rust-lang/crates.io-index"
+
checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34"
+

+
[[package]]
name = "xattr"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
modified radicle-httpd/Cargo.toml
@@ -26,6 +26,7 @@ path = "src/bin/rad-web.rs"

[dependencies]
anyhow = { version = "1" }
+
arboard = { version = "3.3.2" }
axum = { version = "0.7.2", default-features = false, features = ["json", "query", "tokio", "http1"] }
axum-auth = { version= "0.7.0", default-features = false, features = ["auth-bearer"] }
axum-server = { version = "0.6.0", default-features = false }
modified radicle-httpd/src/commands/web.rs
@@ -219,6 +219,14 @@ pub fn run(options: Options, ctx: impl term::Context) -> anyhow::Result<()> {
        }
    } else {
        term::info!("Visit {auth_url} to connect");
+
        match arboard::Clipboard::new() {
+
            Ok(mut ctx) => {
+
                if let Ok(()) = ctx.set_text(auth_url.as_str()) {
+
                    term::hint("URL has been copied to your clipboard");
+
                }
+
            }
+
            Err(err) => term::error(err),
+
        }
    }

    if let Some((runtime, httpd_handle)) = runtime_and_handle {