check_site.lua 758 B

1234567891011121314151617181920212223242526
  1. need_string_array('fastd_mesh_vpn.methods')
  2. need_number('fastd_mesh_vpn.mtu')
  3. need_boolean('fastd_mesh_vpn.enabled', false)
  4. need_boolean('fastd_mesh_vpn.configurable', false)
  5. local function check_peer(prefix)
  6. return function(k, _)
  7. local table = string.format('%s[%q].', prefix, k)
  8. need_string(table .. 'key')
  9. need_string_array(table .. 'remotes')
  10. end
  11. end
  12. local function check_group(prefix)
  13. return function(k, _)
  14. local table = string.format('%s[%q].', prefix, k)
  15. need_number(table .. 'limit', false)
  16. need_table(table .. 'peers', check_peer(table .. 'peers'), false)
  17. need_table(table .. 'groups', check_group(table .. 'groups'), false)
  18. end
  19. end
  20. need_table('fastd_mesh_vpn.groups', check_group('fastd_mesh_vpn.groups'))