forked from j62/ctbrec
Add setting to switch on/off the server webinterface
This commit is contained in:
parent
1e5eff780c
commit
bc724b2f42
|
@ -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.
|
||||
|
|
|
@ -114,4 +114,5 @@ public class Settings {
|
|||
public int windowWidth = 1340;
|
||||
public int windowX;
|
||||
public int windowY;
|
||||
public boolean webinterface = false;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue