1
0
Fork 0
mirror of https://codeberg.org/icewind/haze.git synced 2026-06-03 09:04:12 +02:00
This commit is contained in:
Robin Appelman 2025-03-04 21:57:52 +01:00
commit 1992f7f80a
5 changed files with 541 additions and 535 deletions

1037
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -2,17 +2,17 @@
name = "haze" name = "haze"
version = "1.6.0" version = "1.6.0"
authors = ["Robin Appelman <robin@icewind.nl>"] authors = ["Robin Appelman <robin@icewind.nl>"]
edition = "2018" edition = "2024"
repository = "https://github.com/icewind1991/haze" repository = "https://github.com/icewind1991/haze"
license = "MIT" license = "MIT"
description = "Easy setup and management of Nextcloud test instances using docker" description = "Easy setup and management of Nextcloud test instances using docker"
[dependencies] [dependencies]
bollard = "0.16.1" bollard = "0.18.1"
maplit = "1.0.2" maplit = "1.0.2"
camino = { version = "1.1.7", features = ["serde1"] } camino = { version = "1.1.7", features = ["serde1"] }
tokio = { version = "1.38.0", features = ["fs", "macros", "signal", "rt-multi-thread"] } tokio = { version = "1.38.0", features = ["fs", "macros", "signal", "rt-multi-thread"] }
parse-display = "0.9.1" parse-display = "0.10.0"
futures-util = "0.3.30" futures-util = "0.3.30"
termion = "4.0.1" termion = "4.0.1"
opener = "0.7.1" opener = "0.7.1"
@ -35,7 +35,7 @@ tracing-subscriber = "0.3.18"
hyper-reverse-proxy = { version = "0.5.2-dev", git = "https://github.com/felipenoris/hyper-reverse-proxy" } hyper-reverse-proxy = { version = "0.5.2-dev", git = "https://github.com/felipenoris/hyper-reverse-proxy" }
hyper = "0.14.29" hyper = "0.14.29"
atty = "0.2.14" atty = "0.2.14"
git2 = { version = "0.18.3", default-features = false } git2 = { version = "0.20.0", default-features = false }
[profile.release] [profile.release]
lto = true lto = true

30
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"crane": { "crane": {
"locked": { "locked": {
"lastModified": 1733688869, "lastModified": 1739936662,
"narHash": "sha256-KrhxxFj1CjESDrL5+u/zsVH0K+Ik9tvoac/oFPoxSB8=", "narHash": "sha256-x4syUjNUuRblR07nDPeLDP7DpphaBVbUaSoeZkFbGSk=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "604637106e420ad99907cae401e13ab6b452e7d9", "rev": "19de14aaeb869287647d9461cbd389187d8ecdb7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +22,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1739796086, "lastModified": 1741005720,
"narHash": "sha256-jxpUiVJ6O+V1YsXsvWdMgqnv8zk9TFiqF86CRdGGGH4=", "narHash": "sha256-zNIvYFBOTGomaxknkZLO/7p6eorwwgvHeatN2YySBPQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "flakelight", "repo": "flakelight",
"rev": "540efca2f9015aff7dc574c7a03404e5fa72d42f", "rev": "f996547e5d142853ab6d619858a605af516d1d67",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -44,11 +44,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1735052218, "lastModified": 1740783063,
"narHash": "sha256-I30wh6G8fSUO4EseexxiDXcxyUhXR6C8BvEeKn6xyfE=", "narHash": "sha256-nJ/tvNBWFNJtwtNG/KsqtVq4p3aitkEb1pRW0qHvmsk=",
"owner": "icewind1991", "owner": "icewind1991",
"repo": "mill-scale", "repo": "mill-scale",
"rev": "7e45bb598ff63a8416ee3c26743b20644563bd93", "rev": "591ea924cfd3cd7932b385341fb0aad0a935bb46",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -59,11 +59,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1739758141, "lastModified": 1740932899,
"narHash": "sha256-uq6A2L7o1/tR6VfmYhZWoVAwb3gTy7j4Jx30MIrH0rE=", "narHash": "sha256-F0qDu2egq18M3edJwEOAE+D+VQ+yESK6YWPRQBfOqq8=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c618e28f70257593de75a7044438efc1c1fc0791", "rev": "1546c45c538633ae40b93e2d14e0bb6fd8f13347",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -88,11 +88,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733884434, "lastModified": 1740277845,
"narHash": "sha256-8GXR9kC07dyOIshAyfZhG11xfvBRSZzYghnZ2weOKJU=", "narHash": "sha256-NNU0CdiaSbAeZ8tpDG4aFi9qtcdlItRvk8Xns9oBrVU=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "d0483df44ddf0fd1985f564abccbe568e020ddf2", "rev": "f933070c29f9c1c5457447a51903f27f76ebb519",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,14 +1,14 @@
use crate::config::{HazeConfig, HazeVolumeConfig, Preset}; use crate::config::{HazeConfig, HazeVolumeConfig, Preset};
use crate::database::Database; use crate::database::Database;
use crate::exec::{exec, exec_io, exec_tty, ExitCode}; use crate::exec::{ExitCode, exec, exec_io, exec_tty};
use crate::mapping::{default_mappings, Mapping}; use crate::mapping::{Mapping, default_mappings};
use crate::php::{PhpVersion, PHP_MEMORY_LIMIT}; use crate::php::{PHP_MEMORY_LIMIT, PhpVersion};
use crate::service::Service; use crate::service::Service;
use crate::service::ServiceTrait; use crate::service::ServiceTrait;
use bollard::Docker;
use bollard::container::{ListContainersOptions, RemoveContainerOptions, UpdateContainerOptions}; use bollard::container::{ListContainersOptions, RemoveContainerOptions, UpdateContainerOptions};
use bollard::models::ContainerState; use bollard::models::ContainerState;
use bollard::network::CreateNetworkOptions; use bollard::network::CreateNetworkOptions;
use bollard::Docker;
use camino::Utf8PathBuf; use camino::Utf8PathBuf;
use flate2::read::GzDecoder; use flate2::read::GzDecoder;
use futures_util::future::try_join_all; use futures_util::future::try_join_all;
@ -18,7 +18,7 @@ use serde_json::Value;
use std::collections::HashMap; use std::collections::HashMap;
use std::fmt::Display; use std::fmt::Display;
use std::fs; use std::fs;
use std::io::{stdout, Cursor, Read, Stdout, Write}; use std::io::{Cursor, Read, Stdout, Write, stdout};
use std::iter::Peekable; use std::iter::Peekable;
use std::net::IpAddr; use std::net::IpAddr;
use std::os::unix::fs::MetadataExt; use std::os::unix::fs::MetadataExt;
@ -254,9 +254,7 @@ impl Cloud {
}) })
.await .await
.into_diagnostic()? .into_diagnostic()?
.id .id;
.ok_or_else(|| Report::msg("No network id in response"))
.wrap_err("Failed to create network")?;
let network_info = docker let network_info = docker
.inspect_network::<String>(&network, None) .inspect_network::<String>(&network, None)

View file

@ -46,7 +46,6 @@ pub async fn ensure_network_exists(docker: &Docker, name: &str) -> Result<String
}) })
.await .await
.into_diagnostic()? .into_diagnostic()?
.id .id)
.unwrap())
} }
} }