[misc] switch from settings-sharelatex to @overleaf/settings

This commit is contained in:
Jakob Ackermann 2021-07-12 17:47:19 +01:00
parent 8d6f169c66
commit 3152bf361d
19 changed files with 23 additions and 31 deletions

View file

@ -4,7 +4,7 @@ Metrics.initialize(process.env.METRICS_APP_NAME || 'filestore')
const logger = require('logger-sharelatex') const logger = require('logger-sharelatex')
logger.initialize(process.env.METRICS_APP_NAME || 'filestore') logger.initialize(process.env.METRICS_APP_NAME || 'filestore')
const settings = require('settings-sharelatex') const settings = require('@overleaf/settings')
const express = require('express') const express = require('express')
const bodyParser = require('body-parser') const bodyParser = require('body-parser')

View file

@ -1,5 +1,5 @@
const metrics = require('@overleaf/metrics') const metrics = require('@overleaf/metrics')
const Settings = require('settings-sharelatex') const Settings = require('@overleaf/settings')
const { callbackify } = require('util') const { callbackify } = require('util')
const safeExec = require('./SafeExec').promises const safeExec = require('./SafeExec').promises

View file

@ -1,4 +1,4 @@
const Settings = require('settings-sharelatex') const Settings = require('@overleaf/settings')
const { callbackify } = require('util') const { callbackify } = require('util')
const fs = require('fs') const fs = require('fs')
const PersistorManager = require('./PersistorManager') const PersistorManager = require('./PersistorManager')

View file

@ -1,6 +1,6 @@
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const Settings = require('settings-sharelatex') const Settings = require('@overleaf/settings')
const streamBuffers = require('stream-buffers') const streamBuffers = require('stream-buffers')
const { promisify } = require('util') const { promisify } = require('util')
const Stream = require('stream') const Stream = require('stream')

View file

