From 6b03ea5cf3ee23b917ae4ad9ec085ef3871685f7 Mon Sep 17 00:00:00 2001 From: Matteo Pietro Dazzi Date: Sat, 2 Mar 2024 16:11:50 +0100 Subject: [PATCH 1/4] feat: build docker image --- .dockerignore | 1 + Dockerfile | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1de5659 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +target \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3555d3a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM clux/muslrust:stable as builder +ADD . /skyfolder +WORKDIR /skyfolder +RUN echo "nobody:x:65534:65534:Nobody:/:" > /etc_passwd && \ + cargo build --release + +################################### + +FROM scratch +ARG arch=x86_64 +COPY --from=builder "/skyfolder/target/${arch}-unknown-linux-musl/release/skyfolder" "./skyfolder" +COPY --from=builder "/etc_passwd" "/etc/passwd" +USER nobody +EXPOSE 30080 +ENTRYPOINT [ "./skyfolder" ] \ No newline at end of file From bd56384b40ff470771eef83f54193ed4efdc43fe Mon Sep 17 00:00:00 2001 From: Matteo Pietro Dazzi Date: Sat, 2 Mar 2024 16:16:11 +0100 Subject: [PATCH 2/4] fix: github typo --- src/main.rs | 4 ++-- templates/about.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6723ebe..9b9ab5c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,8 +28,8 @@ include!(concat!(env!("OUT_DIR"), "/constants.rs")); async fn main() { println!("Starting up \x1B[95mSkyFolder\x1B[0m {VERSION}\n"); - println!("✅ If you need a feature or find a bug let me know in the Github issues tab."); - println!("⭐ If you like the program please star it on Github as it helps me."); + println!("✅ If you need a feature or find a bug let me know in the GitHub issues tab."); + println!("⭐ If you like the program please star it on GitHub as it helps me."); //start the actual application if let Err(e) = init().await { diff --git a/templates/about.html b/templates/about.html index ad55f53..ed6aadb 100644 --- a/templates/about.html +++ b/templates/about.html @@ -34,7 +34,7 @@
SkyFolder Logo

Version: {{ VERSION }}

-

Source code: [Github]

+

Source code: [GitHub]

License: GPLv3

Crafted with love and care 💕

[Back]

From 2c2a0c7072f439b611e848b4743dcfc011fff59e Mon Sep 17 00:00:00 2001 From: Matteo Pietro Dazzi Date: Sat, 2 Mar 2024 16:27:09 +0100 Subject: [PATCH 3/4] fix: remove public ip message if not available --- src/main.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9b9ab5c..c1ad7a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -73,8 +73,12 @@ async fn init() -> Result<(), AppErrorInternal> { } //todo only show this if the user has upnp mode enabled. remember to set port to whatever upnp negotiates - println!("Available on WAN (Public internet) at:"); - println!(" http://{}:30080", helper::get_public_ip().await.unwrap_or("Failed to determine IP".to_string())); + let public_ip = helper::get_public_ip().await.unwrap_or("".to_string()); + + if public_ip != "" { + println!("Available on WAN (Public internet) at:"); + println!(" http://{}:30080", public_ip); + } let app = axum::Router::new() From c8bcf6446900510695c9486c066f94df513dd5cd Mon Sep 17 00:00:00 2001 From: Matteo Pietro Dazzi Date: Sat, 2 Mar 2024 16:32:25 +0100 Subject: [PATCH 4/4] fix: js typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ade311..0603793 100644 --- a/README.md +++ b/README.md @@ -82,4 +82,4 @@ It's not complete as of Sep 2, 2023. Expect updates soon. ## Limitations -1. Some functionality requires Javascript to work \ No newline at end of file +1. Some functionality requires JavaScript to work \ No newline at end of file