itlab-internal-services 2.1.0 → 2.1.2

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.
@@ -36,11 +36,10 @@ let DatabaseModule = DatabaseModule_1 = class DatabaseModule {
36
36
  this.logger.log('Running in production mode... Connecting internally without tls');
37
37
  else
38
38
  this.logger.log('Running in development mode... Connecting externally with tls');
39
- const uri = configService.getOrThrow('MONGO_SRV');
40
39
  const username = configService.getOrThrow('MONGO_USERNAME');
41
40
  const password = configService.getOrThrow('MONGO_PASSWORD');
42
41
  const generalOpts = {
43
- uri: `mongodb+srv://${uri}`,
42
+ uri: configService.getOrThrow('MONGO_SRV'),
44
43
  auth: { username, password },
45
44
  appName: options.appName,
46
45
  dbName: options.dbName,
@@ -50,12 +49,12 @@ let DatabaseModule = DatabaseModule_1 = class DatabaseModule {
50
49
  serverSelectionTimeoutMS: 2000,
51
50
  };
52
51
  const certDir = () => configService.getOrThrow('MONGO_CERT_DIR');
53
- const tlsOpts = {
52
+ const tlsOpts = () => ({
54
53
  tls: true,
55
54
  tlsCAFile: (0, path_1.join)(process.cwd(), certDir(), 'ca.crt'),
56
55
  tlsCertificateKeyFile: (0, path_1.join)(process.cwd(), certDir(), 'certificate-key.pem'),
57
- };
58
- return Object.assign({}, generalOpts, production ? {} : tlsOpts);
56
+ });
57
+ return Object.assign({}, generalOpts, production ? {} : tlsOpts());
59
58
  },
60
59
  }),
61
60
  ],
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "timo.scheuermann@sv-informatik.de",
6
6
  "url": "https://timos.design"
7
7
  },
8
- "version": "2.1.0",
8
+ "version": "2.1.2",
9
9
  "type": "commonjs",
10
10
  "files": [
11
11
  "dist"