diff --git a/README.md b/README.md index 28252e0..4b9cec9 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,21 @@ unnecessary features, or they didn't have all the features I wanted. - Backend written in Java using [Spark Java](http://sparkjava.com/), frontend written in plain HTML and vanilla JS, using [Pure CSS](https://purecss.io/) for styling + +# Bloat that will not be implemented +- Logging, tracking or spying of any kind. The only logs that still exist are + errors printed to stderr and the default SLF4J warning +- User management. If you need a shortener for your whole organisation, either + run separate containers for everyone or use something else +- Cookies, newsletters, "we value your privacy" popups or any of the multiple +other ways modern web shows how anti-user it is. We all hate those and they're +not needed here +- Paywalls or messages beging for donations. If you want to support me (for +whatever reason), you can message me through Github issues or via email +[github@draganczuk.tk](mailto:github@draganczuk.tk) + +I _might_ add one of those "fork me on github" thingies in the corner, though I +doubt I will # Screenshot ![Screenshot](./screenshot.png) @@ -55,6 +70,8 @@ export db.url= # Default: './urls.sqlite' ``` java -jar build/libs/url.jar ``` +You can optionally set the port the server listens on by appending `--port=[port]` + ### 4. Navigate to `http://localhost:4567` in your browser, add links as you wish. ## Running with docker diff --git a/src/main/java/tk/draganczuk/url/App.java b/src/main/java/tk/draganczuk/url/App.java index 4258751..332263f 100644 --- a/src/main/java/tk/draganczuk/url/App.java +++ b/src/main/java/tk/draganczuk/url/App.java @@ -1,7 +1,5 @@ package tk.draganczuk.url; -import spark.Filter; - import static spark.Spark.*; public class App { @@ -17,13 +15,13 @@ public class App { staticFiles.location("/public"); } - port(Integer.parseInt(System.getProperty("port", "4567"))); + port(Integer.parseInt(System.getenv().getOrDefault("port", "4567"))); // Add GZIP compression after(Filters::addGZIP); // No need to auth in dev - if(System.getenv("dev") == null) { + if (System.getenv("dev") == null) { // Authenticate before("/api/*", Filters.createAuthFilter()); } diff --git a/src/main/java/tk/draganczuk/url/Routes.java b/src/main/java/tk/draganczuk/url/Routes.java index e775660..da2765e 100644 --- a/src/main/java/tk/draganczuk/url/Routes.java +++ b/src/main/java/tk/draganczuk/url/Routes.java @@ -4,8 +4,6 @@ import org.eclipse.jetty.http.HttpStatus; import spark.Request; import spark.Response; -import java.io.IOException; - public class Routes { private static UrlRepository urlRepository; diff --git a/src/main/java/tk/draganczuk/url/UrlRepository.java b/src/main/java/tk/draganczuk/url/UrlRepository.java index 456e3c2..8e84ec3 100644 --- a/src/main/java/tk/draganczuk/url/UrlRepository.java +++ b/src/main/java/tk/draganczuk/url/UrlRepository.java @@ -1,10 +1,5 @@ package tk.draganczuk.url; -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.StandardCopyOption; -import java.nio.file.StandardOpenOption; import java.sql.*; import java.util.ArrayList; import java.util.List;