Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions dockercompose/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ func auth( //nolint:funlen
httpPort uint,
useTLS bool,
nhostFolder string,
port uint,
exposePort uint,
) (*Service, error) {
if exposePort != 0 {
httpPort = exposePort
}

envars, err := appconfig.HasuraAuthEnv(
cfg,
"http://graphql:8080/v1/graphql",
Expand Down Expand Up @@ -94,7 +98,7 @@ func auth( //nolint:funlen
},
},
}.Labels(),
Ports: ports(port, authPort),
Ports: ports(exposePort, authPort),
Restart: "always",
Volumes: []Volume{
{
Expand Down
44 changes: 34 additions & 10 deletions dockercompose/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,16 +207,18 @@ func TestAuth(t *testing.T) {
t.Parallel()

cases := []struct {
name string
cfg func() *model.ConfigConfig
useTlS bool
expected func() *Service
name string
cfg func() *model.ConfigConfig
useTlS bool
exposePort uint
expected func() *Service
}{
{
name: "default",
cfg: getConfig,
useTlS: false,
expected: expectedAuth,
name: "default",
cfg: getConfig,
useTlS: false,
exposePort: 0,
expected: expectedAuth,
},
{
name: "pre-0.22.0",
Expand All @@ -225,7 +227,8 @@ func TestAuth(t *testing.T) {
cfg.Auth.Version = ptr("0.21.3")
return cfg
},
useTlS: false,
useTlS: false,
exposePort: 0,
expected: func() *Service {
svc := expectedAuth()
svc.Image = "nhost/hasura-auth:0.21.3"
Expand All @@ -237,13 +240,34 @@ func TestAuth(t *testing.T) {
return svc
},
},
{
name: "custom port",
cfg: getConfig,
useTlS: false,
exposePort: 8080,
expected: func() *Service {
svc := expectedAuth()

svc.Environment["AUTH_SERVER_URL"] = "http://dev.auth.local.nhost.run:8080/v1"
svc.Ports = []Port{
{
Mode: "ingress",
Target: 4000,
Published: "8080",
Protocol: "tcp",
},
}

return svc
},
},
}

for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

got, err := auth(tc.cfg(), "dev", 1336, tc.useTlS, "/tmp/nhost", 0)
got, err := auth(tc.cfg(), "dev", 1336, tc.useTlS, "/tmp/nhost", tc.exposePort)
if err != nil {
t.Errorf("got error: %v", err)
}
Expand Down
4 changes: 4 additions & 0 deletions dockercompose/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func storage( //nolint:funlen
httpPort uint,
exposePort uint,
) (*Service, error) {
if exposePort != 0 {
httpPort = exposePort
}

envars, err := appconfig.HasuraStorageEnv(
cfg,
"http://graphql:8080/v1",
Expand Down
41 changes: 32 additions & 9 deletions dockercompose/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,47 @@ func TestStorage(t *testing.T) {
t.Parallel()

cases := []struct {
name string
cfg func() *model.ConfigConfig
useTlS bool
expected func() *Service
name string
cfg func() *model.ConfigConfig
useTlS bool
exposePort uint
expected func() *Service
}{
{
name: "success",
cfg: getConfig,
useTlS: false,
expected: expectedStorage,
name: "success",
cfg: getConfig,
useTlS: false,
exposePort: 0,
expected: expectedStorage,
},
{
name: "custom port",
cfg: getConfig,
useTlS: false,
exposePort: 8080,
expected: func() *Service {
svc := expectedStorage()
svc.Environment["PUBLIC_URL"] = "http://dev.storage.local.nhost.run:8080"

svc.Ports = []Port{
{
Mode: "ingress",
Target: 5000,
Published: "8080",
Protocol: "tcp",
},
}

return svc
},
},
}

for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()

got, err := storage(tc.cfg(), "dev", tc.useTlS, 444, 0)
got, err := storage(tc.cfg(), "dev", tc.useTlS, 444, tc.exposePort)
if err != nil {
t.Errorf("got error: %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ require (
github.com/go-git/go-git/v5 v5.16.2
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
github.com/hashicorp/go-getter v1.7.8
github.com/hashicorp/go-getter v1.7.9
github.com/nhost/be v0.0.0-20250826100053-51f349e46355
github.com/pelletier/go-toml/v2 v2.2.4
github.com/rs/cors/wrapper/gin v0.0.0-20240830163046-1084d89a1692
Expand Down Expand Up @@ -100,7 +100,6 @@ require (
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/mpvl/unique v0.0.0-20150818121801-cbe035fff7de // indirect
Expand Down
11 changes: 2 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ cloud.google.com/go/compute v1.15.1/go.mod h1:bjjoF/NtFUrkD/urWfdHaKuOPDR5nWIs63
cloud.google.com/go/compute v1.18.0/go.mod h1:1X7yHxec2Ga+Ss6jPyjxRxpu2uu7PLgsOVXvgU0yacs=
cloud.google.com/go/compute v1.19.0/go.mod h1:rikpw2y+UMidAe9tISo04EHNOIf42RLYF/q8Bs93scU=
cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE=
cloud.google.com/go/compute v1.41.0 h1:S+HvMIzBUAFK/73wxkrA4/GwvM7R9d+egGZvih4kp+M=
cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU=
cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k=
cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM=
Expand Down Expand Up @@ -685,7 +684,6 @@ github.com/bytedance/sonic/loader v0.3.0/go.mod h1:N8A3vUdtUebEY2/VQC0MyhYeKUFos
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/census-instrumentation/opencensus-proto v0.4.1/go.mod h1:4T9NM4+4Vw91VeyqjLS6ao50K5bOcLKN6Q42XnYaRYw=
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
Expand Down Expand Up @@ -726,7 +724,6 @@ github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWH
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443 h1:aQ3y1lwWyqYPiWZThqv1aFbZMiM9vblcSArJRf2Irls=
github.com/cncf/xds/go v0.0.0-20250501225837-2ac532fd4443/go.mod h1:W+zGtBO5Y1IgJhy4+A9GOqVhqLpfZi+vwmdNXUehLA8=
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E=
github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw=
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
Expand Down Expand Up @@ -951,8 +948,8 @@ github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4Zs
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3/go.mod h1:o//XUCC/F+yRGJoPO/VU0GSB0f8Nhgmxx0VIRUvaC0w=
github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ=
github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48=
github.com/hashicorp/go-getter v1.7.8 h1:mshVHx1Fto0/MydBekWan5zUipGq7jO0novchgMmSiY=
github.com/hashicorp/go-getter v1.7.8/go.mod h1:2c6CboOEb9jG6YvmC9xdD+tyAFsrUaJPedwXDGr0TM4=
github.com/hashicorp/go-getter v1.7.9 h1:G9gcjrDixz7glqJ+ll5IWvggSBR+R0B54DSRt4qfdC4=
github.com/hashicorp/go-getter v1.7.9/go.mod h1:dyFCmT1AQkDfOIt9NH8pw9XBDqNrIKJT5ylbpi7zPNE=
github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo=
github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I=
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
Expand Down Expand Up @@ -1032,8 +1029,6 @@ github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcs
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU=
github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8=
github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0=
github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
Expand All @@ -1047,8 +1042,6 @@ github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
github.com/nhost/be v0.0.0-20250730065440-072ba750534a h1:PBNFdtz2XdGUbFVDTJNBdKwtWLab3jgEl0fpb5rn3j0=
github.com/nhost/be v0.0.0-20250730065440-072ba750534a/go.mod h1:Btk2JXy1ih/+VTlNItNNFfhOTZlKlrodBqXaJ+2K7Pg=
github.com/nhost/be v0.0.0-20250826100053-51f349e46355 h1:K0orUm3ex3GBuZ8InnmSjAVbYqcO4LfK1ftcsPDS6k0=
github.com/nhost/be v0.0.0-20250826100053-51f349e46355/go.mod h1:iRPhO+qcQzTtNQ7PaQMJAcEw0tgWzgjzcGWgJ4ifrUo=
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
Expand Down
19 changes: 7 additions & 12 deletions vendor/github.com/hashicorp/go-getter/.goreleaser.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions vendor/github.com/hashicorp/go-getter/CHANGELOG.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 18 additions & 14 deletions vendor/github.com/hashicorp/go-getter/checksum.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions vendor/github.com/hashicorp/go-getter/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vendor/github.com/hashicorp/go-getter/common.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading