90847e422d
* Feat: configurable file limits * ci(circleci): container build speed imporvements * feat(frontend nginx): add file size limit configurability to frontend nginx * feat(server blobstorage): use the new file size limit customization value * feat(helm chart): implement the file size configuration in the helm chart * fix(frontend docker): fix entrypoint script * fix(server blobstorage): fix env var parsing NaN * feat(fileimport-service): add customizable import timeout * feat(helm chart): add fileimport service timeout value to helm chart * feat(blobstorage): add server side blob storage size limits * feat(docker-compose): add blob size limit env var to docker-compose files * refactor(frontend file uploads): refactor file uploads to use `useQuery` * refactor(server env helper): move env helper to shared module * refactor(blobstorage): use env helper for file size limit * refactor(frontend file uploads): use generated query document * fix(server blob sotrage): fix file size limit function call Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
41 lines
838 B
JavaScript
41 lines
838 B
JavaScript
function isTestEnv() {
|
|
return process.env.NODE_ENV === 'test'
|
|
}
|
|
|
|
function isDevEnv() {
|
|
return process.env.NODE_ENV === 'development'
|
|
}
|
|
|
|
function isProdEnv() {
|
|
return process.env.NODE_ENV === 'production'
|
|
}
|
|
|
|
function getServerVersion() {
|
|
return process.env.SPECKLE_SERVER_VERSION || 'dev'
|
|
}
|
|
|
|
function isApolloMonitoringEnabled() {
|
|
return [true, 'true'].includes(process.env.APOLLO_SCHEMA_REPORTING)
|
|
}
|
|
|
|
function getApolloServerVersion() {
|
|
return process.env.APOLLO_SERVER_USER_VERSION
|
|
}
|
|
|
|
function getFileSizeLimitMB() {
|
|
let sizeLimit = 100
|
|
const suppliedSize = parseInt(process.env.FILE_SIZE_LIMIT_MB)
|
|
if (suppliedSize) sizeLimit = suppliedSize
|
|
return sizeLimit
|
|
}
|
|
|
|
module.exports = {
|
|
isTestEnv,
|
|
isDevEnv,
|
|
isProdEnv,
|
|
getServerVersion,
|
|
isApolloMonitoringEnabled,
|
|
getApolloServerVersion,
|
|
getFileSizeLimitMB
|
|
}
|