Merge pull request #17627 from overleaf/msm-sp-hotfix-5_0_1

[CE/SP] Hotfix 5.0.1

GitOrigin-RevId: ce193b9c7ad7988547289bddb4e8e63d4c718371
This commit is contained in:
Miguel Serrano 2024-04-01 10:43:31 +02:00 committed by Copybot
parent a164eaf517
commit b84e76b201
7 changed files with 312 additions and 0 deletions

View file

@ -0,0 +1,17 @@
FROM sharelatex/sharelatex:5.0.0-RC4
# Bugfix: Grammarly ad shouldn't be displayed in Overleaf CE
COPY pr_17625.patch .
RUN patch -p0 < pr_17625.patch
# Patch: force services to use ipv4 in server-ce container
ADD env.sh /etc/overleaf/env.sh
COPY pr_17601-1.patch /etc/overleaf/
RUN cd /etc/overleaf && patch -p0 < pr_17601-1.patch && rm pr_17601-1.patch
COPY pr_17601-2.patch /overleaf/cron/
RUN cd /overleaf/cron && patch -p0 < pr_17601-2.patch && rm pr_17601-2.patch
COPY pr_17601-3.patch /etc/nginx/sites-enabled/
RUN cd /etc/nginx/sites-enabled && patch -p0 < pr_17601-3.patch && rm pr_17601-3.patch
COPY pr_17601-4.patch /etc/service/
RUN cd /etc/service && patch -p0 < pr_17601-4.patch && rm pr_17601-4.patch

View file

@ -0,0 +1,14 @@
export CHAT_HOST=127.0.0.1
export CLSI_HOST=127.0.0.1
export CONTACTS_HOST=127.0.0.1
export DOCSTORE_HOST=127.0.0.1
export DOCUMENT_UPDATER_HOST=127.0.0.1
export DOCUPDATER_HOST=127.0.0.1
export FILESTORE_HOST=127.0.0.1
export HISTORY_V1_HOST=127.0.0.1
export NOTIFICATIONS_HOST=127.0.0.1
export PROJECT_HISTORY_HOST=127.0.0.1
export REALTIME_HOST=127.0.0.1
export SPELLING_HOST=127.0.0.1
export WEB_HOST=127.0.0.1
export WEB_API_HOST=127.0.0.1

View file

