mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2025-10-30 17:47:59 +00:00
renderer: add ssid purpose support
This allow us to use pre-defined BSS settings Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
@@ -1,4 +1,45 @@
|
|||||||
{%
|
{%
|
||||||
|
let purpose = {
|
||||||
|
"onboarding-ap": {
|
||||||
|
"name": "OpenWifi-onboarding",
|
||||||
|
"hidden_ssid": true,
|
||||||
|
"isolate_clients": true,
|
||||||
|
"wifi_bands": [
|
||||||
|
"2G"
|
||||||
|
],
|
||||||
|
"bss_mode": "ap",
|
||||||
|
"encryption": {
|
||||||
|
"proto": "wpa2",
|
||||||
|
"ieee80211w": "required"
|
||||||
|
},
|
||||||
|
"certificates": {
|
||||||
|
"use_local_certificates": true
|
||||||
|
},
|
||||||
|
"radius": {
|
||||||
|
"local": {
|
||||||
|
"server-identity": "uCentral-EAP"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"onboarding-sta": {
|
||||||
|
"name": "OpenWifi-onboarding",
|
||||||
|
"wifi_bands": [
|
||||||
|
"2G"
|
||||||
|
],
|
||||||
|
"bss_mode": "sta",
|
||||||
|
"encryption": {
|
||||||
|
"proto": "wpa2",
|
||||||
|
"ieee80211w": "required"
|
||||||
|
},
|
||||||
|
"certificates": {
|
||||||
|
"use_local_certificates": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (purpose[ssid.purpose])
|
||||||
|
ssid = purpose[ssid.purpose];
|
||||||
|
|
||||||
let phys = [];
|
let phys = [];
|
||||||
|
|
||||||
for (let band in ssid.wifi_bands)
|
for (let band in ssid.wifi_bands)
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ try {
|
|||||||
fs.symlink(ARGV[2], '/etc/ucentral/ucentral.active');
|
fs.symlink(ARGV[2], '/etc/ucentral/ucentral.active');
|
||||||
|
|
||||||
set_service_state(true);
|
set_service_state(true);
|
||||||
if (split(old_config, ".")[1] == "/etc/ucentral/ucentral")
|
if (old_config && split(old_config, ".")[1] == "/etc/ucentral/ucentral")
|
||||||
fs.unlink(old_config);
|
fs.unlink(old_config);
|
||||||
} else {
|
} else {
|
||||||
error = 1;
|
error = 1;
|
||||||
|
|||||||
@@ -3,6 +3,16 @@ description:
|
|||||||
These properties are described inside this object.
|
These properties are described inside this object.
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
|
purpose:
|
||||||
|
description:
|
||||||
|
An SSID can have a special purpose such as the hidden on-boarding BSS.
|
||||||
|
All purposes other than "user-defined" are static pre-defined configurations.
|
||||||
|
type: string
|
||||||
|
enum:
|
||||||
|
- user-defined
|
||||||
|
- onboarding-ap
|
||||||
|
- onboarding-sta
|
||||||
|
default: user-defined
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
The broadcasted SSID of the wireless network and for for managed mode
|
The broadcasted SSID of the wireless network and for for managed mode
|
||||||
|
|||||||
@@ -2597,6 +2597,23 @@ function instantiateInterfaceSsid(location, value, errors) {
|
|||||||
if (type(value) == "object") {
|
if (type(value) == "object") {
|
||||||
let obj = {};
|
let obj = {};
|
||||||
|
|
||||||
|
function parsePurpose(location, value, errors) {
|
||||||
|
if (type(value) != "string")
|
||||||
|
push(errors, [ location, "must be of type string" ]);
|
||||||
|
|
||||||
|
if (!(value in [ "user-defined", "onboarding-ap", "onboarding-sta" ]))
|
||||||
|
push(errors, [ location, "must be one of \"user-defined\", \"onboarding-ap\" or \"onboarding-sta\"" ]);
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exists(value, "purpose")) {
|
||||||
|
obj.purpose = parsePurpose(location + "/purpose", value["purpose"], errors);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj.purpose = "user-defined";
|
||||||
|
}
|
||||||
|
|
||||||
function parseName(location, value, errors) {
|
function parseName(location, value, errors) {
|
||||||
if (type(value) == "string") {
|
if (type(value) == "string") {
|
||||||
if (length(value) > 32)
|
if (length(value) > 32)
|
||||||
|
|||||||
@@ -1036,6 +1036,15 @@
|
|||||||
"interface.ssid": {
|
"interface.ssid": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"purpose": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"user-defined",
|
||||||
|
"onboarding-ap",
|
||||||
|
"onboarding-sta"
|
||||||
|
],
|
||||||
|
"default": "user-defined"
|
||||||
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"maxLength": 32,
|
"maxLength": 32,
|
||||||
|
|||||||
Reference in New Issue
Block a user