mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-25 09:42:34 +00:00
Manual tidying
This commit is contained in:
parent
b5b2bb3d22
commit
0649773c15
1 changed files with 19 additions and 34 deletions
|
@ -1,13 +1,3 @@
|
||||||
/* eslint-disable
|
|
||||||
no-path-concat,
|
|
||||||
*/
|
|
||||||
// TODO: This file was created by bulk-decaffeinate.
|
|
||||||
// Fix any style issues and re-enable lint.
|
|
||||||
/*
|
|
||||||
* decaffeinate suggestions:
|
|
||||||
* DS207: Consider shorter variations of null checks
|
|
||||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
||||||
*/
|
|
||||||
const Path = require('path')
|
const Path = require('path')
|
||||||
|
|
||||||
// environment variables renamed for consistency
|
// environment variables renamed for consistency
|
||||||
|
@ -21,10 +11,7 @@ if (process.env.AWS_SECRET && !process.env.AWS_SECRET_ACCESS_KEY) {
|
||||||
|
|
||||||
// pre-backend setting, fall back to old behaviour
|
// pre-backend setting, fall back to old behaviour
|
||||||
if (process.env.BACKEND == null) {
|
if (process.env.BACKEND == null) {
|
||||||
if (
|
if (process.env.AWS_ACCESS_KEY_ID || process.env.S3_BUCKET_CREDENTIALS) {
|
||||||
process.env.AWS_ACCESS_KEY_ID != null ||
|
|
||||||
process.env.S3_BUCKET_CREDENTIALS != null
|
|
||||||
) {
|
|
||||||
process.env.BACKEND = 's3'
|
process.env.BACKEND = 's3'
|
||||||
process.env.USER_FILES_BUCKET_NAME =
|
process.env.USER_FILES_BUCKET_NAME =
|
||||||
process.env.AWS_S3_USER_FILES_BUCKET_NAME
|
process.env.AWS_S3_USER_FILES_BUCKET_NAME
|
||||||
|
@ -35,12 +22,15 @@ if (process.env.BACKEND == null) {
|
||||||
} else {
|
} else {
|
||||||
process.env.BACKEND = 'fs'
|
process.env.BACKEND = 'fs'
|
||||||
process.env.USER_FILES_BUCKET_NAME = Path.resolve(
|
process.env.USER_FILES_BUCKET_NAME = Path.resolve(
|
||||||
|
// eslint-disable-next-line no-path-concat
|
||||||
__dirname + '/../user_files'
|
__dirname + '/../user_files'
|
||||||
)
|
)
|
||||||
process.env.TEMPLATE_FILES_BUCKET_NAME = Path.resolve(
|
process.env.TEMPLATE_FILES_BUCKET_NAME = Path.resolve(
|
||||||
|
// eslint-disable-next-line no-path-concat
|
||||||
__dirname + '/../template_files'
|
__dirname + '/../template_files'
|
||||||
)
|
)
|
||||||
process.env.PUBLIC_FILES_BUCKET_NAME = Path.resolve(
|
process.env.PUBLIC_FILES_BUCKET_NAME = Path.resolve(
|
||||||
|
// eslint-disable-next-line no-path-concat
|
||||||
__dirname + '/../public_files'
|
__dirname + '/../public_files'
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -77,16 +67,14 @@ const settings = {
|
||||||
},
|
},
|
||||||
|
|
||||||
s3:
|
s3:
|
||||||
process.env.AWS_ACCESS_KEY_ID != null ||
|
process.env.AWS_ACCESS_KEY_ID || process.env.S3_BUCKET_CREDENTIALS
|
||||||
process.env.S3_BUCKET_CREDENTIALS != null
|
|
||||||
? {
|
? {
|
||||||
key: process.env.AWS_ACCESS_KEY_ID,
|
key: process.env.AWS_ACCESS_KEY_ID,
|
||||||
secret: process.env.AWS_SECRET_ACCESS_KEY,
|
secret: process.env.AWS_SECRET_ACCESS_KEY,
|
||||||
endpoint: process.env.AWS_S3_ENDPOINT,
|
endpoint: process.env.AWS_S3_ENDPOINT,
|
||||||
pathStyle: process.env.AWS_S3_PATH_STYLE,
|
pathStyle: process.env.AWS_S3_PATH_STYLE,
|
||||||
partSize: process.env.AWS_S3_PARTSIZE || 100 * 1024 * 1024,
|
partSize: process.env.AWS_S3_PARTSIZE || 100 * 1024 * 1024,
|
||||||
bucketCreds:
|
bucketCreds: process.env.S3_BUCKET_CREDENTIALS
|
||||||
process.env.S3_BUCKET_CREDENTIALS != null
|
|
||||||
? JSON.parse(process.env.S3_BUCKET_CREDENTIALS)
|
? JSON.parse(process.env.S3_BUCKET_CREDENTIALS)
|
||||||
: undefined
|
: undefined
|
||||||
}
|
}
|
||||||
|
@ -101,8 +89,7 @@ const settings = {
|
||||||
public_files: process.env.PUBLIC_FILES_BUCKET_NAME
|
public_files: process.env.PUBLIC_FILES_BUCKET_NAME
|
||||||
},
|
},
|
||||||
|
|
||||||
fallback:
|
fallback: process.env.FALLBACK_BACKEND
|
||||||
process.env.FALLBACK_BACKEND != null
|
|
||||||
? {
|
? {
|
||||||
backend: process.env.FALLBACK_BACKEND,
|
backend: process.env.FALLBACK_BACKEND,
|
||||||
// mapping of bucket names on the fallback, to bucket names on the primary.
|
// mapping of bucket names on the fallback, to bucket names on the primary.
|
||||||
|
@ -116,6 +103,7 @@ const settings = {
|
||||||
},
|
},
|
||||||
|
|
||||||
path: {
|
path: {
|
||||||
|
// eslint-disable-next-line no-path-concat
|
||||||
uploadFolder: Path.resolve(__dirname + '/../uploads')
|
uploadFolder: Path.resolve(__dirname + '/../uploads')
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -134,10 +122,7 @@ const settings = {
|
||||||
// Filestore health check
|
// Filestore health check
|
||||||
// ----------------------
|
// ----------------------
|
||||||
// Project and file details to check in persistor when calling /health_check
|
// Project and file details to check in persistor when calling /health_check
|
||||||
if (
|
if (process.env.HEALTH_CHECK_PROJECT_ID && process.env.HEALTH_CHECK_FILE_ID) {
|
||||||
process.env.HEALTH_CHECK_PROJECT_ID != null &&
|
|
||||||
process.env.HEALTH_CHECK_FILE_ID != null
|
|
||||||
) {
|
|
||||||
settings.health_check = {
|
settings.health_check = {
|
||||||
project_id: process.env.HEALTH_CHECK_PROJECT_ID,
|
project_id: process.env.HEALTH_CHECK_PROJECT_ID,
|
||||||
file_id: process.env.HEALTH_CHECK_FILE_ID
|
file_id: process.env.HEALTH_CHECK_FILE_ID
|
||||||
|
|
Loading…
Reference in a new issue