From 9b3cfce76628855ea101feaf0470e269d0976ba8 Mon Sep 17 00:00:00 2001 From: James Downie Date: Sat, 29 Jun 2024 20:15:47 +1000 Subject: [PATCH 1/7] Setting the cloned bare repository to safe.directory. --- install-onlyoffice.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/install-onlyoffice.sh b/install-onlyoffice.sh index cebb80343..295ed2a39 100755 --- a/install-onlyoffice.sh +++ b/install-onlyoffice.sh @@ -117,6 +117,8 @@ ensure_oo_is_downloaded () { echo "Downloading OnlyOffice..." git clone --bare https://github.com/cryptpad/onlyoffice-builds.git "$BUILDS_DIR" fi + git config --global --add safe.directory /cryptpad/onlyoffice-conf/onlyoffice-builds.git + } install_version () { From e2c9b66fe91f3884c51ecea419c2320e89748774 Mon Sep 17 00:00:00 2001 From: James Downie Date: Sat, 29 Jun 2024 20:36:35 +1000 Subject: [PATCH 2/7] Added a few packages to Dockerfile that are handy for troubleshooting. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e46137658..009662a4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN npm install --production \ # Create actual CryptPad image FROM node:lts-slim ENV DEBIAN_FRONTEND=noninteractive -RUN apt update && apt install -y git rdfind && rm -rf /var/lib/apt/lists/* +RUN apt update && apt install -y git rdfind procps net-tools curl && rm -rf /var/lib/apt/lists/* # Create user and group for CryptPad so it does not run as root RUN groupadd cryptpad -g 4001 From 2d2855679d2eef766f20f928c3ee2bfb922f3ed1 Mon Sep 17 00:00:00 2001 From: James Downie Date: Tue, 2 Jul 2024 09:48:39 +1000 Subject: [PATCH 3/7] Added new install-onlyoffice.sh switch to docker-entrypoint.sh --- docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 3429b90f6..4629fe690 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -31,7 +31,7 @@ fi cd $CPAD_HOME if [ "$CPAD_INSTALL_ONLYOFFICE" == "yes" ]; then - ./install-onlyoffice.sh --accept-license + ./install-onlyoffice.sh --accept-license --trust-repository fi npm run build From b1e30221ce92da9a05aedc2f62c8a7d1b24c28d9 Mon Sep 17 00:00:00 2001 From: James Downie Date: Tue, 2 Jul 2024 19:13:30 +1000 Subject: [PATCH 4/7] Removed a superfluous apt install statement. --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3d23653e7..e2be11805 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,6 @@ RUN npm install --production \ # Create actual CryptPad image FROM node:lts-slim ENV DEBIAN_FRONTEND=noninteractive -RUN apt update && apt install -y git rdfind && rm -rf /var/lib/apt/lists/* # Create user and group for CryptPad so it does not run as root RUN groupadd cryptpad -g 4001 From 8d0c411a38ca1a13784fee32683fda6e9a7458dd Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Mon, 8 Jul 2024 11:51:43 +0200 Subject: [PATCH 5/7] Do not send OO changes when in read only mode https://github.com/cryptpad/cryptpad/issues/1364 --- www/common/onlyoffice/inner.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 4facd8156..3994f269e 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1478,6 +1478,10 @@ define([ send({ type: "message" }); break; case "saveChanges": + if (readOnly) { + return; + } + // If we have unsaved data before reloading for a checkpoint... if (APP.onStrictSaveChanges) { delete APP.unsavedLocks; From 6638c4cc499d75b9db9a741e3b44e2b3eb578f36 Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Mon, 8 Jul 2024 14:49:43 +0200 Subject: [PATCH 6/7] Handle ids of OO read only users correctly --- www/common/onlyoffice/inner.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 3994f269e..12d95112a 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -919,7 +919,10 @@ define([ }; const getMyOOIndex = function() { - return findUserByOOId(myOOId).index; + const user = findUserByOOId(myOOId); + return user + ? user.index + : content.ids.length; // Assign an unused id to read-only users }; var getParticipants = function () { From 072dba254e3c2be32cd6b261d84510909deb713f Mon Sep 17 00:00:00 2001 From: yflory Date: Wed, 10 Jul 2024 14:51:55 +0200 Subject: [PATCH 7/7] Fix calendar refresh issue #1551 --- www/common/outer/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/common/outer/calendar.js b/www/common/outer/calendar.js index 1b3f02231..21bff21ff 100644 --- a/www/common/outer/calendar.js +++ b/www/common/outer/calendar.js @@ -1055,7 +1055,7 @@ define([ var removeClient = function (ctx, cId) { var idx = ctx.clients.indexOf(cId); - ctx.clients.splice(idx, 1); + if (idx !== -1) { ctx.clients.splice(idx, 1); } Object.keys(ctx.calendars).forEach(function (id) { var cal = ctx.calendars[id];