2018-01-19 09:12:43 +00:00
|
|
|
need_string(in_site({'site_code'}))
|
|
|
|
need_string(in_site({'site_name'}))
|
2018-01-19 06:15:38 +00:00
|
|
|
|
|
|
|
-- this_domain() returns nil when multidomain support is disabled
|
|
|
|
if this_domain() then
|
|
|
|
function need_domain_name(path)
|
|
|
|
need_string(path)
|
|
|
|
need(path, function(default_domain)
|
|
|
|
local f = io.open(os.getenv('IPKG_INSTROOT') .. '/lib/gluon/domains/' .. default_domain .. '.json')
|
|
|
|
if not f then return false end
|
|
|
|
f:close()
|
|
|
|
return true
|
|
|
|
end, nil, 'be a valid domain name')
|
|
|
|
end
|
|
|
|
need_domain_name(in_site({'default_domain'}))
|
|
|
|
end
|
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string_match(in_domain({'domain_seed'}), '^' .. ('%x'):rep(64) .. '$')
|
2014-07-05 00:48:56 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string({'opkg', 'lede'}, false)
|
|
|
|
need_table({'opkg', 'extra'}, function(extra_repo)
|
|
|
|
need_alphanumeric_key(extra_repo)
|
|
|
|
need_string(extra_repo)
|
|
|
|
end, false)
|
2015-10-14 00:55:13 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string(in_site({'hostname_prefix'}), false)
|
|
|
|
need_string(in_site({'timezone'}))
|
2015-10-14 00:55:13 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string_array({'ntp_servers'}, false)
|
2015-10-14 00:55:13 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string_match(in_domain({'prefix6'}), '^[%x:]+/64$')
|
2015-10-26 19:59:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
for _, config in ipairs({'wifi24', 'wifi5'}) do
|
2018-01-19 09:12:43 +00:00
|
|
|
if need_table({config}, nil, false) then
|
|
|
|
need_string(in_site({'regdom'})) -- regdom is only required when wifi24 or wifi5 is configured
|
2017-01-24 22:02:20 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_number({config, 'channel'})
|
2017-01-24 22:02:20 +00:00
|
|
|
|
|
|
|
local rates = {1000, 2000, 5500, 6000, 9000, 11000, 12000, 18000, 24000, 36000, 48000, 54000}
|
2018-01-19 09:12:43 +00:00
|
|
|
local supported_rates = need_array_of(in_site({config, 'supported_rates'}), rates, false)
|
|
|
|
need_array_of({config, 'basic_rate'}, supported_rates or rates, supported_rates ~= nil)
|
|
|
|
|
|
|
|
if need_table({config, 'ibss'}, nil, false) then
|
|
|
|
need_string(in_domain({config, 'ibss', 'ssid'}))
|
|
|
|
need_string_match(in_domain({config, 'ibss', 'bssid'}), '^%x[02468aAcCeE]:%x%x:%x%x:%x%x:%x%x:%x%x$')
|
|
|
|
need_one_of({config, 'ibss', 'mcast_rate'}, supported_rates or rates, false)
|
|
|
|
need_number({config, 'ibss', 'vlan'}, false)
|
|
|
|
need_boolean({config, 'ibss', 'disabled'}, false)
|
|
|
|
end
|
|
|
|
|
|
|
|
if need_table({config, 'mesh'}, nil, false) then
|
|
|
|
need_string(in_domain({config, 'mesh', 'id'}))
|
|
|
|
need_one_of({config, 'mesh', 'mcast_rate'}, supported_rates or rates, false)
|
|
|
|
need_boolean({config, 'mesh', 'disabled'}, false)
|
2017-01-24 22:02:20 +00:00
|
|
|
end
|
|
|
|
end
|
2015-10-26 19:59:56 +00:00
|
|
|
end
|
2016-07-29 22:00:39 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_boolean(in_site({'poe_passthrough'}), false)
|
2016-12-30 16:22:22 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
if need_table({'dns'}, nil, false) then
|
|
|
|
need_string_array_match({'dns', 'servers'}, '^[%x:]+$')
|
|
|
|
need_number({'dns', 'cacheentries'}, false)
|
2016-12-30 16:22:22 +00:00
|
|
|
end
|
2017-02-10 20:19:34 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_string_match(in_domain({'next_node', 'ip6'}), '^[%x:]+$', false)
|
|
|
|
need_string_match(in_domain({'next_node', 'ip4'}), '^%d+.%d+.%d+.%d+$', false)
|
2017-02-10 20:19:34 +00:00
|
|
|
|
2018-01-19 09:12:43 +00:00
|
|
|
need_boolean(in_site({'mesh_on_wan'}), false)
|
|
|
|
need_boolean(in_site({'mesh_on_lan'}), false)
|
|
|
|
need_boolean(in_site({'single_as_lan'}), false)
|