@rpcbase/server 0.178.0 → 0.180.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/express/index.js CHANGED
@@ -17,6 +17,11 @@ const log = debug("rb:server")
17
17
  const is_production = process.env.IS_PRODUCTION === "yes"
18
18
  const {APP_DOMAIN, CLIENT_PORT} = process.env
19
19
 
20
+ // TODO: document this
21
+ // we could have a larger size, but it's good practice to keep it small to prevent body upload ddos attacks
22
+ const BODY_MAX_SIZE_MB = 8
23
+
24
+
20
25
  log("server is production:", JSON.stringify(is_production))
21
26
 
22
27
  module.exports = () => {
@@ -24,7 +29,7 @@ module.exports = () => {
24
29
 
25
30
  app.use(request_ip.mw())
26
31
 
27
- app.use(body_parser.json({limit: "2mb"}))
32
+ app.use(body_parser.json({limit: `${BODY_MAX_SIZE_MB}mb`}))
28
33
 
29
34
  app.set("trust proxy", 1)
30
35
 
@@ -81,8 +86,8 @@ module.exports = () => {
81
86
 
82
87
  app.use(session_middleware)
83
88
 
84
- app.get("/api/ping", (req, res) => res.json({message: "pong"}))
85
- app.post("/api/ping", (req, res) => res.json({message: "pong"}))
89
+ app.get("__/ping", (req, res) => res.json({message: "pong"}))
90
+ app.post("__/ping", (req, res) => res.json({message: "pong"}))
86
91
 
87
92
  auth(app)
88
93
 
@@ -0,0 +1,3 @@
1
+ FROM docker.elastic.co/elasticsearch/elasticsearch:8.6.1
2
+
3
+ RUN bin/elasticsearch-plugin remove --purge repository-gcs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/server",
3
- "version": "0.178.0",
3
+ "version": "0.180.0",
4
4
  "license": "SSPL-1.0",
5
5
  "main": "./index.js",
6
6
  "bin": {