From 44f567490bd19a4bcdd6911bcd8dfd2913f60ce5 Mon Sep 17 00:00:00 2001 From: Entity Date: Wed, 16 Oct 2024 15:01:53 +0200 Subject: [PATCH] Initial Build --- .devcontainer/Dev.Dockerfile | 2 +- .gitignore | 3 ++- SSH-Transfer/.cargo/config.toml | 5 +++++ SSH-Transfer/Source/App.rs | 4 +++- 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 SSH-Transfer/.cargo/config.toml diff --git a/.devcontainer/Dev.Dockerfile b/.devcontainer/Dev.Dockerfile index be5c98b..d6681f7 100644 --- a/.devcontainer/Dev.Dockerfile +++ b/.devcontainer/Dev.Dockerfile @@ -1,6 +1,6 @@ FROM alpine:latest # Install dependencies -RUN apk add --no-cache --update g++ zsh git ca-certificates curl openssh-client +RUN apk add --no-cache --update g++ zsh git ca-certificates curl openssh-client musl-dev clang lld llvm file # Add my user RUN adduser Entity -h /home/Entity -S --shell /bin/zsh RUN addgroup Entity diff --git a/.gitignore b/.gitignore index 3c1e41e..2aeffc7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -SSH-Transfer/target \ No newline at end of file +SSH-Transfer/target +SSH-Transfer/SSH-Transfer \ No newline at end of file diff --git a/SSH-Transfer/.cargo/config.toml b/SSH-Transfer/.cargo/config.toml new file mode 100644 index 0000000..aabe38d --- /dev/null +++ b/SSH-Transfer/.cargo/config.toml @@ -0,0 +1,5 @@ +[build] +target = "x86_64-unknown-linux-musl" + +[target.'cfg(target_os = "linux")'] +rustflags = ["-C", "linker=ld.lld", "-C", "relocation-model=static", "-C", "strip=symbols"] \ No newline at end of file diff --git a/SSH-Transfer/Source/App.rs b/SSH-Transfer/Source/App.rs index 171ec37..e9ba9b6 100644 --- a/SSH-Transfer/Source/App.rs +++ b/SSH-Transfer/Source/App.rs @@ -15,10 +15,12 @@ struct CLI fn main() { + #[cfg(debug_assertions)] let Args = CLI::parse(); let CurrentUUID = get_current_uid(); let CurrentUser = get_user_by_uid(CurrentUUID).unwrap(); + #[cfg(debug_assertions)] let CurrentUserName = CurrentUser.name().to_str().unwrap(); let CurrentUserHomeDir = CurrentUser.home_dir().to_str().unwrap(); @@ -26,7 +28,7 @@ fn main() println!("Program running from {} with UUID {}", CurrentUserName, CurrentUUID ); #[cfg(debug_assertions)] println!("{}'s home directory: {}" , CurrentUserName, CurrentUserHomeDir); - + #[cfg(debug_assertions)] println!("Copying from {} to {}/.ssh", Args.Source, CurrentUserHomeDir); VerifySource();