(system) Supply local IP to service discovery if multiFace is enabled

This commit is contained in:
Viktor Lofgren 2024-12-19 22:20:19 +01:00
parent b1f970152d
commit 1118657ffd

View File

@ -72,6 +72,17 @@ public class ServiceConfigurationModule extends AbstractModule {
return configuredValue; return configuredValue;
} }
if (Boolean.getBoolean("system.multiFace")) {
try {
String localNetworkIp = getLocalNetworkIP();
if (null != localNetworkIp) {
return localNetworkIp;
}
}
catch (Exception ex) {
logger.warn("Failed to get local network IP", ex);
}
}
// If we're in docker, we'll use the hostname // If we're in docker, we'll use the hostname
if (Boolean.getBoolean("service.useDockerHostname")) { if (Boolean.getBoolean("service.useDockerHostname")) {
return System.getenv("HOSTNAME"); return System.getenv("HOSTNAME");