openvidu-server: show warning log on startup if openvidu-dev container

pull/750/head
pabloFuente 2022-09-20 16:09:47 +02:00
parent ec6106b079
commit 7e5a8afb48
3 changed files with 27 additions and 1 deletions

View File

@ -9,5 +9,5 @@ command=/bin/bash /kms.sh
redirect_stderr=true
[program:openvidu-server]
command=/bin/bash -c "java -jar -Dspring.config.additional-location=classpath:/application-container.properties /openvidu-server.jar"
command=/bin/bash -c "java -jar -Dspring.config.additional-location=classpath:/application-container.properties -DOPENVIDU_DEV=true /openvidu-server.jar"
redirect_stderr=true

View File

@ -366,6 +366,13 @@ public class OpenViduServer implements JsonRpcConfigurer {
+ "----------------------------------------------------\n";
// @formatter:on
if (config.isOpenViduDev()) {
// @formatter:off
msg += "\n\n WARNING!! THIS OPENVIDU DEPLOYMENT IS NOT SUITABLE FOR PRODUCTION ENVIRONMENTS\n"
+ " To deploy in production visit https://docs.openvidu.io/en/stable/deployment\n\n";
// @formatter:on
}
log.info(msg);
}

View File

@ -205,6 +205,8 @@ public class OpenviduConfig {
private String dotenvPath;
private boolean openviduDev = false;
// Media Nodes private IPs and Public IPs
// If defined, they will be configured as public IPs of Kurento or Mediasoup
// Key: Private IP
@ -445,6 +447,10 @@ public class OpenviduConfig {
return secret.equals(this.getOpenViduSecret());
}
public boolean isOpenViduDev() {
return this.openviduDev;
}
public boolean openviduRecordingCustomLayoutChanged(String path) {
return !"/opt/openvidu/custom-layout".equals(path);
}
@ -634,6 +640,10 @@ public class OpenviduConfig {
webrtcIceServersBuilders = loadWebrtcIceServers("OPENVIDU_WEBRTC_ICE_SERVERS");
Boolean openviduDevAux = asOptionalBoolean("OPENVIDU_DEV");
if (openviduDevAux != null) {
openviduDev = openviduDevAux;
}
}
private void checkCertificateType() {
@ -877,6 +887,15 @@ public class OpenviduConfig {
return getValue(property);
}
protected Boolean asOptionalBoolean(String property) {
Boolean value = null;
String strValue = this.getValue(property, false);
if (strValue != null) {
value = Boolean.parseBoolean(strValue);
}
return value;
}
protected String asOptionalStringAndNullIfBlank(String property) {
String value = getValue(property);
if (value != null && value.isBlank()) {