From 5e773ce9505eedbdef04c2f1d44d6374706b6387 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Wed, 7 Jul 2021 11:38:56 +0200 Subject: [PATCH] Merge pull request #4101 from overleaf/ae-settings-module Migrate from `settings-sharelatex` to `@overleaf/settings` GitOrigin-RevId: 9a298ba26382180c1351683c5fddc9004418c1e6 --- services/web/app.js | 2 +- .../Features/Analytics/AnalyticsManager.js | 2 +- .../src/Features/Analytics/AnalyticsProxy.js | 2 +- .../AuthenticationController.js | 2 +- .../Authentication/AuthenticationManager.js | 2 +- .../BetaProgram/BetaProgramController.js | 2 +- .../BrandVariations/BrandVariationsHandler.js | 2 +- .../src/Features/Captcha/CaptchaMiddleware.js | 2 +- .../app/src/Features/Chat/ChatApiHandler.js | 2 +- .../CollaboratorsEmailHandler.js | 2 +- .../CollaboratorsInviteController.js | 2 +- .../src/Features/Compile/ClsiCookieManager.js | 2 +- .../src/Features/Compile/ClsiFormatChecker.js | 2 +- .../app/src/Features/Compile/ClsiManager.js | 2 +- .../src/Features/Compile/ClsiStateManager.js | 2 +- .../src/Features/Compile/CompileController.js | 2 +- .../src/Features/Compile/CompileManager.js | 2 +- .../src/Features/Contacts/ContactManager.js | 2 +- .../src/Features/Contacts/ContactRouter.js | 2 +- .../src/Features/Docstore/DocstoreManager.js | 2 +- .../DocumentUpdater/DocumentUpdaterHandler.js | 2 +- .../Editor/EditorRealTimeController.js | 2 +- .../app/src/Features/Email/EmailBuilder.js | 2 +- .../app/src/Features/Email/EmailHandler.js | 2 +- .../web/app/src/Features/Email/EmailSender.js | 2 +- .../Layouts/BaseWithHeaderEmailLayout.js | 2 +- .../web/app/src/Features/Errors/Errors.js | 2 +- .../src/Features/Errors/HttpErrorHandler.js | 2 +- .../src/Features/Exports/ExportsHandler.js | 4 ++-- .../Features/FileStore/FileStoreHandler.js | 2 +- .../HealthCheck/HealthCheckController.js | 2 +- .../web/app/src/Features/Helpers/NewLogsUI.js | 2 +- .../web/app/src/Features/Helpers/UrlHelper.js | 2 +- .../src/Features/History/HistoryController.js | 2 +- .../src/Features/History/HistoryManager.js | 2 +- .../src/Features/History/RestoreManager.js | 2 +- .../Features/Institutions/InstitutionsAPI.js | 2 +- .../Institutions/InstitutionsFeatures.js | 2 +- .../LinkedFiles/LinkedFilesController.js | 2 +- .../Features/LinkedFiles/ProjectFileAgent.js | 2 +- .../LinkedFiles/ProjectOutputFileAgent.js | 2 +- .../Features/Newsletter/NewsletterManager.js | 2 +- .../Notifications/NotificationsBuilder.js | 2 +- .../Notifications/NotificationsHandler.js | 2 +- .../PasswordReset/PasswordResetHandler.js | 2 +- .../src/Features/Project/ProjectController.js | 2 +- .../Project/ProjectCreationHandler.js | 2 +- .../Features/Project/ProjectDetailsHandler.js | 2 +- .../ProjectEntityMongoUpdateHandler.js | 2 +- .../Project/ProjectEntityUpdateHandler.js | 2 +- .../app/src/Features/Project/ProjectHelper.js | 2 +- .../Features/Project/ProjectHistoryHandler.js | 2 +- .../Features/Project/ProjectOptionsHandler.js | 2 +- .../src/Features/Referal/ReferalFeatures.js | 2 +- .../References/ReferencesController.js | 2 +- .../Features/References/ReferencesHandler.js | 2 +- .../Security/RateLimiterMiddleware.js | 2 +- .../Features/ServerAdmin/AdminController.js | 2 +- .../Features/Spelling/SpellingController.js | 2 +- .../src/Features/Spelling/SpellingHandler.js | 2 +- .../Features/SplitTests/SplitTestHandler.js | 2 +- .../StaticPages/UniversityController.js | 4 ++-- .../Features/Subscription/FeaturesUpdater.js | 2 +- .../Features/Subscription/GroupPlansData.js | 2 +- .../Subscription/LimitationsManager.js | 2 +- .../src/Features/Subscription/PlansLocator.js | 2 +- .../Features/Subscription/RecurlyClient.js | 2 +- .../Features/Subscription/RecurlyWrapper.js | 2 +- .../Subscription/SubscriptionController.js | 2 +- .../Subscription/SubscriptionFormatters.js | 2 +- .../Subscription/SubscriptionGroupHandler.js | 2 +- .../Subscription/SubscriptionRouter.js | 2 +- .../SubscriptionViewModelBuilder.js | 2 +- .../Subscription/TeamInvitesController.js | 2 +- .../Subscription/TeamInvitesHandler.js | 2 +- .../Subscription/V1SubscriptionManager.js | 2 +- .../SystemMessages/SystemMessageController.js | 2 +- .../Features/Templates/TemplatesManager.js | 2 +- .../Features/Templates/TemplatesMiddleware.js | 2 +- .../ThirdPartyDataStore/TpdsQueueManager.js | 2 +- .../ThirdPartyDataStore/TpdsUpdateSender.js | 2 +- .../TokenAccess/TokenAccessController.js | 2 +- .../TokenAccess/TokenAccessHandler.js | 2 +- .../src/Features/Uploads/ArchiveManager.js | 2 +- .../src/Features/Uploads/FileTypeManager.js | 2 +- .../Uploads/ProjectUploadController.js | 2 +- .../app/src/Features/Uploads/UploadsRouter.js | 2 +- .../User/ThirdPartyIdentityManager.js | 2 +- .../User/UserEmailsConfirmationHandler.js | 2 +- .../web/app/src/Features/User/UserGetter.js | 2 +- .../src/Features/User/UserPagesController.js | 2 +- .../Features/User/UserRegistrationHandler.js | 2 +- .../src/Features/User/UserSessionsManager.js | 2 +- services/web/app/src/Features/V1/V1Api.js | 2 +- services/web/app/src/Features/V1/V1Handler.js | 2 +- .../app/src/infrastructure/ExpressLocals.js | 2 +- .../web/app/src/infrastructure/Features.js | 2 +- .../web/app/src/infrastructure/FileWriter.js | 2 +- .../web/app/src/infrastructure/GeoIpLookup.js | 2 +- .../app/src/infrastructure/JsonWebToken.js | 2 +- .../web/app/src/infrastructure/LockManager.js | 2 +- .../web/app/src/infrastructure/Modules.js | 2 +- .../web/app/src/infrastructure/Mongoose.js | 2 +- .../app/src/infrastructure/ProxyManager.js | 2 +- services/web/app/src/infrastructure/Queues.js | 2 +- .../web/app/src/infrastructure/RateLimiter.js | 2 +- .../app/src/infrastructure/RedirectManager.js | 2 +- .../app/src/infrastructure/RedisWrapper.js | 2 +- services/web/app/src/infrastructure/Server.js | 2 +- .../SessionAutostartMiddleware.js | 2 +- .../app/src/infrastructure/Translations.js | 2 +- .../UnsupportedBrowserMiddleware.js | 2 +- services/web/app/src/infrastructure/Views.js | 2 +- .../web/app/src/infrastructure/mongodb.js | 2 +- services/web/app/src/models/Institution.js | 2 +- services/web/app/src/models/Publisher.js | 2 +- services/web/app/src/models/User.js | 2 +- services/web/app/src/router.js | 2 +- .../macros/import-overleaf-module.macro.js | 2 +- .../launchpad/app/src/LaunchpadController.js | 2 +- .../launchpad/app/src/LaunchpadRouter.js | 2 +- .../test/unit/src/LaunchpadControllerTests.js | 2 +- .../app/src/UserActivateRouter.js | 2 +- services/web/package-lock.json | 20 +++++-------------- services/web/package.json | 3 +-- services/web/scripts/set_tex_live_image.js | 2 +- .../web/test/acceptance/src/ApiClsiTests.js | 2 +- .../test/acceptance/src/AuthorizationTests.js | 2 +- .../acceptance/src/BodyParserErrorsTest.js | 2 +- .../web/test/acceptance/src/CloseSiteTests.js | 2 +- .../web/test/acceptance/src/DeletionTests.js | 2 +- .../web/test/acceptance/src/DocUpdateTests.js | 2 +- .../acceptance/src/FeatureUpdaterTests.js | 2 +- .../src/HealthCheckControllerTests.js | 2 +- .../test/acceptance/src/LinkedFilesTests.js | 2 +- .../src/ProjectDuplicateNameTests.js | 2 +- .../acceptance/src/ProjectFeaturesTests.js | 2 +- .../test/acceptance/src/ProjectInviteTests.js | 2 +- .../acceptance/src/ProjectStructureTests.js | 2 +- .../src/SubscriptionDeletionTests.js | 2 +- .../test/acceptance/src/TokenAccessTests.js | 2 +- .../src/UserThirdPartyIdentityTests.js | 2 +- .../web/test/acceptance/src/helpers/User.js | 2 +- .../test/acceptance/src/helpers/UserHelper.js | 2 +- .../web/test/acceptance/src/helpers/redis.js | 2 +- services/web/test/smoke/src/SmokeTests.js | 2 +- .../smoke/src/steps/001_clearRateLimits.js | 2 +- .../web/test/smoke/src/steps/002_login.js | 2 +- .../test/smoke/src/steps/101_loadEditor.js | 2 +- .../test/smoke/src/support/requestHelper.js | 2 +- services/web/test/unit/bootstrap.js | 16 --------------- .../src/Analytics/AnalyticsManagerTests.js | 2 +- .../AuthenticationControllerTests.js | 2 +- .../AuthenticationManagerTests.js | 2 +- .../AuthorizationManagerTests.js | 2 +- .../BetaProgram/BetaProgramControllerTests.js | 2 +- .../BrandVariationsHandlerTests.js | 2 +- .../test/unit/src/Chat/ChatApiHandlerTests.js | 2 +- .../test/unit/src/Chat/ChatControllerTests.js | 2 +- .../CollaboratorsInviteControllerTests.js | 2 +- .../CollaboratorsInviteHandlerTests.js | 2 +- .../src/Compile/ClsiCookieManagerTests.js | 2 +- .../src/Compile/ClsiFormatCheckerTests.js | 4 +++- .../test/unit/src/Compile/ClsiManagerTests.js | 2 +- .../unit/src/Compile/ClsiStateManagerTests.js | 2 +- .../src/Compile/CompileControllerTests.js | 2 +- .../unit/src/Compile/CompileManagerTests.js | 2 +- .../unit/src/Contact/ContactManagerTests.js | 2 +- .../unit/src/Docstore/DocstoreManagerTests.js | 2 +- .../DocumentUpdaterHandlerTests.js | 2 +- .../Editor/EditorRealTimeControllerTests.js | 2 +- .../test/unit/src/Email/EmailBuilderTests.js | 2 +- .../test/unit/src/Email/EmailHandlerTests.js | 2 +- .../test/unit/src/Email/EmailSenderTests.js | 2 +- .../unit/src/Errors/HttpErrorHandlerTests.js | 2 +- .../unit/src/Exports/ExportsHandlerTests.js | 2 +- .../src/FileStore/FileStoreControllerTests.js | 2 +- .../src/FileStore/FileStoreHandlerTests.js | 2 +- .../unit/src/HelperFiles/NewLogsUITests.js | 2 +- .../unit/src/HelperFiles/UrlHelperTests.js | 2 +- .../src/History/HistoryControllerTests.js | 2 +- .../unit/src/History/HistoryManagerTests.js | 2 +- .../unit/src/History/RestoreManagerTests.js | 2 +- .../InactiveProjectManagerTests.js | 2 +- .../src/Institutions/InstitutionsAPITests.js | 2 +- .../Institutions/InstitutionsFeaturesTests.js | 2 +- .../src/Newsletter/NewsletterManagerTests.js | 2 +- .../NotificationsBuilderTests.js | 2 +- .../NotificationsHandlerTests.js | 2 +- .../PasswordResetControllerTests.js | 2 +- .../PasswordResetHandlerTests.js | 2 +- .../src/Project/ProjectControllerTests.js | 2 +- .../src/Project/ProjectDetailsHandlerTests.js | 2 +- .../ProjectEntityMongoUpdateHandlerTests.js | 2 +- .../ProjectEntityUpdateHandlerTests.js | 2 +- .../unit/src/Project/ProjectHelperTests.js | 2 +- .../src/Project/ProjectHistoryHandlerTests.js | 2 +- .../src/Project/ProjectOptionsHandlerTests.js | 2 +- .../unit/src/Referal/ReferalAllocatorTests.js | 2 +- .../unit/src/Referal/ReferalFeaturesTests.js | 2 +- .../References/ReferencesControllerTests.js | 2 +- .../src/References/ReferencesHandlerTests.js | 2 +- .../src/Security/OneTimeTokenHandlerTests.js | 2 +- .../Security/RateLimiterMiddlewareTests.js | 2 +- .../SessionAutostartMiddlewareTests.js | 2 +- .../test/unit/src/Settings/SettingsTests.js | 4 ++-- .../src/Spelling/SpellingControllerTests.js | 2 +- .../unit/src/Spelling/SpellingHandlerTests.js | 2 +- .../src/Subscription/FeaturesUpdaterTests.js | 2 +- .../Subscription/LimitationsManagerTests.js | 2 +- .../src/Subscription/PlansLocatorTests.js | 2 +- .../src/Subscription/RecurlyClientTests.js | 2 +- .../src/Subscription/RecurlyWrapperTests.js | 2 +- .../SubscriptionControllerTests.js | 2 +- .../SubscriptionGroupHandlerTests.js | 2 +- .../Subscription/SubscriptionHandlerTests.js | 2 +- .../Subscription/SubscriptionUpdaterTests.js | 2 +- .../Subscription/TeamInvitesHandlerTests.js | 2 +- .../V1SusbcriptionManagerTests.js | 2 +- .../src/Templates/TemplatesManagerTests.js | 2 +- .../TpdsUpdateSenderTests.js | 2 +- .../ThirdPartyDataStore/UpdateMergerTests.js | 2 +- .../TokenAccess/TokenAccessHandlerTests.js | 2 +- .../unit/src/Uploads/ArchiveManagerTests.js | 2 +- .../Uploads/FileSystemImportManagerTests.js | 2 +- .../unit/src/Uploads/FileTypeManagerTests.js | 4 ++-- .../Uploads/ProjectUploadControllerTests.js | 2 +- .../User/ThirdPartyIdentityManagerTests.js | 2 +- .../test/unit/src/User/UserControllerTests.js | 2 +- .../UserEmailsConfirmationHandlerTests.js | 2 +- .../web/test/unit/src/User/UserGetterTests.js | 2 +- .../unit/src/User/UserPagesControllerTests.js | 2 +- .../src/User/UserRegistrationHandlerTests.js | 2 +- .../unit/src/User/UserSessionsManagerTests.js | 2 +- .../test/unit/src/User/UserUpdaterTests.js | 2 +- .../unit/src/infrastructure/FeaturesTests.js | 2 +- .../src/infrastructure/GeoIpLookupTest.js | 2 +- .../LockManager/ReleasingTheLock.js | 2 +- .../LockManager/getLockTests.js | 2 +- .../LockManager/tryLockTests.js | 2 +- .../src/infrastructure/ProxyManagerTests.js | 2 +- .../src/infrastructure/TranslationsTests.js | 2 +- 242 files changed, 251 insertions(+), 276 deletions(-) diff --git a/services/web/app.js b/services/web/app.js index f6ccd2cb17..927e5f9060 100644 --- a/services/web/app.js +++ b/services/web/app.js @@ -11,7 +11,7 @@ */ const metrics = require('@overleaf/metrics') metrics.initialize(process.env.METRICS_APP_NAME || 'web') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const PlansLocator = require('./app/src/Features/Subscription/PlansLocator') logger.initialize(process.env.METRICS_APP_NAME || 'web') diff --git a/services/web/app/src/Features/Analytics/AnalyticsManager.js b/services/web/app/src/Features/Analytics/AnalyticsManager.js index a0ac8f1b4f..278ea4691c 100644 --- a/services/web/app/src/Features/Analytics/AnalyticsManager.js +++ b/services/web/app/src/Features/Analytics/AnalyticsManager.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const Metrics = require('../../infrastructure/Metrics') const Queues = require('../../infrastructure/Queues') diff --git a/services/web/app/src/Features/Analytics/AnalyticsProxy.js b/services/web/app/src/Features/Analytics/AnalyticsProxy.js index 707f58f1aa..b1c19008a4 100644 --- a/services/web/app/src/Features/Analytics/AnalyticsProxy.js +++ b/services/web/app/src/Features/Analytics/AnalyticsProxy.js @@ -1,4 +1,4 @@ -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const Errors = require('../Errors/Errors') const httpProxy = require('express-http-proxy') const URL = require('url') diff --git a/services/web/app/src/Features/Authentication/AuthenticationController.js b/services/web/app/src/Features/Authentication/AuthenticationController.js index 8d04fa07d3..31c07acdb5 100644 --- a/services/web/app/src/Features/Authentication/AuthenticationController.js +++ b/services/web/app/src/Features/Authentication/AuthenticationController.js @@ -5,7 +5,7 @@ const UserUpdater = require('../User/UserUpdater') const Metrics = require('@overleaf/metrics') const logger = require('logger-sharelatex') const querystring = require('querystring') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const basicAuth = require('basic-auth-connect') const crypto = require('crypto') const UserHandler = require('../User/UserHandler') diff --git a/services/web/app/src/Features/Authentication/AuthenticationManager.js b/services/web/app/src/Features/Authentication/AuthenticationManager.js index 3d4f1f075f..0aa903803e 100644 --- a/services/web/app/src/Features/Authentication/AuthenticationManager.js +++ b/services/web/app/src/Features/Authentication/AuthenticationManager.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { User } = require('../../models/User') const { db, ObjectId } = require('../../infrastructure/mongodb') const bcrypt = require('bcrypt') diff --git a/services/web/app/src/Features/BetaProgram/BetaProgramController.js b/services/web/app/src/Features/BetaProgram/BetaProgramController.js index 52ec73787f..4f0f8c5ea8 100644 --- a/services/web/app/src/Features/BetaProgram/BetaProgramController.js +++ b/services/web/app/src/Features/BetaProgram/BetaProgramController.js @@ -1,7 +1,7 @@ const BetaProgramHandler = require('./BetaProgramHandler') const OError = require('@overleaf/o-error') const UserGetter = require('../User/UserGetter') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const AuthenticationController = require('../Authentication/AuthenticationController') diff --git a/services/web/app/src/Features/BrandVariations/BrandVariationsHandler.js b/services/web/app/src/Features/BrandVariations/BrandVariationsHandler.js index 0d0926295a..350c822488 100644 --- a/services/web/app/src/Features/BrandVariations/BrandVariationsHandler.js +++ b/services/web/app/src/Features/BrandVariations/BrandVariationsHandler.js @@ -1,6 +1,6 @@ const OError = require('@overleaf/o-error') const url = require('url') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const V1Api = require('../V1/V1Api') const sanitizeHtml = require('sanitize-html') diff --git a/services/web/app/src/Features/Captcha/CaptchaMiddleware.js b/services/web/app/src/Features/Captcha/CaptchaMiddleware.js index a50f426a5e..fa5c3d12e5 100644 --- a/services/web/app/src/Features/Captcha/CaptchaMiddleware.js +++ b/services/web/app/src/Features/Captcha/CaptchaMiddleware.js @@ -13,7 +13,7 @@ let CaptchaMiddleware const request = require('request') const logger = require('logger-sharelatex') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') module.exports = CaptchaMiddleware = { validateCaptcha(action) { diff --git a/services/web/app/src/Features/Chat/ChatApiHandler.js b/services/web/app/src/Features/Chat/ChatApiHandler.js index 66daffb9cc..8afe7319fa 100644 --- a/services/web/app/src/Features/Chat/ChatApiHandler.js +++ b/services/web/app/src/Features/Chat/ChatApiHandler.js @@ -14,7 +14,7 @@ let ChatApiHandler const OError = require('@overleaf/o-error') const request = require('request') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') module.exports = ChatApiHandler = { _apiRequest(opts, callback) { diff --git a/services/web/app/src/Features/Collaborators/CollaboratorsEmailHandler.js b/services/web/app/src/Features/Collaborators/CollaboratorsEmailHandler.js index a92c81bc1e..4311532571 100644 --- a/services/web/app/src/Features/Collaborators/CollaboratorsEmailHandler.js +++ b/services/web/app/src/Features/Collaborators/CollaboratorsEmailHandler.js @@ -13,7 +13,7 @@ let CollaboratorsEmailHandler const { Project } = require('../../models/Project') const EmailHandler = require('../Email/EmailHandler') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') module.exports = CollaboratorsEmailHandler = { _buildInviteUrl(project, invite) { diff --git a/services/web/app/src/Features/Collaborators/CollaboratorsInviteController.js b/services/web/app/src/Features/Collaborators/CollaboratorsInviteController.js index 84aa26e338..a7fbb6fdd3 100644 --- a/services/web/app/src/Features/Collaborators/CollaboratorsInviteController.js +++ b/services/web/app/src/Features/Collaborators/CollaboratorsInviteController.js @@ -20,7 +20,7 @@ const UserGetter = require('../User/UserGetter') const CollaboratorsGetter = require('./CollaboratorsGetter') const CollaboratorsInviteHandler = require('./CollaboratorsInviteHandler') const logger = require('logger-sharelatex') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const EmailHelper = require('../Helpers/EmailHelper') const EditorRealTimeController = require('../Editor/EditorRealTimeController') const AnalyticsManager = require('../Analytics/AnalyticsManager') diff --git a/services/web/app/src/Features/Compile/ClsiCookieManager.js b/services/web/app/src/Features/Compile/ClsiCookieManager.js index bd38d20f94..2e529a16fd 100644 --- a/services/web/app/src/Features/Compile/ClsiCookieManager.js +++ b/services/web/app/src/Features/Compile/ClsiCookieManager.js @@ -13,7 +13,7 @@ */ let rclient_secondary const OError = require('@overleaf/o-error') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const request = require('request').defaults({ timeout: 30 * 1000 }) const RedisWrapper = require('../../infrastructure/RedisWrapper') const rclient = RedisWrapper.client('clsi_cookie') diff --git a/services/web/app/src/Features/Compile/ClsiFormatChecker.js b/services/web/app/src/Features/Compile/ClsiFormatChecker.js index 902be1f38c..cc91a2a32b 100644 --- a/services/web/app/src/Features/Compile/ClsiFormatChecker.js +++ b/services/web/app/src/Features/Compile/ClsiFormatChecker.js @@ -12,7 +12,7 @@ let ClsiFormatChecker const _ = require('lodash') const async = require('async') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') module.exports = ClsiFormatChecker = { checkRecoursesForProblems(resources, callback) { diff --git a/services/web/app/src/Features/Compile/ClsiManager.js b/services/web/app/src/Features/Compile/ClsiManager.js index 2e96a8b3ae..baadf34496 100644 --- a/services/web/app/src/Features/Compile/ClsiManager.js +++ b/services/web/app/src/Features/Compile/ClsiManager.js @@ -1,5 +1,5 @@ const async = require('async') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const request = require('request') const ProjectGetter = require('../Project/ProjectGetter') const ProjectEntityHandler = require('../Project/ProjectEntityHandler') diff --git a/services/web/app/src/Features/Compile/ClsiStateManager.js b/services/web/app/src/Features/Compile/ClsiStateManager.js index b5ac0a85ac..f19624373e 100644 --- a/services/web/app/src/Features/Compile/ClsiStateManager.js +++ b/services/web/app/src/Features/Compile/ClsiStateManager.js @@ -14,7 +14,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ let ClsiStateManager -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const crypto = require('crypto') const ProjectEntityHandler = require('../Project/ProjectEntityHandler') diff --git a/services/web/app/src/Features/Compile/CompileController.js b/services/web/app/src/Features/Compile/CompileController.js index ef8511bedf..15cd0e725d 100644 --- a/services/web/app/src/Features/Compile/CompileController.js +++ b/services/web/app/src/Features/Compile/CompileController.js @@ -22,7 +22,7 @@ const ClsiManager = require('./ClsiManager') const logger = require('logger-sharelatex') const request = require('request') const sanitize = require('sanitizer') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const AuthenticationController = require('../Authentication/AuthenticationController') const UserGetter = require('../User/UserGetter') const RateLimiter = require('../../infrastructure/RateLimiter') diff --git a/services/web/app/src/Features/Compile/CompileManager.js b/services/web/app/src/Features/Compile/CompileManager.js index 43e96f7332..c4c7bd3561 100644 --- a/services/web/app/src/Features/Compile/CompileManager.js +++ b/services/web/app/src/Features/Compile/CompileManager.js @@ -14,7 +14,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ let CompileManager -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const RedisWrapper = require('../../infrastructure/RedisWrapper') const rclient = RedisWrapper.client('clsi_recently_compiled') const ProjectGetter = require('../Project/ProjectGetter') diff --git a/services/web/app/src/Features/Contacts/ContactManager.js b/services/web/app/src/Features/Contacts/ContactManager.js index aa07c5d52c..11caf6c1eb 100644 --- a/services/web/app/src/Features/Contacts/ContactManager.js +++ b/services/web/app/src/Features/Contacts/ContactManager.js @@ -15,7 +15,7 @@ let ContactManager const OError = require('@overleaf/o-error') const request = require('request') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') module.exports = ContactManager = { getContactIds(user_id, options, callback) { diff --git a/services/web/app/src/Features/Contacts/ContactRouter.js b/services/web/app/src/Features/Contacts/ContactRouter.js index 43b8fc879c..e1a73eba8b 100644 --- a/services/web/app/src/Features/Contacts/ContactRouter.js +++ b/services/web/app/src/Features/Contacts/ContactRouter.js @@ -1,6 +1,6 @@ const AuthenticationController = require('../Authentication/AuthenticationController') const ContactController = require('./ContactController') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') function contactsAuthenticationMiddleware() { if (!Settings.allowAnonymousReadAndWriteSharing) { diff --git a/services/web/app/src/Features/Docstore/DocstoreManager.js b/services/web/app/src/Features/Docstore/DocstoreManager.js index 244dfbe15a..f7327a5f3a 100644 --- a/services/web/app/src/Features/Docstore/DocstoreManager.js +++ b/services/web/app/src/Features/Docstore/DocstoreManager.js @@ -15,7 +15,7 @@ const request = require('request').defaults({ jar: false }) const OError = require('@overleaf/o-error') const logger = require('logger-sharelatex') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const Errors = require('../Errors/Errors') const { promisifyAll } = require('../../util/promises') diff --git a/services/web/app/src/Features/DocumentUpdater/DocumentUpdaterHandler.js b/services/web/app/src/Features/DocumentUpdater/DocumentUpdaterHandler.js index 22cefc9fc2..3aa5eacc75 100644 --- a/services/web/app/src/Features/DocumentUpdater/DocumentUpdaterHandler.js +++ b/services/web/app/src/Features/DocumentUpdater/DocumentUpdaterHandler.js @@ -1,6 +1,6 @@ const request = require('request').defaults({ timeout: 30 * 100 }) const OError = require('@overleaf/o-error') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const _ = require('underscore') const async = require('async') const logger = require('logger-sharelatex') diff --git a/services/web/app/src/Features/Editor/EditorRealTimeController.js b/services/web/app/src/Features/Editor/EditorRealTimeController.js index ce6f52d920..6f551950fd 100644 --- a/services/web/app/src/Features/Editor/EditorRealTimeController.js +++ b/services/web/app/src/Features/Editor/EditorRealTimeController.js @@ -12,7 +12,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ let EditorRealTimeController -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const Metrics = require('@overleaf/metrics') const RedisWrapper = require('../../infrastructure/RedisWrapper') const rclient = RedisWrapper.client('pubsub') diff --git a/services/web/app/src/Features/Email/EmailBuilder.js b/services/web/app/src/Features/Email/EmailBuilder.js index d79318ee75..4ba27d0cab 100644 --- a/services/web/app/src/Features/Email/EmailBuilder.js +++ b/services/web/app/src/Features/Email/EmailBuilder.js @@ -1,5 +1,5 @@ const _ = require('underscore') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const moment = require('moment') const EmailMessageHelper = require('./EmailMessageHelper') const StringHelper = require('../Helpers/StringHelper') diff --git a/services/web/app/src/Features/Email/EmailHandler.js b/services/web/app/src/Features/Email/EmailHandler.js index 3cc40bb088..6c17752f8b 100644 --- a/services/web/app/src/Features/Email/EmailHandler.js +++ b/services/web/app/src/Features/Email/EmailHandler.js @@ -1,5 +1,5 @@ const { callbackify } = require('util') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const EmailBuilder = require('./EmailBuilder') const EmailSender = require('./EmailSender') diff --git a/services/web/app/src/Features/Email/EmailSender.js b/services/web/app/src/Features/Email/EmailSender.js index f3a049937b..ff2bc0f2c5 100644 --- a/services/web/app/src/Features/Email/EmailSender.js +++ b/services/web/app/src/Features/Email/EmailSender.js @@ -1,7 +1,7 @@ const { callbackify } = require('util') const logger = require('logger-sharelatex') const metrics = require('@overleaf/metrics') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const nodemailer = require('nodemailer') const sesTransport = require('nodemailer-ses-transport') const mandrillTransport = require('nodemailer-mandrill-transport') diff --git a/services/web/app/src/Features/Email/Layouts/BaseWithHeaderEmailLayout.js b/services/web/app/src/Features/Email/Layouts/BaseWithHeaderEmailLayout.js index 98f86d9628..851ca417ba 100644 --- a/services/web/app/src/Features/Email/Layouts/BaseWithHeaderEmailLayout.js +++ b/services/web/app/src/Features/Email/Layouts/BaseWithHeaderEmailLayout.js @@ -1,5 +1,5 @@ const _ = require('underscore') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') module.exports = _.template(`\ `.${ext}`), diff --git a/services/web/app/src/Features/Uploads/ProjectUploadController.js b/services/web/app/src/Features/Uploads/ProjectUploadController.js index 6aa78cbae5..fc1188b6b1 100644 --- a/services/web/app/src/Features/Uploads/ProjectUploadController.js +++ b/services/web/app/src/Features/Uploads/ProjectUploadController.js @@ -19,7 +19,7 @@ const Path = require('path') const FileSystemImportManager = require('./FileSystemImportManager') const ProjectUploadManager = require('./ProjectUploadManager') const AuthenticationController = require('../Authentication/AuthenticationController') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { InvalidZipFileError } = require('./ArchiveErrors') const multer = require('multer') diff --git a/services/web/app/src/Features/Uploads/UploadsRouter.js b/services/web/app/src/Features/Uploads/UploadsRouter.js index f23aad73fb..575114bba9 100644 --- a/services/web/app/src/Features/Uploads/UploadsRouter.js +++ b/services/web/app/src/Features/Uploads/UploadsRouter.js @@ -2,7 +2,7 @@ const AuthorizationMiddleware = require('../Authorization/AuthorizationMiddlewar const AuthenticationController = require('../Authentication/AuthenticationController') const ProjectUploadController = require('./ProjectUploadController') const RateLimiterMiddleware = require('../Security/RateLimiterMiddleware') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') module.exports = { apply(webRouter, apiRouter) { diff --git a/services/web/app/src/Features/User/ThirdPartyIdentityManager.js b/services/web/app/src/Features/User/ThirdPartyIdentityManager.js index 7320eb44fa..c1054d8741 100644 --- a/services/web/app/src/Features/User/ThirdPartyIdentityManager.js +++ b/services/web/app/src/Features/User/ThirdPartyIdentityManager.js @@ -6,7 +6,7 @@ const Errors = require('../Errors/Errors') const _ = require('lodash') const logger = require('logger-sharelatex') const OError = require('@overleaf/o-error') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const { User } = require(`${APP_ROOT}/models/User`) const { promisifyAll } = require(`${APP_ROOT}/util/promises`) diff --git a/services/web/app/src/Features/User/UserEmailsConfirmationHandler.js b/services/web/app/src/Features/User/UserEmailsConfirmationHandler.js index a60cd6ccd8..f204482d54 100644 --- a/services/web/app/src/Features/User/UserEmailsConfirmationHandler.js +++ b/services/web/app/src/Features/User/UserEmailsConfirmationHandler.js @@ -1,7 +1,7 @@ const EmailHelper = require('../Helpers/EmailHelper') const EmailHandler = require('../Email/EmailHandler') const OneTimeTokenHandler = require('../Security/OneTimeTokenHandler') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const Errors = require('../Errors/Errors') const UserUpdater = require('./UserUpdater') const UserGetter = require('./UserGetter') diff --git a/services/web/app/src/Features/User/UserGetter.js b/services/web/app/src/Features/User/UserGetter.js index 192abdc052..0b1f4f39c9 100644 --- a/services/web/app/src/Features/User/UserGetter.js +++ b/services/web/app/src/Features/User/UserGetter.js @@ -3,7 +3,7 @@ const { db } = require('../../infrastructure/mongodb') const metrics = require('@overleaf/metrics') const logger = require('logger-sharelatex') const moment = require('moment') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const { promisifyAll } = require('../../util/promises') const { promises: InstitutionsAPIPromises, diff --git a/services/web/app/src/Features/User/UserPagesController.js b/services/web/app/src/Features/User/UserPagesController.js index 299e0cdd9f..d775b58ef9 100644 --- a/services/web/app/src/Features/User/UserPagesController.js +++ b/services/web/app/src/Features/User/UserPagesController.js @@ -2,7 +2,7 @@ const UserGetter = require('./UserGetter') const OError = require('@overleaf/o-error') const UserSessionsManager = require('./UserSessionsManager') const logger = require('logger-sharelatex') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const AuthenticationController = require('../Authentication/AuthenticationController') const _ = require('lodash') diff --git a/services/web/app/src/Features/User/UserRegistrationHandler.js b/services/web/app/src/Features/User/UserRegistrationHandler.js index c72f6169cd..d935e4cd7b 100644 --- a/services/web/app/src/Features/User/UserRegistrationHandler.js +++ b/services/web/app/src/Features/User/UserRegistrationHandler.js @@ -9,7 +9,7 @@ const crypto = require('crypto') const EmailHandler = require('../Email/EmailHandler') const OneTimeTokenHandler = require('../Security/OneTimeTokenHandler') const Analytics = require('../Analytics/AnalyticsManager') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const EmailHelper = require('../Helpers/EmailHelper') const UserRegistrationHandler = { diff --git a/services/web/app/src/Features/User/UserSessionsManager.js b/services/web/app/src/Features/User/UserSessionsManager.js index 94b46134c2..ce1abf1f0c 100644 --- a/services/web/app/src/Features/User/UserSessionsManager.js +++ b/services/web/app/src/Features/User/UserSessionsManager.js @@ -1,5 +1,5 @@ const OError = require('@overleaf/o-error') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const Async = require('async') const _ = require('underscore') diff --git a/services/web/app/src/Features/V1/V1Api.js b/services/web/app/src/Features/V1/V1Api.js index e21d614454..df86d22f3d 100644 --- a/services/web/app/src/Features/V1/V1Api.js +++ b/services/web/app/src/Features/V1/V1Api.js @@ -11,7 +11,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 Errors = require('../Errors/Errors') const { promisifyAll } = require('../../util/promises') diff --git a/services/web/app/src/Features/V1/V1Handler.js b/services/web/app/src/Features/V1/V1Handler.js index 42d200906d..e5e33f51dd 100644 --- a/services/web/app/src/Features/V1/V1Handler.js +++ b/services/web/app/src/Features/V1/V1Handler.js @@ -16,7 +16,7 @@ let V1Handler const OError = require('@overleaf/o-error') const V1Api = require('./V1Api') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') module.exports = V1Handler = { diff --git a/services/web/app/src/infrastructure/ExpressLocals.js b/services/web/app/src/infrastructure/ExpressLocals.js index 90a0eb21ba..58cd558e1c 100644 --- a/services/web/app/src/infrastructure/ExpressLocals.js +++ b/services/web/app/src/infrastructure/ExpressLocals.js @@ -1,5 +1,5 @@ const logger = require('logger-sharelatex') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const querystring = require('querystring') const _ = require('lodash') const Url = require('url') diff --git a/services/web/app/src/infrastructure/Features.js b/services/web/app/src/infrastructure/Features.js index a8ae39247b..571646c8b5 100644 --- a/services/web/app/src/infrastructure/Features.js +++ b/services/web/app/src/infrastructure/Features.js @@ -1,5 +1,5 @@ const _ = require('lodash') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const fs = require('fs') const publicRegistrationModuleAvailable = fs.existsSync( diff --git a/services/web/app/src/infrastructure/FileWriter.js b/services/web/app/src/infrastructure/FileWriter.js index 31bc2706ac..55e5faba8f 100644 --- a/services/web/app/src/infrastructure/FileWriter.js +++ b/services/web/app/src/infrastructure/FileWriter.js @@ -15,7 +15,7 @@ const OError = require('@overleaf/o-error') const logger = require('logger-sharelatex') const uuid = require('uuid') const _ = require('underscore') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const request = require('request') const { Transform, pipeline } = require('stream') const { FileTooLargeError } = require('../Features/Errors/Errors') diff --git a/services/web/app/src/infrastructure/GeoIpLookup.js b/services/web/app/src/infrastructure/GeoIpLookup.js index 71da9eae2d..94bb5a0d66 100644 --- a/services/web/app/src/infrastructure/GeoIpLookup.js +++ b/services/web/app/src/infrastructure/GeoIpLookup.js @@ -1,5 +1,5 @@ const request = require('request') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const _ = require('underscore') const logger = require('logger-sharelatex') const URL = require('url') diff --git a/services/web/app/src/infrastructure/JsonWebToken.js b/services/web/app/src/infrastructure/JsonWebToken.js index e8ad42a2fc..0a49e97062 100644 --- a/services/web/app/src/infrastructure/JsonWebToken.js +++ b/services/web/app/src/infrastructure/JsonWebToken.js @@ -1,6 +1,6 @@ const { callbackify, promisify } = require('util') const JWT = require('jsonwebtoken') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const jwtSign = promisify(JWT.sign) diff --git a/services/web/app/src/infrastructure/LockManager.js b/services/web/app/src/infrastructure/LockManager.js index c36ab17922..4e8adfc98f 100644 --- a/services/web/app/src/infrastructure/LockManager.js +++ b/services/web/app/src/infrastructure/LockManager.js @@ -6,7 +6,7 @@ const logger = require('logger-sharelatex') const os = require('os') const crypto = require('crypto') const async = require('async') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const HOST = os.hostname() const PID = process.pid diff --git a/services/web/app/src/infrastructure/Modules.js b/services/web/app/src/infrastructure/Modules.js index d68803e783..777c4335c5 100644 --- a/services/web/app/src/infrastructure/Modules.js +++ b/services/web/app/src/infrastructure/Modules.js @@ -3,7 +3,7 @@ const Path = require('path') const pug = require('pug') const async = require('async') const { promisify } = require('util') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const MODULE_BASE_PATH = Path.resolve(__dirname + '/../../../modules') diff --git a/services/web/app/src/infrastructure/Mongoose.js b/services/web/app/src/infrastructure/Mongoose.js index 3f7fb6835b..f680abe94c 100644 --- a/services/web/app/src/infrastructure/Mongoose.js +++ b/services/web/app/src/infrastructure/Mongoose.js @@ -1,5 +1,5 @@ const mongoose = require('mongoose') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') if ( diff --git a/services/web/app/src/infrastructure/ProxyManager.js b/services/web/app/src/infrastructure/ProxyManager.js index cc60ea2d34..a5afff292b 100644 --- a/services/web/app/src/infrastructure/ProxyManager.js +++ b/services/web/app/src/infrastructure/ProxyManager.js @@ -11,7 +11,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ let ProxyManager -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const request = require('request') const URL = require('url') diff --git a/services/web/app/src/infrastructure/Queues.js b/services/web/app/src/infrastructure/Queues.js index 8bfd88b9d1..d22d0ac61a 100644 --- a/services/web/app/src/infrastructure/Queues.js +++ b/services/web/app/src/infrastructure/Queues.js @@ -1,5 +1,5 @@ const Queue = require('bull') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') // Bull will keep a fixed number of the most recently completed jobs. This is // useful to inspect recently completed jobs. The bull prometheus exporter also diff --git a/services/web/app/src/infrastructure/RateLimiter.js b/services/web/app/src/infrastructure/RateLimiter.js index 20359af4dd..6691edb820 100644 --- a/services/web/app/src/infrastructure/RateLimiter.js +++ b/services/web/app/src/infrastructure/RateLimiter.js @@ -1,4 +1,4 @@ -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const Metrics = require('@overleaf/metrics') const RedisWrapper = require('./RedisWrapper') const rclient = RedisWrapper.client('ratelimiter') diff --git a/services/web/app/src/infrastructure/RedirectManager.js b/services/web/app/src/infrastructure/RedirectManager.js index 0f50e7a319..6f0d3c3ec2 100644 --- a/services/web/app/src/infrastructure/RedirectManager.js +++ b/services/web/app/src/infrastructure/RedirectManager.js @@ -13,7 +13,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ let RedirectManager -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const URL = require('url') const querystring = require('querystring') diff --git a/services/web/app/src/infrastructure/RedisWrapper.js b/services/web/app/src/infrastructure/RedisWrapper.js index 1775d36d87..9f6df9a5a2 100644 --- a/services/web/app/src/infrastructure/RedisWrapper.js +++ b/services/web/app/src/infrastructure/RedisWrapper.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const redis = require('@overleaf/redis-wrapper') if ( diff --git a/services/web/app/src/infrastructure/Server.js b/services/web/app/src/infrastructure/Server.js index 6005494e2c..6c9ece4216 100644 --- a/services/web/app/src/infrastructure/Server.js +++ b/services/web/app/src/infrastructure/Server.js @@ -1,6 +1,6 @@ const Path = require('path') const express = require('express') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const metrics = require('@overleaf/metrics') const expressLocals = require('./ExpressLocals') diff --git a/services/web/app/src/infrastructure/SessionAutostartMiddleware.js b/services/web/app/src/infrastructure/SessionAutostartMiddleware.js index e9379cfcfb..ca883db483 100644 --- a/services/web/app/src/infrastructure/SessionAutostartMiddleware.js +++ b/services/web/app/src/infrastructure/SessionAutostartMiddleware.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const OError = require('@overleaf/o-error') const botUserAgents = [ diff --git a/services/web/app/src/infrastructure/Translations.js b/services/web/app/src/infrastructure/Translations.js index 5ef005ec08..af92ca5f08 100644 --- a/services/web/app/src/infrastructure/Translations.js +++ b/services/web/app/src/infrastructure/Translations.js @@ -2,7 +2,7 @@ const i18n = require('i18next') const fsBackend = require('i18next-fs-backend') const middleware = require('i18next-http-middleware') const path = require('path') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { URL } = require('url') const fallbackLanguageCode = Settings.i18n.defaultLng || 'en' diff --git a/services/web/app/src/infrastructure/UnsupportedBrowserMiddleware.js b/services/web/app/src/infrastructure/UnsupportedBrowserMiddleware.js index 9a53c4b3d6..d7cf9db39e 100644 --- a/services/web/app/src/infrastructure/UnsupportedBrowserMiddleware.js +++ b/services/web/app/src/infrastructure/UnsupportedBrowserMiddleware.js @@ -1,5 +1,5 @@ const Bowser = require('bowser') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const Url = require('url') const { getSafeRedirectPath } = require('../Features/Helpers/UrlHelper') diff --git a/services/web/app/src/infrastructure/Views.js b/services/web/app/src/infrastructure/Views.js index 89956df638..e1323a823d 100644 --- a/services/web/app/src/infrastructure/Views.js +++ b/services/web/app/src/infrastructure/Views.js @@ -1,7 +1,7 @@ const logger = require('logger-sharelatex') const pug = require('pug') const globby = require('globby') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const path = require('path') // Generate list of view names from app/views diff --git a/services/web/app/src/infrastructure/mongodb.js b/services/web/app/src/infrastructure/mongodb.js index 048abeca93..408f174906 100644 --- a/services/web/app/src/infrastructure/mongodb.js +++ b/services/web/app/src/infrastructure/mongodb.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { MongoClient, ObjectId } = require('mongodb') if ( diff --git a/services/web/app/src/models/Institution.js b/services/web/app/src/models/Institution.js index d46d88cc15..7b44012405 100644 --- a/services/web/app/src/models/Institution.js +++ b/services/web/app/src/models/Institution.js @@ -1,7 +1,7 @@ const mongoose = require('../infrastructure/Mongoose') const { Schema } = mongoose const { ObjectId } = Schema -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const request = require('request') diff --git a/services/web/app/src/models/Publisher.js b/services/web/app/src/models/Publisher.js index b640635ebe..b19a0b4cac 100644 --- a/services/web/app/src/models/Publisher.js +++ b/services/web/app/src/models/Publisher.js @@ -1,7 +1,7 @@ const mongoose = require('../infrastructure/Mongoose') const { Schema } = mongoose const { ObjectId } = Schema -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const request = require('request') diff --git a/services/web/app/src/models/User.js b/services/web/app/src/models/User.js index 3923569cfb..4ba8a810f2 100644 --- a/services/web/app/src/models/User.js +++ b/services/web/app/src/models/User.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const mongoose = require('../infrastructure/Mongoose') const TokenGenerator = require('../Features/TokenGenerator/TokenGenerator') const { Schema } = mongoose diff --git a/services/web/app/src/router.js b/services/web/app/src/router.js index 92bed079a2..5e9fb631df 100644 --- a/services/web/app/src/router.js +++ b/services/web/app/src/router.js @@ -4,7 +4,7 @@ const ProjectController = require('./Features/Project/ProjectController') const ProjectApiController = require('./Features/Project/ProjectApiController') const SpellingController = require('./Features/Spelling/SpellingController') const EditorRouter = require('./Features/Editor/EditorRouter') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const TpdsController = require('./Features/ThirdPartyDataStore/TpdsController') const SubscriptionRouter = require('./Features/Subscription/SubscriptionRouter') const UploadsRouter = require('./Features/Uploads/UploadsRouter') diff --git a/services/web/frontend/macros/import-overleaf-module.macro.js b/services/web/frontend/macros/import-overleaf-module.macro.js index 95b8a0301d..0ce07bb18c 100644 --- a/services/web/frontend/macros/import-overleaf-module.macro.js +++ b/services/web/frontend/macros/import-overleaf-module.macro.js @@ -1,5 +1,5 @@ const { createMacro, MacroError } = require('babel-plugin-macros') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const macro = createMacro(importOverleafModuleMacro) diff --git a/services/web/modules/launchpad/app/src/LaunchpadController.js b/services/web/modules/launchpad/app/src/LaunchpadController.js index fbc469bbcb..522709cd05 100644 --- a/services/web/modules/launchpad/app/src/LaunchpadController.js +++ b/services/web/modules/launchpad/app/src/LaunchpadController.js @@ -13,7 +13,7 @@ */ let LaunchpadController const OError = require('@overleaf/o-error') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const Path = require('path') const Url = require('url') const logger = require('logger-sharelatex') diff --git a/services/web/modules/launchpad/app/src/LaunchpadRouter.js b/services/web/modules/launchpad/app/src/LaunchpadRouter.js index a6692f3f24..db9bbb1666 100644 --- a/services/web/modules/launchpad/app/src/LaunchpadRouter.js +++ b/services/web/modules/launchpad/app/src/LaunchpadRouter.js @@ -10,7 +10,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const logger = require('logger-sharelatex') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const LaunchpadController = require('./LaunchpadController') const AuthenticationController = require('../../../../app/src/Features/Authentication/AuthenticationController') const AuthorizationMiddleware = require('../../../../app/src/Features/Authorization/AuthorizationMiddleware') diff --git a/services/web/modules/launchpad/test/unit/src/LaunchpadControllerTests.js b/services/web/modules/launchpad/test/unit/src/LaunchpadControllerTests.js index a7ee54dfa4..f854812970 100644 --- a/services/web/modules/launchpad/test/unit/src/LaunchpadControllerTests.js +++ b/services/web/modules/launchpad/test/unit/src/LaunchpadControllerTests.js @@ -31,7 +31,7 @@ describe('LaunchpadController', function () { this.User = {} this.LaunchpadController = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.Settings = {}), + '@overleaf/settings': (this.Settings = {}), '@overleaf/metrics': (this.Metrics = {}), '../../../../app/src/Features/User/UserRegistrationHandler': (this.UserRegistrationHandler = {}), '../../../../app/src/Features/Email/EmailHandler': (this.EmailHandler = {}), diff --git a/services/web/modules/user-activate/app/src/UserActivateRouter.js b/services/web/modules/user-activate/app/src/UserActivateRouter.js index cba4811fe5..ce5dea9468 100644 --- a/services/web/modules/user-activate/app/src/UserActivateRouter.js +++ b/services/web/modules/user-activate/app/src/UserActivateRouter.js @@ -1,5 +1,5 @@ const logger = require('logger-sharelatex') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const UserActivateController = require('./UserActivateController') const AuthenticationController = require('../../../../app/src/Features/Authentication/AuthenticationController') diff --git a/services/web/package-lock.json b/services/web/package-lock.json index 9a7baf496a..4f682bd45a 100644 --- a/services/web/package-lock.json +++ b/services/web/package-lock.json @@ -6527,6 +6527,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==" + }, "@pmmmwh/react-refresh-webpack-plugin": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.4.3.tgz", @@ -32833,21 +32838,6 @@ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz", "integrity": "sha512-9jphSf3UbIgpOX/RKvX02iw/rN2TKdusnsPpGfO/rkcsrd+IRqgHZb4VGnmL0Cynps8Nj2hN45wsi30BzrHDIw==" }, - "settings-sharelatex": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/settings-sharelatex/-/settings-sharelatex-1.3.0.tgz", - "integrity": "sha512-AWSeCiY1eHi+z6DF4bmTyC3tusOc6EF5zDkC28aAOhEAbgVEIuY034kx1X7a4j9HE0iVs0sVOlZrQMWJBVk3oQ==", - "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": "sha1-gIs5bhEPU9AhoZpO8fZb4OjjX6M=" - } - } - }, "sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", diff --git a/services/web/package.json b/services/web/package.json index d4a476c45a..3012a1354e 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -51,6 +51,7 @@ "@overleaf/o-error": "^3.3.1", "@overleaf/object-persistor": "https://github.com/overleaf/object-persistor/archive/8fbc9ed03206bfb54368578d22b7ac4f285baa25.tar.gz", "@overleaf/redis-wrapper": "^2.0.0", + "@overleaf/settings": "^2.1.1", "@pollyjs/adapter-node-http": "^4.2.1", "@pollyjs/core": "^4.2.1", "@pollyjs/persister-fs": "^4.2.1", @@ -162,7 +163,6 @@ "sanitize-html": "^1.27.1", "sanitizer": "0.1.1", "scroll-into-view-if-needed": "^2.2.25", - "settings-sharelatex": "^1.3.0", "underscore": "^1.13.1", "url-parse": "^1.4.7", "utf-8-validate": "^5.0.2", @@ -194,7 +194,6 @@ "chai-as-promised": "^7.1.1", "chaid": "^1.0.2", "cheerio": "^1.0.0-rc.3", - "coffeescript": "^2.5.1", "copy-webpack-plugin": "^5.1.1", "css-loader": "^3.5.2", "es6-promise": "^4.2.8", diff --git a/services/web/scripts/set_tex_live_image.js b/services/web/scripts/set_tex_live_image.js index aa4e40782a..5e873cc358 100644 --- a/services/web/scripts/set_tex_live_image.js +++ b/services/web/scripts/set_tex_live_image.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { ObjectId } = require('mongodb') const { Project } = require('../app/src/models/Project') diff --git a/services/web/test/acceptance/src/ApiClsiTests.js b/services/web/test/acceptance/src/ApiClsiTests.js index 4003fbfef2..0fb47acca9 100644 --- a/services/web/test/acceptance/src/ApiClsiTests.js +++ b/services/web/test/acceptance/src/ApiClsiTests.js @@ -14,7 +14,7 @@ */ const { expect } = require('chai') const request = require('./helpers/request') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const auth = new Buffer('sharelatex:password').toString('base64') const authed_request = request.defaults({ diff --git a/services/web/test/acceptance/src/AuthorizationTests.js b/services/web/test/acceptance/src/AuthorizationTests.js index 5ea7d7a285..2d03f90f9a 100644 --- a/services/web/test/acceptance/src/AuthorizationTests.js +++ b/services/web/test/acceptance/src/AuthorizationTests.js @@ -2,7 +2,7 @@ const { expect } = require('chai') const async = require('async') const User = require('./helpers/User') const request = require('./helpers/request') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const expectErrorResponse = require('./helpers/expectErrorResponse') diff --git a/services/web/test/acceptance/src/BodyParserErrorsTest.js b/services/web/test/acceptance/src/BodyParserErrorsTest.js index f8355e76d2..26aac4b9d3 100644 --- a/services/web/test/acceptance/src/BodyParserErrorsTest.js +++ b/services/web/test/acceptance/src/BodyParserErrorsTest.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const request = require('./helpers/request') // create a string that is longer than the max allowed (as defined in Server.js) diff --git a/services/web/test/acceptance/src/CloseSiteTests.js b/services/web/test/acceptance/src/CloseSiteTests.js index 4235ef3103..82748890ca 100644 --- a/services/web/test/acceptance/src/CloseSiteTests.js +++ b/services/web/test/acceptance/src/CloseSiteTests.js @@ -10,7 +10,7 @@ * DS102: Remove unnecessary code created because of implicit returns * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const request = require('./helpers/request') describe('siteIsOpen', function () { diff --git a/services/web/test/acceptance/src/DeletionTests.js b/services/web/test/acceptance/src/DeletionTests.js index 57043e04a8..eb2e533fd3 100644 --- a/services/web/test/acceptance/src/DeletionTests.js +++ b/services/web/test/acceptance/src/DeletionTests.js @@ -2,7 +2,7 @@ const User = require('./helpers/User') const request = require('./helpers/request') const async = require('async') const { expect } = require('chai') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const { db, ObjectId } = require('../../../app/src/infrastructure/mongodb') const { Subscription } = require('../../../app/src/models/Subscription') const SubscriptionViewModelBuilder = require('../../../app/src/Features/Subscription/SubscriptionViewModelBuilder') diff --git a/services/web/test/acceptance/src/DocUpdateTests.js b/services/web/test/acceptance/src/DocUpdateTests.js index 624d963ab9..6e388a7d57 100644 --- a/services/web/test/acceptance/src/DocUpdateTests.js +++ b/services/web/test/acceptance/src/DocUpdateTests.js @@ -1,7 +1,7 @@ const User = require('./helpers/User') const request = require('./helpers/request') const { expect } = require('chai') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const { ObjectId } = require('mongodb') describe('DocUpdate', function () { diff --git a/services/web/test/acceptance/src/FeatureUpdaterTests.js b/services/web/test/acceptance/src/FeatureUpdaterTests.js index 05ee9294ba..12d3cfef30 100644 --- a/services/web/test/acceptance/src/FeatureUpdaterTests.js +++ b/services/web/test/acceptance/src/FeatureUpdaterTests.js @@ -1,6 +1,6 @@ const { expect } = require('chai') const UserHelper = require('./helpers/UserHelper') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const { ObjectId } = require('mongodb') const { Subscription } = require('../../../app/src/models/Subscription') const { User } = require('../../../app/src/models/User') diff --git a/services/web/test/acceptance/src/HealthCheckControllerTests.js b/services/web/test/acceptance/src/HealthCheckControllerTests.js index 25b554f355..2bcea42956 100644 --- a/services/web/test/acceptance/src/HealthCheckControllerTests.js +++ b/services/web/test/acceptance/src/HealthCheckControllerTests.js @@ -1,5 +1,5 @@ const { expect } = require('chai') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const User = require('./helpers/User').promises describe('HealthCheckController', function () { diff --git a/services/web/test/acceptance/src/LinkedFilesTests.js b/services/web/test/acceptance/src/LinkedFilesTests.js index 98569f0d3e..c2873e44cf 100644 --- a/services/web/test/acceptance/src/LinkedFilesTests.js +++ b/services/web/test/acceptance/src/LinkedFilesTests.js @@ -3,7 +3,7 @@ const _ = require('underscore') const mkdirp = require('mkdirp') const { promisify } = require('util') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const User = require('./helpers/User').promises const express = require('express') diff --git a/services/web/test/acceptance/src/ProjectDuplicateNameTests.js b/services/web/test/acceptance/src/ProjectDuplicateNameTests.js index 6e026071c1..f7fb1ae0fc 100644 --- a/services/web/test/acceptance/src/ProjectDuplicateNameTests.js +++ b/services/web/test/acceptance/src/ProjectDuplicateNameTests.js @@ -21,7 +21,7 @@ const sinon = require('sinon') const mkdirp = require('mkdirp') const Path = require('path') const fs = require('fs') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const _ = require('underscore') const ProjectGetter = require('../../../app/src/Features/Project/ProjectGetter.js') diff --git a/services/web/test/acceptance/src/ProjectFeaturesTests.js b/services/web/test/acceptance/src/ProjectFeaturesTests.js index a9820ed2d9..3e66730a34 100644 --- a/services/web/test/acceptance/src/ProjectFeaturesTests.js +++ b/services/web/test/acceptance/src/ProjectFeaturesTests.js @@ -15,7 +15,7 @@ const { expect } = require('chai') const async = require('async') const User = require('./helpers/User') const request = require('./helpers/request') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const joinProject = (user_id, project_id, callback) => request.post( diff --git a/services/web/test/acceptance/src/ProjectInviteTests.js b/services/web/test/acceptance/src/ProjectInviteTests.js index f426c02942..b6124b8e86 100644 --- a/services/web/test/acceptance/src/ProjectInviteTests.js +++ b/services/web/test/acceptance/src/ProjectInviteTests.js @@ -1,7 +1,7 @@ const { expect } = require('chai') const Async = require('async') const User = require('./helpers/User') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const CollaboratorsEmailHandler = require('../../../app/src/Features/Collaborators/CollaboratorsEmailHandler') const Features = require('../../../app/src/infrastructure/Features') diff --git a/services/web/test/acceptance/src/ProjectStructureTests.js b/services/web/test/acceptance/src/ProjectStructureTests.js index 2321a8042d..20867c603f 100644 --- a/services/web/test/acceptance/src/ProjectStructureTests.js +++ b/services/web/test/acceptance/src/ProjectStructureTests.js @@ -3,7 +3,7 @@ const mkdirp = require('mkdirp') const { ObjectId } = require('mongodb') const Path = require('path') const fs = require('fs') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const _ = require('underscore') const { Project } = require('../../../app/src/models/Project') diff --git a/services/web/test/acceptance/src/SubscriptionDeletionTests.js b/services/web/test/acceptance/src/SubscriptionDeletionTests.js index 7dd7b61e4a..fe4f65c0e0 100644 --- a/services/web/test/acceptance/src/SubscriptionDeletionTests.js +++ b/services/web/test/acceptance/src/SubscriptionDeletionTests.js @@ -4,7 +4,7 @@ const request = require('./helpers/request') const User = require('./helpers/User') const RecurlySubscription = require('./helpers/RecurlySubscription') const SubscriptionUpdater = require('../../../app/src/Features/Subscription/SubscriptionUpdater') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') describe('Subscriptions', function () { describe('deletion', function () { diff --git a/services/web/test/acceptance/src/TokenAccessTests.js b/services/web/test/acceptance/src/TokenAccessTests.js index 3f4867fb71..1dcfa2d487 100644 --- a/services/web/test/acceptance/src/TokenAccessTests.js +++ b/services/web/test/acceptance/src/TokenAccessTests.js @@ -2,7 +2,7 @@ const { expect } = require('chai') const async = require('async') const User = require('./helpers/User') const request = require('./helpers/request') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const { db, ObjectId } = require('../../../app/src/infrastructure/mongodb') const MockV1ApiClass = require('./mocks/MockV1Api') const expectErrorResponse = require('./helpers/expectErrorResponse') diff --git a/services/web/test/acceptance/src/UserThirdPartyIdentityTests.js b/services/web/test/acceptance/src/UserThirdPartyIdentityTests.js index 2732f4c871..20e3e89d56 100644 --- a/services/web/test/acceptance/src/UserThirdPartyIdentityTests.js +++ b/services/web/test/acceptance/src/UserThirdPartyIdentityTests.js @@ -11,7 +11,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ const Errors = require('../../../app/src/Features/Errors/Errors') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const User = require('./helpers/User') const ThirdPartyIdentityManager = require('../../../app/src/Features/User/ThirdPartyIdentityManager') const { expect } = require('chai') diff --git a/services/web/test/acceptance/src/helpers/User.js b/services/web/test/acceptance/src/helpers/User.js index 7811a2de36..ce8390a43a 100644 --- a/services/web/test/acceptance/src/helpers/User.js +++ b/services/web/test/acceptance/src/helpers/User.js @@ -1,5 +1,5 @@ const request = require('./request') -const settings = require('settings-sharelatex') +const settings = require('@overleaf/settings') const { db, ObjectId } = require('../../../../app/src/infrastructure/mongodb') const UserModel = require('../../../../app/src/models/User').User const UserUpdater = require('../../../../app/src/Features/User/UserUpdater') diff --git a/services/web/test/acceptance/src/helpers/UserHelper.js b/services/web/test/acceptance/src/helpers/UserHelper.js index 8d2f8b313b..6fce8cc90d 100644 --- a/services/web/test/acceptance/src/helpers/UserHelper.js +++ b/services/web/test/acceptance/src/helpers/UserHelper.js @@ -1,6 +1,6 @@ const { expect } = require('chai') const AuthenticationManager = require('../../../../app/src/Features/Authentication/AuthenticationManager') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const UserCreator = require('../../../../app/src/Features/User/UserCreator') const UserGetter = require('../../../../app/src/Features/User/UserGetter') const UserUpdater = require('../../../../app/src/Features/User/UserUpdater') diff --git a/services/web/test/acceptance/src/helpers/redis.js b/services/web/test/acceptance/src/helpers/redis.js index 966e3b881f..e1cd72dd35 100644 --- a/services/web/test/acceptance/src/helpers/redis.js +++ b/services/web/test/acceptance/src/helpers/redis.js @@ -11,7 +11,7 @@ * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const logger = require('logger-sharelatex') const Async = require('async') diff --git a/services/web/test/smoke/src/SmokeTests.js b/services/web/test/smoke/src/SmokeTests.js index 79d35d6224..ab25cc7a6f 100644 --- a/services/web/test/smoke/src/SmokeTests.js +++ b/services/web/test/smoke/src/SmokeTests.js @@ -1,7 +1,7 @@ const fs = require('fs') const Path = require('path') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const { getCsrfTokenForFactory } = require('./support/Csrf') const { SmokeTestFailure } = require('./support/Errors') const { diff --git a/services/web/test/smoke/src/steps/001_clearRateLimits.js b/services/web/test/smoke/src/steps/001_clearRateLimits.js index 8e17d71b73..d090b93293 100644 --- a/services/web/test/smoke/src/steps/001_clearRateLimits.js +++ b/services/web/test/smoke/src/steps/001_clearRateLimits.js @@ -1,5 +1,5 @@ const OError = require('@overleaf/o-error') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const RateLimiter = require('../../../../app/src/infrastructure/RateLimiter') async function clearRateLimit(endpointName, subject) { diff --git a/services/web/test/smoke/src/steps/002_login.js b/services/web/test/smoke/src/steps/002_login.js index 7d3a64efea..f0bdd8a321 100644 --- a/services/web/test/smoke/src/steps/002_login.js +++ b/services/web/test/smoke/src/steps/002_login.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') async function run({ assertHasStatusCode, loginCsrfToken, request }) { const response = await request('/login', { diff --git a/services/web/test/smoke/src/steps/101_loadEditor.js b/services/web/test/smoke/src/steps/101_loadEditor.js index 12c7a1242d..42d9af1999 100644 --- a/services/web/test/smoke/src/steps/101_loadEditor.js +++ b/services/web/test/smoke/src/steps/101_loadEditor.js @@ -1,4 +1,4 @@ -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') async function run({ assertHasStatusCode, request }) { const response = await request(`/project/${Settings.smokeTest.projectId}`) diff --git a/services/web/test/smoke/src/support/requestHelper.js b/services/web/test/smoke/src/support/requestHelper.js index a704be9798..2157a5fff0 100644 --- a/services/web/test/smoke/src/support/requestHelper.js +++ b/services/web/test/smoke/src/support/requestHelper.js @@ -4,7 +4,7 @@ const { promisify } = require('util') const OError = require('@overleaf/o-error') const request = require('request') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') // send requests to web router if this is the api process const OWN_PORT = Settings.port || Settings.internal.web.port || 3000 diff --git a/services/web/test/unit/bootstrap.js b/services/web/test/unit/bootstrap.js index c8d8fc6134..0dcb497324 100644 --- a/services/web/test/unit/bootstrap.js +++ b/services/web/test/unit/bootstrap.js @@ -46,22 +46,6 @@ const SandboxedModule = require('sandboxed-module') SandboxedModule.configure({ requires: getSandboxedModuleRequires(), globals: { Buffer, Promise, console, process }, - sourceTransformers: { - coffee(source) { - if (this.filename.endsWith('.coffee')) { - // Coffeescript mucks with Error.prepareStackTrace, which, in turn, - // conflicts with OError. This is a hacky way to prevent Coffeescript - // from interfering. - // - // See https://github.com/jashkenas/coffeescript/blob/07f644c39223e016aceedd2cd71b5941579b5659/src/coffeescript.coffee#L368 - const originalPrepareStackTrace = Error.prepareStackTrace - const compiled = require('coffeescript').compile(source) - Error.prepareStackTrace = originalPrepareStackTrace - return compiled - } - return source - }, - }, }) function getSandboxedModuleRequires() { diff --git a/services/web/test/unit/src/Analytics/AnalyticsManagerTests.js b/services/web/test/unit/src/Analytics/AnalyticsManagerTests.js index 847713832b..ed08641a7b 100644 --- a/services/web/test/unit/src/Analytics/AnalyticsManagerTests.js +++ b/services/web/test/unit/src/Analytics/AnalyticsManagerTests.js @@ -48,7 +48,7 @@ describe('AnalyticsManager', function () { this.request = sinon.stub().yields() this.AnalyticsManager = SandboxedModule.require(MODULE_PATH, { requires: { - 'settings-sharelatex': this.Settings, + '@overleaf/settings': this.Settings, '../../infrastructure/Queues': this.Queues, }, }) diff --git a/services/web/test/unit/src/Authentication/AuthenticationControllerTests.js b/services/web/test/unit/src/Authentication/AuthenticationControllerTests.js index bb8009d43c..f4f35098da 100644 --- a/services/web/test/unit/src/Authentication/AuthenticationControllerTests.js +++ b/services/web/test/unit/src/Authentication/AuthenticationControllerTests.js @@ -43,7 +43,7 @@ describe('AuthenticationController', function () { identifyUser: sinon.stub(), }), '../../infrastructure/SessionStoreManager': (this.SessionStoreManager = {}), - 'settings-sharelatex': (this.Settings = { + '@overleaf/settings': (this.Settings = { siteUrl: 'http://www.foo.bar', httpAuthUsers: this.httpAuthUsers, }), diff --git a/services/web/test/unit/src/Authentication/AuthenticationManagerTests.js b/services/web/test/unit/src/Authentication/AuthenticationManagerTests.js index 6b7bc1f625..f825822e30 100644 --- a/services/web/test/unit/src/Authentication/AuthenticationManagerTests.js +++ b/services/web/test/unit/src/Authentication/AuthenticationManagerTests.js @@ -20,7 +20,7 @@ describe('AuthenticationManager', function () { ObjectId, }, bcrypt: (this.bcrypt = {}), - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, '../User/UserGetter': (this.UserGetter = {}), './AuthenticationErrors': AuthenticationErrors, }, diff --git a/services/web/test/unit/src/Authorization/AuthorizationManagerTests.js b/services/web/test/unit/src/Authorization/AuthorizationManagerTests.js index 04bf5ac4cf..657dddd11f 100644 --- a/services/web/test/unit/src/Authorization/AuthorizationManagerTests.js +++ b/services/web/test/unit/src/Authorization/AuthorizationManagerTests.js @@ -35,7 +35,7 @@ describe('AuthorizationManager', function () { .stub() .callsArgWith(2, null, false, false), }), - 'settings-sharelatex': { passwordStrengthOptions: {} }, + '@overleaf/settings': { passwordStrengthOptions: {} }, }, }) this.user_id = 'user-id-1' diff --git a/services/web/test/unit/src/BetaProgram/BetaProgramControllerTests.js b/services/web/test/unit/src/BetaProgram/BetaProgramControllerTests.js index a22581585a..8a785b2818 100644 --- a/services/web/test/unit/src/BetaProgram/BetaProgramControllerTests.js +++ b/services/web/test/unit/src/BetaProgram/BetaProgramControllerTests.js @@ -30,7 +30,7 @@ describe('BetaProgramController', function () { '../User/UserGetter': (this.UserGetter = { getUser: sinon.stub(), }), - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { languages: {}, }), '../Authentication/AuthenticationController': (this.AuthenticationController = { diff --git a/services/web/test/unit/src/BrandVariations/BrandVariationsHandlerTests.js b/services/web/test/unit/src/BrandVariations/BrandVariationsHandlerTests.js index 35f4cea35d..5372ba6899 100644 --- a/services/web/test/unit/src/BrandVariations/BrandVariationsHandlerTests.js +++ b/services/web/test/unit/src/BrandVariations/BrandVariationsHandlerTests.js @@ -43,7 +43,7 @@ describe('BrandVariationsHandler', function () { this.V1Api = { request: sinon.stub() } this.BrandVariationsHandler = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, '../V1/V1Api': this.V1Api, }, }) diff --git a/services/web/test/unit/src/Chat/ChatApiHandlerTests.js b/services/web/test/unit/src/Chat/ChatApiHandlerTests.js index e06d95c222..594b9606a1 100644 --- a/services/web/test/unit/src/Chat/ChatApiHandlerTests.js +++ b/services/web/test/unit/src/Chat/ChatApiHandlerTests.js @@ -32,7 +32,7 @@ describe('ChatApiHandler', function () { this.request = sinon.stub() this.ChatApiHandler = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, request: this.request, }, }) diff --git a/services/web/test/unit/src/Chat/ChatControllerTests.js b/services/web/test/unit/src/Chat/ChatControllerTests.js index 77ba582cd1..e599e7b698 100644 --- a/services/web/test/unit/src/Chat/ChatControllerTests.js +++ b/services/web/test/unit/src/Chat/ChatControllerTests.js @@ -33,7 +33,7 @@ describe('ChatController', function () { } this.ChatController = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, './ChatApiHandler': this.ChatApiHandler, '../Editor/EditorRealTimeController': this.EditorRealTimeController, '../Authentication/AuthenticationController': this diff --git a/services/web/test/unit/src/Collaborators/CollaboratorsInviteControllerTests.js b/services/web/test/unit/src/Collaborators/CollaboratorsInviteControllerTests.js index 40660c7474..c70a7d48fa 100644 --- a/services/web/test/unit/src/Collaborators/CollaboratorsInviteControllerTests.js +++ b/services/web/test/unit/src/Collaborators/CollaboratorsInviteControllerTests.js @@ -54,7 +54,7 @@ describe('CollaboratorsInviteController', function () { '../Analytics/AnalyticsManager': this.AnalyticsManger, '../Authentication/AuthenticationController': this .AuthenticationController, - 'settings-sharelatex': (this.settings = {}), + '@overleaf/settings': (this.settings = {}), '../../infrastructure/RateLimiter': this.RateLimiter, }, }) diff --git a/services/web/test/unit/src/Collaborators/CollaboratorsInviteHandlerTests.js b/services/web/test/unit/src/Collaborators/CollaboratorsInviteHandlerTests.js index efce33ddc8..08eca22d94 100644 --- a/services/web/test/unit/src/Collaborators/CollaboratorsInviteHandlerTests.js +++ b/services/web/test/unit/src/Collaborators/CollaboratorsInviteHandlerTests.js @@ -54,7 +54,7 @@ describe('CollaboratorsInviteHandler', function () { this.Crypto = Crypto this.CollaboratorsInviteHandler = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = {}), + '@overleaf/settings': (this.settings = {}), '../../models/ProjectInvite': { ProjectInvite: this.ProjectInvite }, './CollaboratorsEmailHandler': (this.CollaboratorsEmailHandler = {}), './CollaboratorsHandler': (this.CollaboratorsHandler = { diff --git a/services/web/test/unit/src/Compile/ClsiCookieManagerTests.js b/services/web/test/unit/src/Compile/ClsiCookieManagerTests.js index e9fdea0115..49345b3734 100644 --- a/services/web/test/unit/src/Compile/ClsiCookieManagerTests.js +++ b/services/web/test/unit/src/Compile/ClsiCookieManagerTests.js @@ -52,7 +52,7 @@ describe('ClsiCookieManager', function () { '../../infrastructure/RedisWrapper': (this.RedisWrapper = { client: () => this.redis, }), - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, request: this.request, } return (this.ClsiCookieManager = SandboxedModule.require(modulePath, { diff --git a/services/web/test/unit/src/Compile/ClsiFormatCheckerTests.js b/services/web/test/unit/src/Compile/ClsiFormatCheckerTests.js index 41844f5d57..53fcc6dc84 100644 --- a/services/web/test/unit/src/Compile/ClsiFormatCheckerTests.js +++ b/services/web/test/unit/src/Compile/ClsiFormatCheckerTests.js @@ -20,7 +20,9 @@ describe('ClsiFormatChecker', function () { beforeEach(function () { this.ClsiFormatChecker = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = { compileBodySizeLimitMb: 5 }), + '@overleaf/settings': (this.settings = { + compileBodySizeLimitMb: 5, + }), }, }) return (this.project_id = 'project-id') diff --git a/services/web/test/unit/src/Compile/ClsiManagerTests.js b/services/web/test/unit/src/Compile/ClsiManagerTests.js index 4b41bfe8e9..b593eaae10 100644 --- a/services/web/test/unit/src/Compile/ClsiManagerTests.js +++ b/services/web/test/unit/src/Compile/ClsiManagerTests.js @@ -35,7 +35,7 @@ describe('ClsiManager', function () { } this.ClsiManager = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { apis: { filestore: { url: 'filestore.example.com', diff --git a/services/web/test/unit/src/Compile/ClsiStateManagerTests.js b/services/web/test/unit/src/Compile/ClsiStateManagerTests.js index bd23086c76..cad4356296 100644 --- a/services/web/test/unit/src/Compile/ClsiStateManagerTests.js +++ b/services/web/test/unit/src/Compile/ClsiStateManagerTests.js @@ -21,7 +21,7 @@ describe('ClsiStateManager', function () { beforeEach(function () { this.ClsiStateManager = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = {}), + '@overleaf/settings': (this.settings = {}), '../Project/ProjectEntityHandler': (this.ProjectEntityHandler = {}), }, }) diff --git a/services/web/test/unit/src/Compile/CompileControllerTests.js b/services/web/test/unit/src/Compile/CompileControllerTests.js index c5bbd871f8..7cc39a19b4 100644 --- a/services/web/test/unit/src/Compile/CompileControllerTests.js +++ b/services/web/test/unit/src/Compile/CompileControllerTests.js @@ -59,7 +59,7 @@ describe('CompileController', function () { } this.CompileController = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, request: (this.request = sinon.stub()), '../Project/ProjectGetter': (this.ProjectGetter = {}), '@overleaf/metrics': (this.Metrics = { inc: sinon.stub() }), diff --git a/services/web/test/unit/src/Compile/CompileManagerTests.js b/services/web/test/unit/src/Compile/CompileManagerTests.js index 5fcf9a33c1..d3fae7e91d 100644 --- a/services/web/test/unit/src/Compile/CompileManagerTests.js +++ b/services/web/test/unit/src/Compile/CompileManagerTests.js @@ -25,7 +25,7 @@ describe('CompileManager', function () { this.ratelimiter = { addCount: sinon.stub() } this.CompileManager = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { redis: { web: { host: 'localhost', port: 42 } }, rateLimit: { autoCompile: {} }, }), diff --git a/services/web/test/unit/src/Contact/ContactManagerTests.js b/services/web/test/unit/src/Contact/ContactManagerTests.js index 0eeb2a101f..96dfae7839 100644 --- a/services/web/test/unit/src/Contact/ContactManagerTests.js +++ b/services/web/test/unit/src/Contact/ContactManagerTests.js @@ -18,7 +18,7 @@ describe('ContactManager', function () { this.ContactManager = SandboxedModule.require(modulePath, { requires: { request: (this.request = sinon.stub()), - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { apis: { contacts: { url: 'contacts.sharelatex.com', diff --git a/services/web/test/unit/src/Docstore/DocstoreManagerTests.js b/services/web/test/unit/src/Docstore/DocstoreManagerTests.js index ebfcbb9816..40fe409fee 100644 --- a/services/web/test/unit/src/Docstore/DocstoreManagerTests.js +++ b/services/web/test/unit/src/Docstore/DocstoreManagerTests.js @@ -23,7 +23,7 @@ describe('DocstoreManager', function () { request: { defaults: this.requestDefaults, }, - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { apis: { docstore: { url: 'docstore.sharelatex.com', diff --git a/services/web/test/unit/src/DocumentUpdater/DocumentUpdaterHandlerTests.js b/services/web/test/unit/src/DocumentUpdater/DocumentUpdaterHandlerTests.js index e0c4d8ce27..63873717ca 100644 --- a/services/web/test/unit/src/DocumentUpdater/DocumentUpdaterHandlerTests.js +++ b/services/web/test/unit/src/DocumentUpdater/DocumentUpdaterHandlerTests.js @@ -38,7 +38,7 @@ describe('DocumentUpdaterHandler', function () { return this.request }, }, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, '../Project/ProjectEntityHandler': this.projectEntityHandler, '../../models/Project': { Project: (this.Project = {}), diff --git a/services/web/test/unit/src/Editor/EditorRealTimeControllerTests.js b/services/web/test/unit/src/Editor/EditorRealTimeControllerTests.js index 2f82333822..6c8c2ec71f 100644 --- a/services/web/test/unit/src/Editor/EditorRealTimeControllerTests.js +++ b/services/web/test/unit/src/Editor/EditorRealTimeControllerTests.js @@ -29,7 +29,7 @@ describe('EditorRealTimeController', function () { '../../infrastructure/Server': { io: (this.io = {}), }, - 'settings-sharelatex': { redis: {} }, + '@overleaf/settings': { redis: {} }, '@overleaf/metrics': this.Metrics, crypto: (this.crypto = { randomBytes: sinon diff --git a/services/web/test/unit/src/Email/EmailBuilderTests.js b/services/web/test/unit/src/Email/EmailBuilderTests.js index c30470be7a..c65a0be6c1 100644 --- a/services/web/test/unit/src/Email/EmailBuilderTests.js +++ b/services/web/test/unit/src/Email/EmailBuilderTests.js @@ -25,7 +25,7 @@ describe('EmailBuilder', function () { './Bodies/cta-email': ctaEmailBody, './Bodies/NoCTAEmailBody': NoCTAEmailBody, './Layouts/BaseWithHeaderEmailLayout': BaseWithHeaderEmailLayout, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, }, }) }) diff --git a/services/web/test/unit/src/Email/EmailHandlerTests.js b/services/web/test/unit/src/Email/EmailHandlerTests.js index 262e8bf8c2..9317bd55f7 100644 --- a/services/web/test/unit/src/Email/EmailHandlerTests.js +++ b/services/web/test/unit/src/Email/EmailHandlerTests.js @@ -24,7 +24,7 @@ describe('EmailHandler', function () { requires: { './EmailBuilder': this.EmailBuilder, './EmailSender': this.EmailSender, - 'settings-sharelatex': this.Settings, + '@overleaf/settings': this.Settings, }, }) }) diff --git a/services/web/test/unit/src/Email/EmailSenderTests.js b/services/web/test/unit/src/Email/EmailSenderTests.js index 5f4a451343..185311971a 100644 --- a/services/web/test/unit/src/Email/EmailSenderTests.js +++ b/services/web/test/unit/src/Email/EmailSenderTests.js @@ -37,7 +37,7 @@ describe('EmailSender', function () { nodemailer: this.ses, 'nodemailer-ses-transport': sinon.stub(), 'nodemailer-mandrill-transport': {}, - 'settings-sharelatex': this.Settings, + '@overleaf/settings': this.Settings, '../../infrastructure/RateLimiter': this.RateLimiter, '@overleaf/metrics': { inc() {}, diff --git a/services/web/test/unit/src/Errors/HttpErrorHandlerTests.js b/services/web/test/unit/src/Errors/HttpErrorHandlerTests.js index c6e4fb46ad..4d4fee63ed 100644 --- a/services/web/test/unit/src/Errors/HttpErrorHandlerTests.js +++ b/services/web/test/unit/src/Errors/HttpErrorHandlerTests.js @@ -11,7 +11,7 @@ describe('HttpErrorHandler', function () { this.HttpErrorHandler = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': { + '@overleaf/settings': { appName: 'Overleaf', statusPageUrl: 'https://status.overlaf.com', }, diff --git a/services/web/test/unit/src/Exports/ExportsHandlerTests.js b/services/web/test/unit/src/Exports/ExportsHandlerTests.js index f0b250e5ba..b02b121d3e 100644 --- a/services/web/test/unit/src/Exports/ExportsHandlerTests.js +++ b/services/web/test/unit/src/Exports/ExportsHandlerTests.js @@ -31,7 +31,7 @@ describe('ExportsHandler', function () { '../Project/ProjectLocator': (this.ProjectLocator = {}), '../Project/ProjectRootDocManager': (this.ProjectRootDocManager = {}), '../User/UserGetter': (this.UserGetter = {}), - 'settings-sharelatex': (this.settings = {}), + '@overleaf/settings': (this.settings = {}), request: this.request, }, }) diff --git a/services/web/test/unit/src/FileStore/FileStoreControllerTests.js b/services/web/test/unit/src/FileStore/FileStoreControllerTests.js index b4a5f5b6e1..77d00f419f 100644 --- a/services/web/test/unit/src/FileStore/FileStoreControllerTests.js +++ b/services/web/test/unit/src/FileStore/FileStoreControllerTests.js @@ -15,7 +15,7 @@ describe('FileStoreController', function () { this.ProjectLocator = { findElement: sinon.stub() } this.controller = SandboxedModule.require(MODULE_PATH, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, '../Project/ProjectLocator': this.ProjectLocator, './FileStoreHandler': this.FileStoreHandler, }, diff --git a/services/web/test/unit/src/FileStore/FileStoreHandlerTests.js b/services/web/test/unit/src/FileStore/FileStoreHandlerTests.js index 740a624ad3..2de3d545cf 100644 --- a/services/web/test/unit/src/FileStore/FileStoreHandlerTests.js +++ b/services/web/test/unit/src/FileStore/FileStoreHandlerTests.js @@ -58,7 +58,7 @@ describe('FileStoreHandler', function () { } this.handler = SandboxedModule.require(MODULE_PATH, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, request: this.request, './FileHashManager': this.FileHashManager, // FIXME: need to stub File object here diff --git a/services/web/test/unit/src/HelperFiles/NewLogsUITests.js b/services/web/test/unit/src/HelperFiles/NewLogsUITests.js index 9fa942763d..e526862903 100644 --- a/services/web/test/unit/src/HelperFiles/NewLogsUITests.js +++ b/services/web/test/unit/src/HelperFiles/NewLogsUITests.js @@ -48,7 +48,7 @@ describe('NewLogsUI helper', function () { NewLogsUI = SandboxedModule.require(MODULE_PATH, { requires: { mongodb: { ObjectId }, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, }, }) }) diff --git a/services/web/test/unit/src/HelperFiles/UrlHelperTests.js b/services/web/test/unit/src/HelperFiles/UrlHelperTests.js index b147bcb95a..832ece1d6b 100644 --- a/services/web/test/unit/src/HelperFiles/UrlHelperTests.js +++ b/services/web/test/unit/src/HelperFiles/UrlHelperTests.js @@ -12,7 +12,7 @@ describe('UrlHelper', function () { siteUrl: 'http://localhost:3000', } this.UrlHelper = SandboxedModule.require(modulePath, { - requires: { 'settings-sharelatex': this.settings }, + requires: { '@overleaf/settings': this.settings }, }) }) describe('getSafeRedirectPath', function () { diff --git a/services/web/test/unit/src/History/HistoryControllerTests.js b/services/web/test/unit/src/History/HistoryControllerTests.js index b355deb3fd..5e0cccff0f 100644 --- a/services/web/test/unit/src/History/HistoryControllerTests.js +++ b/services/web/test/unit/src/History/HistoryControllerTests.js @@ -26,7 +26,7 @@ describe('HistoryController', function () { this.HistoryController = SandboxedModule.require(modulePath, { requires: { request: (this.request = sinon.stub()), - 'settings-sharelatex': (this.settings = {}), + '@overleaf/settings': (this.settings = {}), '../Authentication/AuthenticationController': this .AuthenticationController, './HistoryManager': (this.HistoryManager = {}), diff --git a/services/web/test/unit/src/History/HistoryManagerTests.js b/services/web/test/unit/src/History/HistoryManagerTests.js index eb86a84da3..e76c4c5d6d 100644 --- a/services/web/test/unit/src/History/HistoryManagerTests.js +++ b/services/web/test/unit/src/History/HistoryManagerTests.js @@ -46,7 +46,7 @@ describe('HistoryManager', function () { this.HistoryManager = SandboxedModule.require(MODULE_PATH, { requires: { 'request-promise-native': this.request, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, '../User/UserGetter': this.UserGetter, }, }) diff --git a/services/web/test/unit/src/History/RestoreManagerTests.js b/services/web/test/unit/src/History/RestoreManagerTests.js index 410f19a23c..79516c6f10 100644 --- a/services/web/test/unit/src/History/RestoreManagerTests.js +++ b/services/web/test/unit/src/History/RestoreManagerTests.js @@ -27,7 +27,7 @@ describe('RestoreManager', function () { tk.freeze(Date.now()) // freeze the time for these tests this.RestoreManager = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': {}, + '@overleaf/settings': {}, '../../infrastructure/FileWriter': (this.FileWriter = {}), '../Uploads/FileSystemImportManager': (this.FileSystemImportManager = {}), '../Project/ProjectEntityHandler': (this.ProjectEntityHandler = {}), diff --git a/services/web/test/unit/src/InactiveData/InactiveProjectManagerTests.js b/services/web/test/unit/src/InactiveData/InactiveProjectManagerTests.js index 656383fc43..1e229b3901 100644 --- a/services/web/test/unit/src/InactiveData/InactiveProjectManagerTests.js +++ b/services/web/test/unit/src/InactiveData/InactiveProjectManagerTests.js @@ -37,7 +37,7 @@ describe('InactiveProjectManager', function () { this.InactiveProjectManager = SandboxedModule.require(modulePath, { requires: { mongodb: { ObjectId }, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, '../Docstore/DocstoreManager': this.DocstoreManager, '../Project/ProjectUpdateHandler': this.ProjectUpdateHandler, '../Project/ProjectGetter': this.ProjectGetter, diff --git a/services/web/test/unit/src/Institutions/InstitutionsAPITests.js b/services/web/test/unit/src/Institutions/InstitutionsAPITests.js index 7ca625667f..32df83e5c8 100644 --- a/services/web/test/unit/src/Institutions/InstitutionsAPITests.js +++ b/services/web/test/unit/src/Institutions/InstitutionsAPITests.js @@ -20,7 +20,7 @@ describe('InstitutionsAPI', function () { '@overleaf/metrics': { timeAsyncMethod: sinon.stub(), }, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, request: this.request, '../Notifications/NotificationsBuilder': { ipMatcherAffiliation: sinon diff --git a/services/web/test/unit/src/Institutions/InstitutionsFeaturesTests.js b/services/web/test/unit/src/Institutions/InstitutionsFeaturesTests.js index 66e71f4e43..deaa07a0b3 100644 --- a/services/web/test/unit/src/Institutions/InstitutionsFeaturesTests.js +++ b/services/web/test/unit/src/Institutions/InstitutionsFeaturesTests.js @@ -28,7 +28,7 @@ describe('InstitutionsFeatures', function () { requires: { '../User/UserGetter': this.UserGetter, '../Subscription/PlansLocator': this.PlansLocator, - 'settings-sharelatex': { + '@overleaf/settings': { institutionPlanCode: this.institutionPlanCode, }, }, diff --git a/services/web/test/unit/src/Newsletter/NewsletterManagerTests.js b/services/web/test/unit/src/Newsletter/NewsletterManagerTests.js index 7b1625328b..689d29a37e 100644 --- a/services/web/test/unit/src/Newsletter/NewsletterManagerTests.js +++ b/services/web/test/unit/src/Newsletter/NewsletterManagerTests.js @@ -28,7 +28,7 @@ describe('NewsletterManager', function () { this.NewsletterManager = SandboxedModule.require(MODULE_PATH, { requires: { 'mailchimp-api-v3': this.Mailchimp, - 'settings-sharelatex': this.Settings, + '@overleaf/settings': this.Settings, }, }).promises diff --git a/services/web/test/unit/src/Notifications/NotificationsBuilderTests.js b/services/web/test/unit/src/Notifications/NotificationsBuilderTests.js index 3ad158038f..88ca7a125b 100644 --- a/services/web/test/unit/src/Notifications/NotificationsBuilderTests.js +++ b/services/web/test/unit/src/Notifications/NotificationsBuilderTests.js @@ -16,7 +16,7 @@ describe('NotificationsBuilder', function () { this.controller = SandboxedModule.require(modulePath, { requires: { './NotificationsHandler': this.handler, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, request: this.request, }, }) diff --git a/services/web/test/unit/src/Notifications/NotificationsHandlerTests.js b/services/web/test/unit/src/Notifications/NotificationsHandlerTests.js index b6f590daca..12f3e8bc0f 100644 --- a/services/web/test/unit/src/Notifications/NotificationsHandlerTests.js +++ b/services/web/test/unit/src/Notifications/NotificationsHandlerTests.js @@ -30,7 +30,7 @@ describe('NotificationsHandler', function () { this.request = sinon.stub().callsArgWith(1) return (this.handler = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': { + '@overleaf/settings': { apis: { notifications: { url: notificationUrl } }, }, request: this.request, diff --git a/services/web/test/unit/src/PasswordReset/PasswordResetControllerTests.js b/services/web/test/unit/src/PasswordReset/PasswordResetControllerTests.js index c4066debf5..e378ea93ed 100644 --- a/services/web/test/unit/src/PasswordReset/PasswordResetControllerTests.js +++ b/services/web/test/unit/src/PasswordReset/PasswordResetControllerTests.js @@ -51,7 +51,7 @@ describe('PasswordResetController', function () { } this.PasswordResetController = SandboxedModule.require(MODULE_PATH, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, './PasswordResetHandler': this.PasswordResetHandler, '../../infrastructure/RateLimiter': this.RateLimiter, '../Authentication/AuthenticationController': (this.AuthenticationController = { diff --git a/services/web/test/unit/src/PasswordReset/PasswordResetHandlerTests.js b/services/web/test/unit/src/PasswordReset/PasswordResetHandlerTests.js index c768b56e0e..4be10b9128 100644 --- a/services/web/test/unit/src/PasswordReset/PasswordResetHandlerTests.js +++ b/services/web/test/unit/src/PasswordReset/PasswordResetHandlerTests.js @@ -51,7 +51,7 @@ describe('PasswordResetHandler', function () { '../Security/OneTimeTokenHandler': this.OneTimeTokenHandler, '../Email/EmailHandler': this.EmailHandler, '../Authentication/AuthenticationManager': this.AuthenticationManager, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, }, }) this.token = '12312321i' diff --git a/services/web/test/unit/src/Project/ProjectControllerTests.js b/services/web/test/unit/src/Project/ProjectControllerTests.js index aa25df5e49..55c66d9240 100644 --- a/services/web/test/unit/src/Project/ProjectControllerTests.js +++ b/services/web/test/unit/src/Project/ProjectControllerTests.js @@ -134,7 +134,7 @@ describe('ProjectController', function () { this.ProjectController = SandboxedModule.require(MODULE_PATH, { requires: { mongodb: { ObjectId }, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, '@overleaf/metrics': this.Metrics, '../SplitTests/SplitTestHandler': this.SplitTestHandler, './ProjectDeleter': this.ProjectDeleter, diff --git a/services/web/test/unit/src/Project/ProjectDetailsHandlerTests.js b/services/web/test/unit/src/Project/ProjectDetailsHandlerTests.js index 10f297709f..8ac4286eeb 100644 --- a/services/web/test/unit/src/Project/ProjectDetailsHandlerTests.js +++ b/services/web/test/unit/src/Project/ProjectDetailsHandlerTests.js @@ -75,7 +75,7 @@ describe('ProjectDetailsHandler', function () { '../User/UserGetter': this.UserGetter, '../ThirdPartyDataStore/TpdsUpdateSender': this.TpdsUpdateSender, '../TokenGenerator/TokenGenerator': this.TokenGenerator, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, }, }) }) diff --git a/services/web/test/unit/src/Project/ProjectEntityMongoUpdateHandlerTests.js b/services/web/test/unit/src/Project/ProjectEntityMongoUpdateHandlerTests.js index f531e6ec55..638ea9e748 100644 --- a/services/web/test/unit/src/Project/ProjectEntityMongoUpdateHandlerTests.js +++ b/services/web/test/unit/src/Project/ProjectEntityMongoUpdateHandlerTests.js @@ -180,7 +180,7 @@ describe('ProjectEntityMongoUpdateHandler', function () { this.subject = SandboxedModule.require(MODULE_PATH, { requires: { mongodb: { ObjectId }, - 'settings-sharelatex': this.Settings, + '@overleaf/settings': this.Settings, '../Cooldown/CooldownManager': this.CooldownManager, '../../models/Folder': { Folder: this.FolderModel }, '../../infrastructure/LockManager': this.LockManager, diff --git a/services/web/test/unit/src/Project/ProjectEntityUpdateHandlerTests.js b/services/web/test/unit/src/Project/ProjectEntityUpdateHandlerTests.js index 5b19655ce9..9243841f36 100644 --- a/services/web/test/unit/src/Project/ProjectEntityUpdateHandlerTests.js +++ b/services/web/test/unit/src/Project/ProjectEntityUpdateHandlerTests.js @@ -144,7 +144,7 @@ describe('ProjectEntityUpdateHandler', function () { } this.ProjectEntityUpdateHandler = SandboxedModule.require(MODULE_PATH, { requires: { - 'settings-sharelatex': { validRootDocExtensions: ['tex'] }, + '@overleaf/settings': { validRootDocExtensions: ['tex'] }, fs: this.fs, '../../models/Doc': { Doc: this.DocModel }, '../Docstore/DocstoreManager': this.DocstoreManager, diff --git a/services/web/test/unit/src/Project/ProjectHelperTests.js b/services/web/test/unit/src/Project/ProjectHelperTests.js index 232ee5811f..0548610d01 100644 --- a/services/web/test/unit/src/Project/ProjectHelperTests.js +++ b/services/web/test/unit/src/Project/ProjectHelperTests.js @@ -36,7 +36,7 @@ describe('ProjectHelper', function () { this.ProjectHelper = SandboxedModule.require(MODULE_PATH, { requires: { mongodb: { ObjectId }, - 'settings-sharelatex': this.Settings, + '@overleaf/settings': this.Settings, }, }) }) diff --git a/services/web/test/unit/src/Project/ProjectHistoryHandlerTests.js b/services/web/test/unit/src/Project/ProjectHistoryHandlerTests.js index d24bd1b6d5..3a8451e282 100644 --- a/services/web/test/unit/src/Project/ProjectHistoryHandlerTests.js +++ b/services/web/test/unit/src/Project/ProjectHistoryHandlerTests.js @@ -44,7 +44,7 @@ describe('ProjectHistoryHandler', function () { return (this.ProjectHistoryHandler = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.Settings = {}), + '@overleaf/settings': (this.Settings = {}), '../../models/Project': { Project: this.ProjectModel, }, diff --git a/services/web/test/unit/src/Project/ProjectOptionsHandlerTests.js b/services/web/test/unit/src/Project/ProjectOptionsHandlerTests.js index 7a11ba97c9..0a1dd7d3f3 100644 --- a/services/web/test/unit/src/Project/ProjectOptionsHandlerTests.js +++ b/services/web/test/unit/src/Project/ProjectOptionsHandlerTests.js @@ -32,7 +32,7 @@ describe('ProjectOptionsHandler', function () { this.handler = SandboxedModule.require(modulePath, { requires: { '../../models/Project': { Project: this.projectModel }, - 'settings-sharelatex': { + '@overleaf/settings': { languages: [ { name: 'English', code: 'en' }, { name: 'French', code: 'fr' }, diff --git a/services/web/test/unit/src/Referal/ReferalAllocatorTests.js b/services/web/test/unit/src/Referal/ReferalAllocatorTests.js index 825e27b532..9adeb74466 100644 --- a/services/web/test/unit/src/Referal/ReferalAllocatorTests.js +++ b/services/web/test/unit/src/Referal/ReferalAllocatorTests.js @@ -13,7 +13,7 @@ describe('ReferalAllocator', function () { User: (this.User = {}), }, '../Subscription/FeaturesUpdater': (this.FeaturesUpdater = {}), - 'settings-sharelatex': (this.Settings = {}), + '@overleaf/settings': (this.Settings = {}), }, }) this.callback = sinon.stub() diff --git a/services/web/test/unit/src/Referal/ReferalFeaturesTests.js b/services/web/test/unit/src/Referal/ReferalFeaturesTests.js index 8b72ffc65a..94a504542f 100644 --- a/services/web/test/unit/src/Referal/ReferalFeaturesTests.js +++ b/services/web/test/unit/src/Referal/ReferalFeaturesTests.js @@ -12,7 +12,7 @@ describe('ReferalFeatures', function () { '../../models/User': { User: (this.User = {}), }, - 'settings-sharelatex': (this.Settings = {}), + '@overleaf/settings': (this.Settings = {}), }, }) this.callback = sinon.stub() diff --git a/services/web/test/unit/src/References/ReferencesControllerTests.js b/services/web/test/unit/src/References/ReferencesControllerTests.js index f77597af68..c013e97a8b 100644 --- a/services/web/test/unit/src/References/ReferencesControllerTests.js +++ b/services/web/test/unit/src/References/ReferencesControllerTests.js @@ -23,7 +23,7 @@ describe('ReferencesController', function () { this.projectId = '2222' this.controller = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { apis: { web: { url: 'http://some.url' } }, }), './ReferencesHandler': (this.ReferencesHandler = { diff --git a/services/web/test/unit/src/References/ReferencesHandlerTests.js b/services/web/test/unit/src/References/ReferencesHandlerTests.js index 0a665cf83a..b0fa942aee 100644 --- a/services/web/test/unit/src/References/ReferencesHandlerTests.js +++ b/services/web/test/unit/src/References/ReferencesHandlerTests.js @@ -47,7 +47,7 @@ describe('ReferencesHandler', function () { this.docIds = ['aaa', 'ccc'] this.handler = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { apis: { references: { url: 'http://some.url/references' }, docstore: { url: 'http://some.url/docstore' }, diff --git a/services/web/test/unit/src/Security/OneTimeTokenHandlerTests.js b/services/web/test/unit/src/Security/OneTimeTokenHandlerTests.js index 0eda2d1e20..2f49c8a7dd 100644 --- a/services/web/test/unit/src/Security/OneTimeTokenHandlerTests.js +++ b/services/web/test/unit/src/Security/OneTimeTokenHandlerTests.js @@ -29,7 +29,7 @@ describe('OneTimeTokenHandler', function () { this.callback = sinon.stub() return (this.OneTimeTokenHandler = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, crypto: { randomBytes: () => this.stubbedToken, }, diff --git a/services/web/test/unit/src/Security/RateLimiterMiddlewareTests.js b/services/web/test/unit/src/Security/RateLimiterMiddlewareTests.js index 06dc41161d..f82d94dd71 100644 --- a/services/web/test/unit/src/Security/RateLimiterMiddlewareTests.js +++ b/services/web/test/unit/src/Security/RateLimiterMiddlewareTests.js @@ -33,7 +33,7 @@ describe('RateLimiterMiddleware', function () { } this.RateLimiterMiddleware = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = {}), + '@overleaf/settings': (this.settings = {}), '../../infrastructure/RateLimiter': (this.RateLimiter = {}), './LoginRateLimiter': {}, '../Authentication/AuthenticationController': this diff --git a/services/web/test/unit/src/Security/SessionAutostartMiddlewareTests.js b/services/web/test/unit/src/Security/SessionAutostartMiddlewareTests.js index 6154250bf2..d4517bda45 100644 --- a/services/web/test/unit/src/Security/SessionAutostartMiddlewareTests.js +++ b/services/web/test/unit/src/Security/SessionAutostartMiddlewareTests.js @@ -18,7 +18,7 @@ describe('SessionAutostartMiddleware', function () { SessionAutostartMiddleware = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': Settings, + '@overleaf/settings': Settings, }, }) diff --git a/services/web/test/unit/src/Settings/SettingsTests.js b/services/web/test/unit/src/Settings/SettingsTests.js index 52b0714984..6633de552f 100644 --- a/services/web/test/unit/src/Settings/SettingsTests.js +++ b/services/web/test/unit/src/Settings/SettingsTests.js @@ -6,7 +6,7 @@ function clearSettingsCache() { require.resolve('../../../../config/settings.defaults.js') ] const settingsDeps = Object.keys(require.cache).filter(x => - x.includes('/settings-sharelatex/') + x.includes('/@overleaf/settings/') ) settingsDeps.forEach(dep => delete require.cache[dep]) } @@ -15,7 +15,7 @@ describe('settings.defaults', function () { it('additional text extensions can be added via config', function () { clearSettingsCache() process.env.ADDITIONAL_TEXT_EXTENSIONS = 'abc, xyz' - const settings = require('settings-sharelatex') + const settings = require('@overleaf/settings') expect(settings.textExtensions).to.include('tex') // from the default list expect(settings.textExtensions).to.include('abc') expect(settings.textExtensions).to.include('xyz') diff --git a/services/web/test/unit/src/Spelling/SpellingControllerTests.js b/services/web/test/unit/src/Spelling/SpellingControllerTests.js index ce18bbb191..e58b065dd4 100644 --- a/services/web/test/unit/src/Spelling/SpellingControllerTests.js +++ b/services/web/test/unit/src/Spelling/SpellingControllerTests.js @@ -28,7 +28,7 @@ describe('SpellingController', function () { this.controller = SandboxedModule.require(modulePath, { requires: { request: this.request, - 'settings-sharelatex': { + '@overleaf/settings': { languages: [ { name: 'English', code: 'en' }, { name: 'French', code: 'fr' }, diff --git a/services/web/test/unit/src/Spelling/SpellingHandlerTests.js b/services/web/test/unit/src/Spelling/SpellingHandlerTests.js index b00c3d576e..eebf3cc175 100644 --- a/services/web/test/unit/src/Spelling/SpellingHandlerTests.js +++ b/services/web/test/unit/src/Spelling/SpellingHandlerTests.js @@ -30,7 +30,7 @@ describe('SpellingHandler', function () { SpellingHandler = SandboxedModule.require(modulePath, { requires: { request: request, - 'settings-sharelatex': { + '@overleaf/settings': { apis: { spelling: { host: SPELLING_HOST, url: SPELLING_URL } }, }, }, diff --git a/services/web/test/unit/src/Subscription/FeaturesUpdaterTests.js b/services/web/test/unit/src/Subscription/FeaturesUpdaterTests.js index 41184a6249..c4facd1b1d 100644 --- a/services/web/test/unit/src/Subscription/FeaturesUpdaterTests.js +++ b/services/web/test/unit/src/Subscription/FeaturesUpdaterTests.js @@ -13,7 +13,7 @@ describe('FeaturesUpdater', function () { './UserFeaturesUpdater': (this.UserFeaturesUpdater = {}), './SubscriptionLocator': (this.SubscriptionLocator = {}), './PlansLocator': (this.PlansLocator = {}), - 'settings-sharelatex': (this.Settings = { + '@overleaf/settings': (this.Settings = { features: { personal: { collaborators: 1, diff --git a/services/web/test/unit/src/Subscription/LimitationsManagerTests.js b/services/web/test/unit/src/Subscription/LimitationsManagerTests.js index 9345543b56..9be6b47803 100644 --- a/services/web/test/unit/src/Subscription/LimitationsManagerTests.js +++ b/services/web/test/unit/src/Subscription/LimitationsManagerTests.js @@ -38,7 +38,7 @@ describe('LimitationsManager', function () { '../Project/ProjectGetter': this.ProjectGetter, '../User/UserGetter': this.UserGetter, './SubscriptionLocator': this.SubscriptionLocator, - 'settings-sharelatex': (this.Settings = {}), + '@overleaf/settings': (this.Settings = {}), '../Collaborators/CollaboratorsGetter': (this.CollaboratorsGetter = {}), '../Collaborators/CollaboratorsInviteHandler': (this.CollaboratorsInviteHandler = {}), './V1SubscriptionManager': (this.V1SubscriptionManager = {}), diff --git a/services/web/test/unit/src/Subscription/PlansLocatorTests.js b/services/web/test/unit/src/Subscription/PlansLocatorTests.js index b2c829c103..0ae540ad89 100644 --- a/services/web/test/unit/src/Subscription/PlansLocatorTests.js +++ b/services/web/test/unit/src/Subscription/PlansLocatorTests.js @@ -32,7 +32,7 @@ describe('PlansLocator', function () { this.PlansLocator = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, }, }) }) diff --git a/services/web/test/unit/src/Subscription/RecurlyClientTests.js b/services/web/test/unit/src/Subscription/RecurlyClientTests.js index f48730ef07..f42a2a8bb1 100644 --- a/services/web/test/unit/src/Subscription/RecurlyClientTests.js +++ b/services/web/test/unit/src/Subscription/RecurlyClientTests.js @@ -62,7 +62,7 @@ describe('RecurlyClient', function () { console: console, }, requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, recurly: this.recurly, 'logger-sharelatex': { err: sinon.stub(), diff --git a/services/web/test/unit/src/Subscription/RecurlyWrapperTests.js b/services/web/test/unit/src/Subscription/RecurlyWrapperTests.js index b016e8e770..fdc9d77dc5 100644 --- a/services/web/test/unit/src/Subscription/RecurlyWrapperTests.js +++ b/services/web/test/unit/src/Subscription/RecurlyWrapperTests.js @@ -145,7 +145,7 @@ describe('RecurlyWrapper', function () { modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, request: sinon.stub(), './Errors': SubscriptionErrors, }, diff --git a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js index 121d27557b..bb2c421162 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js +++ b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js @@ -128,7 +128,7 @@ describe('SubscriptionController', function () { './SubscriptionViewModelBuilder': this.SubscriptionViewModelBuilder, './LimitationsManager': this.LimitationsManager, '../../infrastructure/GeoIpLookup': this.GeoIpLookup, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, '../User/UserGetter': this.UserGetter, './RecurlyWrapper': (this.RecurlyWrapper = { updateAccountEmailAddress: sinon.stub().yields(), diff --git a/services/web/test/unit/src/Subscription/SubscriptionGroupHandlerTests.js b/services/web/test/unit/src/Subscription/SubscriptionGroupHandlerTests.js index 8b6a81cfc9..22b6951c53 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionGroupHandlerTests.js +++ b/services/web/test/unit/src/Subscription/SubscriptionGroupHandlerTests.js @@ -97,7 +97,7 @@ describe('SubscriptionGroupHandler', function () { './LimitationsManager': this.LimitationsManager, '../Security/OneTimeTokenHandler': this.OneTimeTokenHandler, '../Email/EmailHandler': this.EmailHandler, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, '../Notifications/NotificationsBuilder': this.NotificationsBuilder, '../UserMembership/UserMembershipViewModel': this .UserMembershipViewModel, diff --git a/services/web/test/unit/src/Subscription/SubscriptionHandlerTests.js b/services/web/test/unit/src/Subscription/SubscriptionHandlerTests.js index 7f3ba84be7..2da7c0cfd7 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionHandlerTests.js +++ b/services/web/test/unit/src/Subscription/SubscriptionHandlerTests.js @@ -122,7 +122,7 @@ describe('SubscriptionHandler', function () { requires: { './RecurlyWrapper': this.RecurlyWrapper, './RecurlyClient': this.RecurlyClient, - 'settings-sharelatex': this.Settings, + '@overleaf/settings': this.Settings, '../../models/User': { User: this.User, }, diff --git a/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js b/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js index 9c3f2337f9..5c6535b712 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js +++ b/services/web/test/unit/src/Subscription/SubscriptionUpdaterTests.js @@ -117,7 +117,7 @@ describe('SubscriptionUpdater', function () { './SubscriptionLocator': this.SubscriptionLocator, '../User/UserGetter': this.UserGetter, './PlansLocator': this.PlansLocator, - 'settings-sharelatex': this.Settings, + '@overleaf/settings': this.Settings, '../../infrastructure/mongodb': { db: {}, ObjectId }, './FeaturesUpdater': this.FeaturesUpdater, '../../models/DeletedSubscription': { diff --git a/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js b/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js index ded01ad6d2..b9ae93a01c 100644 --- a/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js +++ b/services/web/test/unit/src/Subscription/TeamInvitesHandlerTests.js @@ -86,7 +86,7 @@ describe('TeamInvitesHandler', function () { requires: { mongodb: { ObjectId }, crypto: this.crypto, - 'settings-sharelatex': { siteUrl: 'http://example.com' }, + '@overleaf/settings': { siteUrl: 'http://example.com' }, '../../models/TeamInvite': { TeamInvite: (this.TeamInvite = {}) }, '../../models/Subscription': { Subscription: this.Subscription }, '../User/UserGetter': this.UserGetter, diff --git a/services/web/test/unit/src/Subscription/V1SusbcriptionManagerTests.js b/services/web/test/unit/src/Subscription/V1SusbcriptionManagerTests.js index b9ce29aca1..116750da1e 100644 --- a/services/web/test/unit/src/Subscription/V1SusbcriptionManagerTests.js +++ b/services/web/test/unit/src/Subscription/V1SusbcriptionManagerTests.js @@ -27,7 +27,7 @@ describe('V1SubscriptionManager', function () { this.V1SubscriptionManager = SandboxedModule.require(modulePath, { requires: { '../User/UserGetter': (this.UserGetter = {}), - 'settings-sharelatex': (this.Settings = { + '@overleaf/settings': (this.Settings = { apis: { v1: { host: (this.host = 'http://overleaf.example.com'), diff --git a/services/web/test/unit/src/Templates/TemplatesManagerTests.js b/services/web/test/unit/src/Templates/TemplatesManagerTests.js index 7320498ffd..6daa0518e5 100644 --- a/services/web/test/unit/src/Templates/TemplatesManagerTests.js +++ b/services/web/test/unit/src/Templates/TemplatesManagerTests.js @@ -72,7 +72,7 @@ describe('TemplatesManager', function () { getLoggedInUserId: sinon.stub(), }), '../../infrastructure/FileWriter': this.FileWriter, - 'settings-sharelatex': { + '@overleaf/settings': { path: { dumpFolder: this.dumpFolder, }, diff --git a/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSenderTests.js b/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSenderTests.js index 76bffd9dbe..ba3ffb1d2d 100644 --- a/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSenderTests.js +++ b/services/web/test/unit/src/ThirdPartyDataStore/TpdsUpdateSenderTests.js @@ -60,7 +60,7 @@ describe('TpdsUpdateSender', function () { this.updateSender = SandboxedModule.require(modulePath, { requires: { mongodb: { ObjectId }, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, 'request-promise-native': this.request, '../Collaborators/CollaboratorsGetter': this.CollaboratorsGetter, '../User/UserGetter.js': this.UserGetter, diff --git a/services/web/test/unit/src/ThirdPartyDataStore/UpdateMergerTests.js b/services/web/test/unit/src/ThirdPartyDataStore/UpdateMergerTests.js index a6462dc248..aad0b4a732 100644 --- a/services/web/test/unit/src/ThirdPartyDataStore/UpdateMergerTests.js +++ b/services/web/test/unit/src/ThirdPartyDataStore/UpdateMergerTests.js @@ -15,7 +15,7 @@ describe('UpdateMerger :', function () { '../Uploads/FileTypeManager': (this.FileTypeManager = {}), '../../infrastructure/FileWriter': (this.FileWriter = {}), '../Project/ProjectEntityHandler': (this.ProjectEntityHandler = {}), - 'settings-sharelatex': { path: { dumpPath: 'dump_here' } }, + '@overleaf/settings': { path: { dumpPath: 'dump_here' } }, }, }) this.project_id = 'project_id_here' diff --git a/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js b/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js index ba65af4863..6565d69bbb 100644 --- a/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js +++ b/services/web/test/unit/src/TokenAccess/TokenAccessHandlerTests.js @@ -37,7 +37,7 @@ describe('TokenAccessHandler', function () { requires: { mongodb: { ObjectId }, '../../models/Project': { Project: (this.Project = {}) }, - 'settings-sharelatex': (this.settings = {}), + '@overleaf/settings': (this.settings = {}), '../V1/V1Api': (this.V1Api = { request: sinon.stub(), }), diff --git a/services/web/test/unit/src/Uploads/ArchiveManagerTests.js b/services/web/test/unit/src/Uploads/ArchiveManagerTests.js index 396d17fb57..de23ef28c1 100644 --- a/services/web/test/unit/src/Uploads/ArchiveManagerTests.js +++ b/services/web/test/unit/src/Uploads/ArchiveManagerTests.js @@ -39,7 +39,7 @@ describe('ArchiveManager', function () { this.ArchiveManager = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': {}, + '@overleaf/settings': {}, yauzl: (this.yauzl = { open: sinon.stub().callsArgWith(2, null, this.zipfile), }), diff --git a/services/web/test/unit/src/Uploads/FileSystemImportManagerTests.js b/services/web/test/unit/src/Uploads/FileSystemImportManagerTests.js index 8f045ee3e3..d6495e2781 100644 --- a/services/web/test/unit/src/Uploads/FileSystemImportManagerTests.js +++ b/services/web/test/unit/src/Uploads/FileSystemImportManagerTests.js @@ -25,7 +25,7 @@ describe('FileSystemImportManager', function () { } this.FileSystemImportManager = SandboxedModule.require(MODULE_PATH, { requires: { - 'settings-sharelatex': { + '@overleaf/settings': { textExtensions: ['tex', 'txt'], }, '../Editor/EditorController': this.EditorController, diff --git a/services/web/test/unit/src/Uploads/FileTypeManagerTests.js b/services/web/test/unit/src/Uploads/FileTypeManagerTests.js index 144cb60099..c08845edcb 100644 --- a/services/web/test/unit/src/Uploads/FileTypeManagerTests.js +++ b/services/web/test/unit/src/Uploads/FileTypeManagerTests.js @@ -2,7 +2,7 @@ const sinon = require('sinon') const { expect } = require('chai') const SandboxedModule = require('sandboxed-module') const isUtf8 = require('utf-8-validate') -const Settings = require('settings-sharelatex') +const Settings = require('@overleaf/settings') const modulePath = '../../../../app/src/Features/Uploads/FileTypeManager.js' describe('FileTypeManager', function () { @@ -44,7 +44,7 @@ describe('FileTypeManager', function () { requires: { fs: this.fs, 'utf-8-validate': this.isUtf8, - 'settings-sharelatex': Settings, + '@overleaf/settings': Settings, }, }) }) diff --git a/services/web/test/unit/src/Uploads/ProjectUploadControllerTests.js b/services/web/test/unit/src/Uploads/ProjectUploadControllerTests.js index 532b86379f..d1ecf06ec7 100644 --- a/services/web/test/unit/src/Uploads/ProjectUploadControllerTests.js +++ b/services/web/test/unit/src/Uploads/ProjectUploadControllerTests.js @@ -44,7 +44,7 @@ describe('ProjectUploadController', function () { return (this.ProjectUploadController = SandboxedModule.require(modulePath, { requires: { multer: sinon.stub(), - 'settings-sharelatex': { path: {} }, + '@overleaf/settings': { path: {} }, './ProjectUploadManager': (this.ProjectUploadManager = {}), './FileSystemImportManager': (this.FileSystemImportManager = {}), '@overleaf/metrics': this.metrics, diff --git a/services/web/test/unit/src/User/ThirdPartyIdentityManagerTests.js b/services/web/test/unit/src/User/ThirdPartyIdentityManagerTests.js index 6b10faf381..54e3e3ecb6 100644 --- a/services/web/test/unit/src/User/ThirdPartyIdentityManagerTests.js +++ b/services/web/test/unit/src/User/ThirdPartyIdentityManagerTests.js @@ -28,7 +28,7 @@ describe('ThirdPartyIdentityManager', function () { findOne: sinon.stub().yields(undefined, undefined), }), }, - 'settings-sharelatex': { + '@overleaf/settings': { oauthProviders: { google: { name: 'Google', diff --git a/services/web/test/unit/src/User/UserControllerTests.js b/services/web/test/unit/src/User/UserControllerTests.js index 7ce628a735..a7ec1d2217 100644 --- a/services/web/test/unit/src/User/UserControllerTests.js +++ b/services/web/test/unit/src/User/UserControllerTests.js @@ -114,7 +114,7 @@ describe('UserController', function () { './UserHandler': this.UserHandler, './UserSessionsManager': this.UserSessionsManager, '../Errors/HttpErrorHandler': this.HttpErrorHandler, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, '@overleaf/metrics': { inc() {}, }, diff --git a/services/web/test/unit/src/User/UserEmailsConfirmationHandlerTests.js b/services/web/test/unit/src/User/UserEmailsConfirmationHandlerTests.js index c6e906a1f3..cb9e31bbad 100644 --- a/services/web/test/unit/src/User/UserEmailsConfirmationHandlerTests.js +++ b/services/web/test/unit/src/User/UserEmailsConfirmationHandlerTests.js @@ -26,7 +26,7 @@ describe('UserEmailsConfirmationHandler', function () { beforeEach(function () { this.UserEmailsConfirmationHandler = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { siteUrl: 'emails.example.com', }), '../Security/OneTimeTokenHandler': (this.OneTimeTokenHandler = {}), diff --git a/services/web/test/unit/src/User/UserGetterTests.js b/services/web/test/unit/src/User/UserGetterTests.js index 7285e4b21a..a73d17a378 100644 --- a/services/web/test/unit/src/User/UserGetterTests.js +++ b/services/web/test/unit/src/User/UserGetterTests.js @@ -50,7 +50,7 @@ describe('UserGetter', function () { '@overleaf/metrics': { timeAsyncMethod: sinon.stub(), }, - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { reconfirmNotificationDays: 14, }), '../Institutions/InstitutionsAPI': { diff --git a/services/web/test/unit/src/User/UserPagesControllerTests.js b/services/web/test/unit/src/User/UserPagesControllerTests.js index a09c8a0987..20f59e0316 100644 --- a/services/web/test/unit/src/User/UserPagesControllerTests.js +++ b/services/web/test/unit/src/User/UserPagesControllerTests.js @@ -55,7 +55,7 @@ describe('UserPagesController', function () { } this.UserPagesController = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, './UserGetter': this.UserGetter, './UserSessionsManager': this.UserSessionsManager, '../Errors/ErrorController': this.ErrorController, diff --git a/services/web/test/unit/src/User/UserRegistrationHandlerTests.js b/services/web/test/unit/src/User/UserRegistrationHandlerTests.js index ca316117f0..15748e7b17 100644 --- a/services/web/test/unit/src/User/UserRegistrationHandlerTests.js +++ b/services/web/test/unit/src/User/UserRegistrationHandlerTests.js @@ -51,7 +51,7 @@ describe('UserRegistrationHandler', function () { '../Analytics/AnalyticsManager': (this.AnalyticsManager = { recordEvent: sinon.stub(), }), - 'settings-sharelatex': (this.settings = { + '@overleaf/settings': (this.settings = { siteUrl: 'http://sl.example.com', }), '../Helpers/EmailHelper': EmailHelper, diff --git a/services/web/test/unit/src/User/UserSessionsManagerTests.js b/services/web/test/unit/src/User/UserSessionsManagerTests.js index 56b4511079..ea5e354000 100644 --- a/services/web/test/unit/src/User/UserSessionsManagerTests.js +++ b/services/web/test/unit/src/User/UserSessionsManagerTests.js @@ -55,7 +55,7 @@ describe('UserSessionsManager', function () { } return (this.UserSessionsManager = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, './UserSessionsRedis': this.UserSessionsRedis, }, })) diff --git a/services/web/test/unit/src/User/UserUpdaterTests.js b/services/web/test/unit/src/User/UserUpdaterTests.js index 93e2dc5fdb..0e784c1699 100644 --- a/services/web/test/unit/src/User/UserUpdaterTests.js +++ b/services/web/test/unit/src/User/UserUpdaterTests.js @@ -68,7 +68,7 @@ describe('UserUpdater', function () { refreshFeatures: sinon.stub().resolves(), }, }), - 'settings-sharelatex': (this.settings = {}), + '@overleaf/settings': (this.settings = {}), request: (this.request = {}), '../Newsletter/NewsletterManager': this.NewsletterManager, '../Subscription/RecurlyWrapper': this.RecurlyWrapper, diff --git a/services/web/test/unit/src/infrastructure/FeaturesTests.js b/services/web/test/unit/src/infrastructure/FeaturesTests.js index 3b93b09d9f..7d2068e762 100644 --- a/services/web/test/unit/src/infrastructure/FeaturesTests.js +++ b/services/web/test/unit/src/infrastructure/FeaturesTests.js @@ -6,7 +6,7 @@ describe('Features', function () { beforeEach(function () { this.Features = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': (this.settings = {}), + '@overleaf/settings': (this.settings = {}), }, }) }) diff --git a/services/web/test/unit/src/infrastructure/GeoIpLookupTest.js b/services/web/test/unit/src/infrastructure/GeoIpLookupTest.js index ce3ed9e815..45e0ba0fa3 100644 --- a/services/web/test/unit/src/infrastructure/GeoIpLookupTest.js +++ b/services/web/test/unit/src/infrastructure/GeoIpLookupTest.js @@ -21,7 +21,7 @@ describe('GeoIpLookup', function () { this.GeoIpLookup = SandboxedModule.require(modulePath, { requires: { request: this.request, - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, }, }) this.ipAddress = '12.34.56.78' diff --git a/services/web/test/unit/src/infrastructure/LockManager/ReleasingTheLock.js b/services/web/test/unit/src/infrastructure/LockManager/ReleasingTheLock.js index 14146b6fb2..a5ec96cca7 100644 --- a/services/web/test/unit/src/infrastructure/LockManager/ReleasingTheLock.js +++ b/services/web/test/unit/src/infrastructure/LockManager/ReleasingTheLock.js @@ -23,7 +23,7 @@ const SandboxedModule = require('sandboxed-module') describe('LockManager - releasing the lock', function () { const deleteStub = sinon.stub().callsArgWith(4) const mocks = { - 'settings-sharelatex': { + '@overleaf/settings': { redis: {}, lockManager: { lockTestInterval: 50, diff --git a/services/web/test/unit/src/infrastructure/LockManager/getLockTests.js b/services/web/test/unit/src/infrastructure/LockManager/getLockTests.js index f7c3efad5a..58797e5bb2 100644 --- a/services/web/test/unit/src/infrastructure/LockManager/getLockTests.js +++ b/services/web/test/unit/src/infrastructure/LockManager/getLockTests.js @@ -30,7 +30,7 @@ describe('LockManager - getting the lock', function () { return { auth() {} } }, }, - 'settings-sharelatex': { + '@overleaf/settings': { redis: {}, lockManager: { lockTestInterval: 50, diff --git a/services/web/test/unit/src/infrastructure/LockManager/tryLockTests.js b/services/web/test/unit/src/infrastructure/LockManager/tryLockTests.js index 95940784a4..9252797f2f 100644 --- a/services/web/test/unit/src/infrastructure/LockManager/tryLockTests.js +++ b/services/web/test/unit/src/infrastructure/LockManager/tryLockTests.js @@ -30,7 +30,7 @@ describe('LockManager - trying the lock', function () { } }, }, - 'settings-sharelatex': { + '@overleaf/settings': { redis: {}, lockManager: { lockTestInterval: 50, diff --git a/services/web/test/unit/src/infrastructure/ProxyManagerTests.js b/services/web/test/unit/src/infrastructure/ProxyManagerTests.js index f8f03851c3..fa31285a42 100644 --- a/services/web/test/unit/src/infrastructure/ProxyManagerTests.js +++ b/services/web/test/unit/src/infrastructure/ProxyManagerTests.js @@ -27,7 +27,7 @@ describe('ProxyManager', function () { }) this.proxyManager = SandboxedModule.require(modulePath, { requires: { - 'settings-sharelatex': this.settings, + '@overleaf/settings': this.settings, request: this.request, }, }) diff --git a/services/web/test/unit/src/infrastructure/TranslationsTests.js b/services/web/test/unit/src/infrastructure/TranslationsTests.js index 9e85394af6..66d13e750f 100644 --- a/services/web/test/unit/src/infrastructure/TranslationsTests.js +++ b/services/web/test/unit/src/infrastructure/TranslationsTests.js @@ -14,7 +14,7 @@ describe('Translations', function () { beforeEach(function () { translations = SandboxedModule.require(MODULE_PATH, { requires: { - 'settings-sharelatex': { + '@overleaf/settings': { i18n: { escapeHTMLInVars: false, subdomainLang: {