@ -1,4 +1,4 @@
const settings = require('settings-sharelatex') const settings = require('@overleaf/settings')
module.exports = { module.exports = {
getConvertedFolderKey, getConvertedFolderKey,

View file

@ -4,7 +4,7 @@ const path = require('path')
const Stream = require('stream') const Stream = require('stream')
const { callbackify, promisify } = require('util') const { callbackify, promisify } = require('util')
const metrics = require('@overleaf/metrics') const metrics = require('@overleaf/metrics')
const Settings = require('settings-sharelatex') const Settings = require('@overleaf/settings')
const { WriteError } = require('./Errors') const { WriteError } = require('./Errors')
module.exports = { module.exports = {

View file

@ -1,4 +1,4 @@
const settings = require('settings-sharelatex') const settings = require('@overleaf/settings')
const persistorSettings = settings.filestore const persistorSettings = settings.filestore
persistorSettings.Metrics = require('@overleaf/metrics') persistorSettings.Metrics = require('@overleaf/metrics')

View file

@ -1,6 +1,6 @@
const lodashOnce = require('lodash.once') const lodashOnce = require('lodash.once')
const childProcess = require('child_process') const childProcess = require('child_process')
const Settings = require('settings-sharelatex') const Settings = require('@overleaf/settings')
const { ConversionsDisabledError, FailedCommandError } = require('./Errors') const { ConversionsDisabledError, FailedCommandError } = require('./Errors')
// execute a command in the same way as 'exec' but with a timeout that // execute a command in the same way as 'exec' but with a timeout that

View file

@ -1143,6 +1143,11 @@
"tiny-async-pool": "^1.1.0" "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": { "@protobufjs/aspromise": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", "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", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" "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": { "color-convert": {
"version": "1.9.3", "version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "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", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" "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": { "shebang-command": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",

View file

@ -23,6 +23,7 @@
"@overleaf/metrics": "^3.5.1", "@overleaf/metrics": "^3.5.1",
"@overleaf/o-error": "^3.0.0", "@overleaf/o-error": "^3.0.0",
"@overleaf/object-persistor": "https://github.com/overleaf/object-persistor/archive/8fbc9ed03206bfb54368578d22b7ac4f285baa25.tar.gz", "@overleaf/object-persistor": "https://github.com/overleaf/object-persistor/archive/8fbc9ed03206bfb54368578d22b7ac4f285baa25.tar.gz",
"@overleaf/settings": "^2.1.1",
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"bunyan": "^1.8.15", "bunyan": "^1.8.15",
"express": "^4.17.1", "express": "^4.17.1",
@ -34,7 +35,6 @@
"range-parser": "^1.2.1", "range-parser": "^1.2.1",
"request": "^2.88.2", "request": "^2.88.2",
"request-promise-native": "^1.0.8", "request-promise-native": "^1.0.8",
"settings-sharelatex": "^1.1.0",
"stream-buffers": "~0.2.6", "stream-buffers": "~0.2.6",
"tiny-async-pool": "^1.1.0" "tiny-async-pool": "^1.1.0"
}, },

View file

@ -1,5 +1,5 @@
const logger = require('logger-sharelatex') const logger = require('logger-sharelatex')
const Settings = require('settings-sharelatex') const Settings = require('@overleaf/settings')
const fs = require('fs') const fs = require('fs')
const Path = require('path') const Path = require('path')
const { promisify } = require('util') const { promisify } = require('util')

View file

@ -1,7 +1,7 @@
const chai = require('chai') const chai = require('chai')
const { expect } = chai const { expect } = chai
const fs = require('fs') const fs = require('fs')
const Settings = require('settings-sharelatex') const Settings = require('@overleaf/settings')
const Path = require('path') const Path = require('path')
const FilestoreApp = require('./FilestoreApp') const FilestoreApp = require('./FilestoreApp')
const TestHelper = require('./TestHelper') const TestHelper = require('./TestHelper')

View file

@ -58,7 +58,7 @@ describe('FileController', function () {
'./PersistorManager': PersistorManager, './PersistorManager': PersistorManager,
'./Errors': Errors, './Errors': Errors,
stream: stream, stream: stream,
'settings-sharelatex': settings, '@overleaf/settings': settings,
'@overleaf/metrics': { '@overleaf/metrics': {
inc() {} inc() {}
} }

View file

@ -32,7 +32,7 @@ describe('FileConverter', function () {
inc: sinon.stub(), inc: sinon.stub(),
Timer: sinon.stub().returns({ done: sinon.stub() }) Timer: sinon.stub().returns({ done: sinon.stub() })
}, },
'settings-sharelatex': Settings, '@overleaf/settings': Settings,
'@overleaf/object-persistor': ObjectPersistor '@overleaf/object-persistor': ObjectPersistor
} }
}) })

View file

@ -81,7 +81,7 @@ describe('FileHandler', function () {
'./FileConverter': FileConverter, './FileConverter': FileConverter,
'./KeyBuilder': KeyBuilder, './KeyBuilder': KeyBuilder,
'./ImageOptimiser': ImageOptimiser, './ImageOptimiser': ImageOptimiser,
'settings-sharelatex': Settings, '@overleaf/settings': Settings,
'@overleaf/object-persistor': ObjectPersistor, '@overleaf/object-persistor': ObjectPersistor,
fs: fs fs: fs
}, },

View file

@ -8,7 +8,7 @@ describe('KeybuilderTests', function () {
beforeEach(function () { beforeEach(function () {
KeyBuilder = SandboxedModule.require(modulePath, { KeyBuilder = SandboxedModule.require(modulePath, {
requires: { 'settings-sharelatex': {} } requires: { '@overleaf/settings': {} }
}) })
}) })

View file

@ -29,7 +29,7 @@ describe('LocalFileWriter', function () {
requires: { requires: {
fs, fs,
stream, stream,
'settings-sharelatex': settings, '@overleaf/settings': settings,
'@overleaf/metrics': { '@overleaf/metrics': {
inc: sinon.stub(), inc: sinon.stub(),
Timer: sinon.stub().returns({ done: sinon.stub() }) Timer: sinon.stub().returns({ done: sinon.stub() })

View file

@ -17,7 +17,7 @@ describe('SafeExec', function () {
safeExec = SandboxedModule.require(modulePath, { safeExec = SandboxedModule.require(modulePath, {
globals: { process }, globals: { process },
requires: { requires: {
'settings-sharelatex': settings, '@overleaf/settings': settings,
'@overleaf/object-persistor': ObjectPersistor '@overleaf/object-persistor': ObjectPersistor
} }
}) })

View file

@ -12,7 +12,7 @@ describe('Settings', function () {
} }
} }
process.env.S3_BUCKET_CREDENTIALS = JSON.stringify(s3Settings) process.env.S3_BUCKET_CREDENTIALS = JSON.stringify(s3Settings)
const settings = SandboxedModule.require('settings-sharelatex', { const settings = SandboxedModule.require('@overleaf/settings', {
globals: { console, process } globals: { console, process }
}) })
expect(settings.filestore.s3.bucketCreds).to.deep.equal(s3Settings) expect(settings.filestore.s3.bucketCreds).to.deep.equal(s3Settings)