Skip to content

Commit

Permalink
[change] Added the required default values to the ZeroTier schema
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Aryamanz29 committed Jul 23, 2023
1 parent 50bc3cc commit 3f14cae
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions netjsonconfig/backends/zerotier/schema.py
Expand Up @@ -80,6 +80,7 @@
},
"enableBroadcast": {
"type": "boolean",
"default": True,
"propertyOrder": 8,
"description": "Enable broadcast packets on the network",
},
Expand Down Expand Up @@ -114,11 +115,13 @@
"mtu": {
"type": "integer",
"propertyOrder": 12,
"default": 2800,
"description": "MTU to set on the client virtual network adapter",
},
"multicastLimit": {
"type": "integer",
"propertyOrder": 13,
"default": 32,
"description": (
"Maximum number of recipients per multicast or broadcast. "
"Warning - Setting this to 0 will disable IPv4 communication on your network!"
Expand Down Expand Up @@ -188,6 +191,33 @@
"items": {"type": "object"},
"propertyOrder": 17,
"description": "Array of network rule objects",
# This is the default rule set
# that allows IPv4 and IPv6 traffic
# It is based on the default
# network configuration from ZeroTier Central
# https://docs.zerotier.com/zerotier/rules
"default": [
{
"etherType": 2048,
"not": True,
"or": False,
"type": "MATCH_ETHERTYPE",
},
{
"etherType": 2054,
"not": True,
"or": False,
"type": "MATCH_ETHERTYPE",
},
{
"etherType": 34525,
"not": True,
"or": False,
"type": "MATCH_ETHERTYPE",
},
{"type": "ACTION_DROP"},
{"type": "ACTION_ACCEPT"},
],
},
"capabilities": {
"type": "array",
Expand Down

0 comments on commit 3f14cae

Please sign in to comment.