mirror of https://github.com/OpenVidu/openvidu.git
OpenVidu Server dashboard not being served until recording Docker image is downloaded (if recording module is enabled)
parent
e865e216d0
commit
f6a3c0983e
|
@ -11,7 +11,7 @@ export class RestService {
|
||||||
if (!!this.openviduPublicUrl) {
|
if (!!this.openviduPublicUrl) {
|
||||||
resolve(this.openviduPublicUrl);
|
resolve(this.openviduPublicUrl);
|
||||||
} else {
|
} else {
|
||||||
const url = location.protocol + '//' + location.hostname + ':' + (!!location.port ? location.port : '8443') +
|
const url = location.protocol + '//' + location.hostname + ((!!location.port) ? (':' + location.port) : '') +
|
||||||
'/config/openvidu-publicurl';
|
'/config/openvidu-publicurl';
|
||||||
const http = new XMLHttpRequest();
|
const http = new XMLHttpRequest();
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,11 @@
|
||||||
package io.openvidu.server;
|
package io.openvidu.server;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.MalformedURLException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.annotation.PostConstruct;
|
||||||
import javax.ws.rs.ProcessingException;
|
import javax.ws.rs.ProcessingException;
|
||||||
|
|
||||||
import org.kurento.jsonrpc.JsonUtils;
|
import org.kurento.jsonrpc.JsonUtils;
|
||||||
|
@ -31,7 +33,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Import;
|
import org.springframework.context.annotation.Import;
|
||||||
import org.springframework.core.env.Environment;
|
import org.springframework.core.env.Environment;
|
||||||
|
@ -126,14 +127,36 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
||||||
return new CallDetailRecord();
|
return new CallDetailRecord();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean
|
||||||
|
public OpenviduConfig openviduConfig() {
|
||||||
|
return new OpenviduConfig();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
@ConditionalOnMissingBean
|
||||||
|
public ComposedRecordingService composedRecordingService() {
|
||||||
|
return new ComposedRecordingService();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerJsonRpcHandlers(JsonRpcHandlerRegistry registry) {
|
public void registerJsonRpcHandlers(JsonRpcHandlerRegistry registry) {
|
||||||
registry.addHandler(rpcHandler().withPingWatchdog(true), "/room");
|
registry.addHandler(rpcHandler().withPingWatchdog(true), "/room");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getContainerIp() throws IOException, InterruptedException {
|
||||||
|
return CommandExecutor.execCommand("/bin/sh", "-c", "hostname -i | awk '{print $1}'");
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
ConfigurableApplicationContext context = start(args);
|
log.info("Using /dev/urandom for secure random generation");
|
||||||
OpenviduConfig openviduConf = context.getBean(OpenviduConfig.class);
|
System.setProperty("java.security.egd", "file:/dev/./urandom");
|
||||||
|
SpringApplication.run(OpenViduServer.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() throws MalformedURLException, InterruptedException {
|
||||||
|
OpenviduConfig openviduConf = openviduConfig();
|
||||||
|
|
||||||
String publicUrl = openviduConf.getOpenViduPublicUrl();
|
String publicUrl = openviduConf.getOpenViduPublicUrl();
|
||||||
String type = publicUrl;
|
String type = publicUrl;
|
||||||
|
@ -142,10 +165,15 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
||||||
case "ngrok":
|
case "ngrok":
|
||||||
try {
|
try {
|
||||||
NgrokRestController ngrok = new NgrokRestController();
|
NgrokRestController ngrok = new NgrokRestController();
|
||||||
|
String ngrokAppUrl = ngrok.getNgrokAppUrl();
|
||||||
|
if (ngrokAppUrl.isEmpty()) {
|
||||||
|
ngrokAppUrl = "(No tunnel 'app' found in ngrok.yml)";
|
||||||
|
}
|
||||||
final String NEW_LINE = System.getProperty("line.separator");
|
final String NEW_LINE = System.getProperty("line.separator");
|
||||||
String str = NEW_LINE + " PUBLIC IP " +
|
String str = NEW_LINE +
|
||||||
|
NEW_LINE + " APP PUBLIC IP " +
|
||||||
NEW_LINE + "-------------------------" +
|
NEW_LINE + "-------------------------" +
|
||||||
NEW_LINE + ngrok.getNgrokAppUrl() +
|
NEW_LINE + ngrokAppUrl +
|
||||||
NEW_LINE + "-------------------------" +
|
NEW_LINE + "-------------------------" +
|
||||||
NEW_LINE;
|
NEW_LINE;
|
||||||
log.info(str);
|
log.info(str);
|
||||||
|
@ -210,7 +238,7 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
||||||
|
|
||||||
boolean recordingModuleEnabled = openviduConf.isRecordingModuleEnabled();
|
boolean recordingModuleEnabled = openviduConf.isRecordingModuleEnabled();
|
||||||
if (recordingModuleEnabled) {
|
if (recordingModuleEnabled) {
|
||||||
ComposedRecordingService recordingService = context.getBean(ComposedRecordingService.class);
|
ComposedRecordingService recordingService = composedRecordingService();
|
||||||
recordingService.setRecordingVersion(openviduConf.getOpenViduRecordingVersion());
|
recordingService.setRecordingVersion(openviduConf.getOpenViduRecordingVersion());
|
||||||
log.info("Recording module required: Downloading openvidu/openvidu-recording:"
|
log.info("Recording module required: Downloading openvidu/openvidu-recording:"
|
||||||
+ openviduConf.getOpenViduRecordingVersion() + " Docker image (800 MB aprox)");
|
+ openviduConf.getOpenViduRecordingVersion() + " Docker image (800 MB aprox)");
|
||||||
|
@ -260,18 +288,7 @@ public class OpenViduServer implements JsonRpcConfigurer {
|
||||||
|
|
||||||
recordingService.initRecordingPath();
|
recordingService.initRecordingPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("OpenVidu Server using " + type + " URL: [" + OpenViduServer.publicUrl + "]");
|
log.info("OpenVidu Server using " + type + " URL: [" + OpenViduServer.publicUrl + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getContainerIp() throws IOException, InterruptedException {
|
|
||||||
return CommandExecutor.execCommand("/bin/sh", "-c", "hostname -i | awk '{print $1}'");
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ConfigurableApplicationContext start(String[] args) {
|
|
||||||
log.info("Using /dev/urandom for secure random generation");
|
|
||||||
System.setProperty("java.security.egd", "file:/dev/./urandom");
|
|
||||||
return SpringApplication.run(OpenViduServer.class, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"sources":["webpack/bootstrap ea96a76fbedd04f4a59b"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t\"inline\": 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap ea96a76fbedd04f4a59b"],"sourceRoot":"webpack:///"}
|
{"version":3,"sources":["webpack/bootstrap 2a3452e6cdd2c2100283"],"names":[],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAQ,oBAAoB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAY,2BAA2B;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA,kDAA0C,oBAAoB,WAAW","file":"inline.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t\"inline\": 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 2a3452e6cdd2c2100283"],"sourceRoot":"webpack:///"}
|
|
@ -16018,7 +16018,7 @@ var RestService = (function () {
|
||||||
resolve(_this.openviduPublicUrl);
|
resolve(_this.openviduPublicUrl);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var url = location.protocol + '//' + location.hostname + ':' + (!!location.port ? location.port : '8443') +
|
var url = location.protocol + '//' + location.hostname + ((!!location.port) ? (':' + location.port) : '') +
|
||||||
'/config/openvidu-publicurl';
|
'/config/openvidu-publicurl';
|
||||||
var http_1 = new XMLHttpRequest();
|
var http_1 = new XMLHttpRequest();
|
||||||
http_1.onreadystatechange = function () {
|
http_1.onreadystatechange = function () {
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue