mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-06 04:42:26 +00:00
[misc] switch from settings-sharelatex to @overleaf/settings
This commit is contained in:
parent
7495d2114a
commit
b5bb7c3b04
29 changed files with 33 additions and 43 deletions
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
const Metrics = require('@overleaf/metrics')
|
||||
Metrics.initialize('track-changes')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const logger = require('logger-sharelatex')
|
||||
const TrackChangesLogger = logger.initialize('track-changes').logger
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
let DocumentUpdaterManager
|
||||
const request = require('request')
|
||||
const logger = require('logger-sharelatex')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
|
||||
module.exports = DocumentUpdaterManager = {
|
||||
getDocument(project_id, doc_id, callback) {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
const { ObjectId } = require('./mongodb')
|
||||
const request = require('request')
|
||||
const async = require('async')
|
||||
const settings = require('settings-sharelatex')
|
||||
const settings = require('@overleaf/settings')
|
||||
const { port } = settings.internal.trackchanges
|
||||
const logger = require('logger-sharelatex')
|
||||
const LockManager = require('./LockManager')
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
let LockManager
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const redis = require('@overleaf/redis-wrapper')
|
||||
const rclient = redis.createClient(Settings.redis.lock)
|
||||
const os = require('os')
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
let MongoAWS
|
||||
const settings = require('settings-sharelatex')
|
||||
const settings = require('@overleaf/settings')
|
||||
const logger = require('logger-sharelatex')
|
||||
const AWS = require('aws-sdk')
|
||||
const S3S = require('s3-streams')
|
||||
|
|
|
@ -24,7 +24,7 @@ const LockManager = require('./LockManager')
|
|||
const MongoAWS = require('./MongoAWS')
|
||||
const Metrics = require('@overleaf/metrics')
|
||||
const ProjectIterator = require('./ProjectIterator')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const keys = Settings.redis.lock.key_schema
|
||||
|
||||
// Sharejs operations are stored in a 'pack' object
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
let LIMIT, pending
|
||||
let project_id, doc_id
|
||||
const { callbackify } = require('util')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const async = require('async')
|
||||
const _ = require('underscore')
|
||||
const { db, ObjectId, waitForDb, closeDb } = require('./mongodb')
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
||||
*/
|
||||
let RedisManager
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const redis = require('@overleaf/redis-wrapper')
|
||||
const rclient = redis.createClient(Settings.redis.history)
|
||||
const Keys = Settings.redis.history.key_schema
|
||||
|
|
|
@ -25,7 +25,7 @@ const UpdateTrimmer = require('./UpdateTrimmer')
|
|||
const logger = require('logger-sharelatex')
|
||||
const async = require('async')
|
||||
const _ = require('underscore')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const keys = Settings.redis.lock.key_schema
|
||||
|
||||
module.exports = UpdatesManager = {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
let WebApiManager
|
||||
const request = require('requestretry') // allow retry on error https://github.com/FGRibreau/node-request-retry
|
||||
const logger = require('logger-sharelatex')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
|
||||
// Don't let HTTP calls hang for a long time
|
||||
const MAX_HTTP_REQUEST_LENGTH = 15000 // 15 seconds
|
||||
|
|
|
@ -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/track-changes/package-lock.json
generated
20
services/track-changes/package-lock.json
generated
|
@ -980,6 +980,11 @@
|
|||
"ioredis": "~4.17.3"
|
||||
}
|
||||
},
|
||||
"@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",
|
||||
|
@ -6431,21 +6436,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",
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
"@overleaf/metrics": "^3.5.1",
|
||||
"@overleaf/o-error": "^3.1.0",
|
||||
"@overleaf/redis-wrapper": "^2.0.0",
|
||||
"@overleaf/settings": "^2.1.1",
|
||||
"JSONStream": "^1.3.5",
|
||||
"async": "^2.6.3",
|
||||
"aws-sdk": "^2.643.0",
|
||||
|
@ -38,7 +39,6 @@
|
|||
"request": "~2.88.2",
|
||||
"requestretry": "^4.1.0",
|
||||
"s3-streams": "^0.4.0",
|
||||
"settings-sharelatex": "^1.1.0",
|
||||
"underscore": "~1.13.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
const sinon = require('sinon')
|
||||
const { expect } = require('chai')
|
||||
const { ObjectId } = require('../../../app/js/mongodb')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const request = require('request')
|
||||
const rclient = require('redis').createClient(Settings.redis.history) // Only works locally for now
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
const sinon = require('sinon')
|
||||
const { expect } = require('chai')
|
||||
const { db, ObjectId } = require('../../../app/js/mongodb')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const request = require('request')
|
||||
const rclient = require('redis').createClient(Settings.redis.history) // Only works locally for now
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
const sinon = require('sinon')
|
||||
const { expect } = require('chai')
|
||||
const { ObjectId } = require('../../../app/js/mongodb')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const request = require('request')
|
||||
const rclient = require('redis').createClient(Settings.redis.history) // Only works locally for now
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
const sinon = require('sinon')
|
||||
const { expect } = require('chai')
|
||||
const { ObjectId } = require('../../../app/js/mongodb')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
|
||||
const TrackChangesApp = require('./helpers/TrackChangesApp')
|
||||
const TrackChangesClient = require('./helpers/TrackChangesClient')
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
const sinon = require('sinon')
|
||||
const { expect } = require('chai')
|
||||
const { ObjectId } = require('../../../app/js/mongodb')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
|
||||
const TrackChangesApp = require('./helpers/TrackChangesApp')
|
||||
const TrackChangesClient = require('./helpers/TrackChangesClient')
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
*/
|
||||
const sinon = require('sinon')
|
||||
const { expect } = require('chai')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const LockManager = require('../../../app/js/LockManager')
|
||||
const rclient = require('redis').createClient(Settings.redis.history) // Only works locally for now
|
||||
const TrackChangesApp = require('./helpers/TrackChangesApp')
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
const sinon = require('sinon')
|
||||
const { expect } = require('chai')
|
||||
const { ObjectId } = require('../../../app/js/mongodb')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
|
||||
const TrackChangesApp = require('./helpers/TrackChangesApp')
|
||||
const TrackChangesClient = require('./helpers/TrackChangesClient')
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
const app = require('../../../../app')
|
||||
const { waitForDb } = require('../../../../app/js/mongodb')
|
||||
const logger = require('logger-sharelatex')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
|
||||
module.exports = {
|
||||
running: false,
|
||||
|
|
|
@ -16,7 +16,7 @@ let TrackChangesClient
|
|||
const async = require('async')
|
||||
const zlib = require('zlib')
|
||||
const request = require('request')
|
||||
const Settings = require('settings-sharelatex')
|
||||
const Settings = require('@overleaf/settings')
|
||||
const rclient = require('@overleaf/redis-wrapper').createClient(
|
||||
Settings.redis.history
|
||||
) // Only works locally for now
|
||||
|
|
|
@ -21,7 +21,7 @@ describe('MongoAWS', function () {
|
|||
this.MongoAWS = SandboxedModule.require(modulePath, {
|
||||
singleOnly: true,
|
||||
requires: {
|
||||
'settings-sharelatex': (this.settings = {
|
||||
'@overleaf/settings': (this.settings = {
|
||||
trackchanges: {
|
||||
s3: {
|
||||
secret: 's3-secret',
|
||||
|
|
|
@ -19,7 +19,7 @@ describe('DocumentUpdaterManager', function () {
|
|||
this.DocumentUpdaterManager = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
request: (this.request = {}),
|
||||
'settings-sharelatex': (this.settings = {
|
||||
'@overleaf/settings': (this.settings = {
|
||||
apis: { documentupdater: { url: 'http://example.com' } }
|
||||
})
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ describe('LockManager', function () {
|
|||
return (this.rclient = { auth: sinon.stub() })
|
||||
}
|
||||
},
|
||||
'settings-sharelatex': this.Settings
|
||||
'@overleaf/settings': this.Settings
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ describe('PackManager', function () {
|
|||
'./MongoAWS': {},
|
||||
'@overleaf/metrics': { inc() {} },
|
||||
'./ProjectIterator': require('../../../../app/js/ProjectIterator.js'), // Cache for speed
|
||||
'settings-sharelatex': {
|
||||
'@overleaf/settings': {
|
||||
redis: { lock: { key_schema: {} } }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ describe('RedisManager', function () {
|
|||
})
|
||||
}
|
||||
},
|
||||
'settings-sharelatex': {
|
||||
'@overleaf/settings': {
|
||||
redis: {
|
||||
history: {
|
||||
key_schema: {
|
||||
|
|
|
@ -32,7 +32,7 @@ describe('UpdatesManager', function () {
|
|||
'./WebApiManager': (this.WebApiManager = {}),
|
||||
'./UpdateTrimmer': (this.UpdateTrimmer = {}),
|
||||
'./DocArchiveManager': (this.DocArchiveManager = {}),
|
||||
'settings-sharelatex': {
|
||||
'@overleaf/settings': {
|
||||
redis: {
|
||||
lock: {
|
||||
key_schema: {
|
||||
|
|
|
@ -19,7 +19,7 @@ describe('WebApiManager', function () {
|
|||
this.WebApiManager = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
requestretry: (this.request = {}),
|
||||
'settings-sharelatex': (this.settings = {
|
||||
'@overleaf/settings': (this.settings = {
|
||||
apis: {
|
||||
web: {
|
||||
url: 'http://example.com',
|
||||
|
|
Loading…
Add table
Reference in a new issue