|
|
@ -100,8 +100,9 @@ export const configStriker: RequestHandler< |
|
|
|
domainName: rDomainName = '', |
|
|
|
domainName: rDomainName = '', |
|
|
|
hostName: rHostName = '', |
|
|
|
hostName: rHostName = '', |
|
|
|
hostNumber: rHostNumber = 0, |
|
|
|
hostNumber: rHostNumber = 0, |
|
|
|
networkDNS: rNetworkDns = '', |
|
|
|
dns: rDns = '', |
|
|
|
networkGateway: rNetworkGateway = '', |
|
|
|
gateway: rGateway = '', |
|
|
|
|
|
|
|
gatewayInterface: rGatewayInterface = '', |
|
|
|
networks = [], |
|
|
|
networks = [], |
|
|
|
organizationName: rOrganizationName = '', |
|
|
|
organizationName: rOrganizationName = '', |
|
|
|
organizationPrefix: rOrganizationPrefix = '', |
|
|
|
organizationPrefix: rOrganizationPrefix = '', |
|
|
@ -111,8 +112,9 @@ export const configStriker: RequestHandler< |
|
|
|
const domainName = sanitize(rDomainName, 'string'); |
|
|
|
const domainName = sanitize(rDomainName, 'string'); |
|
|
|
const hostName = sanitize(rHostName, 'string'); |
|
|
|
const hostName = sanitize(rHostName, 'string'); |
|
|
|
const hostNumber = sanitize(rHostNumber, 'number'); |
|
|
|
const hostNumber = sanitize(rHostNumber, 'number'); |
|
|
|
const networkDns = sanitize(rNetworkDns, 'string'); |
|
|
|
const dns = sanitize(rDns, 'string'); |
|
|
|
const networkGateway = sanitize(rNetworkGateway, 'string'); |
|
|
|
const gateway = sanitize(rGateway, 'string'); |
|
|
|
|
|
|
|
const gatewayInterface = sanitize(rGatewayInterface, 'string'); |
|
|
|
const organizationName = sanitize(rOrganizationName, 'string'); |
|
|
|
const organizationName = sanitize(rOrganizationName, 'string'); |
|
|
|
const organizationPrefix = sanitize(rOrganizationPrefix, 'string'); |
|
|
|
const organizationPrefix = sanitize(rOrganizationPrefix, 'string'); |
|
|
|
|
|
|
|
|
|
|
@ -138,13 +140,18 @@ export const configStriker: RequestHandler< |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
assert( |
|
|
|
assert( |
|
|
|
REP_IPV4_CSV.test(networkDns), |
|
|
|
REP_IPV4_CSV.test(dns), |
|
|
|
`Data network DNS must be a comma separated list of valid IPv4 addresses; got [${networkDns}]`, |
|
|
|
`Data network DNS must be a comma separated list of valid IPv4 addresses; got [${dns}]`, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
assert( |
|
|
|
assert( |
|
|
|
REP_IPV4.test(networkGateway), |
|
|
|
REP_IPV4.test(gateway), |
|
|
|
`Data network gateway must be a valid IPv4 address; got [${networkGateway}]`, |
|
|
|
`Data network gateway must be a valid IPv4 address; got [${gateway}]`, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
assert( |
|
|
|
|
|
|
|
REP_PEACEFUL_STRING.test(gatewayInterface), |
|
|
|
|
|
|
|
`Data gateway interface must be a peaceful string; got [${gatewayInterface}]`, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
assert( |
|
|
|
assert( |
|
|
@ -169,8 +176,9 @@ export const configStriker: RequestHandler< |
|
|
|
[cvar(1, 'organization')]: { value: organizationName }, |
|
|
|
[cvar(1, 'organization')]: { value: organizationName }, |
|
|
|
[cvar(1, 'prefix')]: { value: organizationPrefix }, |
|
|
|
[cvar(1, 'prefix')]: { value: organizationPrefix }, |
|
|
|
[cvar(1, 'sequence')]: { value: hostNumber }, |
|
|
|
[cvar(1, 'sequence')]: { value: hostNumber }, |
|
|
|
[cvar(2, 'dns')]: { step: 2, value: networkDns }, |
|
|
|
[cvar(2, 'dns')]: { step: 2, value: dns }, |
|
|
|
[cvar(2, 'gateway')]: { step: 2, value: networkGateway }, |
|
|
|
[cvar(2, 'gateway')]: { step: 2, value: gateway }, |
|
|
|
|
|
|
|
[cvar(2, 'gateway_interface')]: { step: 2, value: gatewayInterface }, |
|
|
|
[cvar(2, 'host_name')]: { step: 2, value: hostName }, |
|
|
|
[cvar(2, 'host_name')]: { step: 2, value: hostName }, |
|
|
|
[cvar(2, 'striker_password')]: { step: 2, value: adminPassword }, |
|
|
|
[cvar(2, 'striker_password')]: { step: 2, value: adminPassword }, |
|
|
|
[cvar(2, 'striker_user')]: { step: 2, value: 'admin' }, |
|
|
|
[cvar(2, 'striker_user')]: { step: 2, value: 'admin' }, |
|
|
|