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

[feature] Added support for ZeroTier to the OpenWRT backend #207 #274

Merged
merged 27 commits into from
Jul 27, 2023

Conversation

Aryamanz29
Copy link
Member

@Aryamanz29 Aryamanz29 commented Jun 8, 2023

Depends on:

Prerequisites:

  1. Install Zerotier

  2. Install Ztncui - Web Interface

  3. Get your Zerotier Service API token sudo cat /var/lib/zerotier-one/authtoken.secret

Tested with openwisp-controller

demo-zerotier-openwrt.mp4

Closes #207

The schema is taken from OpenAPI specification:

https://docs.zerotier.com/service/v1/ (self-hosted controllers)
https://docs.zerotier.com/openapi/centralv1.json (central controllers)

The Zerotier network configuration keys taken from:

https://github.com/zerotier/ZeroTierOne/blob/dev/node/NetworkConfig.hpp
- Used `None` as a default argument and assign
the mutable value inside the method.
- Removed redundant OpenAPI schema property 'example'.
- Changed backend render json indentation to 4 spaces.
@Aryamanz29 Aryamanz29 self-assigned this Jun 8, 2023
@coveralls
Copy link

coveralls commented Jun 8, 2023

Coverage Status

coverage: 98.742% (+0.03%) from 98.711% when pulling db1a216 on issue-207/add-zerotier-to-openwrt-backend into 3f14cae on gsoc23.

@Aryamanz29 Aryamanz29 changed the title [feature] Added ZeroTier backend #208 [feature] Added support for ZeroTier to the OpenWRT backend #207 Jun 8, 2023
@pandafy pandafy changed the base branch from master to issue-208/add-zerotier-backend June 8, 2023 12:44
The schema is taken from OpenAPI specification:

https://docs.zerotier.com/service/v1/ (self-hosted controllers)
https://docs.zerotier.com/openapi/centralv1.json (central controllers)

The Zerotier network configuration keys taken from:

https://github.com/zerotier/ZeroTierOne/blob/dev/node/NetworkConfig.hpp
- Removed redundant OpenAPI schema property 'example'.
- Changed backend render json indentation to 4 spaces.
@Aryamanz29 Aryamanz29 force-pushed the issue-208/add-zerotier-backend branch from eefe53d to 0f82d3f Compare June 11, 2023 13:23
@Aryamanz29 Aryamanz29 force-pushed the issue-208/add-zerotier-backend branch from 0f82d3f to b0a83a1 Compare June 11, 2023 13:29
@Aryamanz29 Aryamanz29 force-pushed the issue-207/add-zerotier-to-openwrt-backend branch from 215acdb to 21ea65e Compare June 12, 2023 10:04
@Aryamanz29 Aryamanz29 marked this pull request as ready for review June 13, 2023 09:37
@Aryamanz29 Aryamanz29 force-pushed the issue-208/add-zerotier-backend branch from cf8555b to 23f338f Compare June 16, 2023 10:06
There are certain properties in the ZeroTier schema
that require default values. For example, if we don't provide
a default value for the `multicastLimit` property, it will be set to `0`
during an API call, which disables IPv4 communication for the network.

More information:
https://docs.zerotier.com/zerotier/rules
Other changes:
- Used checkbox input for "boolean" schema properties.
@Aryamanz29 Aryamanz29 force-pushed the issue-207/add-zerotier-to-openwrt-backend branch from 1c91d8e to 9c9af75 Compare June 22, 2023 10:31
@Aryamanz29 Aryamanz29 force-pushed the issue-207/add-zerotier-to-openwrt-backend branch from 9c9af75 to 474d928 Compare June 22, 2023 11:23
@Aryamanz29 Aryamanz29 force-pushed the issue-207/add-zerotier-to-openwrt-backend branch from 0e9ec35 to 7c723c0 Compare June 29, 2023 12:12
Copy link
Member

@pandafy pandafy left a comment

Choose a reason for hiding this comment

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

Good work @Aryamanz29! It looks very close to getting merged.

netjsonconfig/backends/zerotier/schema.py Outdated Show resolved Hide resolved
netjsonconfig/backends/zerotier/schema.py Outdated Show resolved Hide resolved
netjsonconfig/backends/zerotier/schema.py Show resolved Hide resolved
netjsonconfig/backends/zerotier/schema.py Outdated Show resolved Hide resolved
@Aryamanz29 Aryamanz29 force-pushed the issue-207/add-zerotier-to-openwrt-backend branch 3 times, most recently from d61bb29 to 940a6db Compare July 23, 2023 12:30
@Aryamanz29 Aryamanz29 force-pushed the issue-207/add-zerotier-to-openwrt-backend branch from 940a6db to d965e8e Compare July 23, 2023 12:40
@Aryamanz29 Aryamanz29 requested a review from pandafy July 23, 2023 21:36
@nemesifier nemesifier merged commit 3f21433 into gsoc23 Jul 27, 2023
4 checks passed
@nemesifier nemesifier deleted the issue-207/add-zerotier-to-openwrt-backend branch July 27, 2023 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature] Add support for ZeroTier tunnels to OpenWRT backend
5 participants