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