2014-02-25 09:10:22 +00:00
|
|
|
settings = require("settings-sharelatex")
|
2014-02-25 10:54:51 +00:00
|
|
|
logger = require("logger-sharelatex")
|
2014-02-25 09:10:22 +00:00
|
|
|
|
2014-02-26 11:58:48 +00:00
|
|
|
# assume s3 if none specified
|
2014-03-04 15:01:13 +00:00
|
|
|
settings.filestore.backend ||= "s3"
|
2014-02-26 11:58:48 +00:00
|
|
|
|
|
|
|
|
2014-03-04 15:01:13 +00:00
|
|
|
logger.log backend:settings.filestore.backend, "Loading backend"
|
|
|
|
module.exports = switch settings.filestore.backend
|
2014-02-26 11:58:48 +00:00
|
|
|
when "s3"
|
2014-02-26 15:15:03 +00:00
|
|
|
require("./S3PersistorManager")
|
|
|
|
when "fs"
|
|
|
|
require("./FSPersistorManager")
|
2014-02-25 15:52:30 +00:00
|
|
|
else
|
2014-03-04 15:01:13 +00:00
|
|
|
throw new Error( "Unknown filestore backend: #{settings.filestore.backend}" )
|