@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 +13 -4
- package/infra/eventbus.js +1 -0
- package/infra/mongo.js +1 -2
- package/package.json +3 -3
- package/yarn.lock +17 -12
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,
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefresh-io/service-base",
|
|
3
|
-
"version": "3.0.
|
|
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.
|
|
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.
|
|
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.
|
|
290
|
-
version "2.
|
|
291
|
-
resolved "https://registry.yarnpkg.com/@codefresh-io/authenticated-entity/-/authenticated-entity-2.
|
|
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
|
-
lodash "4.17.
|
|
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.
|
|
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.
|
|
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.
|
|
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"
|