Release 0.1.0: MIT license, changelog, multi-arch Docker image without CLI builds
- LICENSE (MIT), CHANGELOG for 0.1.0, README overhaul - docker-compose.release.yml pulling the registry image - Dockerfile cross-compiles the server with cargo-zigbuild for amd64 and arm64; the terminal client is no longer built into the image - Server, install script and settings point to a source install of the terminal client when no prebuilt binaries are available (/info: cli_builds) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d14c609576
commit
ed9942829a
15 files changed
+384
-109
No files matched your search
@@ -3,6 +3,8 @@ name = "codecraft"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
description = "Web-based coding harness for AI models"
|
||||
license = "MIT"
|
||||
repository = "https://git.familie-zink.org/zink/codecraft"
|
||||
|
||||
[dependencies]
|
||||
codecraft-core = { path = "../core" }
|
||||
|
||||
@@ -16,7 +16,7 @@ case "$arch" in
|
||||
esac
|
||||
case "$os" in
|
||||
linux) ;;
|
||||
*) echo "codecraft: no prebuilt binary for $os yet – build from source: cargo install --git <repo> codecraft-cli" >&2; exit 1 ;;
|
||||
*) echo "codecraft: no prebuilt binary for $os yet – build from source: cargo install --locked --git https://git.familie-zink.org/zink/codecraft codecraft-cli" >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
target="$os-$arch"
|
||||
@@ -24,10 +24,16 @@ url="$SERVER/cli/download/$target"
|
||||
mkdir -p "$DIR"
|
||||
tmp="$DIR/.codecraft.download"
|
||||
echo "Downloading codecraft ($target) from $SERVER …"
|
||||
no_build() {
|
||||
rm -f "$tmp"
|
||||
echo "codecraft: this server has no prebuilt binary for $target." >&2
|
||||
echo "Build it from source (needs Rust): cargo install --locked --git https://git.familie-zink.org/zink/codecraft codecraft-cli" >&2
|
||||
exit 1
|
||||
}
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
curl -fsSL "$url" -o "$tmp"
|
||||
curl -fsSL "$url" -o "$tmp" || no_build
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
wget -q "$url" -O "$tmp"
|
||||
wget -q "$url" -O "$tmp" || no_build
|
||||
else
|
||||
echo "codecraft: needs curl or wget" >&2; exit 1
|
||||
fi
|
||||
|
||||
+8
-1
@@ -180,6 +180,13 @@ fn cli_dir() -> PathBuf {
|
||||
std::env::var("CODECRAFT_CLI_DIR").map(PathBuf::from).unwrap_or_else(|_| PathBuf::from("/app/cli"))
|
||||
}
|
||||
|
||||
/// Whether this server ships prebuilt terminal client binaries (the release image does not).
|
||||
pub(crate) fn cli_builds_available() -> bool {
|
||||
std::fs::read_dir(cli_dir()).map(|mut d| d.any(|e| e.is_ok_and(|e| e.file_name().to_string_lossy().starts_with("codecraft-")))).unwrap_or(false)
|
||||
}
|
||||
|
||||
const CLI_SOURCE_HINT: &str = "build it from source: cargo install --locked --git https://git.familie-zink.org/zink/codecraft codecraft-cli";
|
||||
|
||||
/// The server's public base URL (config, else from the request).
|
||||
fn public_base(app: &App, headers: &axum::http::HeaderMap) -> String {
|
||||
let cfg = app.config();
|
||||
@@ -213,7 +220,7 @@ async fn cli_download(Path(target): Path<String>) -> Response {
|
||||
bytes,
|
||||
)
|
||||
.into_response(),
|
||||
Err(_) => (StatusCode::NOT_FOUND, format!("no codecraft build for {target} on this server")).into_response(),
|
||||
Err(_) => (StatusCode::NOT_FOUND, format!("no prebuilt codecraft for {target} on this server – {CLI_SOURCE_HINT}\n")).into_response(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -257,6 +257,7 @@ pub async fn info(State(app): State<Arc<App>>, headers: HeaderMap) -> Json<Value
|
||||
"commit": crate::update::commit(),
|
||||
"update": if user.as_ref().is_some_and(|u| u.is_admin()) { app.update.latest.lock().unwrap().clone() } else { None },
|
||||
"setup_required": app.setup_code.lock().unwrap().is_some(),
|
||||
"cli_builds": crate::api::cli_builds_available(),
|
||||
"oidc": if cfg.auth.oidc.enabled { json!({"label": cfg.auth.oidc.button_label}) } else { Value::Null },
|
||||
"user": user,
|
||||
}))
|
||||
|
||||
Reference in new issue
Block a user