2017-04-24 09:03:30 -06:00
|
|
|
package proxy
|
|
|
|
|
|
|
|
|
|
import (
|
2017-10-02 16:50:05 -07:00
|
|
|
"github.com/dokku/dokku/plugins/common"
|
|
|
|
|
"github.com/dokku/dokku/plugins/config"
|
2017-04-24 09:03:30 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
}
|