diff --git a/client/src/main/resources/html/docs/ConfigurationFile.md b/client/src/main/resources/html/docs/ConfigurationFile.md index 57d96ccc..75a19f56 100644 --- a/client/src/main/resources/html/docs/ConfigurationFile.md +++ b/client/src/main/resources/html/docs/ConfigurationFile.md @@ -56,3 +56,6 @@ the port ctbrec tries to connect to, if it is run in remote mode. - **splitRecordings** (app only) - [0 - 2147483647] in seconds. Split recordings after this amount of seconds. The recordings are split up into several individual recordings, which have the defined length (roughly). 0 means no splitting. The server does not support splitRecordings. + +- **webinterface** (server only) - [`true`,`false`] Enables the webinterface for the server. You can access it with http://host:port/static/index.html Don't activate this on +a machine, which can be accessed from the internet, because this is totally unprotected at the moment. diff --git a/common/src/main/java/ctbrec/Settings.java b/common/src/main/java/ctbrec/Settings.java index 9e7d3da4..d9f8fd1a 100644 --- a/common/src/main/java/ctbrec/Settings.java +++ b/common/src/main/java/ctbrec/Settings.java @@ -114,4 +114,5 @@ public class Settings { public int windowWidth = 1340; public int windowX; public int windowY; + public boolean webinterface = false; } diff --git a/server/src/main/java/ctbrec/recorder/server/HttpServer.java b/server/src/main/java/ctbrec/recorder/server/HttpServer.java index f30832aa..638f7275 100644 --- a/server/src/main/java/ctbrec/recorder/server/HttpServer.java +++ b/server/src/main/java/ctbrec/recorder/server/HttpServer.java @@ -142,11 +142,13 @@ public class HttpServer { holder = new ServletHolder(hlsServlet); handler.addServletWithMapping(holder, "/hls/*"); - String staticContext = "/static/*"; - LOG.info("Register static file servlet under {}", staticContext); - StaticFileServlet staticFileServlet = new StaticFileServlet("/html"); - holder = new ServletHolder(staticFileServlet); - handler.addServletWithMapping(holder, staticContext); + if (this.config.getSettings().webinterface) { + String staticContext = "/static/*"; + LOG.info("Register static file servlet under {}", staticContext); + StaticFileServlet staticFileServlet = new StaticFileServlet("/html"); + holder = new ServletHolder(staticFileServlet); + handler.addServletWithMapping(holder, staticContext); + } try { server.start();