@codefresh-io/service-base 3.0.8 → 3.0.11
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 +13 -4
- package/infra/mongo.js +1 -2
- package/infra/redis.js +1 -0
- package/package.json +3 -3
- package/yarn.lock +19 -12
package/infra/config.js
CHANGED
|
@@ -62,10 +62,18 @@ base.postgres = {
|
|
|
62
62
|
|
|
63
63
|
base.mongo = {
|
|
64
64
|
uri: process.env.MONGO_URI || `mongodb://${APPLICATION_DOMAIN}/${name}`,
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
options: {
|
|
66
|
+
reconnectTries: process.env.MONGO_RECONNECT_TRIES || Number.MAX_VALUE,
|
|
67
|
+
reconnectInterval: process.env.MONGO_RECONNECT_INTERVAL || 30 * 1000,
|
|
68
|
+
},
|
|
67
69
|
};
|
|
68
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
|
+
|
|
69
77
|
base.logger = {
|
|
70
78
|
filePath: process.env.LOGS_PATH || path.join(__dirname, '../../logs', 'kubernetes-logs.log'),
|
|
71
79
|
console: true,
|
|
@@ -88,8 +96,8 @@ base.logger = {
|
|
|
88
96
|
}
|
|
89
97
|
// human readable format
|
|
90
98
|
return `${options.timestamp()} ${options.level.toUpperCase()} >> ` +
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
`${options.message || ''}` +
|
|
100
|
+
`${options.meta && Object.keys(options.meta).length ? ` << ${JSON.stringify(options.meta)}` : ''}`;
|
|
93
101
|
},
|
|
94
102
|
},
|
|
95
103
|
basePath: null,
|
|
@@ -129,6 +137,7 @@ base.safe = { secret: process.env.SAFE_SECRET || 'secret' };
|
|
|
129
137
|
|
|
130
138
|
base.redis = {
|
|
131
139
|
url: process.env.REDIS_URL || APPLICATION_DOMAIN,
|
|
140
|
+
port: process.env.REDIS_PORT || 6379,
|
|
132
141
|
password: process.env.REDIS_PASSWORD || 'redisPassword',
|
|
133
142
|
db: process.env.REDIS_DB || 1,
|
|
134
143
|
};
|
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.11",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"description": "",
|
|
6
6
|
"engines": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@codefresh-io/authenticated-entity": "^2.13.1",
|
|
32
32
|
"@codefresh-io/cf-openapi": "~0.7.7",
|
|
33
|
-
"@codefresh-io/eventbus": "^1.
|
|
33
|
+
"@codefresh-io/eventbus": "^1.4.1",
|
|
34
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",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"express": "^4.16.4",
|
|
48
48
|
"joi": "^13.0.2",
|
|
49
49
|
"js-yaml": "^3.13.1",
|
|
50
|
-
"lodash": "4.17.
|
|
50
|
+
"lodash": "4.17.21",
|
|
51
51
|
"method-override": "^3.0.0",
|
|
52
52
|
"mongodb": "~3.3.0",
|
|
53
53
|
"morgan": "^1.9.1",
|
package/yarn.lock
CHANGED
|
@@ -321,16 +321,16 @@
|
|
|
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"
|
|
@@ -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"
|
|
@@ -4242,16 +4249,16 @@ lodash@4.17.20, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.
|
|
|
4242
4249
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
|
|
4243
4250
|
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==
|
|
4244
4251
|
|
|
4252
|
+
lodash@4.17.21, lodash@^4.17.21:
|
|
4253
|
+
version "4.17.21"
|
|
4254
|
+
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
|
4255
|
+
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
|
4256
|
+
|
|
4245
4257
|
lodash@^4.17.14:
|
|
4246
4258
|
version "4.17.15"
|
|
4247
4259
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
|
|
4248
4260
|
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
|
|
4249
4261
|
|
|
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
|
-
|
|
4255
4262
|
lodash@^4.17.4, lodash@^4.3.0:
|
|
4256
4263
|
version "4.17.11"
|
|
4257
4264
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
|