[bs-97] Support adding management endpoints to a different network
* ManagementProperties and ServerProperties now support an address property * For example set management.port=9001,management.address=127.0.0.1 to listen on port 9001 but only for connections from the localhost [Fixes #49395783]
This commit is contained in:
@@ -104,6 +104,7 @@ public class ManagementServerConfiguration implements BeanPostProcessor {
|
||||
|
||||
AbstractEmbeddedServletContainerFactory factory = (AbstractEmbeddedServletContainerFactory) bean;
|
||||
factory.setPort(this.configuration.getPort());
|
||||
factory.setAddress(this.configuration.getAddress());
|
||||
factory.setContextPath(this.configuration.getContextPath());
|
||||
|
||||
factory.setErrorPages(Collections
|
||||
|
||||
@@ -96,6 +96,7 @@ public class ServerConfiguration implements BeanPostProcessor, BeanFactoryAware
|
||||
|
||||
AbstractEmbeddedServletContainerFactory factory = (AbstractEmbeddedServletContainerFactory) bean;
|
||||
factory.setPort(server.getPort());
|
||||
factory.setAddress(server.getAddress());
|
||||
factory.setContextPath(server.getContextPath());
|
||||
|
||||
if (factory instanceof TomcatEmbeddedServletContainerFactory) {
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.bootstrap.actuate.properties;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
|
||||
@@ -30,6 +32,8 @@ public class ManagementServerProperties {
|
||||
|
||||
private int port = 8080;
|
||||
|
||||
private InetAddress address;
|
||||
|
||||
@NotNull
|
||||
private String contextPath = "";
|
||||
|
||||
@@ -51,6 +55,14 @@ public class ManagementServerProperties {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public InetAddress getAddress() {
|
||||
return this.address;
|
||||
}
|
||||
|
||||
public void setAddress(InetAddress address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getContextPath() {
|
||||
return this.contextPath;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package org.springframework.bootstrap.actuate.properties;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.InetAddress;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@@ -32,6 +33,8 @@ public class ServerProperties {
|
||||
|
||||
private int port = 8080;
|
||||
|
||||
private InetAddress address;
|
||||
|
||||
@NotNull
|
||||
private String contextPath = "";
|
||||
|
||||
@@ -57,6 +60,14 @@ public class ServerProperties {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public InetAddress getAddress() {
|
||||
return this.address;
|
||||
}
|
||||
|
||||
public void setAddress(InetAddress address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public static class Tomcat {
|
||||
|
||||
private String accessLogPattern;
|
||||
|
||||
Reference in New Issue
Block a user