mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-05-04 18:12:56 +00:00
Make sure the responses are at least non-empty, otherwise we're going to get into a broken vpn situation.
This commit is contained in:
parent
4c257c8e7d
commit
73c62cb5be
@ -83,6 +83,10 @@ module.exports = ->
|
||||
throw body
|
||||
|
||||
console.log('Configuring VPN..', JSON.stringify(body))
|
||||
|
||||
for prop in ['ca', 'cert', 'vpnhost', 'vpnport'] when _.isEmpty(body[prop])
|
||||
throw new Error("'#{prop}' is empty, cannot bootstrap")
|
||||
|
||||
vpnConf = fs.readFileAsync(__dirname + '/openvpn.conf.tmpl', 'utf8')
|
||||
.then (tmpl) ->
|
||||
fs.writeFileAsync('/data/client.conf', _.template(tmpl)(body))
|
||||
|
Loading…
x
Reference in New Issue
Block a user