2014-04-02 12:45:41 -04:00
|
|
|
Path = require "path"
|
|
|
|
|
2019-12-17 04:57:51 -05:00
|
|
|
# environment variables renamed for consistency
|
|
|
|
# use AWS_ACCESS_KEY_ID-style going forward
|
|
|
|
if process.env['AWS_KEY'] && !process.env['AWS_ACCESS_KEY_ID']
|
|
|
|
process.env['AWS_ACCESS_KEY_ID'] = process.env['AWS_KEY']
|
|
|
|
if process.env['AWS_SECRET'] && !process.env['AWS_SECRET_ACCESS_KEY']
|
|
|
|
process.env['AWS_SECRET_ACCESS_KEY'] = process.env['AWS_SECRET']
|
|
|
|
|
2018-03-23 11:26:38 -04:00
|
|
|
settings =
|
2014-02-14 11:39:05 -05:00
|
|
|
internal:
|
|
|
|
filestore:
|
|
|
|
port: 3009
|
2018-03-23 12:14:30 -04:00
|
|
|
host: process.env['LISTEN_ADDRESS'] or "localhost"
|
2014-03-04 10:01:13 -05:00
|
|
|
|
|
|
|
filestore:
|
2014-04-02 12:45:41 -04:00
|
|
|
# Which backend persistor to use.
|
|
|
|
# Choices are
|
2014-03-04 10:01:13 -05:00
|
|
|
# s3 - Amazon S3
|
|
|
|
# fs - local filesystem
|
2019-12-16 12:09:38 -05:00
|
|
|
if process.env['AWS_ACCESS_KEY_ID']? or process.env['S3_BUCKET_CREDENTIALS']?
|
2018-03-23 11:26:38 -04:00
|
|
|
backend: "s3"
|
|
|
|
s3:
|
2019-12-16 12:09:38 -05:00
|
|
|
key: process.env['AWS_ACCESS_KEY_ID']
|
|
|
|
secret: process.env['AWS_SECRET_ACCESS_KEY']
|
2019-12-05 08:55:08 -05:00
|
|
|
endpoint: process.env['AWS_S3_ENDPOINT']
|
2018-03-23 11:26:38 -04:00
|
|
|
stores:
|
|
|
|
user_files: process.env['AWS_S3_USER_FILES_BUCKET_NAME']
|
|
|
|
template_files: process.env['AWS_S3_TEMPLATE_FILES_BUCKET_NAME']
|
|
|
|
public_files: process.env['AWS_S3_PUBLIC_FILES_BUCKET_NAME']
|
2018-09-14 11:49:12 -04:00
|
|
|
# if you are using S3, then fill in your S3 details below,
|
|
|
|
# or use env var with the same structure.
|
|
|
|
# s3:
|
|
|
|
# key: "" # default
|
|
|
|
# secret: "" # default
|
2014-03-04 10:01:13 -05:00
|
|
|
#
|
2018-09-14 11:49:12 -04:00
|
|
|
# s3BucketCreds:
|
|
|
|
# bucketname1: # secrets for bucketname1
|
|
|
|
# auth_key: ""
|
|
|
|
# auth_secret: ""
|
|
|
|
# bucketname2: # secrets for bucketname2...
|
|
|
|
s3BucketCreds: JSON.parse process.env['S3_BUCKET_CREDENTIALS'] if process.env['S3_BUCKET_CREDENTIALS']?
|
2018-03-23 11:26:38 -04:00
|
|
|
else
|
|
|
|
backend: "fs"
|
|
|
|
stores:
|
|
|
|
#
|
|
|
|
# For local filesystem this is the directory to store the files in.
|
|
|
|
# Must contain full path, e.g. "/var/lib/sharelatex/data".
|
|
|
|
# This path must exist, not be tmpfs and be writable to by the user sharelatex is run as.
|
|
|
|
user_files: Path.resolve(__dirname + "/../user_files")
|
|
|
|
public_files: Path.resolve(__dirname + "/../public_files")
|
|
|
|
template_files: Path.resolve(__dirname + "/../template_files")
|
|
|
|
|
2014-05-17 16:01:48 -04:00
|
|
|
path:
|
|
|
|
uploadFolder: Path.resolve(__dirname + "/../uploads")
|
2018-07-06 05:28:02 -04:00
|
|
|
|
2016-05-09 06:37:35 -04:00
|
|
|
commands:
|
|
|
|
# Any commands to wrap the convert utility in, for example ["nice"], or ["firejail", "--profile=/etc/firejail/convert.profile"]
|
|
|
|
convertCommandPrefix: []
|
2014-05-17 16:01:48 -04:00
|
|
|
|
2019-02-05 06:19:02 -05:00
|
|
|
enableConversions: if process.env['ENABLE_CONVERSIONS'] == 'true' then true else false
|
2018-03-23 11:26:38 -04:00
|
|
|
|
2019-03-05 12:20:16 -05:00
|
|
|
sentry:
|
|
|
|
dsn: process.env.SENTRY_DSN
|
|
|
|
|
2018-03-23 11:26:38 -04:00
|
|
|
# Filestore health check
|
|
|
|
# ----------------------
|
|
|
|
# Project and file details to check in persistor when calling /health_check
|
|
|
|
if process.env['HEALTH_CHECK_PROJECT_ID']? and process.env['HEALTH_CHECK_FILE_ID']?
|
|
|
|
settings.health_check =
|
|
|
|
project_id: process.env['HEALTH_CHECK_PROJECT_ID']
|
|
|
|
file_id: process.env['HEALTH_CHECK_FILE_ID']
|
|
|
|
|
|
|
|
module.exports = settings
|