From c7afc0523dca90f1c3df07e66f30591eca7ee257 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 25 Apr 2026 18:07:10 -0400 Subject: [PATCH] fix: maintain backward compatibility for proxy:set command proxy:set continues to work as before by detecting when the first argument is not a known property name and treating it as the type value. Also preserves the port mapping detection error for inputs containing colons. --- plugins/proxy/subcommands.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/proxy/subcommands.go b/plugins/proxy/subcommands.go index e603665c1..997125a38 100644 --- a/plugins/proxy/subcommands.go +++ b/plugins/proxy/subcommands.go @@ -2,6 +2,7 @@ package proxy import ( "errors" + "strings" "github.com/dokku/dokku/plugins/common" ) @@ -80,8 +81,19 @@ func CommandReport(appName string, format string, infoFlag string) error { return ReportSingleApp(appName, format, infoFlag) } -// CommandSet sets a proxy for an app +// CommandSet set or clear a proxy property for an app func CommandSet(appName string, property string, value string) error { + // backward compatibility: `proxy:set ` is treated as + // `proxy:set type ` + if _, ok := DefaultProperties[property]; !ok && value == "" { + if strings.Contains(property, ":") { + common.LogWarn("Detected potential port mapping instead of proxy type") + return errors.New("Consider using ports:set command or specifying a valid proxy") + } + value = property + property = "type" + } + common.CommandPropertySet("proxy", appName, property, value, DefaultProperties, GlobalProperties) return nil }