Custom Fastify bodyLimit (#70)

This commit is contained in:
Lorenzo Mangani
2021-11-29 13:57:54 +01:00
committed by GitHub
parent 650b31d851
commit b08e9d5c50
2 changed files with 7 additions and 1 deletions

View File

@ -155,6 +155,9 @@ The following ENV Variables can be used to control cLoki parameters and backend
| CLOKI_LOGIN | false | Basic HTTP Username |
| CLOKI_PASSWORD | false | Basic HTTP Password |
| READONLY | false | Readonly Mode, no DB Init |
| FASTIFY_BODYLIMIT | 5242880 | API Maximum payload size in bytes |
| FASTIFY_REQUESTTIMEOUT | 0 | API Maximum Request Timeout in ms |
| FASTIFY_MAXREQUESTS | 0 | API Maximum Requests per socket |
| DEBUG | false | Debug Mode |

View File

@ -44,7 +44,10 @@ if (!this.readonly) init(process.env.CLICKHOUSE_DB || 'cloki')
/* Fastify Helper */
const fastify = require('fastify')({
logger: false
logger: false,
bodyLimit: parseInt(process.env.FASTIFY_BODYLIMIT) || 5242880,
requestTimeout: parseInt(process.env.FASTIFY_REQUESTTIMEOUT) || 0,
maxRequestsPerSocket: parseInt(process.env.FASTIFY_MAXREQUESTS) || 0
})
fastify.register(require('fastify-url-data'))