From 58303de9f4102e93a4fcdf27b840c6182d6e1773 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Wed, 2 Jul 2025 11:27:02 +0100 Subject: [PATCH] Enable full project search in Community Edition and Server Pro (#25753) GitOrigin-RevId: 1def9c3e190c907d41b7f822831e12c8609e9c7c --- develop/README.md | 2 +- develop/dev.env | 3 +++ develop/docker-compose.dev.yml | 2 +- .../src/Features/Compile/CompileController.js | 14 ++++++++++--- services/web/config/settings.defaults.js | 21 ++++++++++++++++--- 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/develop/README.md b/develop/README.md index 568259c4e3..8d45383c23 100644 --- a/develop/README.md +++ b/develop/README.md @@ -42,7 +42,7 @@ To do this, use the included `bin/dev` script: bin/dev ``` -This will start all services using `nodemon`, which will automatically monitor the code and restart the services as necessary. +This will start all services using `node --watch`, which will automatically monitor the code and restart the services as necessary. To improve performance, you can start only a subset of the services in development mode by providing a space-separated list to the `bin/dev` script: diff --git a/develop/dev.env b/develop/dev.env index aae91497db..6ebbbb1ffd 100644 --- a/develop/dev.env +++ b/develop/dev.env @@ -6,14 +6,17 @@ DOCUMENT_UPDATER_HOST=document-updater FILESTORE_HOST=filestore GRACEFUL_SHUTDOWN_DELAY_SECONDS=0 HISTORY_V1_HOST=history-v1 +HISTORY_REDIS_HOST=redis LISTEN_ADDRESS=0.0.0.0 MONGO_HOST=mongo MONGO_URL=mongodb://mongo/sharelatex?directConnection=true NOTIFICATIONS_HOST=notifications PROJECT_HISTORY_HOST=project-history +QUEUES_REDIS_HOST=redis REALTIME_HOST=real-time REDIS_HOST=redis SESSION_SECRET=foo +V1_HISTORY_HOST=history-v1 WEBPACK_HOST=webpack WEB_API_PASSWORD=overleaf WEB_API_USER=overleaf diff --git a/develop/docker-compose.dev.yml b/develop/docker-compose.dev.yml index 4432a24162..3d2fca7e0b 100644 --- a/develop/docker-compose.dev.yml +++ b/develop/docker-compose.dev.yml @@ -113,7 +113,7 @@ services: - ../services/real-time/config:/overleaf/services/real-time/config web: - command: ["node", "--watch", "app.js", "--watch-locales"] + command: ["node", "--watch", "app.mjs", "--watch-locales"] environment: - NODE_OPTIONS=--inspect=0.0.0.0:9229 ports: diff --git a/services/web/app/src/Features/Compile/CompileController.js b/services/web/app/src/Features/Compile/CompileController.js index 9d5cbf63b9..8f2e289680 100644 --- a/services/web/app/src/Features/Compile/CompileController.js +++ b/services/web/app/src/Features/Compile/CompileController.js @@ -1,4 +1,4 @@ -const { URL, URLSearchParams } = require('url') +const { URL } = require('url') const { pipeline } = require('stream/promises') const { Cookie } = require('tough-cookie') const OError = require('@overleaf/o-error') @@ -580,10 +580,18 @@ const _CompileController = { }) url = new URL(`${Settings.apis.clsi.url}${url}`) - url.search = new URLSearchParams({ + + const searchParams = { ...persistenceOptions.qs, ...qs, - }).toString() + } + for (const [key, value] of Object.entries(searchParams)) { + if (value !== undefined) { + // avoid sending "undefined" as a string value + url.searchParams.set(key, value) + } + } + const timer = new Metrics.Timer( 'proxy_to_clsi', 1, diff --git a/services/web/config/settings.defaults.js b/services/web/config/settings.defaults.js index 07558a0420..6edb19e6df 100644 --- a/services/web/config/settings.defaults.js +++ b/services/web/config/settings.defaults.js @@ -996,9 +996,24 @@ module.exports = { settingsEntries: [], autoCompleteExtensions: [], sectionTitleGenerators: [], - toastGenerators: [], - editorSidebarComponents: [], - fileTreeToolbarComponents: [], + toastGenerators: [ + Path.resolve( + __dirname, + '../frontend/js/features/pdf-preview/components/synctex-toasts' + ), + ], + editorSidebarComponents: [ + Path.resolve( + __dirname, + '../modules/full-project-search/frontend/js/components/full-project-search.tsx' + ), + ], + fileTreeToolbarComponents: [ + Path.resolve( + __dirname, + '../modules/full-project-search/frontend/js/components/full-project-search-button.tsx' + ), + ], fullProjectSearchPanel: [], integrationPanelComponents: [], referenceSearchSetting: [],