Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set endpoint and port when registering #2505

Closed

Conversation

Aceix
Copy link
Contributor

@Aceix Aceix commented Aug 8, 2023

Describe your changes

check NET-497

Provide Issue ticket number if applicable/not in title

Provide testing steps

Checklist before requesting a review

  • My changes affect only 10 files or less.
  • I have performed a self-review of my code and tested it.
  • If it is a new feature, I have added thorough tests, my code is <= 1450 lines.
  • If it is a bugfix, my code is <= 200 lines.
  • My functions are <= 80 lines.
  • I have had my code reviewed by a peer.
  • My unit tests pass locally.
  • Netmaker is awesome.

@Aceix Aceix marked this pull request as ready for review August 8, 2023 20:17
@Aceix Aceix changed the title static endpoint and port when registering set endpoint and port when registering Aug 8, 2023
@@ -140,7 +142,22 @@ func SessionHandler(conn *websocket.Conn) {
return
}
}
logic.CheckHostPorts(&result.Host)
if slices.Contains(registerMessage.CustomParams, models.HostRegisterCustomParamListenPort) {
Copy link
Member

Choose a reason for hiding this comment

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

this fields are already on host model, not required to extend the req to have custom params

Copy link
Member

Choose a reason for hiding this comment

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

I don't think these changes are required, all the changes should be only on client side for user to set IP and Port for a host

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mainly had to do this for the port check. Otherwise logic.CheckHostPorts(&result.Host) will automatically assign any free port even when user specifies one

@abhishek9686 abhishek9686 marked this pull request as draft August 10, 2023 14:58
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