Skip to content

Commit

Permalink
Treat any service using usual HTTP ports as an HTTP service
Browse files Browse the repository at this point in the history
  • Loading branch information
tucksaun committed Feb 1, 2023
1 parent 75f91e3 commit 5e309e7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions envs/docker.go
Expand Up @@ -429,6 +429,12 @@ func (l *Local) dockerServiceToRelationship(client *docker.Client, container typ
"port": formatDockerPort(p.PublicPort),
"rel": "simple",
}
// Official HTTP(s) ports or well know alternatives
if p.PrivatePort == 80 || p.PrivatePort == 8008 || p.PrivatePort == 8080 || p.PrivatePort == 8081 {
rels[""]["scheme"] = "http"
} else if p.PrivatePort == 443 || p.PrivatePort == 8443 {
rels[""]["scheme"] = "https"
}
return rels
}

Expand Down
2 changes: 1 addition & 1 deletion envs/envs.go
Expand Up @@ -269,7 +269,7 @@ func extractRelationshipsEnvs(env Environment) Envs {
} else if rel == "mercure" {
values["MERCURE_URL"] = fmt.Sprintf("%s://%s:%s/.well-known/mercure", endpoint["scheme"].(string), endpoint["host"].(string), formatInt(endpoint["port"]))
values["MERCURE_PUBLIC_URL"] = values["MERCURE_URL"]
} else if scheme == "http" {
} else if scheme == "http" || scheme == "https" {
username, hasUsername := endpoint["username"].(string)
password, hasPassword := endpoint["password"].(string)
if hasUsername || hasPassword {
Expand Down

0 comments on commit 5e309e7

Please sign in to comment.