openwisp-controller icon indicating copy to clipboard operation
openwisp-controller copied to clipboard

[feature] Allow managing ZeroTier networks from OpenWISP

Open pandafy opened this issue 3 years ago • 1 comments

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

pandafy avatar Feb 16 '22 19:02 pandafy

Expected workflow

  1. A user creates a ZeroTier VPN backend in OpenWISP at /admin/config/vpn/add/
  2. A POST request is sent to https://my.zerotier.com/api/v1/network REST API endpoint. We save the networkId field returned in the response in the configuration. API documentation: https://docs.zerotier.com/central/v1#operation/newNetwork
  3. 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
  4. 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.

pandafy avatar Feb 16 '22 19:02 pandafy

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.

Screenshot from 2023-06-06 22-00-20

Aryamanz29 avatar Jun 06 '23 16:06 Aryamanz29

Completed in https://github.com/openwisp/openwisp-controller/pull/778

pandafy avatar Oct 11 '23 13:10 pandafy