diff --git a/services/filestore/config/settings.defaults.coffee b/services/filestore/config/settings.defaults.coffee index 272230f918..a53a4cf840 100644 --- a/services/filestore/config/settings.defaults.coffee +++ b/services/filestore/config/settings.defaults.coffee @@ -43,6 +43,7 @@ settings = unlockBeforeDelete: process.env['GCS_UNLOCK_BEFORE_DELETE'] == "true" # unlock an event-based hold before deleting. default false deletedBucketSuffix: process.env['GCS_DELETED_BUCKET_SUFFIX'] # if present, copy file to another bucket on delete. default null deleteConcurrency: parseInt(process.env['GCS_DELETE_CONCURRENCY']) || 50 + signedUrlExpiryInMs: parseInt(process.env['LINK_EXPIRY_TIMEOUT'] || 60000) s3: if process.env['AWS_ACCESS_KEY_ID']? or process.env['S3_BUCKET_CREDENTIALS']? @@ -51,6 +52,7 @@ settings = endpoint: process.env['AWS_S3_ENDPOINT'] pathStyle: process.env['AWS_S3_PATH_STYLE'] partSize: process.env['AWS_S3_PARTSIZE'] or (100 * 1024 * 1024) + bucketCreds: JSON.parse process.env['S3_BUCKET_CREDENTIALS'] if process.env['S3_BUCKET_CREDENTIALS']? # GCS should be configured by the service account on the kubernetes pod. See GOOGLE_APPLICATION_CREDENTIALS, # which will be picked up automatically. @@ -60,8 +62,6 @@ settings = template_files: process.env['TEMPLATE_FILES_BUCKET_NAME'] public_files: process.env['PUBLIC_FILES_BUCKET_NAME'] - s3BucketCreds: JSON.parse process.env['S3_BUCKET_CREDENTIALS'] if process.env['S3_BUCKET_CREDENTIALS']? - fallback: if process.env['FALLBACK_BACKEND']? backend: process.env['FALLBACK_BACKEND'] @@ -71,7 +71,6 @@ settings = copyOnMiss: process.env['COPY_ON_MISS'] == 'true' allowRedirects: if process.env['ALLOW_REDIRECTS'] == 'true' then true else false - signedUrlExpiryInMs: parseInt(process.env['LINK_EXPIRY_TIMEOUT'] || 60000) path: uploadFolder: Path.resolve(__dirname + "/../uploads") diff --git a/services/filestore/test/unit/js/SettingsTests.js b/services/filestore/test/unit/js/SettingsTests.js index 84c3361eab..230ea45d15 100644 --- a/services/filestore/test/unit/js/SettingsTests.js +++ b/services/filestore/test/unit/js/SettingsTests.js @@ -15,7 +15,7 @@ describe('Settings', function() { const settings = SandboxedModule.require('settings-sharelatex', { globals: { console, process } }) - expect(settings.filestore.s3BucketCreds).to.deep.equal(s3Settings) + expect(settings.filestore.s3.bucketCreds).to.deep.equal(s3Settings) }) }) })