@rpcbase/server 0.255.0 → 0.257.0
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/cli/run_docker.js +2 -2
- package/express/custom_cors.js +2 -2
- package/express/index.js +20 -23
- package/mailer/index.js +3 -3
- package/package.json +1 -1
- package/rts/index.js +1 -2
package/cli/run_docker.js
CHANGED
|
@@ -3,8 +3,8 @@ const {execSync} = require("child_process")
|
|
|
3
3
|
const path = require("path")
|
|
4
4
|
const fs = require("fs")
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
const is_production =
|
|
6
|
+
|
|
7
|
+
const is_production = process.env.NODE_ENV === "production"
|
|
8
8
|
const is_ci = process.env.CI === "true"
|
|
9
9
|
|
|
10
10
|
const run_docker = async(infrastructure_dir, proj_prefix, args) => {
|
package/express/custom_cors.js
CHANGED
|
@@ -6,9 +6,9 @@ const cors = require("cors")
|
|
|
6
6
|
const log = debug("rb:cors")
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const {RB_SKIP_CORS_PATHS, NODE_ENV, APP_DOMAIN, CLIENT_PORT} = process.env
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const is_production = NODE_ENV === "production"
|
|
12
12
|
|
|
13
13
|
const custom_cors = (app) => {
|
|
14
14
|
|
package/express/index.js
CHANGED
|
@@ -14,9 +14,9 @@ const custom_cors = require("./custom_cors")
|
|
|
14
14
|
|
|
15
15
|
const log = debug("rb:server")
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const
|
|
17
|
+
const {APP_DOMAIN, NODE_ENV, SENTRY_DSN, CLIENT_PORT} = process.env
|
|
18
|
+
|
|
19
|
+
const is_production = NODE_ENV === "production"
|
|
20
20
|
|
|
21
21
|
const has_sentry = !!SENTRY_DSN
|
|
22
22
|
|
|
@@ -31,31 +31,28 @@ module.exports = () => {
|
|
|
31
31
|
|
|
32
32
|
const app = express()
|
|
33
33
|
|
|
34
|
-
if (has_sentry &&
|
|
34
|
+
if (has_sentry && is_production) {
|
|
35
35
|
Sentry.init({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
36
|
+
dsn: SENTRY_DSN,
|
|
37
|
+
integrations: [
|
|
38
|
+
// enable HTTP calls tracing
|
|
39
|
+
new Sentry.Integrations.Http({
|
|
40
|
+
tracing: true
|
|
41
|
+
}),
|
|
42
|
+
// enable Express.js middleware tracing
|
|
43
|
+
new Sentry.Integrations.Express({
|
|
44
|
+
app
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
// Performance Monitoring
|
|
48
|
+
tracesSampleRate: 1.0, // Capture 100% of the transactions, reduce in production!,
|
|
49
|
+
})
|
|
50
50
|
|
|
51
51
|
// Trace incoming requests
|
|
52
|
-
app.use(Sentry.Handlers.requestHandler())
|
|
53
|
-
app.use(Sentry.Handlers.tracingHandler())
|
|
54
|
-
|
|
52
|
+
app.use(Sentry.Handlers.requestHandler())
|
|
53
|
+
app.use(Sentry.Handlers.tracingHandler())
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
|
|
59
56
|
app.use(request_ip.mw())
|
|
60
57
|
|
|
61
58
|
app.use(body_parser.json({limit: `${BODY_MAX_SIZE_MB}mb`}))
|
package/mailer/index.js
CHANGED
|
@@ -4,15 +4,15 @@ const postmark = require("postmark")
|
|
|
4
4
|
|
|
5
5
|
const log = debug("rb:mailer")
|
|
6
6
|
|
|
7
|
-
const {POSTMARK_API_KEY,
|
|
7
|
+
const {POSTMARK_API_KEY, NODE_ENV, RB_FORCE_SEND_EMAILS} = process.env
|
|
8
8
|
|
|
9
|
-
const is_production =
|
|
9
|
+
const is_production = NODE_ENV === "production"
|
|
10
10
|
const force_send = RB_FORCE_SEND_EMAILS === "yes"
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
// TMP use proper mock smtp server in development
|
|
14
14
|
|
|
15
|
-
log("mailer, is_production:", is_production
|
|
15
|
+
log("mailer, is_production:", {is_production})
|
|
16
16
|
|
|
17
17
|
let client
|
|
18
18
|
|
package/package.json
CHANGED
package/rts/index.js
CHANGED