mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
[misc] switch from settings-sharelatex to @overleaf/settings
This commit is contained in:
parent
5239f6c327
commit
2c35adaf48
18 changed files with 22 additions and 32 deletions
|
@ -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')
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const settings = require('settings-sharelatex')
|
||||
const settings = require('@overleaf/settings')
|
||||
|
||||
const persistorSettings = settings.docstore
|
||||
persistorSettings.Metrics = require('@overleaf/metrics')
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const { MongoClient, ObjectId } = require('mongodb')
|
||||
|
||||
const clientPromise = MongoClient.connect(
|
||||
|
|
20
services/docstore/package-lock.json
generated
20
services/docstore/package-lock.json
generated
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
},
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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')
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -146,7 +146,7 @@ describe('DocArchiveManager', function () {
|
|||
|
||||
DocArchiveManager = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
'settings-sharelatex': Settings,
|
||||
'@overleaf/settings': Settings,
|
||||
crypto: Crypto,
|
||||
streamifier: Streamifier,
|
||||
'./MongoManager': MongoManager,
|
||||
|
|
|
@ -31,7 +31,7 @@ describe('DocManager', function () {
|
|||
},
|
||||
shouldUpdateRanges: sinon.stub().returns(false)
|
||||
}),
|
||||
'settings-sharelatex': (this.settings = { docstore: {} }),
|
||||
'@overleaf/settings': (this.settings = { docstore: {} }),
|
||||
'./Errors': Errors
|
||||
}
|
||||
})
|
||||
|
|
|
@ -27,7 +27,7 @@ describe('HttpController', function () {
|
|||
requires: {
|
||||
'./DocManager': (this.DocManager = {}),
|
||||
'./DocArchiveManager': (this.DocArchiveManager = {}),
|
||||
'settings-sharelatex': settings,
|
||||
'@overleaf/settings': settings,
|
||||
'./HealthChecker': {}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue