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,
|
- **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.
|
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 windowWidth = 1340;
|
||||||
public int windowX;
|
public int windowX;
|
||||||
public int windowY;
|
public int windowY;
|
||||||
|
public boolean webinterface = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,11 +142,13 @@ public class HttpServer {
|
||||||
holder = new ServletHolder(hlsServlet);
|
holder = new ServletHolder(hlsServlet);
|
||||||
handler.addServletWithMapping(holder, "/hls/*");
|
handler.addServletWithMapping(holder, "/hls/*");
|
||||||
|
|
||||||
String staticContext = "/static/*";
|
if (this.config.getSettings().webinterface) {
|
||||||
LOG.info("Register static file servlet under {}", staticContext);
|
String staticContext = "/static/*";
|
||||||
StaticFileServlet staticFileServlet = new StaticFileServlet("/html");
|
LOG.info("Register static file servlet under {}", staticContext);
|
||||||
holder = new ServletHolder(staticFileServlet);
|
StaticFileServlet staticFileServlet = new StaticFileServlet("/html");
|
||||||
handler.addServletWithMapping(holder, staticContext);
|
holder = new ServletHolder(staticFileServlet);
|
||||||
|
handler.addServletWithMapping(holder, staticContext);
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
server.start();
|
server.start();
|
||||||
|
|
Loading…
Reference in New Issue