(system) To support configurations with multiple docker networks, bind to the "most local" interface.

Make the behavior optional.
This commit is contained in:
Viktor Lofgren 2024-12-19 20:26:31 +01:00
parent e1783891ab
commit b1f970152d

View File

@ -91,11 +91,15 @@ public class ServiceConfigurationModule extends AbstractModule {
return configuredValue; return configuredValue;
} }
try { if (Boolean.getBoolean("system.multiFace")) {
return Objects.requireNonNullElse(getLocalNetworkIP(), "0.0.0.0"); try {
return Objects.requireNonNullElse(getLocalNetworkIP(), "0.0.0.0");
} catch (Exception ex) {
logger.warn("Failed to get local network IP, falling back to bind to 0.0.0.0", ex);
return "0.0.0.0";
}
} }
catch (Exception ex) { else {
logger.warn("Failed to get local network IP, falling back to bind to 0.0.0.0", ex);
return "0.0.0.0"; return "0.0.0.0";
} }
} }