Skip to content

Commit 4fa1885

Browse files
committed
chore: bump qlean to 0.3.0
1 parent 1b42854 commit 4fa1885

12 files changed

Lines changed: 1242 additions & 253 deletions

Cargo.lock

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

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ libvault-core = "0.1.0"
4242
#====
4343
anyhow = "1.0.102"
4444
serde = { version = "1.0.228", features = ["derive"] }
45-
serde_json = "1.0.149"
45+
serde_json = "1.0.150"
4646
serde_urlencoded = "0.7"
4747
tracing = "0.1.44"
4848
tracing-subscriber = "0.3.23"
@@ -61,7 +61,7 @@ futures = "0.3.32"
6161
futures-util = "0.3.32"
6262
axum = { version = "0.8.9", features = ["macros", "json"] }
6363
axum-extra = "0.12.6"
64-
russh = "0.55.0"
64+
russh = "0.61.1"
6565
tower-http = "0.6.11"
6666
tower = "0.5.3"
6767
tower-sessions = { version = "0.15", features = ["memory-store"] }
@@ -110,10 +110,10 @@ dashmap = "6.2.1"
110110
once_cell = "1.21.4"
111111
serial_test = "3.4.0"
112112
sysinfo = "0.39.2"
113-
http = "1.4.0"
113+
http = "1.4.1"
114114
url = "2.5.8"
115115
jemallocator = "0.5.4"
116-
mimalloc = "0.1.51"
116+
mimalloc = "0.1.52"
117117
dotenvy = "0.15.7"
118118
tokio-tungstenite = "0.29"
119119
tungstenite = "0.29"
@@ -127,7 +127,7 @@ redis-test = "1.0.3"
127127
rustls = "0.23"
128128
object_store = "0.13.2"
129129
parse-display = "0.11.0"
130-
qlean = "0.2.3"
130+
qlean = "0.3.0"
131131
toml = "1.1.2"
132132
rkyv = "0.8.16"
133133
percent-encoding = "2.3"

mono/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ tracing = { workspace = true }
3939
tracing-subscriber = { workspace = true }
4040
tracing-appender = { workspace = true }
4141
russh = { workspace = true }
42+
rand = { workspace = true }
4243
serde = { workspace = true, features = ["derive"] }
4344
serde_json = { workspace = true }
4445
serde_urlencoded = { workspace = true }

mono/src/git_protocol/ssh.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,13 @@ impl server::Handler for SshServer {
9090
// TODO handler ProtocolError
9191
let res = smart_protocol.git_info_refs(&self.state).await.unwrap();
9292
self.smart_protocol = Some(smart_protocol);
93-
session.data(channel, res.to_vec().into())?;
93+
session.data(channel, res.to_vec())?;
9494
session.channel_success(channel)?;
9595
}
9696
//Note that currently mega does not support pure ssh to transfer files, still relay on the https server.
9797
//see https://github.com/git-lfs/git-lfs/blob/main/docs/proposals/ssh_adapter.md for more details about pure ssh file transfer.
9898
"git-lfs-transfer" => {
99-
session.data(channel, "not implemented yet".as_bytes().to_vec().into())?;
99+
session.data(channel, "not implemented yet".as_bytes().to_vec())?;
100100
}
101101
// When connecting over SSH, the first attempt will be made to use
102102
// `git-lfs-transfer`, the pure SSH protocol, and if it fails, Git LFS will fall
@@ -114,7 +114,7 @@ impl server::Handler for SshServer {
114114
expire_time.to_rfc3339()
115115
},
116116
};
117-
session.data(channel, serde_json::to_vec(&link).unwrap().into())?;
117+
session.data(channel, serde_json::to_vec(&link).unwrap())?;
118118
}
119119
command => tracing::error!("Not Supported command! {}", command),
120120
}
@@ -205,7 +205,7 @@ impl SshServer {
205205

206206
tracing::info!("buf is {:?}", buf);
207207
session
208-
.data(channel, String::from_utf8(buf.to_vec()).unwrap().into())
208+
.data(channel, String::from_utf8(buf.to_vec()).unwrap())
209209
.unwrap();
210210

211211
while let Some(chunk) = send_pack_data.next().await {
@@ -218,11 +218,11 @@ impl SshServer {
218218
break;
219219
}
220220
let bytes_out = smart_protocol.build_side_band_format(temp, length);
221-
session.data(channel, bytes_out.to_vec().into()).unwrap();
221+
session.data(channel, bytes_out.to_vec()).unwrap();
222222
}
223223
}
224224
session
225-
.data(channel, smart::PKT_LINE_END_MARKER.to_vec().into())
225+
.data(channel, smart::PKT_LINE_END_MARKER.to_vec())
226226
.unwrap();
227227
}
228228

