A focused Docker Compose management web application.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: docker compose wrapper

Brooke 4289fcb6 b7d5e9b8

+68 -1
+31
packages/node/Cargo.lock
··· 262 262 checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" 263 263 264 264 [[package]] 265 + name = "errno" 266 + version = "0.3.14" 267 + source = "registry+https://github.com/rust-lang/crates.io-index" 268 + checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" 269 + dependencies = [ 270 + "libc", 271 + "windows-sys 0.60.2", 272 + ] 273 + 274 + [[package]] 265 275 name = "eyre" 266 276 version = "0.6.12" 267 277 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 661 671 checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" 662 672 663 673 [[package]] 674 + name = "luminary-macros" 675 + version = "0.0.0" 676 + dependencies = [ 677 + "proc-macro2", 678 + "quote", 679 + "syn 2.0.114", 680 + ] 681 + 682 + [[package]] 664 683 name = "luminary-node" 665 684 version = "0.0.0" 666 685 dependencies = [ 667 686 "axum", 668 687 "bollard", 669 688 "color-eyre", 689 + "luminary-macros", 670 690 "serde", 671 691 "serde_json", 672 692 "specta", ··· 903 923 checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 904 924 905 925 [[package]] 926 + name = "signal-hook-registry" 927 + version = "1.4.8" 928 + source = "registry+https://github.com/rust-lang/crates.io-index" 929 + checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" 930 + dependencies = [ 931 + "errno", 932 + "libc", 933 + ] 934 + 935 + [[package]] 906 936 name = "slab" 907 937 version = "0.4.12" 908 938 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1077 1107 "libc", 1078 1108 "mio", 1079 1109 "pin-project-lite", 1110 + "signal-hook-registry", 1080 1111 "socket2", 1081 1112 "tokio-macros", 1082 1113 "windows-sys 0.61.2",
+6 -1
packages/node/Cargo.toml
··· 9 9 serde = "1.0.228" 10 10 serde_json = "1.0.149" 11 11 specta = { version = "1.0.5", features = ["functions"] } 12 - tokio = { version = "1.49.0", features = ["rt-multi-thread", "macros"] } 12 + luminary-macros = { path = "../macros" } 13 + tokio = { version = "1.49.0", features = [ 14 + "rt-multi-thread", 15 + "macros", 16 + "process", 17 + ] }
+1
packages/node/src/docker/list.rs
··· 1 +
+30
packages/node/src/docker/mod.rs
··· 1 + use std::process::Stdio; 1 2 3 + use color_eyre::eyre::{Context, Result}; 4 + use luminary_macros::wrap_err; 5 + use tokio::process::Command; 6 + 7 + mod list; 8 + 9 + pub struct DockerClient {} 10 + 11 + impl DockerClient { 12 + pub fn new() -> Self { 13 + Self {} 14 + } 15 + 16 + #[wrap_err("Failed to read from docker compose command line interface")] 17 + async fn read_cli(&self, args: Vec<&str>) -> Result<String> { 18 + let output = Command::new("docker") 19 + .arg("compose") 20 + .args(args) 21 + .stdout(Stdio::piped()) 22 + .stderr(Stdio::null()) 23 + .spawn() 24 + .wrap_err("Failed to spawn child process")? 25 + .wait_with_output() 26 + .await 27 + .wrap_err("Failed to wait on child process")?; 28 + let string = String::from_utf8(output.stdout).wrap_err("Invalid UTF-8 from child process")?; 29 + return Ok(string); 30 + } 31 + }