mirror of
https://github.com/fosrl/newt.git
synced 2026-03-03 17:26:43 +00:00
Small refinement to how the docker enforcement setting is applied
This commit is contained in:
4
main.go
4
main.go
@@ -401,7 +401,7 @@ func main() {
|
|||||||
flag.StringVar(&dockerSocket, "docker-socket", "", "Path to Docker socket (typically /var/run/docker.sock)")
|
flag.StringVar(&dockerSocket, "docker-socket", "", "Path to Docker socket (typically /var/run/docker.sock)")
|
||||||
}
|
}
|
||||||
if dockerContainerAsHostname == "" {
|
if dockerContainerAsHostname == "" {
|
||||||
flag.StringVar(&dockerContainerAsHostname, "docker-container-name-as-hostname", "false", "Use container name when hostname for networking (true or false)")
|
flag.StringVar(&dockerContainerAsHostname, "docker-container-name-as-hostname", "false", "Use container name as hostname for networking (true or false)")
|
||||||
}
|
}
|
||||||
if dockerEnforceNetworkValidation == "" {
|
if dockerEnforceNetworkValidation == "" {
|
||||||
flag.StringVar(&dockerEnforceNetworkValidation, "docker-enforce-network-validation", "false", "Enforce validation of container on newt network (true or false)")
|
flag.StringVar(&dockerEnforceNetworkValidation, "docker-enforce-network-validation", "false", "Enforce validation of container on newt network (true or false)")
|
||||||
@@ -830,7 +830,7 @@ func updateTargets(pm *proxy.ProxyManager, action string, tunnelIP string, proto
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add the new target
|
// Add the new target
|
||||||
if dockerSocket != "" && dockerEnforceNetworkValidationBool {
|
if dockerEnforceNetworkValidationBool {
|
||||||
logger.Info("Enforcing docker network validation")
|
logger.Info("Enforcing docker network validation")
|
||||||
|
|
||||||
isWithinNewtNetwork, err := docker.IsWithinHostNetwork(dockerSocket, dockerContainerAsHostnameBool, targetAddress, targetPort)
|
isWithinNewtNetwork, err := docker.IsWithinHostNetwork(dockerSocket, dockerContainerAsHostnameBool, targetAddress, targetPort)
|
||||||
|
|||||||
Reference in New Issue
Block a user