Initial Build

This commit is contained in:
Entity 2024-10-16 15:01:53 +02:00
parent 3d1e27919e
commit 44f567490b
Signed by: Entity
SSH Key Fingerprint: SHA256:zdOcLEK0rgkzxXEN6vZ1EuWYnQSp4+5l+j2y3omc7Tk
4 changed files with 11 additions and 3 deletions

View File

@ -1,6 +1,6 @@
FROM alpine:latest FROM alpine:latest
# Install dependencies # 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 # Add my user
RUN adduser Entity -h /home/Entity -S --shell /bin/zsh RUN adduser Entity -h /home/Entity -S --shell /bin/zsh
RUN addgroup Entity RUN addgroup Entity

1
.gitignore vendored
View File

@ -1 +1,2 @@
SSH-Transfer/target SSH-Transfer/target
SSH-Transfer/SSH-Transfer

View File

@ -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"]

View File

@ -15,10 +15,12 @@ struct CLI
fn main() fn main()
{ {
#[cfg(debug_assertions)]
let Args = CLI::parse(); let Args = CLI::parse();
let CurrentUUID = get_current_uid(); let CurrentUUID = get_current_uid();
let CurrentUser = get_user_by_uid(CurrentUUID).unwrap(); let CurrentUser = get_user_by_uid(CurrentUUID).unwrap();
#[cfg(debug_assertions)]
let CurrentUserName = CurrentUser.name().to_str().unwrap(); let CurrentUserName = CurrentUser.name().to_str().unwrap();
let CurrentUserHomeDir = CurrentUser.home_dir().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 ); println!("Program running from {} with UUID {}", CurrentUserName, CurrentUUID );
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
println!("{}'s home directory: {}" , CurrentUserName, CurrentUserHomeDir); println!("{}'s home directory: {}" , CurrentUserName, CurrentUserHomeDir);
#[cfg(debug_assertions)]
println!("Copying from {} to {}/.ssh", Args.Source, CurrentUserHomeDir); println!("Copying from {} to {}/.ssh", Args.Source, CurrentUserHomeDir);
VerifySource(); VerifySource();