diff --git a/services/clsi/app.js b/services/clsi/app.js index 8dd8a8cbf3..214d20fbab 100644 --- a/services/clsi/app.js +++ b/services/clsi/app.js @@ -11,7 +11,7 @@ Metrics.initialize('clsi') const CompileController = require('./app/js/CompileController') const ContentController = require('./app/js/ContentController') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') logger.initialize('clsi') if ((Settings.sentry != null ? Settings.sentry.dsn : undefined) != null) { diff --git a/services/clsi/app/js/CommandRunner.js b/services/clsi/app/js/CommandRunner.js index 8e07dacf6d..782707b3a8 100644 --- a/services/clsi/app/js/CommandRunner.js +++ b/services/clsi/app/js/CommandRunner.js @@ -6,7 +6,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ let commandRunnerPath -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') if ((Settings.clsi != null ? Settings.clsi.dockerRunner : undefined) === true) { diff --git a/services/clsi/app/js/CompileController.js b/services/clsi/app/js/CompileController.js index 63a4106aa0..acb6626ae8 100644 --- a/services/clsi/app/js/CompileController.js +++ b/services/clsi/app/js/CompileController.js @@ -15,7 +15,7 @@ let CompileController const RequestParser = require('./RequestParser') const CompileManager = require('./CompileManager') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const Metrics = require('./Metrics') const ProjectPersistenceManager = require('./ProjectPersistenceManager') const logger = require('logger-sharelatex') diff --git a/services/clsi/app/js/CompileManager.js b/services/clsi/app/js/CompileManager.js index 765c5e4d8e..f56bfafa32 100644 --- a/services/clsi/app/js/CompileManager.js +++ b/services/clsi/app/js/CompileManager.js @@ -20,7 +20,7 @@ const ResourceWriter = require('./ResourceWriter') const LatexRunner = require('./LatexRunner') const OutputFileFinder = require('./OutputFileFinder') const OutputCacheManager = require('./OutputCacheManager') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const Path = require('path') const logger = require('logger-sharelatex') const Metrics = require('./Metrics') diff --git a/services/clsi/app/js/ContentCacheManager.js b/services/clsi/app/js/ContentCacheManager.js index 34e8a8cd73..7dfc40f0b7 100644 --- a/services/clsi/app/js/ContentCacheManager.js +++ b/services/clsi/app/js/ContentCacheManager.js @@ -6,7 +6,7 @@ const { callbackify } = require('util') const fs = require('fs') const crypto = require('crypto') const Path = require('path') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const OError = require('@overleaf/o-error') const pLimit = require('p-limit') const { parseXrefTable } = require('../lib/pdfjs/parseXrefTable') diff --git a/services/clsi/app/js/ContentController.js b/services/clsi/app/js/ContentController.js index 76478defe8..b154bea175 100644 --- a/services/clsi/app/js/ContentController.js +++ b/services/clsi/app/js/ContentController.js @@ -1,6 +1,6 @@ const Path = require('path') const send = require('send') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const OutputCacheManager = require('./OutputCacheManager') const ONE_DAY_S = 24 * 60 * 60 diff --git a/services/clsi/app/js/DbQueue.js b/services/clsi/app/js/DbQueue.js index 7589370c98..ca2155d230 100644 --- a/services/clsi/app/js/DbQueue.js +++ b/services/clsi/app/js/DbQueue.js @@ -6,7 +6,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const async = require('async') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const queue = async.queue( (task, cb) => task(cb), diff --git a/services/clsi/app/js/DockerRunner.js b/services/clsi/app/js/DockerRunner.js index 0ff8109585..2d0810d14f 100644 --- a/services/clsi/app/js/DockerRunner.js +++ b/services/clsi/app/js/DockerRunner.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const Docker = require('dockerode') const dockerode = new Docker() diff --git a/services/clsi/app/js/LatexRunner.js b/services/clsi/app/js/LatexRunner.js index 4800021932..7cd67a0396 100644 --- a/services/clsi/app/js/LatexRunner.js +++ b/services/clsi/app/js/LatexRunner.js @@ -15,7 +15,7 @@ */ let LatexRunner const Path = require('path') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const Metrics = require('./Metrics') const CommandRunner = require('./CommandRunner') diff --git a/services/clsi/app/js/LockManager.js b/services/clsi/app/js/LockManager.js index 1246cc9848..a3bdf1bcfc 100644 --- a/services/clsi/app/js/LockManager.js +++ b/services/clsi/app/js/LockManager.js @@ -12,7 +12,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 logger = require('logger-sharelatex') const Lockfile = require('lockfile') // from https://github.com/npm/lockfile const Errors = require('./Errors') diff --git a/services/clsi/app/js/OutputCacheManager.js b/services/clsi/app/js/OutputCacheManager.js index 539b1bc99d..682b85aa1a 100644 --- a/services/clsi/app/js/OutputCacheManager.js +++ b/services/clsi/app/js/OutputCacheManager.js @@ -20,7 +20,7 @@ const fse = require('fs-extra') const Path = require('path') const logger = require('logger-sharelatex') const _ = require('lodash') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const crypto = require('crypto') const Metrics = require('./Metrics') diff --git a/services/clsi/app/js/ProjectPersistenceManager.js b/services/clsi/app/js/ProjectPersistenceManager.js index 8145cccd84..814f7e9916 100644 --- a/services/clsi/app/js/ProjectPersistenceManager.js +++ b/services/clsi/app/js/ProjectPersistenceManager.js @@ -20,7 +20,7 @@ const dbQueue = require('./DbQueue') const async = require('async') const logger = require('logger-sharelatex') const oneDay = 24 * 60 * 60 * 1000 -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const diskusage = require('diskusage') const { callbackify } = require('util') diff --git a/services/clsi/app/js/RequestParser.js b/services/clsi/app/js/RequestParser.js index 66c917aeed..702cf5593c 100644 --- a/services/clsi/app/js/RequestParser.js +++ b/services/clsi/app/js/RequestParser.js @@ -18,7 +18,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ let RequestParser -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') module.exports = RequestParser = { VALID_COMPILERS: ['pdflatex', 'latex', 'xelatex', 'lualatex'], diff --git a/services/clsi/app/js/ResourceWriter.js b/services/clsi/app/js/ResourceWriter.js index d8cc2a4cab..25f1b979de 100644 --- a/services/clsi/app/js/ResourceWriter.js +++ b/services/clsi/app/js/ResourceWriter.js @@ -23,7 +23,7 @@ const OutputFileFinder = require('./OutputFileFinder') const ResourceStateManager = require('./ResourceStateManager') const Metrics = require('./Metrics') const logger = require('logger-sharelatex') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const parallelFileDownloads = settings.parallelFileDownloads || 1 diff --git a/services/clsi/app/js/StaticServerForbidSymlinks.js b/services/clsi/app/js/StaticServerForbidSymlinks.js index edde77742c..bcfc5015b3 100644 --- a/services/clsi/app/js/StaticServerForbidSymlinks.js +++ b/services/clsi/app/js/StaticServerForbidSymlinks.js @@ -17,7 +17,7 @@ let ForbidSymlinks const Path = require('path') const fs = require('fs') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const url = require('url') diff --git a/services/clsi/app/js/UrlCache.js b/services/clsi/app/js/UrlCache.js index a8b2b19bea..b6378a5504 100644 --- a/services/clsi/app/js/UrlCache.js +++ b/services/clsi/app/js/UrlCache.js @@ -16,7 +16,7 @@ let UrlCache const db = require('./db') const dbQueue = require('./DbQueue') const UrlFetcher = require('./UrlFetcher') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const crypto = require('crypto') const fs = require('fs') const logger = require('logger-sharelatex') diff --git a/services/clsi/app/js/UrlFetcher.js b/services/clsi/app/js/UrlFetcher.js index adfb55da4c..28155b94be 100644 --- a/services/clsi/app/js/UrlFetcher.js +++ b/services/clsi/app/js/UrlFetcher.js @@ -16,7 +16,7 @@ let UrlFetcher const request = require('request').defaults({ jar: false }) const fs = require('fs') const logger = require('logger-sharelatex') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const URL = require('url') const async = require('async') diff --git a/services/clsi/app/js/db.js b/services/clsi/app/js/db.js index 6b7e50ec9c..135f3a52d4 100644 --- a/services/clsi/app/js/db.js +++ b/services/clsi/app/js/db.js @@ -9,7 +9,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const Sequelize = require('sequelize') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const _ = require('lodash') const logger = require('logger-sharelatex') diff --git a/services/clsi/package-lock.json b/services/clsi/package-lock.json index 418dbab158..77bb2cb4ce 100644 --- a/services/clsi/package-lock.json +++ b/services/clsi/package-lock.json @@ -1022,6 +1022,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", @@ -2065,11 +2070,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": "sha1-gIs5bhEPU9AhoZpO8fZb4OjjX6M=" - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -7047,14 +7047,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", diff --git a/services/clsi/package.json b/services/clsi/package.json index b29aad82eb..8a065d5a5e 100644 --- a/services/clsi/package.json +++ b/services/clsi/package.json @@ -21,6 +21,7 @@ "dependencies": { "@overleaf/metrics": "^3.5.1", "@overleaf/o-error": "^3.3.1", + "@overleaf/settings": "^2.1.1", "async": "3.2.0", "body-parser": "^1.19.0", "bunyan": "^1.8.15", @@ -38,7 +39,6 @@ "request": "^2.88.2", "send": "^0.17.1", "sequelize": "^5.21.5", - "settings-sharelatex": "^1.1.0", "sqlite3": "^4.1.1", "v8-profiler-node8": "^6.1.1", "wrench": "~1.5.9" diff --git a/services/clsi/test/acceptance/js/Stats.js b/services/clsi/test/acceptance/js/Stats.js index 87b20b1cc9..d96a8fcbce 100644 --- a/services/clsi/test/acceptance/js/Stats.js +++ b/services/clsi/test/acceptance/js/Stats.js @@ -1,5 +1,5 @@ const request = require('request') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') after(function (done) { request( { diff --git a/services/clsi/test/acceptance/js/helpers/Client.js b/services/clsi/test/acceptance/js/helpers/Client.js index c5814ff3ef..1da6601efc 100644 --- a/services/clsi/test/acceptance/js/helpers/Client.js +++ b/services/clsi/test/acceptance/js/helpers/Client.js @@ -15,7 +15,7 @@ let Client const request = require('request') const fs = require('fs') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const host = 'localhost' diff --git a/services/clsi/test/acceptance/js/helpers/ClsiApp.js b/services/clsi/test/acceptance/js/helpers/ClsiApp.js index 160b07e51e..343c3c7d95 100644 --- a/services/clsi/test/acceptance/js/helpers/ClsiApp.js +++ b/services/clsi/test/acceptance/js/helpers/ClsiApp.js @@ -15,7 +15,7 @@ const app = require('../../../../app') require('logger-sharelatex').logger.level('info') const logger = require('logger-sharelatex') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') module.exports = { running: false, diff --git a/services/clsi/test/load/js/loadTest.js b/services/clsi/test/load/js/loadTest.js index 65090b8b5f..7e2ae5fa79 100644 --- a/services/clsi/test/load/js/loadTest.js +++ b/services/clsi/test/load/js/loadTest.js @@ -10,7 +10,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const request = require('request') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const async = require('async') const fs = require('fs') const _ = require('lodash') diff --git a/services/clsi/test/smoke/js/SmokeTests.js b/services/clsi/test/smoke/js/SmokeTests.js index 8cfb190b30..8dbdc0a348 100644 --- a/services/clsi/test/smoke/js/SmokeTests.js +++ b/services/clsi/test/smoke/js/SmokeTests.js @@ -1,5 +1,5 @@ const request = require('request') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const buildUrl = (path) => `http://${Settings.internal.clsi.host}:${Settings.internal.clsi.port}/${path}` diff --git a/services/clsi/test/unit/js/CompileControllerTests.js b/services/clsi/test/unit/js/CompileControllerTests.js index 3b29c867c4..e8739379da 100644 --- a/services/clsi/test/unit/js/CompileControllerTests.js +++ b/services/clsi/test/unit/js/CompileControllerTests.js @@ -66,7 +66,7 @@ describe('CompileController', function () { requires: { './CompileManager': (this.CompileManager = {}), './RequestParser': (this.RequestParser = {}), - 'settings-sharelatex': (this.Settings = { + '@overleaf/settings': (this.Settings = { apis: { clsi: { url: 'http://clsi.example.com' diff --git a/services/clsi/test/unit/js/CompileManagerTests.js b/services/clsi/test/unit/js/CompileManagerTests.js index 97e318a4a6..7f4046c2ee 100644 --- a/services/clsi/test/unit/js/CompileManagerTests.js +++ b/services/clsi/test/unit/js/CompileManagerTests.js @@ -31,7 +31,7 @@ describe('CompileManager', function () { './ResourceWriter': (this.ResourceWriter = {}), './OutputFileFinder': (this.OutputFileFinder = {}), './OutputCacheManager': (this.OutputCacheManager = {}), - 'settings-sharelatex': (this.Settings = { + '@overleaf/settings': (this.Settings = { path: { compilesDir: '/compiles/dir', outputDir: '/output/dir' diff --git a/services/clsi/test/unit/js/ContentCacheManagerTests.js b/services/clsi/test/unit/js/ContentCacheManagerTests.js index 76c517d8ce..6e8490babd 100644 --- a/services/clsi/test/unit/js/ContentCacheManagerTests.js +++ b/services/clsi/test/unit/js/ContentCacheManagerTests.js @@ -8,7 +8,7 @@ describe('ContentCacheManager', function () { let contentDir, pdfPath let ContentCacheManager, files, Settings before(function () { - Settings = require('settings-sharelatex') + Settings = require('@overleaf/settings') ContentCacheManager = require(MODULE_PATH) }) let contentRanges, newContentRanges, reclaimed diff --git a/services/clsi/test/unit/js/DockerLockManagerTests.js b/services/clsi/test/unit/js/DockerLockManagerTests.js index 6adfa1231a..f06f1afa0e 100644 --- a/services/clsi/test/unit/js/DockerLockManagerTests.js +++ b/services/clsi/test/unit/js/DockerLockManagerTests.js @@ -20,7 +20,7 @@ describe('LockManager', function () { beforeEach(function () { return (this.LockManager = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.Settings = { clsi: { docker: {} } }) + '@overleaf/settings': (this.Settings = { clsi: { docker: {} } }) } })) }) diff --git a/services/clsi/test/unit/js/DockerRunnerTests.js b/services/clsi/test/unit/js/DockerRunnerTests.js index 67290e440d..b47ed609a9 100644 --- a/services/clsi/test/unit/js/DockerRunnerTests.js +++ b/services/clsi/test/unit/js/DockerRunnerTests.js @@ -28,7 +28,7 @@ describe('DockerRunner', function () { this.container = container = {} this.DockerRunner = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.Settings = { + '@overleaf/settings': (this.Settings = { clsi: { docker: {} }, path: {} }), diff --git a/services/clsi/test/unit/js/LatexRunnerTests.js b/services/clsi/test/unit/js/LatexRunnerTests.js index f763f39cb0..13858ff42a 100644 --- a/services/clsi/test/unit/js/LatexRunnerTests.js +++ b/services/clsi/test/unit/js/LatexRunnerTests.js @@ -23,7 +23,7 @@ describe('LatexRunner', function () { let Timer this.LatexRunner = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.Settings = { + '@overleaf/settings': (this.Settings = { docker: { socketPath: '/var/run/docker.sock' } diff --git a/services/clsi/test/unit/js/LockManagerTests.js b/services/clsi/test/unit/js/LockManagerTests.js index 58580583ca..4f9cc31f21 100644 --- a/services/clsi/test/unit/js/LockManagerTests.js +++ b/services/clsi/test/unit/js/LockManagerTests.js @@ -22,7 +22,7 @@ describe('DockerLockManager', function () { beforeEach(function () { this.LockManager = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': {}, + '@overleaf/settings': {}, fs: { lstat: sinon.stub().callsArgWith(1), readdir: sinon.stub().callsArgWith(1) diff --git a/services/clsi/test/unit/js/ProjectPersistenceManagerTests.js b/services/clsi/test/unit/js/ProjectPersistenceManagerTests.js index e60de54ff3..be8050aa47 100644 --- a/services/clsi/test/unit/js/ProjectPersistenceManagerTests.js +++ b/services/clsi/test/unit/js/ProjectPersistenceManagerTests.js @@ -27,7 +27,7 @@ describe('ProjectPersistenceManager', function () { './UrlCache': (this.UrlCache = {}), './CompileManager': (this.CompileManager = {}), diskusage: (this.diskusage = { check: sinon.stub() }), - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { project_cache_length_ms: 1000, path: { compilesDir: '/compiles', diff --git a/services/clsi/test/unit/js/RequestParserTests.js b/services/clsi/test/unit/js/RequestParserTests.js index ff2ef7a9d1..840e55ddb6 100644 --- a/services/clsi/test/unit/js/RequestParserTests.js +++ b/services/clsi/test/unit/js/RequestParserTests.js @@ -40,7 +40,7 @@ describe('RequestParser', function () { } return (this.RequestParser = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = {}) + '@overleaf/settings': (this.settings = {}) } })) }) diff --git a/services/clsi/test/unit/js/StaticServerForbidSymlinksTests.js b/services/clsi/test/unit/js/StaticServerForbidSymlinksTests.js index 65a66f3dc3..86e279e687 100644 --- a/services/clsi/test/unit/js/StaticServerForbidSymlinksTests.js +++ b/services/clsi/test/unit/js/StaticServerForbidSymlinksTests.js @@ -30,7 +30,7 @@ describe('StaticServerForbidSymlinks', function () { this.fs = {} this.ForbidSymlinks = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, fs: this.fs } }) diff --git a/services/clsi/test/unit/js/UrlCacheTests.js b/services/clsi/test/unit/js/UrlCacheTests.js index 40652c5899..32e175f7ca 100644 --- a/services/clsi/test/unit/js/UrlCacheTests.js +++ b/services/clsi/test/unit/js/UrlCacheTests.js @@ -24,7 +24,7 @@ describe('UrlCache', function () { requires: { './db': {}, './UrlFetcher': (this.UrlFetcher = {}), - 'settings-sharelatex': (this.Settings = { + '@overleaf/settings': (this.Settings = { path: { clsiCacheDir: '/cache/dir' } }), fs: (this.fs = { copyFile: sinon.stub().yields() }) diff --git a/services/clsi/test/unit/js/UrlFetcherTests.js b/services/clsi/test/unit/js/UrlFetcherTests.js index 6a5bc1f3dd..ac94540f70 100644 --- a/services/clsi/test/unit/js/UrlFetcherTests.js +++ b/services/clsi/test/unit/js/UrlFetcherTests.js @@ -24,7 +24,7 @@ describe('UrlFetcher', function () { defaults: (this.defaults = sinon.stub().returns((this.request = {}))) }, fs: (this.fs = {}), - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { apis: { clsiPerf: { host: 'localhost:3043'