@codefresh-io/service-base 3.0.5 → 3.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/infra/config.js CHANGED
@@ -54,6 +54,7 @@ base.eventbus = {
54
54
 
55
55
  base.postgres = {
56
56
  host: process.env.POSTGRES_HOST || APPLICATION_DOMAIN,
57
+ port: process.env.POSTGRES_PORT || 5432,
57
58
  database: process.env.POSTGRES_DATABASE || 'postgres',
58
59
  user: process.env.POSTGRES_USER || 'postgres',
59
60
  password: process.env.POSTGRES_PASSWORD || 'postgres',
@@ -61,10 +62,18 @@ base.postgres = {
61
62
 
62
63
  base.mongo = {
63
64
  uri: process.env.MONGO_URI || `mongodb://${APPLICATION_DOMAIN}/${name}`,
64
- reconnectTries: process.env.MONGO_RECONNECT_TRIES || Number.MAX_VALUE,
65
- reconnectInterval: process.env.MONGO_RECONNECT_INTERVAL || 30 * 1000,
65
+ options: {
66
+ reconnectTries: process.env.MONGO_RECONNECT_TRIES || Number.MAX_VALUE,
67
+ reconnectInterval: process.env.MONGO_RECONNECT_INTERVAL || 30 * 1000,
68
+ },
66
69
  };
67
70
 
71
+ if (process.env.MTLS_CERT_PATH) {
72
+ const credentials = fs.readFileSync(process.env.MTLS_CERT_PATH);
73
+ base.mongo.options.sslKey = credentials;
74
+ base.mongo.options.sslCert = credentials;
75
+ }
76
+
68
77
  base.logger = {
69
78
  filePath: process.env.LOGS_PATH || path.join(__dirname, '../../logs', 'kubernetes-logs.log'),
70
79
  console: true,
@@ -87,8 +96,8 @@ base.logger = {
87
96
  }
88
97
  // human readable format
89
98
  return `${options.timestamp()} ${options.level.toUpperCase()} >> ` +
90
- `${options.message || ''}` +
91
- `${options.meta && Object.keys(options.meta).length ? ` << ${JSON.stringify(options.meta)}` : ''}`;
99
+ `${options.message || ''}` +
100
+ `${options.meta && Object.keys(options.meta).length ? ` << ${JSON.stringify(options.meta)}` : ''}`;
92
101
  },
93
102
  },
94
103
  basePath: null,
package/infra/eventbus.js CHANGED
@@ -35,6 +35,7 @@ class Eventbus {
35
35
  },
36
36
  store: {
37
37
  host: this.config.postgres.host,
38
+ port: this.config.postgres.port,
38
39
  database: this.config.postgres.database,
39
40
  user: this.config.postgres.user,
40
41
  password: this.config.postgres.password,
package/infra/mongo.js CHANGED
@@ -17,8 +17,7 @@ class Mongo {
17
17
  init(config) {
18
18
  const clientSettings = {
19
19
  promiseLibrary: Promise,
20
- reconnectTries: config.mongo.reconnectTries,
21
- reconnectInterval: config.mongo.reconnectInterval,
20
+ ...config.mongo.options,
22
21
  };
23
22
 
24
23
  const logger = require('cf-logs').Logger('codefresh:infra:mongo'); // eslint-disable-line
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefresh-io/service-base",
3
- "version": "3.0.5",
3
+ "version": "3.0.9",
4
4
  "main": "index.js",
5
5
  "description": "",
6
6
  "engines": {
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "homepage": "https://github.com/codefresh-io/service-base#readme",
30
30
  "dependencies": {
31
- "@codefresh-io/authenticated-entity": "^2.11.1",
31
+ "@codefresh-io/authenticated-entity": "^2.13.1",
32
32
  "@codefresh-io/cf-openapi": "~0.7.7",
33
33
  "@codefresh-io/eventbus": "^1.3.1",
34
- "@codefresh-io/http-infra": "^1.8.5",
34
+ "@codefresh-io/http-infra": "^1.8.9",
35
35
  "@codefresh-io/internal-service-config": "^1.0.2",
36
36
  "@ronomon/crypto-async": "^5.0.1",
37
37
  "@wegolook/joi-objectid": "^2.4.0",
package/yarn.lock CHANGED
@@ -286,12 +286,12 @@
286
286
  exec-sh "^0.3.2"
287
287
  minimist "^1.2.0"
288
288
 
289
- "@codefresh-io/authenticated-entity@^2.11.1":
290
- version "2.11.1"
291
- resolved "https://registry.yarnpkg.com/@codefresh-io/authenticated-entity/-/authenticated-entity-2.11.1.tgz#896b7435adc3d8fc531d1b6510b5d1d51c00c5cf"
292
- integrity sha512-kctZR4v7aVQPkeq0BvJAs/nPps+nwrePGmt3SSRI7enTD87HfSm3DrjfFK2Nq+wV1pQUui1sU2Qe0gR7+Vhj8Q==
289
+ "@codefresh-io/authenticated-entity@^2.13.1":
290
+ version "2.13.1"
291
+ resolved "https://registry.yarnpkg.com/@codefresh-io/authenticated-entity/-/authenticated-entity-2.13.1.tgz#d5b03a71206bd45754a92499a98a3fdae7a79d8c"
292
+ integrity sha512-c98gnku0uuUWcQCEikgyN2FGqM6EJhqAXMQqczzt239EGij5GQWutzlBK80uxKVMr0LIDRENFyy0KCUmgCVzoA==
293
293
  dependencies:
294
- lodash "4.17.20"
294
+ lodash "^4.17.21"
295
295
  semver "^7.0.0"
296
296
 
297
297
  "@codefresh-io/cf-openapi@~0.7.7":
@@ -335,16 +335,16 @@
335
335
  pg-cursor "^1.2.0"
336
336
  uuid "^3.0.1"
337
337
 
338
- "@codefresh-io/http-infra@^1.8.5":
339
- version "1.8.5"
340
- resolved "https://registry.yarnpkg.com/@codefresh-io/http-infra/-/http-infra-1.8.5.tgz#2f1954ab7f957633be750f3e0c344591db6ff814"
341
- integrity sha512-mF9v6Yd+KPeRe8WM5vPKvMPPwTcc7zpqFP3RroPrrip4Mr1WOPKTTvKC1ngKQAjhJy3DYwZqhQL9ebdUF+mq/w==
338
+ "@codefresh-io/http-infra@^1.8.9":
339
+ version "1.8.9"
340
+ resolved "https://registry.yarnpkg.com/@codefresh-io/http-infra/-/http-infra-1.8.9.tgz#08cf741fe18370ebda0b4b4a247b426705bc70df"
341
+ integrity sha512-cXqC238xR5hNUNkawxcjJM/p4P6Ok5T1O6LZ3qVkCm4kIewSfraw5Jj451eFkXbZyl0EkqoR9a4wsAm2i4zuJQ==
342
342
  dependencies:
343
- "@codefresh-io/authenticated-entity" "^2.11.1"
343
+ "@codefresh-io/authenticated-entity" "^2.13.1"
344
344
  bluebird "^3.7.2"
345
345
  crypto-random-string "^3.3.0"
346
- lodash "4.17.20"
347
- request "2.88.2"
346
+ lodash "^4.17.21"
347
+ request "^2.88.2"
348
348
  requestretry "^3.1.0"
349
349
 
350
350
  "@codefresh-io/internal-service-config@^1.0.2":
@@ -4247,6 +4247,11 @@ lodash@^4.17.14:
4247
4247
  resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
4248
4248
  integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
4249
4249
 
4250
+ lodash@^4.17.21:
4251
+ version "4.17.21"
4252
+ resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
4253
+ integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
4254
+
4250
4255
  lodash@^4.17.4, lodash@^4.3.0:
4251
4256
  version "4.17.11"
4252
4257
  resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"