@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 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
- // TODO: this should be NODE_ENV, remove INFRASTRUCTURE_IS_PRODUCTION
7
- const is_production = "yes" === process.env.INFRASTRUCTURE_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) => {
@@ -6,9 +6,9 @@ const cors = require("cors")
6
6
  const log = debug("rb:cors")
7
7
 
8
8
 
9
- const is_production = process.env.IS_PRODUCTION === "yes"
9
+ const {RB_SKIP_CORS_PATHS, NODE_ENV, APP_DOMAIN, CLIENT_PORT} = process.env
10
10
 
11
- const {RB_SKIP_CORS_PATHS, APP_DOMAIN, CLIENT_PORT} = process.env
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 is_production = process.env.IS_PRODUCTION === "yes"
18
- const is_development = process.env.NODE_ENV === "development"
19
- const {APP_DOMAIN, SENTRY_DSN, CLIENT_PORT} = process.env
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 && !is_development) {
34
+ if (has_sentry && is_production) {
35
35
  Sentry.init({
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
- });
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, IS_PRODUCTION, RB_FORCE_SEND_EMAILS} = process.env
7
+ const {POSTMARK_API_KEY, NODE_ENV, RB_FORCE_SEND_EMAILS} = process.env
8
8
 
9
- const is_production = IS_PRODUCTION === "yes"
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, "env:", JSON.stringify(IS_PRODUCTION))
15
+ log("mailer, is_production:", {is_production})
16
16
 
17
17
  let client
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/server",
3
- "version": "0.255.0",
3
+ "version": "0.257.0",
4
4
  "license": "SSPL-1.0",
5
5
  "main": "./index.js",
6
6
  "bin": {
package/rts/index.js CHANGED
@@ -13,8 +13,7 @@ const mongoose = require("../mongoose")
13
13
 
14
14
  const log = debug("rb:rts:server")
15
15
 
16
- const is_production = process.env.IS_PRODUCTION === "yes"
17
-
16
+ const is_production = process.env.NODE_ENV === "production"
18
17
 
19
18
  const QUERY_MAX_LIMIT = 4096
20
19