Commit c539e627 by Johannes Edmeier

Add isPreferIp() for correct metadata and fix docs

parent 209756b9
...@@ -21,7 +21,7 @@ The main service that is used is a registrar that registeres the application at ...@@ -21,7 +21,7 @@ The main service that is used is a registrar that registeres the application at
| spring.boot.admin.client.managementUrl | Client-management-URL to register with. Can be overriden in case the reachable URL is different (e.g. Docker). Must be unique in registry.<br>Default: is guessed based on serviceUrl management.port and management.context-path| | spring.boot.admin.client.managementUrl | Client-management-URL to register with. Can be overriden in case the reachable URL is different (e.g. Docker). Must be unique in registry.<br>Default: is guessed based on serviceUrl management.port and management.context-path|
| spring.boot.admin.client.healthUrl | Client-management-URL to register with. Can be overriden in case the reachable URL is different (e.g. Docker). Must be unique in registry.<br>Default: is guessed based on managementUrl and endpoints.health.id | | spring.boot.admin.client.healthUrl | Client-management-URL to register with. Can be overriden in case the reachable URL is different (e.g. Docker). Must be unique in registry.<br>Default: is guessed based on managementUrl and endpoints.health.id |
| spring.boot.admin.client.name | Name to register with. Defaults to the ApplicationContexts name. Only set when it should differ.<br>Default: _${spring.application.name}_ if set, spring-boot-application otherwise. | | spring.boot.admin.client.name | Name to register with. Defaults to the ApplicationContexts name. Only set when it should differ.<br>Default: _${spring.application.name}_ if set, spring-boot-application otherwise. |
| spring.boot.admin.client.preferIpAddress | Use the ip-address rather then the hostname in the guessed urls. It's required to set `server.address` and `management.address`respectively. | | spring.boot.admin.client.preferIp | Use the ip-address rather then the hostname in the guessed urls. It's required to set `server.address` and `management.address`respectively. |
### Other configuration properties ### Other configuration properties
Options from other spring boot features. These should be set to enable all features. Options from other spring boot features. These should be set to enable all features.
......
...@@ -184,6 +184,10 @@ public class AdminClientProperties implements ApplicationListener<ApplicationEve ...@@ -184,6 +184,10 @@ public class AdminClientProperties implements ApplicationListener<ApplicationEve
this.preferIp = preferIp; this.preferIp = preferIp;
} }
public boolean isPreferIp() {
return preferIp;
}
private String createLocalUri(String host, int port) { private String createLocalUri(String host, int port) {
String scheme = server.getSsl() != null && server.getSsl().isEnabled() ? "https" : "http"; String scheme = server.getSsl() != null && server.getSsl().isEnabled() ? "https" : "http";
return scheme + "://" + host + ":" + port; return scheme + "://" + host + ":" + port;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment