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 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 diff --git a/src/main.rs b/src/main.rs index 6723ebe..c1ad7a8 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 { @@ -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() 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]