Repository navigation
feat: custom wireguard port - #366
Merged
Merged
Conversation
Init machine with custom wireguard port: ``` uc machine add [email protected] -c default --wg-port 51823 -n host ``` Add machine with custom wireguard port: ``` uc machine add [email protected] -c default --wg-port 51823 -n host ``` Custom Wireguard port: ``` ❯ ./uncloud machine ls NAME STATE ADDRESS PUBLIC IP WIREGUARD ENDPOINTS MACHINE ID host Up 10.210.2.1/24 xx.xx.xxx.3 xx.xx.xxx.3:51823 ffb6f370c69553fbf90c4e8541531944 ```
Contributor
Author
|
Addresses #228 |
Contributor
Author
|
I am able to get to services on the other nodes with this configuration: and back out to the other machine on the custom port: Other machines in cluster: Listening port: ListenPort: Machine Config: |
miekg
reviewed
May 13, 2026
Contributor
Author
|
Yeah, I'll make the adjustments. Internet is down, so I haven't been able to test the changes and make sure everything looks good. |
- Rename `network.WireGuardPort` to `network.DefaultWireGuardPort` for clarity - Rename `network.Config.ListenPort` field to `network.Config.WireGuardPort` for consistency - Rename `network.Config.EffectiveListenPort()` method to `network.Config.EffectiveWireGuardPort()` - Update all references across CLI commands (add, init, update), internal machine logic, and experiments - Improves naming consistency and makes the purpose of the port configuration more explicit
psviderski
reviewed
May 18, 2026
psviderski
left a comment
Owner
There was a problem hiding this comment.
Overall looks good 👍
Please see a few comments on --wg-port and --wg-endpoints mismatch and using the pinned proto tooling version for generating Go code.
Please also run make cli-docs after changing help strings for flags.
…or endpoints - Add port range validation (1-65535) in machine add and init commands - Update ParseWireGuardEndpoints to accept configurable default port parameter - Pass custom --wg-port value as default when parsing endpoints instead of hardcoded constant - Update help text to reference --wg-port value instead of hardcoded port number - Remove unnecessary network package import from flags.go - Regenerate protobuf files with updated protoc versions (v1.34.2 and v5.27.3) - Ensures WireGuard endpoints use the configured port when port is omitted from endpoint specification
- Update uc_machine_add.md to document --wg-port flag and clarify default port behavior - Update uc_machine_init.md to document --wg-port flag and clarify default port behavior
miekg
approved these changes
May 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Init machine with custom wireguard port:
Add machine with custom wireguard port:
Custom Wireguard port:
Resolves #228