Move `rad-web` binary to `radicle-httpd` package
Signed-off-by: Thomas Scholtes <geigerzaehler@axiom.fm>
This commit is contained in:
parent
aca5cf669f
commit
3ccb6a5fac
|
|
@ -44,6 +44,7 @@ main () {
|
||||||
|
|
||||||
cargo build --target="$target" --package=radicle-httpd --release
|
cargo build --target="$target" --package=radicle-httpd --release
|
||||||
cp target/"$target"/release/radicle-httpd "$staging"/
|
cp target/"$target"/release/radicle-httpd "$staging"/
|
||||||
|
cp target/"$target"/release/rad-web "$staging"/
|
||||||
|
|
||||||
cargo build --target="$target" --package=radicle-node --release
|
cargo build --target="$target" --package=radicle-node --release
|
||||||
cp target/"$target"/release/radicle-node "$staging"/
|
cp target/"$target"/release/radicle-node "$staging"/
|
||||||
|
|
|
||||||
|
|
@ -1705,9 +1705,9 @@ checksum = "478ee9e62aaeaf5b140bd4138753d1f109765488581444218d3ddda43234f3e8"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.147"
|
version = "0.2.150"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3"
|
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libgit2-sys"
|
name = "libgit2-sys"
|
||||||
|
|
@ -2119,9 +2119,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project-lite"
|
name = "pin-project-lite"
|
||||||
version = "0.2.10"
|
version = "0.2.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57"
|
checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-utils"
|
name = "pin-utils"
|
||||||
|
|
@ -2332,7 +2332,6 @@ dependencies = [
|
||||||
"tree-sitter-rust",
|
"tree-sitter-rust",
|
||||||
"tree-sitter-toml",
|
"tree-sitter-toml",
|
||||||
"tree-sitter-typescript",
|
"tree-sitter-typescript",
|
||||||
"ureq",
|
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -2477,6 +2476,7 @@ dependencies = [
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-logfmt",
|
"tracing-logfmt",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
|
"ureq",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -3307,18 +3307,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.29.1"
|
version = "1.33.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da"
|
checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
|
||||||
"backtrace",
|
"backtrace",
|
||||||
"bytes",
|
"bytes",
|
||||||
"libc",
|
"libc",
|
||||||
"mio",
|
"mio",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"socket2 0.4.9",
|
"socket2 0.5.3",
|
||||||
"tokio-macros",
|
"tokio-macros",
|
||||||
"windows-sys",
|
"windows-sys",
|
||||||
]
|
]
|
||||||
|
|
@ -3667,9 +3666,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ureq"
|
name = "ureq"
|
||||||
version = "2.7.1"
|
version = "2.9.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9"
|
checksum = "7830e33f6e25723d41a63f77e434159dad02919f18f55a512b5f16f3b1d77138"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.21.3",
|
"base64 0.21.3",
|
||||||
"log",
|
"log",
|
||||||
|
|
@ -3681,9 +3680,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "url"
|
name = "url"
|
||||||
version = "2.4.0"
|
version = "2.4.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb"
|
checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"form_urlencoded",
|
"form_urlencoded",
|
||||||
"idna",
|
"idna",
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ tree-sitter-ruby = { version = "0.20", optional = true }
|
||||||
tree-sitter-bash = { version = "0.20" }
|
tree-sitter-bash = { version = "0.20" }
|
||||||
tree-sitter-go = { version = "0.20.0" }
|
tree-sitter-go = { version = "0.20.0" }
|
||||||
tree-sitter-md = { version = "0.1.5" }
|
tree-sitter-md = { version = "0.1.5" }
|
||||||
ureq = { version = "2.6.1", default-features = false, features = ["json"] }
|
|
||||||
zeroize = { version = "1.1" }
|
zeroize = { version = "1.1" }
|
||||||
|
|
||||||
[dependencies.radicle]
|
[dependencies.radicle]
|
||||||
|
|
|
||||||
|
|
@ -52,5 +52,3 @@ pub mod rad_unassign;
|
||||||
pub mod rad_unlabel;
|
pub mod rad_unlabel;
|
||||||
#[path = "commands/untrack.rs"]
|
#[path = "commands/untrack.rs"]
|
||||||
pub mod rad_untrack;
|
pub mod rad_untrack;
|
||||||
#[path = "commands/web.rs"]
|
|
||||||
pub mod rad_web;
|
|
||||||
|
|
|
||||||
|
|
@ -267,11 +267,6 @@ fn run_other(exe: &str, args: &[OsString]) -> Result<(), Option<anyhow::Error>>
|
||||||
args.to_vec(),
|
args.to_vec(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
"web" => term::run_command_args::<rad_web::Options, _>(
|
|
||||||
rad_web::HELP,
|
|
||||||
rad_web::run,
|
|
||||||
args.to_vec(),
|
|
||||||
),
|
|
||||||
"remote" => term::run_command_args::<rad_remote::Options, _>(
|
"remote" => term::run_command_args::<rad_remote::Options, _>(
|
||||||
rad_remote::HELP,
|
rad_remote::HELP,
|
||||||
rad_remote::run,
|
rad_remote::run,
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ tower-http = { version = "0.3.4", default-features = false, features = ["trace",
|
||||||
tracing = { version = "0.1.37", default-features = false, features = ["std", "log"] }
|
tracing = { version = "0.1.37", default-features = false, features = ["std", "log"] }
|
||||||
tracing-logfmt = { version = "0.2", optional = true }
|
tracing-logfmt = { version = "0.2", optional = true }
|
||||||
tracing-subscriber = { version = "0.3", default-features = false, features = ["std", "ansi", "fmt"] }
|
tracing-subscriber = { version = "0.3", default-features = false, features = ["std", "ansi", "fmt"] }
|
||||||
|
ureq = { version = "2.9", default-features = false, features = ["json"] }
|
||||||
|
|
||||||
[dependencies.radicle]
|
[dependencies.radicle]
|
||||||
path = "../radicle"
|
path = "../radicle"
|
||||||
|
|
@ -45,6 +46,9 @@ version = "0.2.0"
|
||||||
[dependencies.radicle-term]
|
[dependencies.radicle-term]
|
||||||
path = "../radicle-term"
|
path = "../radicle-term"
|
||||||
|
|
||||||
|
[dependencies.radicle-cli]
|
||||||
|
path = "../radicle-cli"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
hyper = { version = "0.14.17", default-features = false, features = ["client"] }
|
hyper = { version = "0.14.17", default-features = false, features = ["client"] }
|
||||||
pretty_assertions = { version = "1.3.0" }
|
pretty_assertions = { version = "1.3.0" }
|
||||||
|
|
|
||||||
|
|
@ -122,9 +122,9 @@ async fn session_delete_handler(
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod routes {
|
mod routes {
|
||||||
|
use crate::commands::web::{sign, SessionInfo};
|
||||||
use axum::body::Body;
|
use axum::body::Body;
|
||||||
use axum::http::StatusCode;
|
use axum::http::StatusCode;
|
||||||
use radicle_cli::commands::rad_web::{self, SessionInfo};
|
|
||||||
|
|
||||||
use crate::api::auth::{AuthState, Session};
|
use crate::api::auth::{AuthState, Session};
|
||||||
use crate::test::{self, get, post, put};
|
use crate::test::{self, get, post, put};
|
||||||
|
|
@ -154,7 +154,7 @@ mod routes {
|
||||||
|
|
||||||
// Create request body
|
// Create request body
|
||||||
let signer = ctx.profile.signer().unwrap();
|
let signer = ctx.profile.signer().unwrap();
|
||||||
let signature = rad_web::sign(signer, &session_info).unwrap();
|
let signature = sign(signer, &session_info).unwrap();
|
||||||
let body = serde_json::to_vec(&super::AuthChallenge {
|
let body = serde_json::to_vec(&super::AuthChallenge {
|
||||||
sig: signature,
|
sig: signature,
|
||||||
pk: session_info.public_key,
|
pk: session_info.public_key,
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
use radicle_cli::terminal as term;
|
||||||
|
use radicle_httpd::commands::web as rad_web;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
term::run_command_args::<rad_web::Options, _>(
|
||||||
|
rad_web::HELP,
|
||||||
|
rad_web::run,
|
||||||
|
std::env::args_os().skip(1).collect(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
//! Extra CLI commands relating to HTTPd.
|
||||||
|
pub mod web;
|
||||||
|
|
@ -5,8 +5,8 @@ use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use radicle::crypto::{PublicKey, Signature, Signer};
|
use radicle::crypto::{PublicKey, Signature, Signer};
|
||||||
|
|
||||||
use crate::terminal as term;
|
use radicle_cli::terminal as term;
|
||||||
use crate::terminal::args::{Args, Error, Help};
|
use radicle_cli::terminal::args::{Args, Error, Help};
|
||||||
|
|
||||||
pub const HELP: Help = Help {
|
pub const HELP: Help = Help {
|
||||||
name: "web",
|
name: "web",
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#![allow(clippy::type_complexity)]
|
#![allow(clippy::type_complexity)]
|
||||||
#![allow(clippy::too_many_arguments)]
|
#![allow(clippy::too_many_arguments)]
|
||||||
#![recursion_limit = "256"]
|
#![recursion_limit = "256"]
|
||||||
|
pub mod commands;
|
||||||
pub mod error;
|
pub mod error;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ chmod +x \
|
||||||
$RAD_PATH/radicle-node \
|
$RAD_PATH/radicle-node \
|
||||||
$RAD_PATH/radicle-httpd \
|
$RAD_PATH/radicle-httpd \
|
||||||
$RAD_PATH/rad \
|
$RAD_PATH/rad \
|
||||||
|
$RAD_PATH/rad-web \
|
||||||
$RAD_PATH/git-remote-rad
|
$RAD_PATH/git-remote-rad
|
||||||
|
|
||||||
# If radicle is not in $PATH, add it here.
|
# If radicle is not in $PATH, add it here.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue