@igea/oac_backend 1.0.30 → 1.0.32

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/README.md CHANGED
@@ -5,4 +5,25 @@ Backend service for the OAC project
5
5
  ### XSLT
6
6
  ```console
7
7
  sudo apt install xsltproc
8
- ```
8
+ ```
9
+
10
+ ## ENV variables
11
+ Env variables overwrites parameters from the config file
12
+
13
+ ### OAC_DB_USER
14
+ Username for the OAC datbase
15
+
16
+ ### OAC_DB_PASSWORD
17
+ Password for the OAC datbase
18
+
19
+ ### OAC_SMTP_HOST
20
+ Host for the SMTP
21
+
22
+ ### OAC_SMTP_PORT
23
+ Port for the SMTP
24
+
25
+ ### OAC_SMTP_USER
26
+ Username for the SMTP
27
+
28
+ ### OAC_SMTP_PASSWORD
29
+ Password for the SMTP
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igea/oac_backend",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "description": "Backend service for the OAC project",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "secure": true,
29
29
  "auth": {
30
30
  "user": "supporto@igea-soluzioni.it",
31
- "pass": "<your_smtp_password>"
31
+ "pass": "@Sup0_1G34#"
32
32
  }
33
33
  },
34
34
  "exposed":{
package/src/config.js CHANGED
@@ -7,6 +7,14 @@ function loadConfig() {
7
7
  const configFolder = process.env.OAC_CONFIG_FOLDER || __dirname;
8
8
  const configPath = path.join(configFolder, 'config', `${env}.json`);
9
9
  const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
10
+
11
+ config.database.user = process.env.OAC_DB_USER || config.database.user;
12
+ config.database.password = process.env.OAC_DB_PASSWORD || config.database.password;
13
+ config.smtp.host = process.env.OAC_SMTP_HOST || config.smtp.host;
14
+ config.smtp.port = process.env.OAC_SMTP_PORT || config.smtp.port;
15
+ config.smtp.auth.user = process.env.OAC_SMTP_USER || config.smtp.auth.user;
16
+ config.smtp.auth.password = process.env.OAC_SMTP_PASSWORD || config.smtp.auth.password;
17
+
10
18
  return config;
11
19
  }
12
20
 
package/src/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ #!/usr/bin/env node
1
2
  const config = require('./config.js');
2
3
  const express = require("express");
3
4
  const axios = require("axios");