Skip to content

fix(ssh): SSH port was not assigned to gvproxy#94

Merged
ihexon merged 1 commit intooomol-lab:mainfrom
ihexon:fixssh
Jan 7, 2026
Merged

fix(ssh): SSH port was not assigned to gvproxy#94
ihexon merged 1 commit intooomol-lab:mainfrom
ihexon:fixssh

Conversation

@ihexon
Copy link
Collaborator

@ihexon ihexon commented Jan 7, 2026

No description provided.

@ihexon ihexon requested a review from BlackHole1 as a code owner January 7, 2026 10:13
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed SSH port configuration to be properly passed to the gvproxy process, ensuring correct remote access and connectivity
    • Updated port binding to restrict network operations to IPv4 addresses exclusively, improving system stability and compatibility across various network environments

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

This PR makes two configuration-related changes: it modifies the gvproxy command to assign SSHPort from the machine configuration's SSH.Port field, enabling the gvproxy process to receive SSH port details in its command configuration. Additionally, it updates the port package's GetFree function to use "tcp4" instead of "tcp" for network binding, restricting listener binding to IPv4 addresses only.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided, but the pull request cannot be evaluated for this check. Add a description explaining the changes made, the issue being fixed, and how gvproxy now receives the SSH port configuration.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title follows the required format with type(scope): subject and clearly describes the main change of assigning SSH port to gvproxy.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
pkg/port/port.go (1)

16-16: Approve explicit IPv4 binding, but consider consistency with IsListening().

The change to "tcp4" makes the IPv4-only intent explicit, which is appropriate since LocalHostURL is "127.0.0.1". However, IsListening() on line 29 still uses "tcp" in its DialTimeout call, creating an inconsistency in the codebase.

🔄 Suggested refactor for consistency

Consider updating IsListening() to also use "tcp4" for consistency:

func IsListening(port int) bool {
	conn, err := net.DialTimeout("tcp4", fmt.Sprintf("%s:%d", define.LocalHostURL, port), defaultDialTimeout)
	if err != nil {
		return false
	}

	_ = conn.Close()

	return true
}

This ensures both functions use the same network type, making the code more maintainable and avoiding potential edge-case behavior differences across systems.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8aca952 and ca78cea.

📒 Files selected for processing (2)
  • pkg/machine/gvproxy/gvproxy.go
  • pkg/port/port.go
🧰 Additional context used
🧬 Code graph analysis (1)
pkg/port/port.go (1)
pkg/machine/define/define.go (1)
  • LocalHostURL (37-37)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (1)
pkg/machine/gvproxy/gvproxy.go (1)

49-49: LGTM! SSH port assignment correctly implemented.

The SSH port is now properly assigned to the gvproxy command configuration after being obtained via GetSSHPort(). This ensures that the gvproxy process receives the SSH port information, which addresses the core issue described in the PR title.

@ihexon ihexon merged commit 2930af1 into oomol-lab:main Jan 7, 2026
2 of 3 checks passed
@ihexon ihexon deleted the fixssh branch January 17, 2026 22:01
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.

2 participants