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
8d6f169c66
commit
3152bf361d
19 changed files with 23 additions and 31 deletions
|
@ -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')
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const settings = require('settings-sharelatex')
|
||||
const settings = require('@overleaf/settings')
|
||||
|
||||
module.exports = {
|
||||
getConvertedFolderKey,
|
||||
|
|
|
@ -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 = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
const settings = require('settings-sharelatex')
|
||||
const settings = require('@overleaf/settings')
|
||||
|
||||
const persistorSettings = settings.filestore
|
||||
persistorSettings.Metrics = require('@overleaf/metrics')
|
||||
|
|
|
@ -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
|
||||
|
|
18
services/filestore/package-lock.json
generated
18
services/filestore/package-lock.json
generated
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
},
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -58,7 +58,7 @@ describe('FileController', function () {
|
|||
'./PersistorManager': PersistorManager,
|
||||
'./Errors': Errors,
|
||||
stream: stream,
|
||||
'settings-sharelatex': settings,
|
||||
'@overleaf/settings': settings,
|
||||
'@overleaf/metrics': {
|
||||
inc() {}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
})
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -8,7 +8,7 @@ describe('KeybuilderTests', function () {
|
|||
|
||||
beforeEach(function () {
|
||||
KeyBuilder = SandboxedModule.require(modulePath, {
|
||||
requires: { 'settings-sharelatex': {} }
|
||||
requires: { '@overleaf/settings': {} }
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
@ -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() })
|
||||
|
|
|
@ -17,7 +17,7 @@ describe('SafeExec', function () {
|
|||
safeExec = SandboxedModule.require(modulePath, {
|
||||
globals: { process },
|
||||
requires: {
|
||||
'settings-sharelatex': settings,
|
||||
'@overleaf/settings': settings,
|
||||
'@overleaf/object-persistor': ObjectPersistor
|
||||
}
|
||||
})
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue