fix: guard against invalid proxy values due to move of port mapping to ports plugin
Users somewhat infrequently set a port mapping as the proxy type, causing issues in exposing apps publicly. Ideally we list out the available proxy types, but that would be a potential bc-break for non-core plugins, so this is the way to go for now. Closes #6764
This commit is contained in:
@@ -2,6 +2,7 @@ package proxy
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"github.com/dokku/dokku/plugins/common"
|
||||
"github.com/dokku/dokku/plugins/config"
|
||||
@@ -89,6 +90,11 @@ func CommandSet(appName string, proxyType string) error {
|
||||
return errors.New("Please specify a proxy type")
|
||||
}
|
||||
|
||||
if strings.Contains(proxyType, ":") {
|
||||
common.LogWarn("Detected potential port mapping instead of proxy type")
|
||||
return errors.New("Consider using ports:set command or specifying a valid proxy")
|
||||
}
|
||||
|
||||
key := "DOKKU_APP_PROXY_TYPE"
|
||||
if appName == "--global" {
|
||||
key = "DOKKU_PROXY_TYPE"
|
||||
|
||||
Reference in New Issue
Block a user