diff --git a/src/compose/types/service.ts b/src/compose/types/service.ts index cc46d3b1..81fabe29 100644 --- a/src/compose/types/service.ts +++ b/src/compose/types/service.ts @@ -188,6 +188,7 @@ export interface DeviceMetadata { version: string; deviceType: string; deviceApiKey: string; + apiEndpoint: string; listenPort: number; apiSecret: string; supervisorApiHost: string; diff --git a/src/compose/utils.ts b/src/compose/utils.ts index 7fce3041..33f56c26 100644 --- a/src/compose/utils.ts +++ b/src/compose/utils.ts @@ -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'])) { diff --git a/src/config/functions.ts b/src/config/functions.ts index 9ace79d1..5f444cc9 100644 --- a/src/config/functions.ts +++ b/src/config/functions.ts @@ -76,6 +76,7 @@ export const fnSchema = { 'listenPort', 'name', 'apiSecret', + 'apiEndpoint', 'deviceApiKey', 'version', 'deviceType', diff --git a/src/config/schema-type.ts b/src/config/schema-type.ts index f457b6d1..6b1223f9 100644 --- a/src/config/schema-type.ts +++ b/src/config/schema-type.ts @@ -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]),