fix: reconcile webhook-managed configs and make disable_p2p more intelligent#2057
Merged
KKRainbow merged 3 commits intoEasyTier:mainfrom Apr 4, 2026
Merged
fix: reconcile webhook-managed configs and make disable_p2p more intelligent#2057KKRainbow merged 3 commits intoEasyTier:mainfrom
KKRainbow merged 3 commits intoEasyTier:mainfrom
Conversation
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.
Summary
This PR addresses two issues that surfaced in webhook-managed deployments and P2P connection policy handling.
disable_p2pdisable proactive direct connections without breaking relay-based connectivity orneed_p2pexceptions.Changes
easytier-web: reconcile webhook-managed configs by revision
network_configto:managed_network_configs: Vec<ManagedNetworkConfig>config_revision: Stringinstance_idand defaultinstance_name.easytier-web: scope network config uniqueness by device
network_instance_idonly to(user_id, device_id, network_instance_id).user_idanddevice_id.user_running_network_configswith a unique index on(user_id, device_id, network_instance_id).This prevents the same
network_instance_idfrom different devices under the same user from overwriting each other.easytier: make disable_p2p more precise
disable_p2ptoPeerFeatureFlagand propagate it from runtime flags into advertised peer feature flags.disable_p2pneed_p2pdisable_p2pneed_p2pdisable_p2p=true, so the node can still serve peers that explicitly require P2P.The resulting policy is:
disable_p2pdisable_p2p=truedoes not proactively open P2P to ordinary peersneed_p2pstill works as an explicit opt-in override for both directionsTests
Added / updated tests for:
disable_p2ppolicy helper logicdisable_p2pstill allowing connections toneed_p2ppeersdisable_p2ppeersValidation
Passed locally:
cargo test -p easytier-web reconcile_managed_network_configs_upserts_and_deletes_exact_setcargo test -p easytier-web test_user_network_config_same_instance_id_is_scoped_by_devicecargo test -p easytier disable_p2pconnector::tests::disable_p2p_only_allows_need_p2p_exceptionspassedeasytier/src/common/netns.rs:44(No such file or directory)Why this matters
Without the webhook reconciliation changes, webhook-managed nodes can retain stale infra configs or fail to converge cleanly when the webhook changes the desired config set.
Without the
disable_p2ppolicy changes, settingdisable_p2pis too coarse-grained: it prevents useful exception cases and also shuts down server-side capability that other peers may still need. This PR narrows the behavior sodisable_p2pmeans "do not proactively build ordinary P2P links" instead of "disable all direct-connect handling globally".