refactor: rewrite network plugin in golang
This commit is contained in:
committed by
Michael Hobbs
parent
e74346f0dc
commit
c788659b63
21
plugins/proxy/proxy.go
Normal file
21
plugins/proxy/proxy.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package proxy
|
||||
|
||||
import (
|
||||
common "github.com/dokku/dokku/plugins/common"
|
||||
config "github.com/dokku/dokku/plugins/config"
|
||||
)
|
||||
|
||||
// IsAppProxyEnabled returns true if proxy is enabled; otherwise return false
|
||||
func IsAppProxyEnabled(appName string) bool {
|
||||
err := common.VerifyAppName(appName)
|
||||
if err != nil {
|
||||
common.LogFail(err.Error())
|
||||
}
|
||||
|
||||
proxyEnabled := true
|
||||
disableProxy := config.GetWithDefault(appName, "DOKKU_DISABLE_PROXY", "")
|
||||
if disableProxy != "" {
|
||||
proxyEnabled = false
|
||||
}
|
||||
return proxyEnabled
|
||||
}
|
||||
Reference in New Issue
Block a user