[fix] Decoupled ZeroTier network name from VPN name #1426#1429
[fix] Decoupled ZeroTier network name from VPN name #1426#1429Jaydeng75 wants to merge 1 commit into
Conversation
Preserve the ZeroTier network name returned by the API and use it for configuration context variables. VPN name changes no longer alter the machine-facing ZeroTier network name. Closes openwisp#1426 Signed-off-by: Jayden Jeswin Raj <user.josephms@gmail.com>
📝 WalkthroughWalkthroughThis change decouples the ZeroTier network name from the human-facing VPN name. Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Admin
participant AbstractVpn
participant ZerotierConfig
participant Template
Admin->>AbstractVpn: rename VPN (change name)
AbstractVpn->>AbstractVpn: save(created=False)
AbstractVpn->>ZerotierConfig: config["name"] not reassigned
Template->>AbstractVpn: get_vpn_server_context()
AbstractVpn->>ZerotierConfig: read stored zerotier config name
ZerotierConfig-->>Template: network_name unchanged
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (7 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Preserve the ZeroTier network name returned by the API and use it
for configuration context variables. VPN name changes no longer
alter the machine-facing ZeroTier network name.
Closes #1426
Checklist
Reference to Existing Issue
Closes #1426.
Description of Changes
This change decouples the human-facing
Vpn.namefield from themachine-facing ZeroTier network name used in configuration context
variables.
The changes:
VPN configuration instead of treating
nameas a redundant responsefield.
network_nameconfiguration context variable, with
Vpn.nameas a fallback forbackward compatibility with existing VPN configurations.
Vpn.nameonly when theVPN is created, preventing subsequent administrative renames from
being propagated to the ZeroTier controller.
Vpn.namedoes notchange the machine-facing ZeroTier network name used in configuration
context variables.
This prevents administrative VPN renames from unnecessarily changing
client configuration context and invalidating configuration caches.
Screenshot
N/A — this change does not affect the user interface.