From 9b3cfce76628855ea101feaf0470e269d0976ba8 Mon Sep 17 00:00:00 2001 From: James Downie Date: Sat, 29 Jun 2024 20:15:47 +1000 Subject: [PATCH 1/9] 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/9] 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/9] 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/9] 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/9] 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/9] 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/9] 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]; From 848387edcce1dd765cf12f98dd9dfd9c433aeb22 Mon Sep 17 00:00:00 2001 From: DianaXWiki <139217939+DianaXWiki@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:49:15 +0300 Subject: [PATCH 8/9] Fix overlapping variable names --- www/code/inner.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/code/inner.js b/www/code/inner.js index 670e2097a..4be60351a 100644 --- a/www/code/inner.js +++ b/www/code/inner.js @@ -106,7 +106,7 @@ define([ framework._.toolbar.$theme.append($showAuthorColors); markers.setButton($showAuthorColors); }; - var mkPrintButton = function (framework, $content) { + var mkPrintButton = function (framework, $content, $print) { var $printButton = framework._.sfCommon.createButton('print', true); $printButton.click(function () { $print.html($content.html()); @@ -115,8 +115,8 @@ define([ framework.feedback('PRINT_CODE'); UI.clearTooltipsDelay(); }); - var $print = UIElements.getEntryFromButton($printButton); - framework._.toolbar.$drawer.append($print); + var $dropdownEntry = UIElements.getEntryFromButton($printButton); + framework._.toolbar.$drawer.append($dropdownEntry); }; var mkMarkdownTb = function (editor, framework) { var $codeMirrorContainer = $('#cp-app-code-container'); From 13a82303e051df48cc3ff3c8198a6816f5b7d6c5 Mon Sep 17 00:00:00 2001 From: yflory Date: Fri, 12 Jul 2024 11:29:13 +0200 Subject: [PATCH 9/9] Make background color white while printing --- customize.dist/src/print.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/customize.dist/src/print.css b/customize.dist/src/print.css index 076a294a9..7cdf6d3c9 100644 --- a/customize.dist/src/print.css +++ b/customize.dist/src/print.css @@ -8,3 +8,8 @@ margin: 3cm; size: A4 portrait; } +@media print { + body { + background: white !important; + } +}