Skip to content

Instantly share code, notes, and snippets.

@abrodersen
Created January 12, 2018 14:06
Show Gist options
  • Save abrodersen/b36ed6d8ac6277e379d829db6e95759b to your computer and use it in GitHub Desktop.
Save abrodersen/b36ed6d8ac6277e379d829db6e95759b to your computer and use it in GitHub Desktop.
Reconfix schema
{
config_txt: {
type: 'json',
location: {
partition: adaptPartition(config.partition),
path: adaptPath(config.path)
},
properties: [
{
definition: {
persistentLogging: {
type: ['string'],
mapping: ['/persistentLogging'],
optional: true,
},
hostname: {
type: ['string'],
mapping: ['/hostname'],
optional: true,
}
}
}
]
},
resin_wifi: {
type: 'ini',
location: {
partition: adaptPartition(config.partition),
path: adaptPath(config.path)
},
properties: [{
definition: {
wifi: {
properties: [{
definition: {
enabled: {
type: ['boolean'],
optional: true,
mapping: [{
value: true,
template: {
connection: {
id: 'resin-wifi',
type: 'wifi'
},
wifi: {
hidden: true,
mode: 'infrastructure',
ssid: '[[string]]'
},
'wifi-security': {
'auth-alg': 'open',
'key-mgmt': 'wpa-psk',
'psk': '[[string]]'
},
ipv4: {
method: 'auto'
},
ipv6: {
'addr-gen-mode': 'stable-privacy',
method: 'auto'
}
}
}]
},
}
},
{
when: {
wifi: {
enabled: true
}
},
definition: {
'networkSsid': {
type: ['string'],
mapping: ['/wifi/ssid']
},
'networkKey': {
type: ['string'],
mapping: ['/wifi-security/psk']
}
}
}]
}
}
}]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment