@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 +14 -4
- package/infra/eventbus.js +1 -0
- package/infra/mongo.js +1 -2
- package/infra/redis.js +1 -0
- package/package.json +4 -4
- package/yarn.lock +23 -16
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
|
-
|
|
65
|
-
|
|
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
|
-
|
|
91
|
-
|
|
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
package/infra/mongo.js
CHANGED
|
@@ -17,8 +17,7 @@ class Mongo {
|
|
|
17
17
|
init(config) {
|
|
18
18
|
const clientSettings = {
|
|
19
19
|
promiseLibrary: Promise,
|
|
20
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefresh-io/service-base",
|
|
3
|
-
"version": "3.0.
|
|
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.
|
|
31
|
+
"@codefresh-io/authenticated-entity": "^2.13.1",
|
|
32
32
|
"@codefresh-io/cf-openapi": "~0.7.7",
|
|
33
|
-
"@codefresh-io/eventbus": "^1.
|
|
34
|
-
"@codefresh-io/http-infra": "^1.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.
|
|
290
|
-
version "2.13.
|
|
291
|
-
resolved "https://registry.yarnpkg.com/@codefresh-io/authenticated-entity/-/authenticated-entity-2.13.
|
|
292
|
-
integrity sha512-
|
|
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.
|
|
325
|
-
version "1.
|
|
326
|
-
resolved "https://registry.yarnpkg.com/@codefresh-io/eventbus/-/eventbus-1.
|
|
327
|
-
integrity sha512-
|
|
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.
|
|
332
|
-
debug "
|
|
333
|
-
lodash "4.17.
|
|
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.
|
|
339
|
-
version "1.8.
|
|
340
|
-
resolved "https://registry.yarnpkg.com/@codefresh-io/http-infra/-/http-infra-1.8.
|
|
341
|
-
integrity sha512-
|
|
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.
|
|
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"
|