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

Support automatic discovery of IPs from AWS metadata #3

Merged
merged 5 commits into from
Sep 26, 2024

Conversation

jeffreymeng
Copy link
Contributor

@jeffreymeng jeffreymeng commented Sep 25, 2024

This PR adds support for automatic discovery of private IP addresses from AWS metadata through polling. When a change is detected in the AWS metadata, a new server is started or stopped accordingly.

This PR also contains various refactors:

  • moves the logic for starting/stopping servers into a dedicated ServerManager
  • instead of using incremental wireguard IP blocks for new servers, the ServerManager manages the valid range of indices, and wireguard blocks are derived from the server's index and the base IP

Resolves MOD-3580

Copy link
Member

@ekzhang ekzhang left a comment

Choose a reason for hiding this comment

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

Looks good to me!

cmd/server.go Outdated Show resolved Hide resolved
cmd/server.go Outdated Show resolved Hide resolved
cmd/server.go Outdated Show resolved Hide resolved
lib/iputils_test.go Show resolved Hide resolved
lib/server.go Show resolved Hide resolved
lib/server_manager.go Show resolved Hide resolved
lib/server_manager.go Show resolved Hide resolved
lib/server_manager.go Outdated Show resolved Hide resolved
lib/server_manager.go Outdated Show resolved Hide resolved
lib/server_manager.go Outdated Show resolved Hide resolved
@jeffreymeng jeffreymeng merged commit b92e9f8 into main Sep 26, 2024
@jeffreymeng jeffreymeng deleted the jeffreymeng/dynamic_ip_updates branch September 26, 2024 14:54
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