@ -0,0 +1,31 @@
--- settings.js
+++ settings.js
@@ -256,16 +256,16 @@ const settings = {
apis: {
web: {
- url: 'http://localhost:3000',
+ url: 'http://127.0.0.1:3000',
user: httpAuthUser,
pass: httpAuthPass,
},
project_history: {
sendProjectStructureOps: true,
- url: 'http://localhost:3054',
+ url: 'http://127.0.0.1:3054',
},
v1_history: {
- url: process.env.V1_HISTORY_URL || 'http://localhost:3100/api',
+ url: process.env.V1_HISTORY_URL || 'http://127.0.0.1:3100/api',
user: 'staging',
pass: process.env.STAGING_PASSWORD,
requestTimeout: parseInt(
@@ -409,7 +409,7 @@ if (
if (parse(process.env.OVERLEAF_IS_SERVER_PRO) === true) {
settings.bypassPercentageRollouts = true
- settings.apis.references = { url: 'http://localhost:3040' }
+ settings.apis.references = { url: 'http://127.0.0.1:3040' }
}
// Compiler

View file

@ -0,0 +1,63 @@
--- deactivate-projects.sh
+++ deactivate-projects.sh
@@ -14,7 +14,7 @@ if [[ "${ENABLE_CRON_RESOURCE_DELETION:-null}" != "true" ]]; then
exit 0
fi
-WEB_URL='http://localhost:3000'
+WEB_URL='http://127.0.0.1:3000'
USER=$(cat /etc/container_environment/WEB_API_USER)
PASS=$(cat /etc/container_environment/WEB_API_PASSWORD)
--- delete-projects.sh
+++ delete-projects.sh
@@ -14,7 +14,7 @@ if [[ "${ENABLE_CRON_RESOURCE_DELETION:-null}" != "true" ]]; then
exit 0
fi
-WEB_URL='http://localhost:3000'
+WEB_URL='http://127.0.0.1:3000'
USER=$(cat /etc/container_environment/WEB_API_USER)
PASS=$(cat /etc/container_environment/WEB_API_PASSWORD)
--- delete-users.sh
+++ delete-users.sh
@@ -14,7 +14,7 @@ if [[ "${ENABLE_CRON_RESOURCE_DELETION:-null}" != "true" ]]; then
exit 0
fi
-WEB_URL='http://localhost:3000'
+WEB_URL='http://127.0.0.1:3000'
USER=$(cat /etc/container_environment/WEB_API_USER)
PASS=$(cat /etc/container_environment/WEB_API_PASSWORD)
--- project-history-periodic-flush.sh
+++ project-history-periodic-flush.sh
@@ -7,6 +7,6 @@ echo "Flush project-history queue"
echo "--------------------------"
date
-PROJECT_HISTORY_URL='http://localhost:3054'
+PROJECT_HISTORY_URL='http://127.0.0.1:3054'
curl -X POST "${PROJECT_HISTORY_URL}/flush/old?timeout=3600000&limit=5000&background=1"
--- project-history-retry-hard.sh
+++ project-history-retry-hard.sh
@@ -7,6 +7,6 @@ echo "Retry project-history errors (hard)"
echo "-----------------------------------"
date
-PROJECT_HISTORY_URL='http://localhost:3054'
+PROJECT_HISTORY_URL='http://127.0.0.1:3054'
curl -X POST "${PROJECT_HISTORY_URL}/retry/failures?failureType=hard&timeout=3600000&limit=10000"
--- project-history-retry-soft.sh
+++ project-history-retry-soft.sh
@@ -6,6 +6,6 @@ echo "-----------------------------------"
echo "Retry project-history errors (soft)"
echo "-----------------------------------"
-PROJECT_HISTORY_URL='http://localhost:3054'
+PROJECT_HISTORY_URL='http://127.0.0.1:3054'
curl -X POST "${PROJECT_HISTORY_URL}/retry/failures?failureType=soft&timeout=3600000&limit=10000"

View file

@ -0,0 +1,46 @@
--- overleaf.conf
+++ overleaf.conf
@@ -10,7 +10,7 @@ server {
}
location / {
- proxy_pass http://localhost:4000;
+ proxy_pass http://127.0.0.1:4000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
@@ -22,7 +22,7 @@ server {
}
location /socket.io {
- proxy_pass http://localhost:3026;
+ proxy_pass http://127.0.0.1:3026;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
@@ -48,22 +48,22 @@ server {
# handle output files for specific users
location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z]+)$ {
- proxy_pass http://localhost:8080; # clsi-nginx.conf
+ proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
proxy_http_version 1.1;
}
# handle output files for anonymous users
location ~ ^/project/([0-9a-f]+)/build/([0-9a-f-]+)/output/output\.([a-z]+)$ {
- proxy_pass http://localhost:8080; # clsi-nginx.conf
+ proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
proxy_http_version 1.1;
}
# PDF range for specific users
location ~ ^/project/([0-9a-f]+)/user/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
- proxy_pass http://localhost:8080; # clsi-nginx.conf
+ proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
proxy_http_version 1.1;
}
# PDF range for anonymous users
location ~ ^/project/([0-9a-f]+)/content/([0-9a-f-]+/[0-9a-f]+)$ {
- proxy_pass http://localhost:8080; # clsi-nginx.conf
+ proxy_pass http://127.0.0.1:8080; # clsi-nginx.conf
proxy_http_version 1.1;
}

View file

@ -0,0 +1,118 @@
--- chat-overleaf/run
+++ chat-overleaf/run
@@ -6,4 +6,7 @@ if [ "$DEBUG_NODE" == "true" ]; then
NODE_PARAMS="--inspect=0.0.0.0:30100"
fi
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
+
exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/chat/app.js >> /var/log/overleaf/chat.log 2>&1
--- clsi-overleaf/run
+++ clsi-overleaf/run
@@ -15,4 +15,7 @@ if [ -e '/var/run/docker.sock' ]; then
usermod -aG dockeronhost www-data
fi
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
+
exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/clsi/app.js >> /var/log/overleaf/clsi.log 2>&1
--- contacts-overleaf/run
+++ contacts-overleaf/run
@@ -6,4 +6,7 @@ if [ "$DEBUG_NODE" == "true" ]; then
NODE_PARAMS="--inspect=0.0.0.0:30360"
fi
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
+
exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/contacts/app.js >> /var/log/overleaf/contacts.log 2>&1
--- docstore-overleaf/run
+++ docstore-overleaf/run
@@ -6,4 +6,7 @@ if [ "$DEBUG_NODE" == "true" ]; then
NODE_PARAMS="--inspect=0.0.0.0:30160"
fi
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
+
exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/docstore/app.js >> /var/log/overleaf/docstore.log 2>&1
--- document-updater-overleaf/run
+++ document-updater-overleaf/run
@@ -6,4 +6,7 @@ if [ "$DEBUG_NODE" == "true" ]; then
NODE_PARAMS="--inspect=0.0.0.0:30030"
fi
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
+
exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/document-updater/app.js >> /var/log/overleaf/document-updater.log 2>&1
--- filestore-overleaf/run
+++ filestore-overleaf/run
@@ -1,2 +1,6 @@
#!/bin/bash
+
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
+
exec /sbin/setuser www-data /usr/bin/node /overleaf/services/filestore/app.js >> /var/log/overleaf/filestore.log 2>&1
--- notifications-overleaf/run
+++ notifications-overleaf/run
@@ -6,4 +6,7 @@ if [ "$DEBUG_NODE" == "true" ]; then
NODE_PARAMS="--inspect=0.0.0.0:30420"
fi
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
+
exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/notifications/app.js >> /var/log/overleaf/notifications.log 2>&1
--- project-history-overleaf/run
+++ project-history-overleaf/run
@@ -6,4 +6,7 @@ if [ "$DEBUG_NODE" == "true" ]; then
NODE_PARAMS="--inspect=0.0.0.0:30540"
fi
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
+
exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/project-history/app.js >> /var/log/overleaf/project-history.log 2>&1
--- real-time-overleaf/run
+++ real-time-overleaf/run
@@ -1,2 +1,6 @@
#!/bin/bash
+
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
+
exec /sbin/setuser www-data /usr/bin/node /overleaf/services/real-time/app.js >> /var/log/overleaf/real-time.log 2>&1
--- spelling-overleaf/run
+++ spelling-overleaf/run
@@ -6,4 +6,7 @@ if [ "$DEBUG_NODE" == "true" ]; then
NODE_PARAMS="--inspect=0.0.0.0:30050"
fi
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
+
exec /sbin/setuser www-data /usr/bin/node $NODE_PARAMS /overleaf/services/spelling/app.js >> /var/log/overleaf/spelling.log 2>&1
--- web-api-overleaf/run
+++ web-api-overleaf/run
@@ -6,6 +6,7 @@ if [ "$DEBUG_NODE" == "true" ]; then
NODE_PARAMS="--inspect=0.0.0.0:30000"
fi
+source /etc/overleaf/env.sh
export LISTEN_ADDRESS=0.0.0.0
export ENABLED_SERVICES="api"
export METRICS_APP_NAME="web-api"
--- web-overleaf/run
+++ web-overleaf/run
@@ -6,6 +6,8 @@ if [ "$DEBUG_NODE" == "true" ]; then
NODE_PARAMS="--inspect=0.0.0.0:40000"
fi
+source /etc/overleaf/env.sh
+export LISTEN_ADDRESS=127.0.0.1
export ENABLED_SERVICES="web"
export WEB_PORT="4000"

View file

@ -0,0 +1,23 @@
--- services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx
+++ services/web/frontend/js/features/source-editor/components/grammarly-advert.tsx
@@ -6,8 +6,12 @@ import useRemindMeLater from '@/shared/hooks/use-remind-me-later'
import GrammarlyLogo from '@/shared/svgs/grammarly-logo'
import * as eventTracking from '../../../infrastructure/event-tracking'
import useWaitForGrammarlyCheck from '@/shared/hooks/use-wait-for-grammarly-check'
+import getMeta from '@/utils/meta'
+import { ExposedSettings } from '../../../../../types/exposed-settings'
export default function GrammarlyAdvert() {
+ const { isOverleaf } = getMeta('ol-ExposedSettings') as ExposedSettings
+
const [show, setShow] = useState(false)
const { t } = useTranslation()
@@ -57,7 +61,7 @@ export default function GrammarlyAdvert() {
remindThemLater()
}, [remindThemLater])
- if (!show) {
+ if (!isOverleaf || !show) {
return null
}