feat: allow users to bind to all interfaces when a proxy is enabled
- use a plugin trigger to see whether we should bind to all interfaces - create a generic way of setting properties for a plugin - migrate proxy-enabled to the new network property "bind-all-interfaces" - add network:set subcommand
This commit is contained in:
committed by
Michael Hobbs
parent
7a4464a8ae
commit
acde3d60a7
@@ -12,6 +12,16 @@ import (
|
||||
sh "github.com/codeskyblue/go-sh"
|
||||
)
|
||||
|
||||
// ValidProperties is a map of all valid network properties
|
||||
var ValidProperties = map[string]bool{
|
||||
"bind-all-interfaces": true,
|
||||
}
|
||||
|
||||
// DefaultPropertyValues is a map of all valid network properties with corresponding default property values
|
||||
var DefaultPropertyValues = map[string]string{
|
||||
"bind-all-interfaces": "false",
|
||||
}
|
||||
|
||||
// BuildConfig builds network config files
|
||||
func BuildConfig(appName string) {
|
||||
err := common.VerifyAppName(appName)
|
||||
@@ -147,6 +157,14 @@ func GetContainerPort(appName string, procType string, isHerokuishContainer bool
|
||||
return port
|
||||
}
|
||||
|
||||
// GetDefaultValue returns the default value for a given property
|
||||
func GetDefaultValue(property string) string {
|
||||
if ValidProperties[property] {
|
||||
return DefaultPropertyValues[property]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// HasNetworkConfig returns whether the network configuration for a given app exists
|
||||
func HasNetworkConfig(appName string) bool {
|
||||
appRoot := strings.Join([]string{common.MustGetEnv("DOKKU_ROOT"), appName}, "/")
|
||||
|
||||
Reference in New Issue
Block a user