From 8220d9e6edfe44f2c5ec408b7d2b1c2f7234432e Mon Sep 17 00:00:00 2001 From: cruizba Date: Mon, 21 Feb 2022 22:19:38 +0100 Subject: [PATCH] openvidu-server: Minor changes on showing configuration at first run. - Don't show on running some empty parameters on first run. - Add post processing config for openvidu-pro to show postprocessed config parameters correctly on first run. --- .../openvidu/server/config/OpenviduConfig.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/openvidu-server/src/main/java/io/openvidu/server/config/OpenviduConfig.java b/openvidu-server/src/main/java/io/openvidu/server/config/OpenviduConfig.java index d143691c..bbe9f160 100644 --- a/openvidu-server/src/main/java/io/openvidu/server/config/OpenviduConfig.java +++ b/openvidu-server/src/main/java/io/openvidu/server/config/OpenviduConfig.java @@ -541,8 +541,15 @@ public class OpenviduConfig { log.error("Exception checking configuration", e); addError(null, "Exception checking configuration." + e.getClass().getName() + ":" + e.getMessage()); } + postProcessConfigProps(); userConfigProps = new ArrayList<>(configProps.keySet()); userConfigProps.removeAll(getNonUserProperties()); + for (String notShowEmptyConfigKey: getNonPrintablePropertiesIfEmpty()) { + String value = configProps.get(notShowEmptyConfigKey); + if (value == null || value.isEmpty() || value.equals(new JsonArray().toString())) { + userConfigProps.remove(notShowEmptyConfigKey); + } + } } @PostConstruct @@ -550,12 +557,23 @@ public class OpenviduConfig { this.checkConfiguration(true); } + protected void postProcessConfigProps() { + } + + protected Map getPostProcessedProperties() { + return new HashMap<>(); + } + protected List getNonUserProperties() { return Arrays.asList("server.port", "SERVER_PORT", "DOTENV_PATH", "COTURN_IP", "COTURN_PORT", "COTURN_REDIS_IP", "COTURN_REDIS_DBNAME", "COTURN_REDIS_PASSWORD", "COTURN_REDIS_CONNECT_TIMEOUT", "COTURN_INTERNAL_RELAY", "OPENVIDU_RECORDING_IMAGE", "OPENVIDU_RECORDING_ENABLE_GPU"); } + protected List getNonPrintablePropertiesIfEmpty() { + return Arrays.asList("MEDIA_NODES_PUBLIC_IPS", "OPENVIDU_WEBRTC_ICE_SERVERS"); + } + // Properties protected void checkConfigurationProperties(boolean loadDotenv) {