Skip to content

Commit 1e91a4b

Browse files
committed
wip: restore registry crate
1 parent 3f1a909 commit 1e91a4b

File tree

22 files changed

+187
-167
lines changed

22 files changed

+187
-167
lines changed

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
106106
strategy:
107107
matrix:
108-
msrv: ["1.70.0"]
108+
msrv: ["1.74.0"]
109109
name: ubuntu / ${{ matrix.msrv }}
110110
steps:
111111
- uses: actions/checkout@v4

Cargo.lock

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ members = [
66
"goldboot",
77
"goldboot-image",
88
"goldboot-macros",
9+
"goldboot-registry",
910
]

goldboot-image/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[package]
2-
name = "goldboot-image"
2+
authors = ["Tyler Cook"]
33
description = "Defines the goldboot image format"
4-
version = "0.0.1"
54
edition = "2021"
6-
license = "AGPL-3.0-only"
7-
authors = ["Tyler Cook"]
85
homepage = "https://goldboot.fossable.org"
6+
license = "AGPL-3.0-only"
7+
name = "goldboot-image"
98
repository = "https://github.com/fossable/goldboot"
10-
rust-version = "1.70"
9+
rust-version = "1.74"
10+
version = "0.0.1"
1111

1212
[dependencies]
1313
aes-gcm = { version = "0.10.3", features = ["std"] }

goldboot-macros/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "goldboot-macros"
3-
version = "0.0.1"
4-
edition = "2021"
5-
rust-version = "1.70"
2+
authors = ["Tyler Cook"]
63
description = "Supporting macros for goldboot"
4+
edition = "2021"
75
license = "AGPL-3.0-only"
8-
authors = ["Tyler Cook"]
6+
name = "goldboot-macros"
7+
rust-version = "1.74"
8+
version = "0.0.1"
99

1010
[lib]
1111
proc-macro = true

goldboot-registry/Cargo.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
name = "goldboot-registry"
3+
description = "A web service for hosting goldboot images"
4+
version = "0.0.1"
5+
edition = "2021"
6+
license = "AGPL-3.0-only"
7+
authors = ["Tyler Cook"]
8+
readme = "README.md"
9+
homepage = "https://goldboot.org"
10+
repository = "https://github.com/fossable/goldboot/"
11+
rust-version = "1.74"
12+
13+
[dependencies]
14+
anyhow = "1.0.76"
15+
axum = "0.7.4"
16+
clap = { version = "4.4.7", features = ["derive", "string"] }
17+
goldboot = { path="../goldboot", version = "0.0.2" }
18+
goldboot-image = { path="../goldboot-image", version = "0.0.1" }
19+
reqwest = { version = "0.11.22", features = ["stream"] }
20+
tokio = { version = "1.34.0", features = ["full"] }
21+
tracing = "0.1.40"
22+
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }

goldboot-registry/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM alpine:latest
2+
3+
ARG TARGETOS
4+
ARG TARGETARCH
5+
ARG TARGETVARIANT
6+
7+
RUN apk add --no-cache qemu-system-aarch64 qemu-system-arm qemu-system-x86_64
8+
9+
COPY ${TARGETOS}-${TARGETARCH}${TARGETVARIANT}/goldboot-registry /usr/bin/goldboot-registry
10+
RUN chmod +x /usr/bin/goldboot-registry
11+
12+
WORKDIR /root
13+
ENTRYPOINT ["/usr/bin/goldboot-registry"]

goldboot-registry/src/api/image.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
use crate::extract::ImageHandle;
2+
use axum::{
3+
extract::{Path, State},
4+
http::StatusCode,
5+
Json,
6+
};
7+
use goldboot::registry::api::image::ImageInfoResponse;
8+
9+
/// Get image info
10+
pub async fn info(image: ImageHandle) -> Json<ImageInfoResponse> {
11+
Json(image.0.into())
12+
}
13+
14+
/// Get image list
15+
pub async fn list() {}
16+
17+
// Push an image
18+
/*
19+
pub async fn push(id: web::Path<String>, rq: actix_web::HttpRequest) -> Result<HttpResponse> {
20+
let path = match ImageLibrary::find_by_id(&id) {
21+
Ok(image) => {
22+
// Delete if the image already exists
23+
if Path::new(&image.path).exists() {
24+
std::fs::remove_file(&image.path)?;
25+
}
26+
image.path
27+
},
28+
_ => format!("{}.gb", id),
29+
};
30+
31+
let mut file = File::create(&path)?;
32+
std::io::copy(&mut rq, &mut file)?;
33+
""
34+
}*/
35+
36+
/// Get cluster data
37+
pub async fn clusters(Path(_id): Path<String>, Path(_range): Path<String>) {}
38+
39+
/// Get cluster hashes
40+
pub async fn hashes(Path(_id): Path<String>, Path(_range): Path<String>) {}

goldboot-registry/src/api/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pub mod build;
2+
pub mod image;

0 commit comments

Comments
 (0)