ucentral-schema: add captive portal support

Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
John Crispin
2021-03-26 14:27:56 +01:00
parent 50cc5eaa44
commit a2018f2e84
5 changed files with 98 additions and 0 deletions

15
cfg/cfg_captive.uc Normal file
View File

@@ -0,0 +1,15 @@
{%
function generate_captive() {
let opennds = {};
uci_defaults(cfg.captive { "enabled": 0, "gatewayname": "uCentral", "gatewayfqdn": "ucentral.splash",
"maxclients": "64", "authidletimeout": 120, "uploadrate": 0,
"downloadrate": 0, "uploadquota": 0, "downloadquota": 0 };
uci_set_options(opennds, cfg.captive, { "enabled", "gatewayname", "gatewayfqdn", "maxclients",
"authidletimeout", "uploadrate", "downloadrate",
"uploadquota", "downloadquota" });
uci_render("opennds", { opennds });
}
generate_captive();
%}

View File

@@ -15,6 +15,7 @@ yaml2json schema/lldp.yml lldp.schema
yaml2json schema/rtty.yml rtty.schema
yaml2json schema/stats.yml stats.schema
yaml2json schema/mqtt.yml mqtt.schema
yaml2json schema/captive.yml captive.schema
./merge-schema.py
mkdir -p docs
jsonschema2md ucentral.schema.json docs/ucentral-schema.md

View File

@@ -41,4 +41,5 @@ schema_merge("lldp", "lldp.schema")
schema_merge("rtty", "rtty.schema")
schema_merge("stats", "stats.schema")
schema_merge("mqtt", "mqtt.schema")
schema_merge("captive", "captive.schema")
schema_write()

41
schema/captive.yml Normal file
View File

@@ -0,0 +1,41 @@
type: object
properties:
captive:
description:
This section can be used to setup a captive portal on the AP.
type: object
properties:
enabled:
description:
Enable this option to tell the unit that it shall start a captive portal.
type: number
maximum: 1
minimum: 0
gatewayname:
type: string
description:
This name will be presented to connecting users in on the splash page.
gatewayfqdn:
type: string
description:
The fqdn used for the captive portal IP.
maxclients:
type: number
description:
The number of clients that we accept.
uploadrate:
type: number
description:
The maximum upload rate for a specific client.
downloadrate:
type: number
description:
The maximum download rate for a specific client.
uploadquota:
type: number
description:
The maximum upload quota for a specific client.
downloadquota:
type: number
description:
The maximum download quota for a specific client.

View File

@@ -662,6 +662,46 @@
"type": "string"
}
}
},
"captive": {
"description": "This section can be used to setup a captive portal on the AP.",
"type": "object",
"properties": {
"enabled": {
"description": "Enable this option to tell the unit that it shall start a captive portal.",
"type": "number",
"maximum": 1,
"minimum": 0
},
"gatewayname": {
"type": "string",
"description": "This name will be presented to connecting users in on the splash page."
},
"gatewayfqdn": {
"type": "string",
"description": "The fqdn used for the captive portal IP."
},
"maxclients": {
"type": "number",
"description": "The number of clients that we accept."
},
"uploadrate": {
"type": "number",
"description": "The maximum upload rate for a specific client."
},
"downloadrate": {
"type": "number",
"description": "The maximum download rate for a specific client."
},
"uploadquota": {
"type": "number",
"description": "The maximum upload quota for a specific client."
},
"downloadquota": {
"type": "number",
"description": "The maximum download quota for a specific client."
}
}
}
}
}