From 78e2e185abc15e5c0f52f5fbd49e003c5632104a Mon Sep 17 00:00:00 2001 From: Samuel Hassine Date: Thu, 3 Mar 2022 15:31:31 +0100 Subject: [PATCH] [api] Fix get versions --- opencti-platform/opencti-graphql/config/schema/opencti.graphql | 2 +- opencti-platform/opencti-graphql/src/config/conf.js | 3 ++- opencti-platform/opencti-graphql/src/generated/graphql.ts | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/opencti-platform/opencti-graphql/config/schema/opencti.graphql b/opencti-platform/opencti-graphql/config/schema/opencti.graphql index e08658a0bf10..7995aecbe5bf 100644 --- a/opencti-platform/opencti-graphql/config/schema/opencti.graphql +++ b/opencti-platform/opencti-graphql/config/schema/opencti.graphql @@ -138,7 +138,7 @@ Retrieve the application information version add dependencies """ type AppInfo { """ - The OpenCTI aplication version + The OpenCTI application version """ version: String! """ diff --git a/opencti-platform/opencti-graphql/src/config/conf.js b/opencti-platform/opencti-graphql/src/config/conf.js index 36f5f381a406..30dddf516e25 100644 --- a/opencti-platform/opencti-graphql/src/config/conf.js +++ b/opencti-platform/opencti-graphql/src/config/conf.js @@ -15,6 +15,7 @@ import { ABSTRACT_STIX_DOMAIN_OBJECT, } from '../schema/general'; import { STIX_SIGHTING_RELATIONSHIP } from '../schema/stixSightingRelationship'; +import pjson from '../../package.json'; // https://golang.org/src/crypto/x509/root_linux.go const LINUX_CERTFILES = [ @@ -115,7 +116,7 @@ export const BUS_TOPICS = { }, }; -export const PLATFORM_VERSION = process.env.npm_package_version; +export const PLATFORM_VERSION = pjson.version; export const booleanConf = (key, defaultValue = true) => { const configValue = nconf.get(key); diff --git a/opencti-platform/opencti-graphql/src/generated/graphql.ts b/opencti-platform/opencti-graphql/src/generated/graphql.ts index 77320a9ea271..ba7f26e75c5a 100644 --- a/opencti-platform/opencti-graphql/src/generated/graphql.ts +++ b/opencti-platform/opencti-graphql/src/generated/graphql.ts @@ -45,7 +45,7 @@ export type AppInfo = { dependencies: Array; /** The OpenCTI api current memory usage */ memory?: Maybe; - /** The OpenCTI aplication version */ + /** The OpenCTI application version */ version: Scalars['String']; };