Skip to content

Commit f0225e9

Browse files
[openwrt] Add firewall includes to schema
1 parent 81b17a0 commit f0225e9

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

netjsonconfig/backends/openwrt/schema.py

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,36 @@
756756
},
757757
}
758758

759+
firewall_includes_properties = {
760+
"name": {"$ref": "#/definitions/firewall/name"},
761+
"enabled": {"$ref": "#/definitions/firewall/enabled"},
762+
"family": {"$ref": "#/definitions/firewall/family"},
763+
"script_type": { # Note: corresponds to UCI variable "type"
764+
"type": "string",
765+
"title": "The type of the script",
766+
"description": 'Specifies the type of the include, can be "script" for traditional '
767+
'shell script includes or restore for plain files in iptables-restore format.',
768+
"enum": ["script", "restore"],
769+
"propertyOrder": 101,
770+
},
771+
"path": {
772+
"type": "string",
773+
"title": "Script to include",
774+
"description": "Specifies a shell script to execute on boot or firewall restarts",
775+
"default": "/etc/firewall.user",
776+
"propertyOrder": 102,
777+
},
778+
"reload": {
779+
"type": "boolean",
780+
"title": "Reload the included file when reloading firewall rules",
781+
"description": "This specifies whether or not the included file should be "
782+
"reloaded when the firewall rules are reloaded. This is only needed if "
783+
"the included file injects rules into internal OpenWRT chains.",
784+
"default": False,
785+
"propertyOrder": 103,
786+
},
787+
}
788+
759789
firewall_redirect_properties = {
760790
"name": {"$ref": "#/definitions/firewall/name"},
761791
"enabled": {"$ref": "#/definitions/firewall/enabled"},
@@ -1230,6 +1260,17 @@
12301260
"properties": firewall_redirect_properties,
12311261
},
12321262
},
1263+
"includes": {
1264+
"type": "array",
1265+
"title": "Includes",
1266+
"propertyOrder": 9,
1267+
"items": {
1268+
"type": "object",
1269+
"title": "Include",
1270+
"additionalProperties": False,
1271+
"properties": firewall_includes_properties,
1272+
},
1273+
},
12331274
}
12341275

12351276
firewall = {

0 commit comments

Comments
 (0)