openwisp-controller
openwisp-controller copied to clipboard
[feature] Allow managing ZeroTier networks from OpenWISP
ZeroTier Controller exposes REST API endpoints which can be used to configure the network. We can use those endpoints to allow managing ZeroTier network directly from OpenWISP.
Dependencies
- [ ] https://github.com/openwisp/openwisp-controller/issues/604
Expected workflow
- A user creates a ZeroTier VPN backend in OpenWISP at
/admin/config/vpn/add/ - A POST request is sent to
https://my.zerotier.com/api/v1/networkREST API endpoint. We save the networkId field returned in the response in the configuration. API documentation: https://docs.zerotier.com/central/v1#operation/newNetwork - A POST request is sent to
https://my.zerotier.com/api/v1/network/{networkID}with the configuration set by user. This POST request is always sent whenever there is any change to the configuration of the VPN. API documentation: https://docs.zerotier.com/central/v1#operation/updateNetwork - Deleting a ZeroTier VPN should send a DELETE request to
https://my.zerotier.com/api/v1/network/{networkID}. API documentation: https://docs.zerotier.com/central/v1#operation/deleteNetwork
https://my.zerotier.com/ in above points should be made configurable using the Host field of VPN model to support self-hosted ZeroTier controllers.
Note
To implement IP assignment for ZeroTier clients, we can make use of the subnet field in the VPN model, similar to the WireGuard VPN backend.
Completed in https://github.com/openwisp/openwisp-controller/pull/778