Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Comments

fix: set URLs correctly when customizing the port#982

Merged
dbarrosop merged 2 commits intomainfrom
expose-port
Sep 8, 2025
Merged

fix: set URLs correctly when customizing the port#982
dbarrosop merged 2 commits intomainfrom
expose-port

Conversation

@dbarrosop
Copy link
Member

@dbarrosop dbarrosop commented Sep 8, 2025

User description

Fixes #847


PR Type

Bug fix, Tests


Description

  • Add exposePort override for auth and storage

  • Update service environment and port mappings

  • Extend tests to cover custom port scenarios

  • Preserve default behavior when exposePort is zero


File Walkthrough

Relevant files
Enhancement
auth.go
Expose `httpPort` override via `exposePort`                           

dockercompose/auth.go

  • Add exposePort override for httpPort
  • Apply exposePort to service ports mapping
+6/-2     
storage.go
Expose `httpPort` override via `exposePort`                           

dockercompose/storage.go

  • Add exposePort override for httpPort
  • Apply exposePort to published port mapping
+4/-0     
Tests
auth_test.go
Test custom exposePort in auth config                                       

dockercompose/auth_test.go

  • Include exposePort field in test cases
  • Add custom port testing scenario
  • Update auth call to use exposePort
+34/-10 
storage_test.go
Test custom exposePort in storage config                                 

dockercompose/storage_test.go

  • Include exposePort field in storage tests
  • Add custom port test scenario
  • Update storage call to use exposePort
+32/-9   

@github-actions github-actions bot added the fix label Sep 8, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Publish default HTTP port

Use the effective httpPort in the port mapping so that when no custom port is
provided, the service still publishes the default HTTP port. This aligns published
ports with the URL logic.

dockercompose/auth.go [101]

-Ports:   ports(exposePort, authPort),
+Ports:   ports(httpPort, authPort),
Suggestion importance[1-10]: 10

__

Why: Currently ports(exposePort, authPort) will publish port 0 when no custom port is set; using httpPort ensures the default or overridden port is correctly published.

High

@dbarrosop dbarrosop merged commit e997aee into main Sep 8, 2025
8 checks passed
@dbarrosop dbarrosop deleted the expose-port branch September 8, 2025 07:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Presigned URLs are incorrect when using a custom port for storage with nhost up

3 participants