Merge pull request #922 from balena-io/include-api-url-with-device-api-key

feature: Add `BALENA_API_URL` environment variable
This commit is contained in:
Rich Bayliss 2019-02-28 11:52:02 +00:00 committed by GitHub
commit 9009f08c92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 0 deletions

View File

@ -188,6 +188,7 @@ export interface DeviceMetadata {
version: string;
deviceType: string;
deviceApiKey: string;
apiEndpoint: string;
listenPort: number;
apiSecret: string;
supervisorApiHost: string;

View File

@ -357,6 +357,7 @@ export function addFeaturesFromLabels(
if (checkTruthy(service.config.labels['io.balena.features.balena-api'])) {
setEnvVariables('API_KEY', options.deviceApiKey);
setEnvVariables('API_URL', options.apiEndpoint);
}
if (checkTruthy(service.config.labels['io.balena.features.supervisor-api'])) {

View File

@ -76,6 +76,7 @@ export const fnSchema = {
'listenPort',
'name',
'apiSecret',
'apiEndpoint',
'deviceApiKey',
'version',
'deviceType',

View File

@ -218,6 +218,7 @@ export const schemaTypes = {
name: t.string,
apiSecret: t.union([t.string, NullOrUndefined]),
deviceApiKey: t.string,
apiEndpoint: t.string,
version: t.string,
deviceType: t.string,
osVersion: t.union([t.string, NullOrUndefined]),