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.
pull/701/head
cruizba 2022-02-21 22:19:38 +01:00
parent c972751e42
commit 8220d9e6ed
1 changed files with 18 additions and 0 deletions

View File

@ -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<String, String> getPostProcessedProperties() {
return new HashMap<>();
}
protected List<String> 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<String> getNonPrintablePropertiesIfEmpty() {
return Arrays.asList("MEDIA_NODES_PUBLIC_IPS", "OPENVIDU_WEBRTC_ICE_SERVERS");
}
// Properties
protected void checkConfigurationProperties(boolean loadDotenv) {