mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 08:43:41 -05:00
make s3 configurable via env vars
This commit is contained in:
parent
77e34d33df
commit
9e321658ed
1 changed files with 33 additions and 23 deletions
|
@ -1,6 +1,6 @@
|
||||||
Path = require "path"
|
Path = require "path"
|
||||||
|
|
||||||
module.exports =
|
settings =
|
||||||
internal:
|
internal:
|
||||||
filestore:
|
filestore:
|
||||||
port: 3009
|
port: 3009
|
||||||
|
@ -11,22 +11,26 @@ module.exports =
|
||||||
# Choices are
|
# Choices are
|
||||||
# s3 - Amazon S3
|
# s3 - Amazon S3
|
||||||
# fs - local filesystem
|
# fs - local filesystem
|
||||||
backend: "fs"
|
if process.env['AWS_KEY']?
|
||||||
stores:
|
backend: "s3"
|
||||||
# where to store user and template binary files
|
s3:
|
||||||
#
|
key: process.env['AWS_KEY']
|
||||||
# For Amazon S3 this is the bucket name to store binary files in.
|
secret: process.env['AWS_SECRET']
|
||||||
#
|
stores:
|
||||||
# For local filesystem this is the directory to store the files in.
|
user_files: process.env['AWS_S3_USER_FILES_BUCKET_NAME']
|
||||||
# Must contain full path, e.g. "/var/lib/sharelatex/data".
|
template_files: process.env['AWS_S3_TEMPLATE_FILES_BUCKET_NAME']
|
||||||
# This path must exist, not be tmpfs and be writable to by the user sharelatex is run as.
|
public_files: process.env['AWS_S3_PUBLIC_FILES_BUCKET_NAME']
|
||||||
user_files: Path.resolve(__dirname + "/../user_files")
|
else
|
||||||
public_files: Path.resolve(__dirname + "/../public_files")
|
backend: "fs"
|
||||||
template_files: Path.resolve(__dirname + "/../template_files")
|
stores:
|
||||||
# if you are using S3, then fill in your S3 details below
|
#
|
||||||
# s3:
|
# For local filesystem this is the directory to store the files in.
|
||||||
# key: ""
|
# Must contain full path, e.g. "/var/lib/sharelatex/data".
|
||||||
# secret: ""
|
# 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")
|
||||||
|
|
||||||
|
|
||||||
path:
|
path:
|
||||||
uploadFolder: Path.resolve(__dirname + "/../uploads")
|
uploadFolder: Path.resolve(__dirname + "/../uploads")
|
||||||
|
@ -35,9 +39,15 @@ module.exports =
|
||||||
# Any commands to wrap the convert utility in, for example ["nice"], or ["firejail", "--profile=/etc/firejail/convert.profile"]
|
# Any commands to wrap the convert utility in, for example ["nice"], or ["firejail", "--profile=/etc/firejail/convert.profile"]
|
||||||
convertCommandPrefix: []
|
convertCommandPrefix: []
|
||||||
|
|
||||||
# Filestore health check
|
|
||||||
# ----------------------
|
# Filestore health check
|
||||||
# Project and file details to check in persistor when calling /health_check
|
# ----------------------
|
||||||
# health_check:
|
# Project and file details to check in persistor when calling /health_check
|
||||||
# project_id: ""
|
if process.env['HEALTH_CHECK_PROJECT_ID']? and process.env['HEALTH_CHECK_FILE_ID']?
|
||||||
# file_id: ""
|
settings.health_check =
|
||||||
|
project_id: process.env['HEALTH_CHECK_PROJECT_ID']
|
||||||
|
file_id: process.env['HEALTH_CHECK_FILE_ID']
|
||||||
|
|
||||||
|
module.exports = settings
|
||||||
|
|
||||||
|
console.log module.exports
|
Loading…
Reference in a new issue