Skip to content

feat: use external hostname with IP address fallback for SSH URI#243

Merged
horner merged 1 commit intomainfrom
241-bug-open-in-vs-code-and-open-ssh-in-terminal-use-hardcoded-ip-addresses
Mar 18, 2026
Merged

feat: use external hostname with IP address fallback for SSH URI#243
horner merged 1 commit intomainfrom
241-bug-open-in-vs-code-and-open-ssh-in-terminal-use-hardcoded-ip-addresses

Conversation

@runleveldev
Copy link
Collaborator

This pull request updates how SSH and HTTP host information is handled and displayed for containers, ensuring that the correct external host is used for SSH connections in both the backend and frontend. The changes improve reliability when generating SSH and HTTP URLs, especially in environments where an external domain is configured.

Backend improvements to host information:

  • Refactored the construction of the HTTP external host and URL in containers.js to separate the host from the full URL, enabling reuse of the host for SSH connections. (create-a-container/routers/containers.js, create-a-container/routers/containers.jsL181-R184)
  • Added a new sshHost field to the container object, preferring the HTTP external host if available, otherwise falling back to the site's external IP. (create-a-container/routers/containers.js, create-a-container/routers/containers.jsR198)

Frontend updates for SSH links:

  • Updated the SSH connection links in the containers index view to use the new sshHost value instead of always using the site's external IP, ensuring links point to the correct external hostname when available. (create-a-container/views/containers/index.ejs, create-a-container/views/containers/index.ejsL76-R79)

@horner horner merged commit c62fce2 into main Mar 18, 2026
3 checks passed
@horner horner deleted the 241-bug-open-in-vs-code-and-open-ssh-in-terminal-use-hardcoded-ip-addresses branch March 18, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: "Open in VS Code" and "Open SSH in terminal" use hardcoded IP addresses

2 participants