chore: Release dkl version 1.2.3

This commit is contained in:
Mikaël Cluseau
2026-07-17 14:28:50 +02:00
parent a003043c93
commit 2aeb9ee132
5 changed files with 30 additions and 16 deletions
Generated
+1 -1
View File
@@ -341,7 +341,7 @@ dependencies = [
[[package]]
name = "dkl"
version = "1.2.2"
version = "1.2.3"
dependencies = [
"async-compression",
"base32",
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "dkl"
version = "1.2.2"
version = "1.2.3"
edition = "2024"
[profile.release]
+2 -2
View File
@@ -2,12 +2,12 @@ set -ex
tag=$(git describe --always)
repo=novit.tech/direktil/dkl:$tag
docker build --push --platform=linux/amd64,linux/arm64 . -t $repo
publish() {
arch=$1
pf=$2
docker build --push --platform=$pf . -t $repo
for bin in dkl dls; do
curl --user $(jq '.auths["novit.tech"].auth' ~/.docker/config.json -r |base64 -d) \
--upload-file <(docker run --rm --platform $pf $repo cat /bin/$bin) \
+20 -8
View File
@@ -84,6 +84,10 @@ enum ClusterCommand {
#[arg(default_value = "cluster")]
name: String,
},
SetCaCert {
ca: String,
cert_path: PathBuf,
},
Token {
#[arg(default_value = "admin")]
name: String,
@@ -138,18 +142,26 @@ async fn main() -> eyre::Result<()> {
let dls = dls();
let cluster = dls.cluster(cluster);
let Some(command) = command else {
write_json(&cluster.config().await?);
return Ok(());
};
use ClusterCommand as CC;
match command {
None => write_json(&cluster.config().await?),
Some(CC::CaCert { name }) => write_raw(&cluster.ca_cert(&name).await?),
Some(CC::Token { name }) => println!("{}", &cluster.token(&name).await?),
Some(CC::Addons) => write_raw(&cluster.addons().await?),
Some(CC::SshSign {
CC::CaCert { name } => write_raw(&cluster.ca_cert(&name).await?),
CC::SetCaCert { ca, cert_path } => {
let cert = tokio::fs::read(cert_path).await?;
cluster.set_ca_cert(&ca, cert).await?;
}
CC::Token { name } => println!("{}", &cluster.token(&name).await?),
CC::Addons => write_raw(&cluster.addons().await?),
CC::SshSign {
user_public_key,
principal,
validity,
options,
}) => {
} => {
let pub_key = tokio::fs::read_to_string(user_public_key).await?;
let cert = cluster
.ssh_userca_sign(&dls::SshSignReq {
@@ -161,12 +173,12 @@ async fn main() -> eyre::Result<()> {
.await?;
write_raw(&cert);
}
Some(CC::KubeSign {
CC::KubeSign {
csr,
user,
group,
validity,
}) => {
} => {
let csr = tokio::fs::read_to_string(csr).await?;
let cert = cluster
.kube_sign(&dls::KubeSignReq {
+6 -4
View File
@@ -154,12 +154,14 @@ impl<'t> Cluster<'t> {
Ok(resp.bytes().await.map_err(Error::Read)?.to_vec())
}
pub async fn restore_ca_cert(&self, ca: &str, cert: Vec<u8>) -> Result<()> {
pub async fn set_ca_cert(&self, ca: &str, cert: Vec<u8>) -> Result<()> {
let req = self.dls.req(
Method::POST,
format!("clusters/{}/CAs/{ca}/restore", self.name),
Method::PUT,
format!("clusters/{}/CAs/{ca}/certificate", self.name),
)?;
let req = req.body(cert);
let req = req
.body(cert)
.header("Content-Type", "application/x-x509-ca-cert");
do_req(req, &self.dls.token).await?;
Ok(())
}