mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 16:01:13 +00:00
Populate S3 settings from environment variable
This commit is contained in:
parent
c14476c0c1
commit
836ff145b8
2 changed files with 25 additions and 1 deletions
|
@ -23,7 +23,8 @@ module.exports =
|
|||
user_files: Path.resolve(__dirname + "/../user_files")
|
||||
public_files: Path.resolve(__dirname + "/../public_files")
|
||||
template_files: Path.resolve(__dirname + "/../template_files")
|
||||
# if you are using S3, then fill in your S3 details below
|
||||
# if you are using S3, then fill in your S3 details below,
|
||||
# or use env var with the same structure.
|
||||
# s3:
|
||||
# key: "" # default
|
||||
# secret: "" # default
|
||||
|
@ -31,6 +32,7 @@ module.exports =
|
|||
# auth_key: ""
|
||||
# auth_secret: ""
|
||||
# bucketname2: # secrets for bucketname2...
|
||||
s3: JSON.parse process.env['S3_CREDENTIALS'] if process.env['S3_CREDENTIALS']
|
||||
|
||||
path:
|
||||
uploadFolder: Path.resolve(__dirname + "/../uploads")
|
||||
|
|
22
services/filestore/test/unit/coffee/SettingsTests.coffee
Normal file
22
services/filestore/test/unit/coffee/SettingsTests.coffee
Normal file
|
@ -0,0 +1,22 @@
|
|||
assert = require("chai").assert
|
||||
sinon = require('sinon')
|
||||
chai = require('chai')
|
||||
should = chai.should()
|
||||
expect = chai.expect
|
||||
modulePath = "../../../app/js/BucketController.js"
|
||||
SandboxedModule = require('sandboxed-module')
|
||||
|
||||
describe "Settings", ->
|
||||
describe "s3", ->
|
||||
it "should use JSONified env var if present", (done)->
|
||||
s3_settings =
|
||||
key: 'default_key'
|
||||
secret: 'default_secret'
|
||||
bucket1:
|
||||
auth_key: 'bucket1_key'
|
||||
auth_secret: 'bucket1_secret'
|
||||
process.env['S3_CREDENTIALS'] = JSON.stringify s3_settings
|
||||
|
||||
settings =require('settings-sharelatex')
|
||||
expect(settings.filestore.s3).to.deep.equal s3_settings
|
||||
done()
|
Loading…
Reference in a new issue