MCPcopy Index your code
hub / github.com/ddev/ddev / GetMailpitHTTPPort

Method GetMailpitHTTPPort

pkg/ddevapp/ddevapp.go:795–811  ·  view source on GitHub ↗

GetMailpitHTTPPort returns app's mailpit router http port If HTTP_EXPOSE has a mapping to port 8025 in the container, use that If not, use the global or project MailpitHTTPPort

()

Source from the content-addressed store, hash-verified

793// If HTTP_EXPOSE has a mapping to port 8025 in the container, use that
794// If not, use the global or project MailpitHTTPPort
795func (app *DdevApp) GetMailpitHTTPPort() string {
796 if httpExpose := app.GetWebEnvVar("HTTP_EXPOSE"); httpExpose != "" {
797 httpPort := app.TargetPortFromExposeVariable(httpExpose, "8025")
798 if httpPort != "" {
799 return httpPort
800 }
801 }
802
803 port := globalconfig.DdevGlobalConfig.RouterMailpitHTTPPort
804 if port == "" {
805 port = nodeps.DdevDefaultMailpitHTTPPort
806 }
807 if app.MailpitHTTPPort != "" {
808 port = app.MailpitHTTPPort
809 }
810 return port
811}
812
813// GetMailpitHTTPSPort returns app's mailpit router https port
814// If HTTPS_EXPOSE has a mapping to port 8025 in the container, use that

Callers 9

TestDdevFullSiteSetupFunction · 0.95
DescribeMethod · 0.95
StartMethod · 0.95
DockerEnvMethod · 0.95
TestConfigSetValuesFunction · 0.95
symfonyEnvMailerFunction · 0.80
TestEnvironmentVariablesFunction · 0.80
TestUseEphemeralPortFunction · 0.80
runPortDiagnoseFunction · 0.80

Calls 2

GetWebEnvVarMethod · 0.95

Tested by 4

TestDdevFullSiteSetupFunction · 0.76
TestConfigSetValuesFunction · 0.76
TestEnvironmentVariablesFunction · 0.64
TestUseEphemeralPortFunction · 0.64