mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-17 02:54:11 +00:00
init s3 feature
This commit is contained in:
parent
775f5ebbe1
commit
ae047ecf76
2 changed files with 32 additions and 0 deletions
24
services/track-changes/app/coffee/DocArquiveManager.coffee
Normal file
24
services/track-changes/app/coffee/DocArquiveManager.coffee
Normal file
|
@ -0,0 +1,24 @@
|
|||
MongoManager = require "./MongoManager"
|
||||
Errors = require "./Errors"
|
||||
logger = require "logger-sharelatex"
|
||||
_ = require "underscore"
|
||||
async = require "async"
|
||||
settings = require("settings-sharelatex")
|
||||
request = require("request")
|
||||
crypto = require("crypto")
|
||||
thirtySeconds = 30 * 1000
|
||||
|
||||
module.exports = DocArchiveManager =
|
||||
|
||||
buildS3Options: (content, key)->
|
||||
return {
|
||||
aws:
|
||||
key: settings.filestore.s3.key
|
||||
secret: settings.filestore.s3.secret
|
||||
bucket: settings.filestore.stores.user_files
|
||||
timeout: thirtySeconds
|
||||
json: content
|
||||
#headers:
|
||||
# 'content-md5': crypto.createHash("md5").update(JSON.stringify(content)).digest("hex")
|
||||
uri:"https://#{settings.filestore.stores.user_files}.s3.amazonaws.com/#{key}"
|
||||
}
|
|
@ -19,3 +19,11 @@ module.exports =
|
|||
host: "localhost"
|
||||
port: 6379
|
||||
pass: ""
|
||||
|
||||
#filestore:
|
||||
# backend: "s3"
|
||||
# stores:
|
||||
# user_files: "sharelatex-dev"
|
||||
# s3:
|
||||
# key: ""
|
||||
# secret: ""
|
||||
|
|
Loading…
Reference in a new issue