diff --git a/services/filestore/app.js b/services/filestore/app.js index 5f59b13bed..4a5f34fc5b 100644 --- a/services/filestore/app.js +++ b/services/filestore/app.js @@ -4,7 +4,7 @@ Metrics.initialize(process.env.METRICS_APP_NAME || 'filestore') const logger = require('logger-sharelatex') logger.initialize(process.env.METRICS_APP_NAME || 'filestore') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const express = require('express') const bodyParser = require('body-parser') diff --git a/services/filestore/app/js/FileConverter.js b/services/filestore/app/js/FileConverter.js index 18137f16b7..3a8549fd6c 100644 --- a/services/filestore/app/js/FileConverter.js +++ b/services/filestore/app/js/FileConverter.js @@ -1,5 +1,5 @@ const metrics = require('@overleaf/metrics') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { callbackify } = require('util') const safeExec = require('./SafeExec').promises diff --git a/services/filestore/app/js/FileHandler.js b/services/filestore/app/js/FileHandler.js index 7f476e3630..872ab65746 100644 --- a/services/filestore/app/js/FileHandler.js +++ b/services/filestore/app/js/FileHandler.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { callbackify } = require('util') const fs = require('fs') const PersistorManager = require('./PersistorManager') diff --git a/services/filestore/app/js/HealthCheckController.js b/services/filestore/app/js/HealthCheckController.js index c71b567fe0..9f32f479fd 100644 --- a/services/filestore/app/js/HealthCheckController.js +++ b/services/filestore/app/js/HealthCheckController.js @@ -1,6 +1,6 @@ const fs = require('fs') const path = require('path') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const streamBuffers = require('stream-buffers') const { promisify } = require('util') const Stream = require('stream') diff --git a/services/filestore/app/js/KeyBuilder.js b/services/filestore/app/js/KeyBuilder.js index 9968753349..b615e69743 100644 --- a/services/filestore/app/js/KeyBuilder.js +++ b/services/filestore/app/js/KeyBuilder.js @@ -1,4 +1,4 @@ -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') module.exports = { getConvertedFolderKey, diff --git a/services/filestore/app/js/LocalFileWriter.js b/services/filestore/app/js/LocalFileWriter.js index 501856e2f1..9b0cc7b289 100644 --- a/services/filestore/app/js/LocalFileWriter.js +++ b/services/filestore/app/js/LocalFileWriter.js @@ -4,7 +4,7 @@ const path = require('path') const Stream = require('stream') const { callbackify, promisify } = require('util') const metrics = require('@overleaf/metrics') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { WriteError } = require('./Errors') module.exports = { diff --git a/services/filestore/app/js/PersistorManager.js b/services/filestore/app/js/PersistorManager.js index 1af996a7ab..3a57723be2 100644 --- a/services/filestore/app/js/PersistorManager.js +++ b/services/filestore/app/js/PersistorManager.js @@ -1,4 +1,4 @@ -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const persistorSettings = settings.filestore persistorSettings.Metrics = require('@overleaf/metrics') diff --git a/services/filestore/app/js/SafeExec.js b/services/filestore/app/js/SafeExec.js index 6bdae0ea34..655ecf2f5c 100644 --- a/services/filestore/app/js/SafeExec.js +++ b/services/filestore/app/js/SafeExec.js @@ -1,6 +1,6 @@ const lodashOnce = require('lodash.once') const childProcess = require('child_process') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { ConversionsDisabledError, FailedCommandError } = require('./Errors') // execute a command in the same way as 'exec' but with a timeout that diff --git a/services/filestore/package-lock.json b/services/filestore/package-lock.json index 32c09f8489..01303d74ba 100644 --- a/services/filestore/package-lock.json +++ b/services/filestore/package-lock.json @@ -1143,6 +1143,11 @@ "tiny-async-pool": "^1.1.0" } }, + "@overleaf/settings": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@overleaf/settings/-/settings-2.1.1.tgz", + "integrity": "sha512-vcJwqCGFKmQxTP/syUqCeMaSRjHmBcQgKOACR9He2uJcErg2GZPa1go+nGvszMbkElM4HfRKm/MfxvqHhoN4TQ==" + }, "@protobufjs/aspromise": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", @@ -1911,11 +1916,6 @@ "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" }, - "coffee-script": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/coffee-script/-/coffee-script-1.6.0.tgz", - "integrity": "sha512-Tx8itEfCsQp8RbLDFt7qwjqXycAx2g6SI7//4PPUR2j6meLmNifYm6zKrNDcU1+Q/GWRhjhEZk7DaLG1TfIzGA==" - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -6095,14 +6095,6 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" }, - "settings-sharelatex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/settings-sharelatex/-/settings-sharelatex-1.1.0.tgz", - "integrity": "sha512-f7D+0lnlohoteSn6IKTH72NE+JnAdMWTKwQglAuimZWTID2FRRItZSGeYMTRpvEnaQApkoVwRp//WRMsiddnqw==", - "requires": { - "coffee-script": "1.6.0" - } - }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", diff --git a/services/filestore/package.json b/services/filestore/package.json index 89ab38c935..6cb9dab872 100644 --- a/services/filestore/package.json +++ b/services/filestore/package.json @@ -23,6 +23,7 @@ "@overleaf/metrics": "^3.5.1", "@overleaf/o-error": "^3.0.0", "@overleaf/object-persistor": "https://github.com/overleaf/object-persistor/archive/8fbc9ed03206bfb54368578d22b7ac4f285baa25.tar.gz", + "@overleaf/settings": "^2.1.1", "body-parser": "^1.19.0", "bunyan": "^1.8.15", "express": "^4.17.1", @@ -34,7 +35,6 @@ "range-parser": "^1.2.1", "request": "^2.88.2", "request-promise-native": "^1.0.8", - "settings-sharelatex": "^1.1.0", "stream-buffers": "~0.2.6", "tiny-async-pool": "^1.1.0" }, diff --git a/services/filestore/test/acceptance/js/FilestoreApp.js b/services/filestore/test/acceptance/js/FilestoreApp.js index acb6b71828..495edb2273 100644 --- a/services/filestore/test/acceptance/js/FilestoreApp.js +++ b/services/filestore/test/acceptance/js/FilestoreApp.js @@ -1,5 +1,5 @@ const logger = require('logger-sharelatex') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const fs = require('fs') const Path = require('path') const { promisify } = require('util') diff --git a/services/filestore/test/acceptance/js/FilestoreTests.js b/services/filestore/test/acceptance/js/FilestoreTests.js index 7c7cb90e54..b7a2744ed3 100644 --- a/services/filestore/test/acceptance/js/FilestoreTests.js +++ b/services/filestore/test/acceptance/js/FilestoreTests.js @@ -1,7 +1,7 @@ const chai = require('chai') const { expect } = chai const fs = require('fs') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const Path = require('path') const FilestoreApp = require('./FilestoreApp') const TestHelper = require('./TestHelper') diff --git a/services/filestore/test/unit/js/FileControllerTests.js b/services/filestore/test/unit/js/FileControllerTests.js index 6a5ae729c8..f731c8f212 100644 --- a/services/filestore/test/unit/js/FileControllerTests.js +++ b/services/filestore/test/unit/js/FileControllerTests.js @@ -58,7 +58,7 @@ describe('FileController', function () { './PersistorManager': PersistorManager, './Errors': Errors, stream: stream, - 'settings-sharelatex': settings, + '@overleaf/settings': settings, '@overleaf/metrics': { inc() {} } diff --git a/services/filestore/test/unit/js/FileConverterTests.js b/services/filestore/test/unit/js/FileConverterTests.js index b6f59348d5..923983a7ae 100644 --- a/services/filestore/test/unit/js/FileConverterTests.js +++ b/services/filestore/test/unit/js/FileConverterTests.js @@ -32,7 +32,7 @@ describe('FileConverter', function () { inc: sinon.stub(), Timer: sinon.stub().returns({ done: sinon.stub() }) }, - 'settings-sharelatex': Settings, + '@overleaf/settings': Settings, '@overleaf/object-persistor': ObjectPersistor } }) diff --git a/services/filestore/test/unit/js/FileHandlerTests.js b/services/filestore/test/unit/js/FileHandlerTests.js index 90bc06832e..23a0922c0e 100644 --- a/services/filestore/test/unit/js/FileHandlerTests.js +++ b/services/filestore/test/unit/js/FileHandlerTests.js @@ -81,7 +81,7 @@ describe('FileHandler', function () { './FileConverter': FileConverter, './KeyBuilder': KeyBuilder, './ImageOptimiser': ImageOptimiser, - 'settings-sharelatex': Settings, + '@overleaf/settings': Settings, '@overleaf/object-persistor': ObjectPersistor, fs: fs }, diff --git a/services/filestore/test/unit/js/KeybuilderTests.js b/services/filestore/test/unit/js/KeybuilderTests.js index d72e65df5b..883364fb22 100644 --- a/services/filestore/test/unit/js/KeybuilderTests.js +++ b/services/filestore/test/unit/js/KeybuilderTests.js @@ -8,7 +8,7 @@ describe('KeybuilderTests', function () { beforeEach(function () { KeyBuilder = SandboxedModule.require(modulePath, { - requires: { 'settings-sharelatex': {} } + requires: { '@overleaf/settings': {} } }) }) diff --git a/services/filestore/test/unit/js/LocalFileWriterTests.js b/services/filestore/test/unit/js/LocalFileWriterTests.js index 5fb9e56dca..3635b9a994 100644 --- a/services/filestore/test/unit/js/LocalFileWriterTests.js +++ b/services/filestore/test/unit/js/LocalFileWriterTests.js @@ -29,7 +29,7 @@ describe('LocalFileWriter', function () { requires: { fs, stream, - 'settings-sharelatex': settings, + '@overleaf/settings': settings, '@overleaf/metrics': { inc: sinon.stub(), Timer: sinon.stub().returns({ done: sinon.stub() }) diff --git a/services/filestore/test/unit/js/SafeExecTests.js b/services/filestore/test/unit/js/SafeExecTests.js index c4b59e70e4..0bcfb44133 100644 --- a/services/filestore/test/unit/js/SafeExecTests.js +++ b/services/filestore/test/unit/js/SafeExecTests.js @@ -17,7 +17,7 @@ describe('SafeExec', function () { safeExec = SandboxedModule.require(modulePath, { globals: { process }, requires: { - 'settings-sharelatex': settings, + '@overleaf/settings': settings, '@overleaf/object-persistor': ObjectPersistor } }) diff --git a/services/filestore/test/unit/js/SettingsTests.js b/services/filestore/test/unit/js/SettingsTests.js index 68bc580ca6..7ddff93c5c 100644 --- a/services/filestore/test/unit/js/SettingsTests.js +++ b/services/filestore/test/unit/js/SettingsTests.js @@ -12,7 +12,7 @@ describe('Settings', function () { } } process.env.S3_BUCKET_CREDENTIALS = JSON.stringify(s3Settings) - const settings = SandboxedModule.require('settings-sharelatex', { + const settings = SandboxedModule.require('@overleaf/settings', { globals: { console, process } }) expect(settings.filestore.s3.bucketCreds).to.deep.equal(s3Settings)