settings.defaults.coffee 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Path = require "path"
  2. settings =
  3. internal:
  4. filestore:
  5. port: 3009
  6. host: process.env['LISTEN_ADDRESS'] or "localhost"
  7. filestore:
  8. # Which backend persistor to use.
  9. # Choices are
  10. # s3 - Amazon S3
  11. # fs - local filesystem
  12. if process.env['AWS_KEY']? or process.env['S3_BUCKET_CREDENTIALS']?
  13. backend: "s3"
  14. s3:
  15. key: process.env['AWS_KEY']
  16. secret: process.env['AWS_SECRET']
  17. stores:
  18. user_files: process.env['AWS_S3_USER_FILES_BUCKET_NAME']
  19. template_files: process.env['AWS_S3_TEMPLATE_FILES_BUCKET_NAME']
  20. public_files: process.env['AWS_S3_PUBLIC_FILES_BUCKET_NAME']
  21. # if you are using S3, then fill in your S3 details below,
  22. # or use env var with the same structure.
  23. # s3:
  24. # key: "" # default
  25. # secret: "" # default
  26. #
  27. # s3BucketCreds:
  28. # bucketname1: # secrets for bucketname1
  29. # auth_key: ""
  30. # auth_secret: ""
  31. # bucketname2: # secrets for bucketname2...
  32. s3BucketCreds: JSON.parse process.env['S3_BUCKET_CREDENTIALS'] if process.env['S3_BUCKET_CREDENTIALS']?
  33. else
  34. backend: "fs"
  35. stores:
  36. #
  37. # For local filesystem this is the directory to store the files in.
  38. # Must contain full path, e.g. "/var/lib/sharelatex/data".
  39. # This path must exist, not be tmpfs and be writable to by the user sharelatex is run as.
  40. user_files: Path.resolve(__dirname + "/../user_files")
  41. public_files: Path.resolve(__dirname + "/../public_files")
  42. template_files: Path.resolve(__dirname + "/../template_files")
  43. path:
  44. uploadFolder: Path.resolve(__dirname + "/../uploads")
  45. commands:
  46. # Any commands to wrap the convert utility in, for example ["nice"], or ["firejail", "--profile=/etc/firejail/convert.profile"]
  47. convertCommandPrefix: []
  48. enableConversions: if process.env['ENABLE_CONVERSIONS'] == 'true' then true else false
  49. # Filestore health check
  50. # ----------------------
  51. # Project and file details to check in persistor when calling /health_check
  52. if process.env['HEALTH_CHECK_PROJECT_ID']? and process.env['HEALTH_CHECK_FILE_ID']?
  53. settings.health_check =
  54. project_id: process.env['HEALTH_CHECK_PROJECT_ID']
  55. file_id: process.env['HEALTH_CHECK_FILE_ID']
  56. module.exports = settings