Skip to content

Commit

Permalink
fix: set correct extraHosts for the console (#899)
Browse files Browse the repository at this point in the history
* fix: set correct extraHosts for the console
  • Loading branch information
dbarrosop committed Aug 20, 2024
1 parent 5ef234e commit 4294c19
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion dockercompose/graphql.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package dockercompose

import (
"fmt"
"strings"

"github.com/nhost/be/services/mimir/model"
"github.com/nhost/be/services/mimir/schema/appconfig"
Expand Down Expand Up @@ -117,6 +118,13 @@ func console( //nolint:funlen
return nil, fmt.Errorf("failed to get hasura env vars: %w", err)
}

extraHosts := extraHosts(subdomain)
for i, host := range extraHosts {
if strings.HasPrefix(host, subdomain+".hasura") {
extraHosts[i] = subdomain + ".hasura.local.nhost.run:0.0.0.0"
}
}

env := make(map[string]string, len(envars))
for _, v := range envars {
if v.Name == "HASURA_GRAPHQL_CORS_DOMAIN" && v.Value != "*" {
Expand Down Expand Up @@ -149,7 +157,7 @@ func console( //nolint:funlen
},
EntryPoint: nil,
Environment: env,
ExtraHosts: extraHosts(subdomain),
ExtraHosts: extraHosts,
HealthCheck: &HealthCheck{
Test: []string{
"CMD-SHELL",
Expand Down
2 changes: 1 addition & 1 deletion dockercompose/graphql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func expectedConsole() *Service {
"dev.db.local.nhost.run:host-gateway",
"dev.functions.local.nhost.run:host-gateway",
"dev.graphql.local.nhost.run:host-gateway",
"dev.hasura.local.nhost.run:host-gateway",
"dev.hasura.local.nhost.run:0.0.0.0",
"dev.storage.local.nhost.run:host-gateway",
},
HealthCheck: &HealthCheck{
Expand Down

0 comments on commit 4294c19

Please sign in to comment.