mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-01 00:45:23 +00:00
Auto-merge for PR #544 via VersionBot
Fix saving deviceApiKey to the DB (to fix the RESIN_API_KEY env var)
This commit is contained in:
commit
122b55fbe5
@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
|
||||
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## v6.5.9 - 2018-01-12
|
||||
|
||||
* Fix saving deviceApiKey to the DB (to fix the RESIN_API_KEY env var) when updating from some older supervisors #544 [Pablo Carranza Velez]
|
||||
|
||||
## v6.5.8 - 2018-01-10
|
||||
|
||||
* Update docker-toolbelt to v3.2.1 to fix a bug in deltas #543 [Pablo Carranza Velez]
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "resin-supervisor",
|
||||
"description": "This is resin.io's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as Resin's API informs it to.",
|
||||
"version": "6.5.8",
|
||||
"version": "6.5.9",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -223,6 +223,17 @@ bootstrapper.done = new Promise (resolve) ->
|
||||
# This will only be the case when the supervisor/OS has been updated.
|
||||
if userConfig.apiKey?
|
||||
exchangeKeyOrRetry()
|
||||
else
|
||||
Promise.join(
|
||||
knex('config').select('value').where(key: 'apiKey')
|
||||
knex('config').select('value').where(key: 'deviceApiKey')
|
||||
([ apiKey ], [ deviceApiKey ]) ->
|
||||
if !deviceApiKey?.value
|
||||
# apiKey in the DB is actually the deviceApiKey, but it was
|
||||
# exchanged in a supervisor version that didn't save it to the DB
|
||||
# (which mainly affects the RESIN_API_KEY env var)
|
||||
knex('config').insert({ key: 'deviceApiKey', value: apiKey.value })
|
||||
)
|
||||
return
|
||||
|
||||
bootstrapper.bootstrapped = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user