From ef094326c927b4f695bd148a167750e1613d991c Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Fri, 2 May 2025 09:41:31 +0200 Subject: [PATCH 01/13] Add a warning when using x2t with LibreOffice documents --- customize.dist/messages.js | 2 ++ www/common/common-interface.js | 30 ++++++++++++++++++++++++++++++ www/common/onlyoffice/inner.js | 18 ++++++++++++++---- 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/customize.dist/messages.js b/customize.dist/messages.js index 4d62fc52e..257f1eec2 100755 --- a/customize.dist/messages.js +++ b/customize.dist/messages.js @@ -140,6 +140,8 @@ define(req, function(AppConfig, Default, Language) { Messages.badges_premium = "Premium user"; Messages.badges_error = "Error while validating this user's data"; Messages.profile_badges = "Badges"; + Messages.oo_unstableMigrationWarning = "In- and exporting from and to LibreOffice file formats is not very stable right now. " + + "However, we'll try our best to convert your document."; return Messages; diff --git a/www/common/common-interface.js b/www/common/common-interface.js index 92633fdf1..187ba1724 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -727,6 +727,36 @@ define([ }; }; + UI.alertPromise = function (msg, opt) { + return new Promise((resolve) => { + UI.alert(msg, resolve, opt); + }); + }; + + /** + * @callback promptCallback + * @param {string} value - the value the user chose + */ + + /** + * Optional parameters for UI.prompt() + * @typedef {Object} PromptParams + * @property {boolean} [password] - if true: ask the user for a password + * @property {Element} [typeInput] - if set: add a dropdown next to the text input field (create it with UIElements.createDropdown()) + * @property {Object} [inputOpts] - parameters for dialog.textInput() + * @property {string} [ok] - caption for the OK button + * @property {string} [cancel] - caption for the cancel button + */ + + /** + * Show a popup to ask something. + * + * @param {(string|Element)} [msg] - Message/title to show + * @param {string} [def] - the default value + * @param {promptCallback} [cb] - called when the used selected a value + * @param {PromptParams} [opt] - optional settings for the prompt + * @param {boolean} [force] - if true: do not HTML escape msg + */ UI.prompt = function (msg, def, cb, opt, force) { cb = cb || function () {}; opt = opt || {}; diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index f447fc398..d490358c4 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -63,7 +63,8 @@ define([ var PENDING_TIMEOUT = 30000; const HISTORY_KEEPER_INDEX_USER = 1; const READ_ONLY_INDEX_USER = 2; - + const BROKEN_EXPORT_FORMATS = ['odt', 'odp']; + const BROKEN_IMPORT_FORMATS = ['odp']; //var READONLY_REFRESH_TO = 15000; var debug = function (x, type) { @@ -2230,7 +2231,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null warning ]); - UI.prompt(promptMessage, Util.fixFileName(suggestion), function (filename) { + UI.prompt(promptMessage, Util.fixFileName(suggestion), async function (filename) { // $select.getValue() if (!(typeof(filename) === 'string' && filename)) { return; } var ext = ($select.getValue() || '').slice(1); @@ -2240,6 +2241,10 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null return; } + if (BROKEN_EXPORT_FORMATS.includes(ext)) { + await UI.alertPromise(Messages.oo_unstableMigrationWarning); + } + var content = h('div.cp-oo-x2tXls', [ h('span.fa.fa-spin.fa-spinner'), h('span', Messages.oo_exportInProgress) @@ -2335,7 +2340,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null if (!content) { UI.removeModals(); return void UI.alert(Messages.oo_invalidFormat); -    } + } var blob = new Blob([content], {type: 'plain/text'}); var file = getFileType(); blob.name = (metadataMgr.getMetadataLazy().title || file.doc) + '.' + file.type; @@ -2357,10 +2362,15 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null APP.FM.handleFile(blob, data); }; - var importXLSXFile = function(content, filename, ext) { + var importXLSXFile = async function(content, filename, ext) { // Perform the x2t conversion debug("Filename"); debug(filename); + + if (BROKEN_IMPORT_FORMATS.includes(ext)) { + await UI.alertPromise(Messages.oo_unstableMigrationWarning); + } + if (ext === "bin") { return void importFile(content); } From 3e2d8c3aa2cab974c19c12e63ce56e58b79cd50b Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Mon, 5 May 2025 10:17:36 +0200 Subject: [PATCH 02/13] Add warning message when importing unstable x2t doc in drive https://github.com/cryptpad/cryptpad/issues/1883 --- www/common/common-util.js | 6 ++++++ www/common/drive-ui.js | 18 ++++++++++++------ www/common/onlyoffice/broken-formats.js | 9 +++++++++ www/common/onlyoffice/inner.js | 8 ++++---- 4 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 www/common/onlyoffice/broken-formats.js diff --git a/www/common/common-util.js b/www/common/common-util.js index c48bf809f..aa939e5d1 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -867,6 +867,12 @@ const factory = (NaclUtil) => { }; /* End of code copied from saferphore */ + Util.requirePromise = function(modulePath){ + return new Promise((resolve) => { + require([modulePath], resolve); + }); + } + return Util; }; diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index e397e0a84..944b8919d 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -1652,15 +1652,15 @@ define([ if (($(e.target).offset().top + $(e.target).height()) > ($(window).height()-$menu.height())) { if ( $(e.target).offset().top < $menu.height()) { menuPositionTop = 0; - + } else { - menuPositionTop = ($(e.target).offset().top - $menu.height()); - } + menuPositionTop = ($(e.target).offset().top - $menu.height()); + } } else { menuPositionTop = $(e.target).offset().top + $(e.target).outerHeight(); } if (($(e.target).offset().left + $(e.target).width()) < $menu.width()) { - menuPositionLeft = $(e.target).offset().left; + menuPositionLeft = $(e.target).offset().left; } else { menuPositionLeft = $(e.target).offset().left - ($menu.width() - $(e.target).width()) + 10; } @@ -4841,7 +4841,7 @@ define([ }); }; - var openInApp = function (paths, app) { + var openInApp = async function (paths, app) { var p = paths[0]; var el = manager.find(p.path); var path = currentPath; @@ -4854,6 +4854,13 @@ define([ password: _metadata.password, channel: _metadata.channel, }; + + const ext = _simpleData.title.split('.').pop(); + const brokenFormats = await Util.requirePromise('/common/onlyoffice/broken-formats.js'); + if (brokenFormats.brokenImportFormats.includes(ext)) { + await UI.alertPromise(Messages.oo_unstableMigrationWarning); + } + openIn(app, path, APP.team, _simpleData); }; @@ -5642,4 +5649,3 @@ define([ logError: logError }; }); - diff --git a/www/common/onlyoffice/broken-formats.js b/www/common/onlyoffice/broken-formats.js new file mode 100644 index 000000000..34c5a1024 --- /dev/null +++ b/www/common/onlyoffice/broken-formats.js @@ -0,0 +1,9 @@ + +// SPDX-FileCopyrightText: 2023 XWiki CryptPad Team and contributors +// +// SPDX-License-Identifier: AGPL-3.0-or-later + +define({ + brokenExportFormats: ['odt', 'odp'], + brokenImportFormats: ['odp'], +}); diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index d490358c4..cb1c1d2dc 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -63,8 +63,6 @@ define([ var PENDING_TIMEOUT = 30000; const HISTORY_KEEPER_INDEX_USER = 1; const READ_ONLY_INDEX_USER = 2; - const BROKEN_EXPORT_FORMATS = ['odt', 'odp']; - const BROKEN_IMPORT_FORMATS = ['odp']; //var READONLY_REFRESH_TO = 15000; var debug = function (x, type) { @@ -2241,7 +2239,8 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null return; } - if (BROKEN_EXPORT_FORMATS.includes(ext)) { + const brokenFormats = await Util.requirePromise('/common/onlyoffice/broken-formats.js'); + if (brokenFormats.brokenExportFormats.includes(ext)) { await UI.alertPromise(Messages.oo_unstableMigrationWarning); } @@ -2367,7 +2366,8 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null debug("Filename"); debug(filename); - if (BROKEN_IMPORT_FORMATS.includes(ext)) { + const brokenFormats = await Util.requirePromise('/common/onlyoffice/broken-formats.js'); + if (brokenFormats.brokenImportFormats.includes(ext)) { await UI.alertPromise(Messages.oo_unstableMigrationWarning); } From a37c0100dd67474740aa0158db2323e9689c82fe Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Mon, 5 May 2025 10:22:24 +0200 Subject: [PATCH 03/13] Fix linter warnings --- www/common/common-util.js | 4 +- www/common/onlyoffice/inner.js | 151 +++++++++++++++++---------------- 2 files changed, 78 insertions(+), 77 deletions(-) diff --git a/www/common/common-util.js b/www/common/common-util.js index aa939e5d1..65216993c 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -867,11 +867,11 @@ const factory = (NaclUtil) => { }; /* End of code copied from saferphore */ - Util.requirePromise = function(modulePath){ + Util.requirePromise = function (modulePath) { return new Promise((resolve) => { require([modulePath], resolve); }); - } + }; return Util; }; diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index cb1c1d2dc..433a11e94 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1961,82 +1961,7 @@ define([ APP.UploadImageFiles = function (files, type, id, jwt, cb) { return void cb(); }; - APP.AddImage = function(cb1, cb2) { - APP.AddImageSuccessCallback = cb1; - APP.AddImageErrorCallback = cb2; - common.openFilePicker({ - types: ['file'], - where: ['root'], - filter: { - fileType: ['image/'] - } - }, function (data) { - if (data.type !== 'file') { - debug("Unexpected data type picked " + data.type); - return; - } - var name = data.name; - // Add image to the list - var mediasSources = getMediasSources(); - - // Check if name already exists - var getUniqueName = function (name, mediasSources) { - var get = function () { - var s = name.split('.'); - if (s.length > 1) { - s[s.length - 2] = s[s.length - 2] + '-' + Util.uid(); - name = s.join('.'); - } else { - name += '-'+ Util.uid(); - } - }; - while (mediasSources[name]) { get(); } - return name; - }; - if (mediasSources[name]) { - name = getUniqueName(name, mediasSources); - data.name = name; - } - mediasSources[name] = data; - APP.onLocal(); - - APP.realtime.onSettle(function () { - getImageURL(name).then(function(url) { - debug("CRYPTPAD success add " + name); - common.setPadAttribute('atime', +new Date(), null, data.href); - APP.AddImageSuccessCallback({ - name: name, - url: url - }); - }); - }); - }); - }; - - APP.remoteTheme = function () { - /* - APP.themeRemote = true; - */ - }; - APP.changeTheme = function (/*id*/) { - /* - // disabled: -Uncaught TypeError: Cannot read property 'calculatedType' of null - at CPresentation.changeTheme (sdk-all.js?ver=4.11.0-1633612942653-1633619288217:15927) - */ - - /* - APP.themeChanged = { - id: id - }; - */ - }; - APP.openURL = function (url) { - common.openUnsafeURL(url); - }; - - APP.loadingImage = 0; const getImageURL = function(name) { return new Promise((resolve) => { if (name && /^data:image/.test(name)) { @@ -2129,6 +2054,82 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null }); }; + APP.AddImage = function(cb1, cb2) { + APP.AddImageSuccessCallback = cb1; + APP.AddImageErrorCallback = cb2; + common.openFilePicker({ + types: ['file'], + where: ['root'], + filter: { + fileType: ['image/'] + } + }, function (data) { + if (data.type !== 'file') { + debug("Unexpected data type picked " + data.type); + return; + } + var name = data.name; + + // Add image to the list + var mediasSources = getMediasSources(); + + // Check if name already exists + var getUniqueName = function (name, mediasSources) { + var get = function () { + var s = name.split('.'); + if (s.length > 1) { + s[s.length - 2] = s[s.length - 2] + '-' + Util.uid(); + name = s.join('.'); + } else { + name += '-'+ Util.uid(); + } + }; + while (mediasSources[name]) { get(); } + return name; + }; + if (mediasSources[name]) { + name = getUniqueName(name, mediasSources); + data.name = name; + } + mediasSources[name] = data; + APP.onLocal(); + + APP.realtime.onSettle(function () { + getImageURL(name).then(function(url) { + debug("CRYPTPAD success add " + name); + common.setPadAttribute('atime', +new Date(), null, data.href); + APP.AddImageSuccessCallback({ + name: name, + url: url + }); + }); + }); + }); + }; + + APP.remoteTheme = function () { + /* + APP.themeRemote = true; + */ + }; + APP.changeTheme = function (/*id*/) { + /* + // disabled: +Uncaught TypeError: Cannot read property 'calculatedType' of null + at CPresentation.changeTheme (sdk-all.js?ver=4.11.0-1633612942653-1633619288217:15927) + */ + + /* + APP.themeChanged = { + id: id + }; + */ + }; + APP.openURL = function (url) { + common.openUnsafeURL(url); + }; + + APP.loadingImage = 0; // Always hide right menu try { localStorage?.original?.removeItem('sse-hide-right-settings'); From bcc1278fe7c7cc9c5575e9009899d885e2f0027a Mon Sep 17 00:00:00 2001 From: AAAMON Date: Mon, 12 May 2025 12:28:18 +0300 Subject: [PATCH 04/13] Make install oo script automatically install only needed versions --- install-onlyoffice.sh | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/install-onlyoffice.sh b/install-onlyoffice.sh index bdadd6c6b..5e2d75736 100755 --- a/install-onlyoffice.sh +++ b/install-onlyoffice.sh @@ -27,24 +27,28 @@ main() { ask_for_license - # Remember the 1st version that is installed. This will help us install only - # needed OnlyOffice versions in a later version of this script. - set_prop oldest_needed_version v1 + # Check if 'oldest_needed_version' is already set, if not, set it to v8 + if [ -z "${PROPS['oldest_needed_version']}" ]; then + echo "'oldest_needed_version' is not set. Setting it to v8." + set_prop "oldest_needed_version" "v8" + else + echo "'oldest_needed_version' is already set to ${PROPS['oldest_needed_version']}. No changes made." + fi mkdir -p "$OO_DIR" - echo "Do you want to install all available OnlyOffice versions? (Y/N)" - read -r install_all + available_versions=(v1 v2b v4 v5 v6 v7 v8 x2t) - declare -a selected_versions - - if [[ "$install_all" =~ ^[Yy] ]]; then - selected_versions=(v1 v2b v4 v5 v6 v7 v8 x2t) - else - echo "Select which versions to install (space-separated), options are:" - echo " v1 v2b v4 v5 v6 v7 v8 x2t" - read -ra selected_versions - fi + start_installing=false + for version in "${available_versions[@]}"; do + if [ "$start_installing" = true ]; then + selected_versions+=("$version") + elif [ "$version" = "${PROPS['oldest_needed_version']}" ]; then + start_installing=true + selected_versions+=("$version") + fi + done + for version in "${selected_versions[@]}"; do case $version in From 4abb843a01eb76f43a83640e50e58e7029b4a4b6 Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Tue, 13 May 2025 10:50:13 +0200 Subject: [PATCH 05/13] Warn about OO8 size in CHANGELOG https://github.com/cryptpad/cryptpad/issues/1897 --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 54073eb29..ff02bb4b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ SPDX-FileCopyrightText: 2023 XWiki CryptPad Team and cont SPDX-License-Identifier: AGPL-3.0-or-later --> +# Release (2025.3.1) + +> [!NOTE] +> The new version of OnlyOffice is much bigger than the previous versions. When installing version 8.3 with `install-onlyoffice.sh` ~830MB additional disk space is needed. + # 💐 Spring 2025 release (2025.3.0) ## Goals From 238e3a6dc2616ae02667a6b8120a2a0af0b6a33b Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Tue, 13 May 2025 15:45:19 +0200 Subject: [PATCH 06/13] Simplify loading of BrokenFormats module --- www/common/common-util.js | 6 ------ www/common/drive-ui.js | 7 ++++--- www/common/onlyoffice/inner.js | 10 +++++----- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/www/common/common-util.js b/www/common/common-util.js index 65216993c..c48bf809f 100644 --- a/www/common/common-util.js +++ b/www/common/common-util.js @@ -867,12 +867,6 @@ const factory = (NaclUtil) => { }; /* End of code copied from saferphore */ - Util.requirePromise = function (modulePath) { - return new Promise((resolve) => { - require([modulePath], resolve); - }); - }; - return Util; }; diff --git a/www/common/drive-ui.js b/www/common/drive-ui.js index 944b8919d..b76b8216b 100644 --- a/www/common/drive-ui.js +++ b/www/common/drive-ui.js @@ -25,6 +25,7 @@ define([ '/customize/messages.js', '/customize/pages.js', '/common/pad-types.js', + '/common/onlyoffice/broken-formats.js', ], function ( $, ApiConfig, @@ -45,7 +46,8 @@ define([ AppConfig, Messages, Pages, - PadTypes) + PadTypes, + BrokenFormats) { var APP = window.APP = { @@ -4856,8 +4858,7 @@ define([ }; const ext = _simpleData.title.split('.').pop(); - const brokenFormats = await Util.requirePromise('/common/onlyoffice/broken-formats.js'); - if (brokenFormats.brokenImportFormats.includes(ext)) { + if (BrokenFormats.brokenImportFormats.includes(ext)) { await UI.alertPromise(Messages.oo_unstableMigrationWarning); } diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 433a11e94..c5c25c705 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -24,6 +24,7 @@ define([ '/common/onlyoffice/ooslide_base.js', '/common/onlyoffice/current-version.js', + '/common/onlyoffice/broken-formats.js', '/components/file-saver/FileSaver.min.js', 'css!/components/bootstrap/dist/css/bootstrap.min.css', @@ -49,7 +50,8 @@ define([ EmptyCell, EmptyDoc, EmptySlide, - OOCurrentVersion) + OOCurrentVersion, + BrokenFormats) { var saveAs = window.saveAs; var APP = window.APP = { @@ -2240,8 +2242,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null return; } - const brokenFormats = await Util.requirePromise('/common/onlyoffice/broken-formats.js'); - if (brokenFormats.brokenExportFormats.includes(ext)) { + if (BrokenFormats.brokenExportFormats.includes(ext)) { await UI.alertPromise(Messages.oo_unstableMigrationWarning); } @@ -2367,8 +2368,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null debug("Filename"); debug(filename); - const brokenFormats = await Util.requirePromise('/common/onlyoffice/broken-formats.js'); - if (brokenFormats.brokenImportFormats.includes(ext)) { + if (BrokenFormats.brokenImportFormats.includes(ext)) { await UI.alertPromise(Messages.oo_unstableMigrationWarning); } From 63c49de42ba6c30892dcbd6023f949416c0a1f86 Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Tue, 6 May 2025 11:06:04 +0200 Subject: [PATCH 07/13] Show error message when x2t conversion fails in OO editor https://github.com/cryptpad/cryptpad/issues/1888 --- customize.dist/messages.js | 2 +- www/common/onlyoffice/inner.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/customize.dist/messages.js b/customize.dist/messages.js index 4d62fc52e..f0adf04e5 100755 --- a/customize.dist/messages.js +++ b/customize.dist/messages.js @@ -140,7 +140,7 @@ define(req, function(AppConfig, Default, Language) { Messages.badges_premium = "Premium user"; Messages.badges_error = "Error while validating this user's data"; Messages.profile_badges = "Badges"; - + Messages.oo_couldNotConvertDocument = "The conversion of the document failed. Note that MS file formats are currently more stable."; return Messages; }); diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index f447fc398..f82b7dd9f 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1598,8 +1598,8 @@ define([ mediasData: mediasData }, function (err, obj) { if (err || !obj || !obj.data) { - UI.warn(Messages.error); - return void cb(); + UI.alert(Messages.oo_couldNotConvertDocument, cb); + return; } cb(obj.data, obj.images); }, { @@ -2185,7 +2185,7 @@ Uncaught TypeError: Cannot read property 'calculatedType' of null saveAs(blob, finalFilename); return; } - UI.warn(Messages.error); + UI.alert(Messages.oo_couldNotConvertDocument); }); }; From dc638883983322538b3f6fc0a2f8d013633d4418 Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Tue, 13 May 2025 16:06:39 +0200 Subject: [PATCH 08/13] Revert "Make install oo script automatically install only needed versions" This reverts commit bcc1278fe7c7cc9c5575e9009899d885e2f0027a. --- install-onlyoffice.sh | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/install-onlyoffice.sh b/install-onlyoffice.sh index 5e2d75736..bdadd6c6b 100755 --- a/install-onlyoffice.sh +++ b/install-onlyoffice.sh @@ -27,28 +27,24 @@ main() { ask_for_license - # Check if 'oldest_needed_version' is already set, if not, set it to v8 - if [ -z "${PROPS['oldest_needed_version']}" ]; then - echo "'oldest_needed_version' is not set. Setting it to v8." - set_prop "oldest_needed_version" "v8" - else - echo "'oldest_needed_version' is already set to ${PROPS['oldest_needed_version']}. No changes made." - fi + # Remember the 1st version that is installed. This will help us install only + # needed OnlyOffice versions in a later version of this script. + set_prop oldest_needed_version v1 mkdir -p "$OO_DIR" - available_versions=(v1 v2b v4 v5 v6 v7 v8 x2t) + echo "Do you want to install all available OnlyOffice versions? (Y/N)" + read -r install_all - start_installing=false - for version in "${available_versions[@]}"; do - if [ "$start_installing" = true ]; then - selected_versions+=("$version") - elif [ "$version" = "${PROPS['oldest_needed_version']}" ]; then - start_installing=true - selected_versions+=("$version") - fi - done - + declare -a selected_versions + + if [[ "$install_all" =~ ^[Yy] ]]; then + selected_versions=(v1 v2b v4 v5 v6 v7 v8 x2t) + else + echo "Select which versions to install (space-separated), options are:" + echo " v1 v2b v4 v5 v6 v7 v8 x2t" + read -ra selected_versions + fi for version in "${selected_versions[@]}"; do case $version in From 36ebfc5cea772ba9e8f5d0303f29a668329c2b8c Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Tue, 13 May 2025 16:06:43 +0200 Subject: [PATCH 09/13] Revert "Remove help and dictionaries from older oo versions & fix oo script expecting clean env" This reverts commit 1266255f0c06ee1aacf983d41184a562494ccef7. --- install-onlyoffice.sh | 58 +++++++++++-------------------------------- 1 file changed, 14 insertions(+), 44 deletions(-) diff --git a/install-onlyoffice.sh b/install-onlyoffice.sh index bdadd6c6b..3bff02b31 100755 --- a/install-onlyoffice.sh +++ b/install-onlyoffice.sh @@ -15,10 +15,6 @@ PROPS_FILE="$CONF_DIR"/onlyoffice.properties declare -A PROPS main() { - - # clean build env in case a previous build has failed - rm -rf "$BUILDS_DIR" - mkdir -p "$CONF_DIR" load_props @@ -32,6 +28,14 @@ main() { set_prop oldest_needed_version v1 mkdir -p "$OO_DIR" + install_old_version v1 4f370beb + install_old_version v2b d9da72fd + install_old_version v4 6ebc6938 + install_old_version v5 88a356f0 + install_old_version v6 abd8a309 + install_version v7 v7.3.3.60+10 be3c926d534b0c77aa1ed83b170a38b9e56ebbbfd73a1a968f523d63c5ed69ecdb063fad08740812de82c1e79af7309faf67ffdd81b45451adce539192f3414c + install_version v8 v8.3.3.23+0 d3752926a68a487c5f855651a8966c04b320277a0dd2dfc3a4c1537b8d925cf59ec93a15f97664cbdb8867c32a94e105798b28751e0ef49521bc72c323b634a8 + install_x2t v7.3+1 ab0c05b0e4c81071acea83f0c6a8e75f5870c360ec4abc4af09105dd9b52264af9711ec0b7020e87095193ac9b6e20305e446f2321a541f743626a598e5318c1 echo "Do you want to install all available OnlyOffice versions? (Y/N)" read -r install_all @@ -48,46 +52,12 @@ main() { for version in "${selected_versions[@]}"; do case $version in - v1) - set_prop oldest_needed_version v1; install_old_version v1 4f370beb - # We delete 'help' from previous versions as they are useless and take up storage - rm -rf "$OO_DIR/v1/web-apps/apps/documenteditor/main/resources/help" - rm -rf "$OO_DIR/v1/web-apps/apps/presentationeditor/main/resources/help" - rm -rf "$OO_DIR/v1/web-apps/apps/spreadsheeteditor/main/resources/help" - ;; - v2b) - install_old_version v2b d9da72fd - rm -rf "$OO_DIR/v2b/web-apps/apps/documenteditor/main/resources/help" - rm -rf "$OO_DIR/v2b/web-apps/apps/presentationeditor/main/resources/help" - rm -rf "$OO_DIR/v2b/web-apps/apps/spreadsheeteditor/main/resources/help" - ;; - v4) - install_old_version v4 6ebc6938 - rm -rf "$OO_DIR/v4/web-apps/apps/documenteditor/main/resources/help" - rm -rf "$OO_DIR/v4/web-apps/apps/presentationeditor/main/resources/help" - rm -rf "$OO_DIR/v4/web-apps/apps/spreadsheeteditor/main/resources/help" - ;; - v5) - install_old_version v5 88a356f0 - rm -rf "$OO_DIR/v5/web-apps/apps/documenteditor/main/resources/help" - rm -rf "$OO_DIR/v5/web-apps/apps/presentationeditor/main/resources/help" - rm -rf "$OO_DIR/v5/web-apps/apps/spreadsheeteditor/main/resources/help" - ;; - v6) - install_old_version v6 abd8a309 - rm -rf "$OO_DIR/v6/web-apps/apps/documenteditor/main/resources/help" - rm -rf "$OO_DIR/v6/web-apps/apps/presentationeditor/main/resources/help" - rm -rf "$OO_DIR/v6/web-apps/apps/spreadsheeteditor/main/resources/help" - ;; - v7) - install_version v7 v7.3.3.60+10 be3c926d534b0c77aa1ed83b170a38b9e56ebbbfd73a1a968f523d63c5ed69ecdb063fad08740812de82c1e79af7309faf67ffdd81b45451adce539192f3414c - rm -rf "$OO_DIR/v7/web-apps/apps/documenteditor/main/resources/help" - rm -rf "$OO_DIR/v7/web-apps/apps/presentationeditor/main/resources/help" - rm -rf "$OO_DIR/v7/web-apps/apps/spreadsheeteditor/main/resources/help" - rm -rf "$OO_DIR/v7/web-apps/apps/common/main/resources/help/" - # From all the older versions only v7 has 'dictionaries', we remove it for the same reasons - rm -rf "$OO_DIR/v7/dictionaries/" - ;; + v1) set_prop oldest_needed_version v1; install_old_version v1 4f370beb ;; + v2b) install_old_version v2b d9da72fd ;; + v4) install_old_version v4 6ebc6938 ;; + v5) install_old_version v5 88a356f0 ;; + v6) install_old_version v6 abd8a309 ;; + v7) install_version v7 v7.3.3.60+10 be3c926d534b0c77aa1ed83b170a38b9e56ebbbfd73a1a968f523d63c5ed69ecdb063fad08740812de82c1e79af7309faf67ffdd81b45451adce539192f3414c ;; v8) install_version v8 v8.3.0.83+3 fbf77671ea8b960b6c65fdad025980894dfc9ed0b79d9540951f56c79871d0bde3361f29a35b9653764f7802ec74df01601b6c9961e0f3118988422667563470 ;; x2t) install_x2t v7.3+1 ab0c05b0e4c81071acea83f0c6a8e75f5870c360ec4abc4af09105dd9b52264af9711ec0b7020e87095193ac9b6e20305e446f2321a541f743626a598e5318c1 ;; *) From 9923382550d924580b93753e9e312a3a304c3730 Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Tue, 13 May 2025 16:06:45 +0200 Subject: [PATCH 10/13] Revert "Modify OO install script so you can selectively install versions" This reverts commit 80ef7f61cb96f0385a2facd0e60f0a49775ce595. --- install-onlyoffice.sh | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/install-onlyoffice.sh b/install-onlyoffice.sh index 3bff02b31..c688bc430 100755 --- a/install-onlyoffice.sh +++ b/install-onlyoffice.sh @@ -37,36 +37,6 @@ main() { install_version v8 v8.3.3.23+0 d3752926a68a487c5f855651a8966c04b320277a0dd2dfc3a4c1537b8d925cf59ec93a15f97664cbdb8867c32a94e105798b28751e0ef49521bc72c323b634a8 install_x2t v7.3+1 ab0c05b0e4c81071acea83f0c6a8e75f5870c360ec4abc4af09105dd9b52264af9711ec0b7020e87095193ac9b6e20305e446f2321a541f743626a598e5318c1 - echo "Do you want to install all available OnlyOffice versions? (Y/N)" - read -r install_all - - declare -a selected_versions - - if [[ "$install_all" =~ ^[Yy] ]]; then - selected_versions=(v1 v2b v4 v5 v6 v7 v8 x2t) - else - echo "Select which versions to install (space-separated), options are:" - echo " v1 v2b v4 v5 v6 v7 v8 x2t" - read -ra selected_versions - fi - - for version in "${selected_versions[@]}"; do - case $version in - v1) set_prop oldest_needed_version v1; install_old_version v1 4f370beb ;; - v2b) install_old_version v2b d9da72fd ;; - v4) install_old_version v4 6ebc6938 ;; - v5) install_old_version v5 88a356f0 ;; - v6) install_old_version v6 abd8a309 ;; - v7) install_version v7 v7.3.3.60+10 be3c926d534b0c77aa1ed83b170a38b9e56ebbbfd73a1a968f523d63c5ed69ecdb063fad08740812de82c1e79af7309faf67ffdd81b45451adce539192f3414c ;; - v8) install_version v8 v8.3.0.83+3 fbf77671ea8b960b6c65fdad025980894dfc9ed0b79d9540951f56c79871d0bde3361f29a35b9653764f7802ec74df01601b6c9961e0f3118988422667563470 ;; - x2t) install_x2t v7.3+1 ab0c05b0e4c81071acea83f0c6a8e75f5870c360ec4abc4af09105dd9b52264af9711ec0b7020e87095193ac9b6e20305e446f2321a541f743626a598e5318c1 ;; - *) - echo "Unknown version: $version" - exit 1 - ;; - esac - done - rm -rf "$BUILDS_DIR" if [ "${RDFIND+x}" != "x" ]; then From 733608ccbbeba83aefd4f17fcaa7ffbbcd799b55 Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Tue, 13 May 2025 16:09:00 +0200 Subject: [PATCH 11/13] Clean OnlyOffice environment before installing https://github.com/cryptpad/cryptpad/issues/1777 --- install-onlyoffice.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install-onlyoffice.sh b/install-onlyoffice.sh index c688bc430..ef5a40d66 100755 --- a/install-onlyoffice.sh +++ b/install-onlyoffice.sh @@ -15,6 +15,10 @@ PROPS_FILE="$CONF_DIR"/onlyoffice.properties declare -A PROPS main() { + + # clean build env in case a previous build has failed + rm -rf "$BUILDS_DIR" + mkdir -p "$CONF_DIR" load_props From b12ec703648f43ee73104f13e9b4b06c40d987cb Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Tue, 13 May 2025 17:17:40 +0200 Subject: [PATCH 12/13] Upgrade OnlyOffice to 8.3.3.23+1 --- install-onlyoffice.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-onlyoffice.sh b/install-onlyoffice.sh index ef5a40d66..b85f38ac4 100755 --- a/install-onlyoffice.sh +++ b/install-onlyoffice.sh @@ -38,7 +38,7 @@ main() { install_old_version v5 88a356f0 install_old_version v6 abd8a309 install_version v7 v7.3.3.60+10 be3c926d534b0c77aa1ed83b170a38b9e56ebbbfd73a1a968f523d63c5ed69ecdb063fad08740812de82c1e79af7309faf67ffdd81b45451adce539192f3414c - install_version v8 v8.3.3.23+0 d3752926a68a487c5f855651a8966c04b320277a0dd2dfc3a4c1537b8d925cf59ec93a15f97664cbdb8867c32a94e105798b28751e0ef49521bc72c323b634a8 + install_version v8 v8.3.3.23+1 b9647468ef26c915788da3b2528e0496ba5fa78d5e7acb85eca11241cc325478d94f5508fdcf085b42adf0cad8eda830d71be87c58918d1f01a86c979da6f4e5 install_x2t v7.3+1 ab0c05b0e4c81071acea83f0c6a8e75f5870c360ec4abc4af09105dd9b52264af9711ec0b7020e87095193ac9b6e20305e446f2321a541f743626a598e5318c1 rm -rf "$BUILDS_DIR" From 4b3247277af2bcbbd23ca3b8d15ba0980ba20908 Mon Sep 17 00:00:00 2001 From: Wolfgang Ginolas Date: Tue, 13 May 2025 17:24:16 +0200 Subject: [PATCH 13/13] Remove tmp translations --- customize.dist/messages.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/customize.dist/messages.js b/customize.dist/messages.js index 2d999853b..27f4a6995 100755 --- a/customize.dist/messages.js +++ b/customize.dist/messages.js @@ -140,9 +140,6 @@ define(req, function(AppConfig, Default, Language) { Messages.badges_premium = "Premium user"; Messages.badges_error = "Error while validating this user's data"; Messages.profile_badges = "Badges"; - Messages.oo_unstableMigrationWarning = "In- and exporting from and to LibreOffice file formats is not very stable right now. " - + "However, we'll try our best to convert your document."; - Messages.oo_couldNotConvertDocument = "The conversion of the document failed. Note that MS file formats are currently more stable."; return Messages; });