From 0eff13301ee946b3bf9d3d1488f2918fcd234945 Mon Sep 17 00:00:00 2001 From: "Alexander V. Nikolaev" Date: Mon, 6 Jan 2025 16:17:41 +0200 Subject: [PATCH] Cleanup project root Signed-off-by: Alexander V. Nikolaev --- Cargo.toml | 43 ++----------------- common/api | 1 - crates/admin/Cargo.toml | 36 ++++++++++++++++ {src => crates/admin/src}/admin/entry.rs | 0 {src => crates/admin/src}/admin/mod.rs | 0 {src => crates/admin/src}/admin/registry.rs | 0 {src => crates/admin/src}/admin/server.rs | 0 {src => crates/admin/src}/bin/givc-admin.rs | 0 {src => crates/admin/src}/bin/givc-agent.rs | 0 {src => crates/admin/src}/bin/givc-cli.rs | 0 {src => crates/admin/src}/bin/givc-x509.rs | 0 {src => crates/admin/src}/lib.rs | 0 .../admin/src}/systemd_api/client.rs | 0 {src => crates/admin/src}/systemd_api/mod.rs | 0 .../admin/src}/systemd_api/server.rs | 0 {src => crates/admin/src}/utils/auth.rs | 0 {src => crates/admin/src}/utils/mod.rs | 0 {src => crates/admin/src}/utils/naming.rs | 0 {src => crates/admin/src}/utils/tonic.rs | 0 {src => crates/admin/src}/utils/vsock.rs | 0 {src => crates/admin/src}/utils/x509.rs | 0 {client => crates/client}/Cargo.toml | 0 {client => crates/client}/src/client.rs | 0 {client => crates/client}/src/endpoint.rs | 0 {client => crates/client}/src/error.rs | 0 {client => crates/client}/src/lib.rs | 0 {common => crates/common}/Cargo.toml | 0 crates/common/api | 1 + {common => crates/common}/build.rs | 0 {common => crates/common}/src/address.rs | 0 {common => crates/common}/src/lib.rs | 0 {common => crates/common}/src/query.rs | 0 {common => crates/common}/src/types.rs | 0 nixos/packages/givc-admin-rs.nix | 4 +- 34 files changed, 43 insertions(+), 42 deletions(-) delete mode 120000 common/api create mode 100644 crates/admin/Cargo.toml rename {src => crates/admin/src}/admin/entry.rs (100%) rename {src => crates/admin/src}/admin/mod.rs (100%) rename {src => crates/admin/src}/admin/registry.rs (100%) rename {src => crates/admin/src}/admin/server.rs (100%) rename {src => crates/admin/src}/bin/givc-admin.rs (100%) rename {src => crates/admin/src}/bin/givc-agent.rs (100%) rename {src => crates/admin/src}/bin/givc-cli.rs (100%) rename {src => crates/admin/src}/bin/givc-x509.rs (100%) rename {src => crates/admin/src}/lib.rs (100%) rename {src => crates/admin/src}/systemd_api/client.rs (100%) rename {src => crates/admin/src}/systemd_api/mod.rs (100%) rename {src => crates/admin/src}/systemd_api/server.rs (100%) rename {src => crates/admin/src}/utils/auth.rs (100%) rename {src => crates/admin/src}/utils/mod.rs (100%) rename {src => crates/admin/src}/utils/naming.rs (100%) rename {src => crates/admin/src}/utils/tonic.rs (100%) rename {src => crates/admin/src}/utils/vsock.rs (100%) rename {src => crates/admin/src}/utils/x509.rs (100%) rename {client => crates/client}/Cargo.toml (100%) rename {client => crates/client}/src/client.rs (100%) rename {client => crates/client}/src/endpoint.rs (100%) rename {client => crates/client}/src/error.rs (100%) rename {client => crates/client}/src/lib.rs (100%) rename {common => crates/common}/Cargo.toml (100%) create mode 120000 crates/common/api rename {common => crates/common}/build.rs (100%) rename {common => crates/common}/src/address.rs (100%) rename {common => crates/common}/src/lib.rs (100%) rename {common => crates/common}/src/query.rs (100%) rename {common => crates/common}/src/types.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index 46550d8..bbb9fe6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,43 +1,6 @@ [workspace] members = [ - "client", - "common", - "." + "crates/client", + "crates/common", + "crates/admin" ] - -[package] -authors = ["Alexander Nikolaev "] -edition = "2021" -license = "Apache 2.0" -name = "givc" -publish = false -version = "0.0.1" - -[dependencies] -anyhow = "1.0.86" -async-stream = "0.3" -async-channel = "2.3.1" -strum = {version = "0.26", features = ["derive"]} -clap = {version = "4.5.4", features = ["derive", "env"]} -console = "0.15" -prost = "0.13" -regex = "1.11" -tokio = {version = "1.0", features = ["rt-multi-thread", "time", "macros", "fs"]} -tokio-stream = "0.1" -tokio-vsock = "0.5" -tonic = {version="0.12", features = ["tls"]} -tonic-types = {version="0.12"} -tonic-reflection = {version="0.12"} -tower = {version = "0.4"} -tracing = "0.1" -tracing-subscriber = {version = "0.3", features = ["env-filter", "tracing-log", "time", "local-time"]} -tracing-journald = {version =" 0.2.0"} -serde = { version = "1.0.202", features = ["derive"]} -serde_json = "1.0.120" -x509-parser = { version = "0.16" } - -tokio-listener = { features = ["multi-listener", "tonic012", "vsock"], git = "https://github.com/avnik/tokio-listener", branch = "avnik/vsock-ghaf" } - -# GIVC subparts -givc-common = { path="common" } -givc-client = { path="client" } diff --git a/common/api b/common/api deleted file mode 120000 index 8edbb42..0000000 --- a/common/api +++ /dev/null @@ -1 +0,0 @@ -../api \ No newline at end of file diff --git a/crates/admin/Cargo.toml b/crates/admin/Cargo.toml new file mode 100644 index 0000000..9bb5328 --- /dev/null +++ b/crates/admin/Cargo.toml @@ -0,0 +1,36 @@ +[package] +authors = ["Alexander Nikolaev "] +edition = "2021" +license = "Apache 2.0" +name = "givc" +publish = false +version = "0.0.1" + +[dependencies] +anyhow = "1.0.86" +async-stream = "0.3" +async-channel = "2.3.1" +strum = {version = "0.26", features = ["derive"]} +clap = {version = "4.5.4", features = ["derive", "env"]} +console = "0.15" +prost = "0.13" +regex = "1.11" +tokio = {version = "1.0", features = ["rt-multi-thread", "time", "macros", "fs"]} +tokio-stream = "0.1" +tokio-vsock = "0.5" +tonic = {version="0.12", features = ["tls"]} +tonic-types = {version="0.12"} +tonic-reflection = {version="0.12"} +tower = {version = "0.4"} +tracing = "0.1" +tracing-subscriber = {version = "0.3", features = ["env-filter", "tracing-log", "time", "local-time"]} +tracing-journald = {version =" 0.2.0"} +serde = { version = "1.0.202", features = ["derive"]} +serde_json = "1.0.120" +x509-parser = { version = "0.16" } + +tokio-listener = { features = ["multi-listener", "tonic012", "vsock"], git = "https://github.com/avnik/tokio-listener", branch = "avnik/vsock-ghaf" } + +# GIVC subparts +givc-common = { path="../common" } +givc-client = { path="../client" } diff --git a/src/admin/entry.rs b/crates/admin/src/admin/entry.rs similarity index 100% rename from src/admin/entry.rs rename to crates/admin/src/admin/entry.rs diff --git a/src/admin/mod.rs b/crates/admin/src/admin/mod.rs similarity index 100% rename from src/admin/mod.rs rename to crates/admin/src/admin/mod.rs diff --git a/src/admin/registry.rs b/crates/admin/src/admin/registry.rs similarity index 100% rename from src/admin/registry.rs rename to crates/admin/src/admin/registry.rs diff --git a/src/admin/server.rs b/crates/admin/src/admin/server.rs similarity index 100% rename from src/admin/server.rs rename to crates/admin/src/admin/server.rs diff --git a/src/bin/givc-admin.rs b/crates/admin/src/bin/givc-admin.rs similarity index 100% rename from src/bin/givc-admin.rs rename to crates/admin/src/bin/givc-admin.rs diff --git a/src/bin/givc-agent.rs b/crates/admin/src/bin/givc-agent.rs similarity index 100% rename from src/bin/givc-agent.rs rename to crates/admin/src/bin/givc-agent.rs diff --git a/src/bin/givc-cli.rs b/crates/admin/src/bin/givc-cli.rs similarity index 100% rename from src/bin/givc-cli.rs rename to crates/admin/src/bin/givc-cli.rs diff --git a/src/bin/givc-x509.rs b/crates/admin/src/bin/givc-x509.rs similarity index 100% rename from src/bin/givc-x509.rs rename to crates/admin/src/bin/givc-x509.rs diff --git a/src/lib.rs b/crates/admin/src/lib.rs similarity index 100% rename from src/lib.rs rename to crates/admin/src/lib.rs diff --git a/src/systemd_api/client.rs b/crates/admin/src/systemd_api/client.rs similarity index 100% rename from src/systemd_api/client.rs rename to crates/admin/src/systemd_api/client.rs diff --git a/src/systemd_api/mod.rs b/crates/admin/src/systemd_api/mod.rs similarity index 100% rename from src/systemd_api/mod.rs rename to crates/admin/src/systemd_api/mod.rs diff --git a/src/systemd_api/server.rs b/crates/admin/src/systemd_api/server.rs similarity index 100% rename from src/systemd_api/server.rs rename to crates/admin/src/systemd_api/server.rs diff --git a/src/utils/auth.rs b/crates/admin/src/utils/auth.rs similarity index 100% rename from src/utils/auth.rs rename to crates/admin/src/utils/auth.rs diff --git a/src/utils/mod.rs b/crates/admin/src/utils/mod.rs similarity index 100% rename from src/utils/mod.rs rename to crates/admin/src/utils/mod.rs diff --git a/src/utils/naming.rs b/crates/admin/src/utils/naming.rs similarity index 100% rename from src/utils/naming.rs rename to crates/admin/src/utils/naming.rs diff --git a/src/utils/tonic.rs b/crates/admin/src/utils/tonic.rs similarity index 100% rename from src/utils/tonic.rs rename to crates/admin/src/utils/tonic.rs diff --git a/src/utils/vsock.rs b/crates/admin/src/utils/vsock.rs similarity index 100% rename from src/utils/vsock.rs rename to crates/admin/src/utils/vsock.rs diff --git a/src/utils/x509.rs b/crates/admin/src/utils/x509.rs similarity index 100% rename from src/utils/x509.rs rename to crates/admin/src/utils/x509.rs diff --git a/client/Cargo.toml b/crates/client/Cargo.toml similarity index 100% rename from client/Cargo.toml rename to crates/client/Cargo.toml diff --git a/client/src/client.rs b/crates/client/src/client.rs similarity index 100% rename from client/src/client.rs rename to crates/client/src/client.rs diff --git a/client/src/endpoint.rs b/crates/client/src/endpoint.rs similarity index 100% rename from client/src/endpoint.rs rename to crates/client/src/endpoint.rs diff --git a/client/src/error.rs b/crates/client/src/error.rs similarity index 100% rename from client/src/error.rs rename to crates/client/src/error.rs diff --git a/client/src/lib.rs b/crates/client/src/lib.rs similarity index 100% rename from client/src/lib.rs rename to crates/client/src/lib.rs diff --git a/common/Cargo.toml b/crates/common/Cargo.toml similarity index 100% rename from common/Cargo.toml rename to crates/common/Cargo.toml diff --git a/crates/common/api b/crates/common/api new file mode 120000 index 0000000..f46b949 --- /dev/null +++ b/crates/common/api @@ -0,0 +1 @@ +../../api \ No newline at end of file diff --git a/common/build.rs b/crates/common/build.rs similarity index 100% rename from common/build.rs rename to crates/common/build.rs diff --git a/common/src/address.rs b/crates/common/src/address.rs similarity index 100% rename from common/src/address.rs rename to crates/common/src/address.rs diff --git a/common/src/lib.rs b/crates/common/src/lib.rs similarity index 100% rename from common/src/lib.rs rename to crates/common/src/lib.rs diff --git a/common/src/query.rs b/crates/common/src/query.rs similarity index 100% rename from common/src/query.rs rename to crates/common/src/query.rs diff --git a/common/src/types.rs b/crates/common/src/types.rs similarity index 100% rename from common/src/types.rs rename to crates/common/src/types.rs diff --git a/nixos/packages/givc-admin-rs.nix b/nixos/packages/givc-admin-rs.nix index af7c7df..550e98e 100644 --- a/nixos/packages/givc-admin-rs.nix +++ b/nixos/packages/givc-admin-rs.nix @@ -13,6 +13,8 @@ let # Common arguments can be set here to avoid repeating them later # Note: changes here will rebuild all dependency crates commonArgs = { + pname = "givc"; + version = "0.0.1"; src = lib.cleanSourceWith { src = craneLib.path src; filter = protoOrCargo; @@ -42,7 +44,7 @@ let # MY_CUSTOM_VAR = "some value"; postUnpack = '' # Avoid issue with source filtering, put symlink back into source tree - ln -sf ../api $sourceRoot/common/api + ln -sf ../../api $sourceRoot/crates/common/api ''; postInstall = '' mkdir -p $cli/bin $agent/bin