rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwoode10b85ce436d6165c2efe1277b022ff8e4671653
{
"request": "trigger",
"version": 1,
"event_type": "patch",
"repository": {
"id": "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5",
"name": "heartwood",
"description": "Radicle Heartwood Protocol & Stack",
"private": false,
"default_branch": "master",
"delegates": [
"did:key:z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT",
"did:key:z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW",
"did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"did:key:z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz",
"did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz"
]
},
"action": "Created",
"patch": {
"id": "73e8645b29981b0cbeeb64e40afc1cc0f544a6c8",
"author": {
"id": "did:key:z6MkkfM3tPXNPrPevKr3uSiQtHPuwnNhu2yUVjgd2jXVsVz5",
"alias": "sebastinez"
},
"title": "httpd: Serve a local web client from httpd",
"state": {
"status": "archived",
"conflicts": []
},
"before": "574ac3566bd465d5306cd58d17ff9c87a5118ddd",
"after": "e10b85ce436d6165c2efe1277b022ff8e4671653",
"commits": [
"e10b85ce436d6165c2efe1277b022ff8e4671653"
],
"target": "6cfed884bf37cba1e0d8e97fa8b0e94df4a04b1f",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "73e8645b29981b0cbeeb64e40afc1cc0f544a6c8",
"author": {
"id": "did:key:z6MkkfM3tPXNPrPevKr3uSiQtHPuwnNhu2yUVjgd2jXVsVz5",
"alias": "sebastinez"
},
"description": "",
"base": "574ac3566bd465d5306cd58d17ff9c87a5118ddd",
"oid": "e10b85ce436d6165c2efe1277b022ff8e4671653",
"timestamp": 1713184337
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "626fb164-0740-4e6d-ad65-3cdeac7cd62e"
},
"info_url": "https://cci.rad.levitte.org//626fb164-0740-4e6d-ad65-3cdeac7cd62e.html"
}
Started at: 2025-10-21 18:27:14.163103+02:00
Commands:
$ rad clone rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 .
✓ Creating checkout in ./...
✓ Remote cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT added
✓ Remote-tracking branch cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT/master created for z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT
✓ Remote cloudhead@z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW added
✓ Remote-tracking branch cloudhead@z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW/master created for z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW
✓ Remote fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM added
✓ Remote-tracking branch fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM/master created for z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM
✓ Remote erikli@z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz added
✓ Remote-tracking branch erikli@z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz/master created for z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz
✓ Remote lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz added
✓ Remote-tracking branch lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz/master created for z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz
✓ Repository successfully cloned under /opt/radcis/ci.rad.levitte.org/cci/state/626fb164-0740-4e6d-ad65-3cdeac7cd62e/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 125 issues · 15 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout 73e8645b29981b0cbeeb64e40afc1cc0f544a6c8
✓ Switched to branch patch/73e8645 at revision 73e8645
✓ Branch patch/73e8645 setup to track rad/patches/73e8645b29981b0cbeeb64e40afc1cc0f544a6c8
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout e10b85ce436d6165c2efe1277b022ff8e4671653
HEAD is now at e10b85ce httpd: Serve a local web client from httpd
Exit code: 0
$ git show e10b85ce436d6165c2efe1277b022ff8e4671653
commit e10b85ce436d6165c2efe1277b022ff8e4671653
Author: Sebastian Martinez <me@sebastinez.dev>
Date: Mon Apr 15 14:31:47 2024 +0200
httpd: Serve a local web client from httpd
diff --git a/Cargo.lock b/Cargo.lock
index 21453e8f..edafc659 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1471,17 +1471,23 @@ dependencies = [
[[package]]
name = "http-body-util"
-version = "0.1.0"
+version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840"
+checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d"
dependencies = [
"bytes",
- "futures-util",
+ "futures-core",
"http",
"http-body",
"pin-project-lite",
]
+[[package]]
+name = "http-range-header"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ce4ef31cda248bbdb6e6820603b82dfcd9e833db65a43e997a0ccec777d11fe"
+
[[package]]
name = "httparse"
version = "1.8.0"
@@ -1805,6 +1811,16 @@ version = "0.3.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a"
+[[package]]
+name = "mime_guess"
+version = "2.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef"
+dependencies = [
+ "mime",
+ "unicase",
+]
+
[[package]]
name = "miniz_oxide"
version = "0.7.1"
@@ -2475,6 +2491,7 @@ dependencies = [
"chrono",
"fastrand",
"flate2",
+ "http-body-util",
"hyper",
"lexopt",
"lru",
@@ -3334,10 +3351,18 @@ checksum = "0da193277a4e2c33e59e09b5861580c33dd0a637c3883d0fa74ba40c0374af2e"
dependencies = [
"bitflags 2.4.2",
"bytes",
+ "futures-util",
"http",
"http-body",
"http-body-util",
+ "http-range-header",
+ "httpdate",
+ "mime",
+ "mime_guess",
+ "percent-encoding",
"pin-project-lite",
+ "tokio",
+ "tokio-util",
"tower-layer",
"tower-service",
"tracing",
@@ -3569,6 +3594,15 @@ version = "1.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
+[[package]]
+name = "unicase"
+version = "2.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89"
+dependencies = [
+ "version_check",
+]
+
[[package]]
name = "unicode-bidi"
version = "0.3.15"
diff --git a/radicle-httpd/Cargo.toml b/radicle-httpd/Cargo.toml
index 05ce9b66..691e6cb6 100644
--- a/radicle-httpd/Cargo.toml
+++ b/radicle-httpd/Cargo.toml
@@ -11,10 +11,7 @@ build = "build.rs"
[features]
default = []
-logfmt = [
- "tracing-logfmt",
- "tracing-subscriber/env-filter"
-]
+logfmt = ["tracing-logfmt", "tracing-subscriber/env-filter"]
[[bin]]
name = "radicle-httpd"
@@ -26,8 +23,15 @@ path = "src/bin/rad-web.rs"
[dependencies]
anyhow = { version = "1" }
-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 = { 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 }
base64 = "0.21.3"
chrono = { version = "0.4.22", default-features = false, features = ["clock"] }
@@ -37,16 +41,34 @@ hyper = { version = "1.0.1", default-features = false }
lexopt = { version = "0.3.0" }
lru = { version = "0.12.0" }
nonempty = { version = "0.9.0", features = ["serialize"] }
-radicle-surf = { version = "0.19.0", default-features = false, features = ["serde"] }
+radicle-surf = { version = "0.19.0", default-features = false, features = [
+ "serde",
+] }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
thiserror = { version = "1" }
time = { version = "0.3.17", features = ["parsing", "serde"] }
-tokio = { version = "1.21", default-features = false, features = ["macros", "rt-multi-thread"] }
-tower-http = { version = "0.5", default-features = false, features = ["trace", "cors", "set-header"] }
-tracing = { version = "0.1.37", default-features = false, features = ["std", "log"] }
+tokio = { version = "1.21", default-features = false, features = [
+ "macros",
+ "rt-multi-thread",
+] }
+http-body-util = "0.1.1"
+tower-http = { version = "0.5", default-features = false, features = [
+ "trace",
+ "fs",
+ "cors",
+ "set-header",
+] }
+tracing = { version = "0.1.37", default-features = false, features = [
+ "std",
+ "log",
+] }
tracing-logfmt = { version = "0.3", 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"] }
url = { version = "2.5.0" }
diff --git a/radicle-httpd/src/lib.rs b/radicle-httpd/src/lib.rs
index 299e56f2..0d598014 100644
--- a/radicle-httpd/src/lib.rs
+++ b/radicle-httpd/src/lib.rs
@@ -18,6 +18,7 @@ use axum::http::{Request, Response};
use axum::middleware;
use axum::Router;
use tokio::net::TcpListener;
+use tower_http::services::{ServeDir, ServeFile};
use tower_http::trace::TraceLayer;
use tracing::Span;
@@ -110,15 +111,25 @@ pub async fn run(options: Options) -> anyhow::Result<()> {
fn router(options: Options, profile: Profile) -> anyhow::Result<Router> {
let profile = Arc::new(profile);
let ctx = api::Context::new(profile.clone(), &options);
+ let path = profile.path();
+ let local_ui = std::env::var("SERVE_LOCAL_UI").unwrap_or("0".to_string());
let api_router = api::router(ctx);
let git_router = git::router(profile.clone(), options.aliases);
- let raw_router = raw::router(profile);
-
- let app = Router::new()
- .merge(git_router)
- .nest("/api", api_router)
- .nest("/raw", raw_router);
+ let raw_router = raw::router(profile.clone());
+
+ let mut app = Router::new();
+ app = app.nest("/api", api_router).nest("/raw", raw_router);
+
+ if local_ui == "1" {
+ app = app.nest_service(
+ "/",
+ ServeDir::new(path.join("ui/latest"))
+ .not_found_service(ServeFile::new(path.join("ui/latest/index.html"))),
+ );
+ } else {
+ app = app.merge(git_router);
+ }
Ok(app)
}
Exit code: 0
shell: 'cargo --version rustc --version cargo fmt --check cargo clippy --all-targets --workspace -- --deny clippy::all cargo build --all-targets --workspace cargo doc --workspace cargo test --workspace --no-fail-fast '
Commands:
$ podman run --name 626fb164-0740-4e6d-ad65-3cdeac7cd62e -v /opt/radcis/ci.rad.levitte.org/cci/state/626fb164-0740-4e6d-ad65-3cdeac7cd62e/s:/626fb164-0740-4e6d-ad65-3cdeac7cd62e/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/626fb164-0740-4e6d-ad65-3cdeac7cd62e/w:/626fb164-0740-4e6d-ad65-3cdeac7cd62e/w -w /626fb164-0740-4e6d-ad65-3cdeac7cd62e/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:bookworm bash /626fb164-0740-4e6d-ad65-3cdeac7cd62e/s/script.sh
+ cargo --version
info: syncing channel updates for '1.77-x86_64-unknown-linux-gnu'
info: latest update on 2024-04-09, rust version 1.77.2 (25ef9e3d8 2024-04-09)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'
cargo 1.77.2 (e52e36006 2024-03-26)
+ rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)
+ cargo fmt --check
error: 'cargo-fmt' is not installed for the toolchain '1.77-x86_64-unknown-linux-gnu'.
To install, run `rustup component add --toolchain 1.77-x86_64-unknown-linux-gnu rustfmt`
Exit code: 1
{
"response": "finished",
"result": "failure"
}