diff --git a/services/docstore/app.js b/services/docstore/app.js index c6d2df480c..e31775e943 100644 --- a/services/docstore/app.js +++ b/services/docstore/app.js @@ -6,7 +6,7 @@ */ const Metrics = require('@overleaf/metrics') Metrics.initialize('docstore') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const express = require('express') const bodyParser = require('body-parser') diff --git a/services/docstore/app/js/DocArchiveManager.js b/services/docstore/app/js/DocArchiveManager.js index 7a062bc739..807ae8b3d7 100644 --- a/services/docstore/app/js/DocArchiveManager.js +++ b/services/docstore/app/js/DocArchiveManager.js @@ -2,7 +2,7 @@ const { callbackify } = require('util') const MongoManager = require('./MongoManager').promises const Errors = require('./Errors') const logger = require('logger-sharelatex') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const crypto = require('crypto') const Streamifier = require('streamifier') const RangeManager = require('./RangeManager') diff --git a/services/docstore/app/js/DocManager.js b/services/docstore/app/js/DocManager.js index 39e95f7961..2951377743 100644 --- a/services/docstore/app/js/DocManager.js +++ b/services/docstore/app/js/DocManager.js @@ -20,7 +20,7 @@ const logger = require('logger-sharelatex') const _ = require('underscore') const DocArchive = require('./DocArchiveManager') const RangeManager = require('./RangeManager') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') module.exports = DocManager = { // TODO: For historical reasons, the doc version is currently stored in the docOps diff --git a/services/docstore/app/js/HealthChecker.js b/services/docstore/app/js/HealthChecker.js index 567774af3e..30d82ee8a3 100644 --- a/services/docstore/app/js/HealthChecker.js +++ b/services/docstore/app/js/HealthChecker.js @@ -15,7 +15,7 @@ const request = require('request') const async = require('async') const _ = require('underscore') const crypto = require('crypto') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const { port } = settings.internal.docstore const logger = require('logger-sharelatex') diff --git a/services/docstore/app/js/HttpController.js b/services/docstore/app/js/HttpController.js index 885c241f39..593dcc6a2f 100644 --- a/services/docstore/app/js/HttpController.js +++ b/services/docstore/app/js/HttpController.js @@ -17,7 +17,7 @@ const DocManager = require('./DocManager') const logger = require('logger-sharelatex') const DocArchive = require('./DocArchiveManager') const HealthChecker = require('./HealthChecker') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') module.exports = HttpController = { getDoc(req, res, next) { diff --git a/services/docstore/app/js/MongoManager.js b/services/docstore/app/js/MongoManager.js index 385245c9e3..4e3f71eac8 100644 --- a/services/docstore/app/js/MongoManager.js +++ b/services/docstore/app/js/MongoManager.js @@ -14,7 +14,7 @@ let MongoManager const { db, ObjectId } = require('./mongodb') const logger = require('logger-sharelatex') const metrics = require('@overleaf/metrics') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { promisify } = require('util') module.exports = MongoManager = { diff --git a/services/docstore/app/js/PersistorManager.js b/services/docstore/app/js/PersistorManager.js index aae716e7ab..241b29c4f6 100644 --- a/services/docstore/app/js/PersistorManager.js +++ b/services/docstore/app/js/PersistorManager.js @@ -1,4 +1,4 @@ -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const persistorSettings = settings.docstore persistorSettings.Metrics = require('@overleaf/metrics') diff --git a/services/docstore/app/js/mongodb.js b/services/docstore/app/js/mongodb.js index 566b9a07e9..245f7ed8f7 100644 --- a/services/docstore/app/js/mongodb.js +++ b/services/docstore/app/js/mongodb.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { MongoClient, ObjectId } = require('mongodb') const clientPromise = MongoClient.connect( diff --git a/services/docstore/package-lock.json b/services/docstore/package-lock.json index 8d7e7c9040..756b05775b 100644 --- a/services/docstore/package-lock.json +++ b/services/docstore/package-lock.json @@ -1131,6 +1131,11 @@ } } }, + "@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", @@ -6410,21 +6415,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" - }, - "dependencies": { - "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==" - } - } - }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", diff --git a/services/docstore/package.json b/services/docstore/package.json index f979fce529..5ebda01024 100644 --- a/services/docstore/package.json +++ b/services/docstore/package.json @@ -22,6 +22,7 @@ "@overleaf/metrics": "^3.5.1", "@overleaf/o-error": "^3.0.0", "@overleaf/object-persistor": "https://github.com/overleaf/object-persistor/archive/4ca62157a2beb747e9a56da3ce1569124b90378a.tar.gz", + "@overleaf/settings": "^2.1.1", "async": "^2.6.3", "body-parser": "^1.19.0", "bunyan": "^1.8.15", @@ -31,7 +32,6 @@ "mongodb": "^3.6.0", "p-map": "^4.0.0", "request": "^2.88.2", - "settings-sharelatex": "^1.1.0", "streamifier": "^0.1.1", "underscore": "~1.12.1" }, diff --git a/services/docstore/test/acceptance/js/ArchiveDocsTests.js b/services/docstore/test/acceptance/js/ArchiveDocsTests.js index 61ed52ad99..2a4948ba5d 100644 --- a/services/docstore/test/acceptance/js/ArchiveDocsTests.js +++ b/services/docstore/test/acceptance/js/ArchiveDocsTests.js @@ -13,7 +13,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ process.env.BACKEND = 'gcs' -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { expect } = require('chai') const { db, ObjectId } = require('../../../app/js/mongodb') const async = require('async') diff --git a/services/docstore/test/acceptance/js/DeletingDocsTests.js b/services/docstore/test/acceptance/js/DeletingDocsTests.js index 0d4e1942dc..bc38f3fad8 100644 --- a/services/docstore/test/acceptance/js/DeletingDocsTests.js +++ b/services/docstore/test/acceptance/js/DeletingDocsTests.js @@ -15,7 +15,7 @@ const { db, ObjectId } = require('../../../app/js/mongodb') const { expect } = require('chai') const DocstoreApp = require('./helpers/DocstoreApp') const Errors = require('../../../app/js/Errors') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const DocstoreClient = require('./helpers/DocstoreClient') diff --git a/services/docstore/test/acceptance/js/helpers/DocstoreApp.js b/services/docstore/test/acceptance/js/helpers/DocstoreApp.js index 351a744b13..d541a8f454 100644 --- a/services/docstore/test/acceptance/js/helpers/DocstoreApp.js +++ b/services/docstore/test/acceptance/js/helpers/DocstoreApp.js @@ -14,7 +14,7 @@ const app = require('../../../../app') const { waitForDb } = require('../../../../app/js/mongodb') require('logger-sharelatex').logger.level('error') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') module.exports = { running: false, diff --git a/services/docstore/test/acceptance/js/helpers/DocstoreClient.js b/services/docstore/test/acceptance/js/helpers/DocstoreClient.js index 390a1a0931..49b50907bb 100644 --- a/services/docstore/test/acceptance/js/helpers/DocstoreClient.js +++ b/services/docstore/test/acceptance/js/helpers/DocstoreClient.js @@ -13,7 +13,7 @@ */ let DocstoreClient const request = require('request').defaults({ jar: false }) -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const Persistor = require('../../../../app/js/PersistorManager') async function streamToString(stream) { diff --git a/services/docstore/test/unit/js/DocArchiveManagerTests.js b/services/docstore/test/unit/js/DocArchiveManagerTests.js index 41fe75a8df..0316343c0f 100644 --- a/services/docstore/test/unit/js/DocArchiveManagerTests.js +++ b/services/docstore/test/unit/js/DocArchiveManagerTests.js @@ -146,7 +146,7 @@ describe('DocArchiveManager', function () { DocArchiveManager = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': Settings, + '@overleaf/settings': Settings, crypto: Crypto, streamifier: Streamifier, './MongoManager': MongoManager, diff --git a/services/docstore/test/unit/js/DocManagerTests.js b/services/docstore/test/unit/js/DocManagerTests.js index 1656cd2a6e..60b3a20885 100644 --- a/services/docstore/test/unit/js/DocManagerTests.js +++ b/services/docstore/test/unit/js/DocManagerTests.js @@ -31,7 +31,7 @@ describe('DocManager', function () { }, shouldUpdateRanges: sinon.stub().returns(false) }), - 'settings-sharelatex': (this.settings = { docstore: {} }), + '@overleaf/settings': (this.settings = { docstore: {} }), './Errors': Errors } }) diff --git a/services/docstore/test/unit/js/HttpControllerTests.js b/services/docstore/test/unit/js/HttpControllerTests.js index d0686cda42..16b7baf5b0 100644 --- a/services/docstore/test/unit/js/HttpControllerTests.js +++ b/services/docstore/test/unit/js/HttpControllerTests.js @@ -27,7 +27,7 @@ describe('HttpController', function () { requires: { './DocManager': (this.DocManager = {}), './DocArchiveManager': (this.DocArchiveManager = {}), - 'settings-sharelatex': settings, + '@overleaf/settings': settings, './HealthChecker': {} } }) diff --git a/services/docstore/test/unit/js/MongoManagerTests.js b/services/docstore/test/unit/js/MongoManagerTests.js index 4e54a56586..1e80fd1f21 100644 --- a/services/docstore/test/unit/js/MongoManagerTests.js +++ b/services/docstore/test/unit/js/MongoManagerTests.js @@ -27,7 +27,7 @@ describe('MongoManager', function () { ObjectId }, '@overleaf/metrics': { timeAsyncMethod: sinon.stub() }, - 'settings-sharelatex': { max_deleted_docs: 42 } + '@overleaf/settings': { max_deleted_docs: 42 } } }) this.project_id = ObjectId().toString()