@codefresh-io/service-base 3.0.6 → 3.0.10

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,
@@ -128,6 +137,7 @@ base.safe = { secret: process.env.SAFE_SECRET || 'secret' };
128
137
 
129
138
  base.redis = {
130
139
  url: process.env.REDIS_URL || APPLICATION_DOMAIN,
140
+ port: process.env.REDIS_PORT || 6379,
131
141
  password: process.env.REDIS_PASSWORD || 'redisPassword',
132
142
  db: process.env.REDIS_DB || 1,
133
143
  };
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/infra/redis.js CHANGED
@@ -27,6 +27,7 @@ class Redis {
27
27
  this.client =
28
28
  redis.createClient({
29
29
  host: config.redis.url,
30
+ port: config.redis.port,
30
31
  password: config.redis.password,
31
32
  db: config.redis.db,
32
33
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codefresh-io/service-base",
3
- "version": "3.0.6",
3
+ "version": "3.0.10",
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.13.0",
31
+ "@codefresh-io/authenticated-entity": "^2.13.1",
32
32
  "@codefresh-io/cf-openapi": "~0.7.7",
33
- "@codefresh-io/eventbus": "^1.3.1",
34
- "@codefresh-io/http-infra": "^1.8.8",
33
+ "@codefresh-io/eventbus": "^1.4.1",
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,10 +286,10 @@
286
286
  exec-sh "^0.3.2"
287
287
  minimist "^1.2.0"
288
288
 
289
- "@codefresh-io/authenticated-entity@^2.13.0":
290
- version "2.13.0"
291
- resolved "https://registry.yarnpkg.com/@codefresh-io/authenticated-entity/-/authenticated-entity-2.13.0.tgz#eb5706d9b0d2b0ec6d18ec239754b06e288edd0f"
292
- integrity sha512-9WTAFfDg5Beyba8pVZc8EcecWp5FdD9YW7djHfsgtmJ7rjSs4AUJl5x7WEpvifEZswzqcnm3YLNVL3KJ4mTspg==
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
294
  lodash "^4.17.21"
295
295
  semver "^7.0.0"
@@ -321,26 +321,26 @@
321
321
  rxjs "^6.4.0"
322
322
  websocket "1.0.31"
323
323
 
324
- "@codefresh-io/eventbus@^1.3.1":
325
- version "1.3.1"
326
- resolved "https://registry.yarnpkg.com/@codefresh-io/eventbus/-/eventbus-1.3.1.tgz#08b3216bcd05876c4e6b51f1376930572b6342cf"
327
- integrity sha512-nPyiPlcg3MOgKyvsr5RWqrynSw8TGxOTiX11Ez5zKZYUYYigI5NPVSHeG1zXNEzAHsS32Grevk+Tw3gonQJoVw==
324
+ "@codefresh-io/eventbus@^1.4.1":
325
+ version "1.4.1"
326
+ resolved "https://registry.yarnpkg.com/@codefresh-io/eventbus/-/eventbus-1.4.1.tgz#e9803c7df7b421c49118684e0746172318ad382b"
327
+ integrity sha512-R1DD27pnx2HLuVx8IFENKGCAEb2hH2Gz8YjUqf1LpLIHgbfiwlMl+nKT/Q95iLxO8spYHkc4sfkcqMafKA9quA==
328
328
  dependencies:
329
329
  amqplib "^0.5.1"
330
330
  bluebird "^3.5.0"
331
- cf-errors "^0.1.15"
332
- debug "^2.6.8"
333
- lodash "4.17.20"
331
+ cf-errors "^0.1.16"
332
+ debug "2.6.9"
333
+ lodash "^4.17.21"
334
334
  pg "^7.0.2"
335
335
  pg-cursor "^1.2.0"
336
336
  uuid "^3.0.1"
337
337
 
338
- "@codefresh-io/http-infra@^1.8.8":
339
- version "1.8.8"
340
- resolved "https://registry.yarnpkg.com/@codefresh-io/http-infra/-/http-infra-1.8.8.tgz#10619171521fd983cefa5a9f3b623bc1671bee75"
341
- integrity sha512-ZQS6+sRjWcPVmCbqTIh+iQSkAvEAHfUseSEnLRtPzLAsWheBjZRqaMa6HXYXdRasKcpVjnMnEQMLJ+R4epRhMA==
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.13.0"
343
+ "@codefresh-io/authenticated-entity" "^2.13.1"
344
344
  bluebird "^3.7.2"
345
345
  crypto-random-string "^3.3.0"
346
346
  lodash "^4.17.21"
@@ -1416,6 +1416,13 @@ cf-errors@^0.1.15:
1416
1416
  dependencies:
1417
1417
  lodash "4.17.20"
1418
1418
 
1419
+ cf-errors@^0.1.16:
1420
+ version "0.1.16"
1421
+ resolved "https://registry.yarnpkg.com/cf-errors/-/cf-errors-0.1.16.tgz#03d0b050ac94762552792907b08bd39d1a012116"
1422
+ integrity sha512-ewA6cTS+bVC32NCxIdEu/5HQ8zb09PV1ubdu0t2yPXs51K31gI78+XGEomVjaXdTbZcGBPVIWhFnG6R/U7K4IQ==
1423
+ dependencies:
1424
+ lodash "^4.17.21"
1425
+
1419
1426
  cf-logs@^1.1.24:
1420
1427
  version "1.1.24"
1421
1428
  resolved "https://registry.yarnpkg.com/cf-logs/-/cf-logs-1.1.24.tgz#d383162ee937745aef9bf9e64a455e4f1f816ea8"