@@ -251,7 +251,7 @@ impl SshServer {
251251

252252
tracing::info!("report status: {:?}", report_status);
253253
session
254-
.data(channel, report_status.to_vec().into())
254+
.data(channel, report_status.to_vec())
255255
.unwrap();
256256
}
257257
}

mono/src/server/ssh_server.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use context::AppContext;
77
use ed25519_dalek::pkcs8::spki::der::pem::LineEnding;
88
use russh::{
99
Preferred,
10-
keys::{Algorithm, PrivateKey, ssh_key::rand_core::OsRng},
10+
keys::{Algorithm, PrivateKey},
1111
server::Server,
1212
};
1313
use tokio::sync::Mutex;
@@ -77,8 +77,14 @@ pub async fn load_key(ctx: AppContext) -> PrivateKey {
7777
let secret_key = ssh_key["secret_key"].as_str().unwrap();
7878
PrivateKey::from_openssh(secret_key).unwrap()
7979
} else {
80-
// generate a keypair if not exists
81-
let keys = PrivateKey::random(&mut OsRng, Algorithm::Ed25519).unwrap();
80+
// Generate a keypair if not present in the vault.
81+
//
82+
// `rand::rng()` returns rand 0.10's thread-local CSPRNG (ChaCha, OS-seeded),
83+
// which implements `CryptoRng` — the bound required by `ssh-key` 0.7's
84+
// `PrivateKey::random`. This matches the pattern used by russh's own tests
85+
// and avoids the `OsRng.unwrap_err()` dance that the new `TryRngCore`-only
86+
// `rand_core::OsRng` would otherwise force on us.
87+
let keys = PrivateKey::random(&mut rand::rng(), Algorithm::Ed25519).unwrap();
8288
let secret = serde_json::json!({
8389
"secret_key":
8490
*keys.to_openssh(LineEnding::CR).unwrap()

mono/tests/buck_service_tests.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use std::path::Path;
3434

3535
use anyhow::{Context, Result};
3636
use common::*;
37-
use qlean::{Distro, MachineConfig, create_image, with_machine};
37+
use qlean::{Distro, GuestArch, Image, ImageConfig, MachineConfig, with_machine};
3838

3939
// Test authentication tokens
4040
const TEST_TOKEN: &str = "test-token-12345678-1234-1234-1234-123456789012";
@@ -1584,12 +1584,18 @@ async fn phase17_test_complete_idempotency(vm: &mut qlean::Machine) -> Result<()
15841584
async fn test_buck_service_with_postgres() -> Result<()> {
15851585
tracing_subscriber_init();
15861586

1587-
let image = create_image(Distro::Debian, "debian-13-generic-amd64").await?;
1587+
let image = Image::new(
1588+
ImageConfig::default()
1589+
.with_distro(Distro::Debian)
1590+
.with_arch(GuestArch::Amd64),
1591+
)
1592+
.await?;
15881593
let config = MachineConfig {
15891594
core: 2,
15901595
mem: 2048,
15911596
disk: Some(15),
15921597
clear: true,
1598+
..Default::default()
15931599
};
15941600

15951601
with_machine(&image, &config, |vm| {

mono/tests/campsite_api_store_tests.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ mod common;
3838

3939
use anyhow::{Context, Result};
4040
use common::*;
41-
use qlean::{Distro, MachineConfig, create_image, with_machine};
41+
use qlean::{Distro, GuestArch, Image, ImageConfig, MachineConfig, with_machine};
4242
use serde_json::Value;
4343

4444
const TEST_COOKIE: &str = "test_session_cookie";
@@ -237,12 +237,18 @@ async fn phase5_test_network_error(vm: &mut qlean::Machine) -> Result<()> {
237237
async fn test_campsite_api_store_integration() -> Result<()> {
238238
tracing_subscriber_init();
239239

240-
let image = create_image(Distro::Debian, "debian-13-generic-amd64").await?;
240+
let image = Image::new(
241+
ImageConfig::default()
242+
.with_distro(Distro::Debian)
243+
.with_arch(GuestArch::Amd64),
244+
)
245+
.await?;
241246
let config = MachineConfig {
242247
core: 2,
243248
mem: 2048,
244249
disk: Some(10),
245250
clear: true,
251+
..Default::default()
246252
};
247253

248254
with_machine(&image, &config, |vm| {

mono/tests/cl_merge_integration.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use std::{path::Path, time::Duration};
4949

5050
use anyhow::{Context, Result};
5151
use common::*;
52-
use qlean::{Distro, MachineConfig, create_image, with_machine};
52+
use qlean::{Distro, GuestArch, Image, ImageConfig, MachineConfig, with_machine};
5353
use serde_json::Value;
5454

5555
// Timing constants for test operations
@@ -912,12 +912,18 @@ async fn phase12_verify_cl2_merge(vm: &mut qlean::Machine, cl2: &str) -> Result<
912912
async fn test_cl_merge_integration() -> Result<()> {
913913
tracing_subscriber_init();
914914

915-
let image = create_image(Distro::Debian, "debian-13-generic-amd64").await?;
915+
let image = Image::new(
916+
ImageConfig::default()
917+
.with_distro(Distro::Debian)
918+
.with_arch(GuestArch::Amd64),
919+
)
920+
.await?;
916921
let config = MachineConfig {
917922
core: 2,
918923
mem: 2048,
919924
disk: Some(15),
920925
clear: true,
926+
..Default::default()
921927
};
922928

923929
with_machine(&image, &config, |vm| {

mono/tests/http_server_session_tests.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use std::time::Duration;
3636

3737
use anyhow::{Context, Result};
3838
use common::*;
39-
use qlean::{Distro, MachineConfig, create_image, with_machine};
39+
use qlean::{Distro, GuestArch, Image, ImageConfig, MachineConfig, with_machine};
4040

4141
// ============================================================================
4242
// Test Scenarios - All in one function to avoid multiple VM startups
@@ -254,12 +254,18 @@ async fn phase5_test_session_without_data(vm: &mut qlean::Machine) -> Result<()>
254254
async fn test_http_server_session_with_redis() -> Result<()> {
255255
tracing_subscriber_init();
256256

257-
let image = create_image(Distro::Debian, "debian-13-generic-amd64").await?;
257+
let image = Image::new(
258+
ImageConfig::default()
259+
.with_distro(Distro::Debian)
260+
.with_arch(GuestArch::Amd64),
261+
)
262+
.await?;
258263
let config = MachineConfig {
259264
core: 2,
260265
mem: 2048,
261266
disk: Some(15),
262267
clear: true,
268+
..Default::default()
263269
};
264270

265271
with_machine(&image, &config, |vm| {

mono/tests/login_user_extractor_tests.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use std::time::Duration;
3636

3737
use anyhow::{Context, Result};
3838
use common::*;
39-
use qlean::{Distro, MachineConfig, create_image, with_machine};
39+
use qlean::{Distro, GuestArch, Image, ImageConfig, MachineConfig, with_machine};
4040
use serde_json::Value;
4141

4242
// Docker service names (must match docker-compose.demo.yml)
@@ -273,12 +273,18 @@ async fn phase5_test_network_error(vm: &mut qlean::Machine) -> Result<()> {
273273
async fn test_login_user_extractor_integration() -> Result<()> {
274274
tracing_subscriber_init();
275275

276-
let image = create_image(Distro::Debian, "debian-13-generic-amd64").await?;
276+
let image = Image::new(
277+
ImageConfig::default()
278+
.with_distro(Distro::Debian)
279+
.with_arch(GuestArch::Amd64),
280+
)
281+
.await?;
277282
let config = MachineConfig {
278283
core: 2,
279284
mem: 2048,
280285
disk: Some(15),
281286
clear: true,
287+
..Default::default()
282288
};
283289

284290
with_machine(&image, &config, |vm| {

0 commit comments

Comments
 (0)