From 56dcf608e4f81e786e5e55efc8c1aa2fac818fbb Mon Sep 17 00:00:00 2001 From: GuiLeme Date: Fri, 27 Jan 2023 11:07:51 -0300 Subject: [PATCH 01/14] [detect-mime-improvements] - don't validate mime if there is no command, and enhance log's informations --- .../presentation/SupportedFileTypes.java | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java index 48706ff49e..62bfaa0542 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java @@ -111,9 +111,17 @@ public final class SupportedFileTypes { int exitVal = process.waitFor(); if (exitVal == 0) { mimeType = output.toString().trim(); + } else if (exitVal == 127) { + log.error("Command '{}' doesn't exist in this server, please install it.", processBuilder + .command().toArray(new String[0])[2]); + return null; } else { - log.error("Error while executing command {} for file {}, error: {}", - process.toString(), pres.getAbsolutePath(), process.getErrorStream()); + log.error("Error while executing command '{}' for file {}, with bash error number {}.", + processBuilder.command().subList(2, processBuilder.command().size()).stream().reduce("", + (acc, element) -> { + if (acc.isEmpty()) return element; + return acc + " " + element; + }), pres.getAbsolutePath(), exitVal); } } catch (IOException e) { log.error("Could not read file [{}]", pres.getAbsolutePath(), e.getMessage()); @@ -127,11 +135,15 @@ public final class SupportedFileTypes { public static Boolean isPresentationMimeTypeValid(File pres, String fileExtension) { String mimeType = detectMimeType(pres); - if(mimeType == null || mimeType == "") return false; + // This makes sure that if the file command doesn't exist it will simply validate as + // correct mime type because this command is not used anywhere else. + if (mimeType == null) return true; - if(!mimeTypeUtils.getValidMimeTypes().contains(mimeType)) return false; + if (mimeType == "") return false; - if(!mimeTypeUtils.extensionMatchMimeType(mimeType, fileExtension)) { + if (!mimeTypeUtils.getValidMimeTypes().contains(mimeType)) return false; + + if (!mimeTypeUtils.extensionMatchMimeType(mimeType, fileExtension)) { log.error("File with extension [{}] doesn't match with mimeType [{}].", fileExtension, mimeType); return false; } From 6aaa4976f6c8765cfdb28dbe59a9a1065c5a7779 Mon Sep 17 00:00:00 2001 From: Daniel Petri Rocha Date: Sat, 28 Jan 2023 21:45:00 +0100 Subject: [PATCH 02/14] Remove leftover autoSwapLayout param from component --- .../ui/components/presentation/default-content/component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/presentation/default-content/component.jsx b/bigbluebutton-html5/imports/ui/components/presentation/default-content/component.jsx index ced33c1f49..3b42cc0b08 100644 --- a/bigbluebutton-html5/imports/ui/components/presentation/default-content/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/presentation/default-content/component.jsx @@ -18,7 +18,7 @@ export default (props) => { timeout={{ enter: 400 }} > - +

Date: Mon, 30 Jan 2023 15:05:30 +0000 Subject: [PATCH 03/14] fix(whiteboard): update viewport variables after update Tldraw fixed the width/height mismatch bug in the latest version: https://github.com/tldraw/tldraw/pull/1104/commits/eef047268307ef76616561f4eb5b00d5918179f2 --- .../imports/ui/components/whiteboard/component.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx b/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx index 2ff0f9ebb4..3349fff88c 100644 --- a/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx @@ -424,7 +424,7 @@ export default function Whiteboard(props) { if (prevFitToWidth !== null && fitToWidth !== prevFitToWidth) { const zoom = calculateZoom(slidePosition.width, slidePosition.height) tldrawAPI?.setCamera([0, 0], zoom); - const viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.width, slidePosition.height); + const viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.height, slidePosition.height); setZoom(HUNDRED_PERCENT); zoomChanger(HUNDRED_PERCENT); zoomSlide(parseInt(curPageId), podId, HUNDRED_PERCENT, viewedRegionH, 0, 0); @@ -508,13 +508,13 @@ export default function Whiteboard(props) { if (fitToWidth) { const zoom = calculateZoom(slidePosition.width, slidePosition.height) tldrawAPI?.setCamera([0, 0], zoom); - const viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.width, slidePosition.height); + const viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.height, slidePosition.height); zoomSlide(parseInt(curPageId), podId, HUNDRED_PERCENT, viewedRegionH, 0, 0); setZoom(HUNDRED_PERCENT); zoomChanger(HUNDRED_PERCENT); } else if (!isMounting) { - let viewedRegionW = SlideCalcUtil.calcViewedRegionWidth(tldrawAPI?.viewport.height, slidePosition.width); - let viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.width, slidePosition.height); + let viewedRegionW = SlideCalcUtil.calcViewedRegionWidth(tldrawAPI?.viewport.width, slidePosition.width); + let viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.height, slidePosition.height); const camera = tldrawAPI?.getPageState()?.camera; const zoomFitSlide = calculateZoom(slidePosition.width, slidePosition.height); if (!fitToWidth && camera.zoom === zoomFitSlide) { @@ -679,8 +679,8 @@ export default function Whiteboard(props) { isPresenter && zoomChanger(zoomToolbar); } - let viewedRegionW = SlideCalcUtil.calcViewedRegionWidth(tldrawAPI?.viewport.height, slidePosition.width); - let viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.width, slidePosition.height); + let viewedRegionW = SlideCalcUtil.calcViewedRegionWidth(tldrawAPI?.viewport.width, slidePosition.width); + let viewedRegionH = SlideCalcUtil.calcViewedRegionHeight(tldrawAPI?.viewport.height, slidePosition.height); if (!fitToWidth && camera.zoom === zoomFitSlide) { viewedRegionW = HUNDRED_PERCENT; From 6a32e03b7083e74693e5719ddea935a1f79a1712 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Souza?= Date: Mon, 30 Jan 2023 13:05:35 -0300 Subject: [PATCH 04/14] fix pan tool --- .../imports/ui/components/whiteboard/component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx b/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx index 2ff0f9ebb4..154834ea0b 100644 --- a/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx @@ -805,7 +805,7 @@ export default function Whiteboard(props) { const webcams = document.getElementById('cameraDock'); const dockPos = webcams?.getAttribute("data-position"); - if(currentTool) tldrawAPI?.selectTool(currentTool); + if (currentTool && !isPanning) tldrawAPI?.selectTool(currentTool); const editableWB = ( From 4b7c6d90d74c707d2ae1b1392716edcd0d95b0ed Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Mon, 30 Jan 2023 12:19:02 -0500 Subject: [PATCH 05/14] chore: bump release to 2.6.0-rc.2 --- bigbluebutton-config/bigbluebutton-release | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigbluebutton-config/bigbluebutton-release b/bigbluebutton-config/bigbluebutton-release index c306c7be18..2bae9790b5 100644 --- a/bigbluebutton-config/bigbluebutton-release +++ b/bigbluebutton-config/bigbluebutton-release @@ -1 +1 @@ -BIGBLUEBUTTON_RELEASE=2.6.0-rc.1 +BIGBLUEBUTTON_RELEASE=2.6.0-rc.2 From d43d95dbc87f8bb7f1bdff00a62f2c380ebdb02f Mon Sep 17 00:00:00 2001 From: GuiLeme Date: Mon, 30 Jan 2023 16:06:09 -0300 Subject: [PATCH 06/14] [detect-mime-improvements] - changes in review --- .../presentation/SupportedFileTypes.java | 93 +++++++++++-------- 1 file changed, 56 insertions(+), 37 deletions(-) diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java index 62bfaa0542..763b2dc9c6 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java @@ -95,51 +95,70 @@ public final class SupportedFileTypes { * - MimetypesFileTypeMap fileTypeMap.getContentType(File file); * But none of them was as successful as the linux based command */ - public static String detectMimeType(File pres) { - String mimeType = ""; + public static String detectMimeType(File pres) throws IOException, InterruptedException { if (pres != null && pres.isFile()){ - try { - ProcessBuilder processBuilder = new ProcessBuilder(); - processBuilder.command("bash", "-c", "file -b --mime-type " + pres.getAbsolutePath()); - Process process = processBuilder.start(); - StringBuilder output = new StringBuilder(); - BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); - String line; - while ((line = reader.readLine()) != null) { - output.append(line + "\n"); - } - int exitVal = process.waitFor(); - if (exitVal == 0) { - mimeType = output.toString().trim(); - } else if (exitVal == 127) { - log.error("Command '{}' doesn't exist in this server, please install it.", processBuilder - .command().toArray(new String[0])[2]); - return null; - } else { - log.error("Error while executing command '{}' for file {}, with bash error number {}.", - processBuilder.command().subList(2, processBuilder.command().size()).stream().reduce("", - (acc, element) -> { - if (acc.isEmpty()) return element; - return acc + " " + element; - }), pres.getAbsolutePath(), exitVal); - } - } catch (IOException e) { - log.error("Could not read file [{}]", pres.getAbsolutePath(), e.getMessage()); - } catch (InterruptedException e) { - log.error("Flow interrupted for file [{}]", pres.getAbsolutePath(), e.getMessage()); + ProcessBuilder processBuilder = new ProcessBuilder(); + processBuilder.command("bash", "-c", "file -b --mime-type " + pres.getAbsolutePath()); + Process process = processBuilder.start(); + StringBuilder output = new StringBuilder(); + BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + output.append(line + "\n"); } + int exitVal = process.waitFor(); + if (exitVal == 0) { + return output.toString().trim(); + } else { + log.error("Error while executing command '{}' for file {};", + processBuilder.command().subList(2, processBuilder.command().size()).stream().reduce("", + (acc, element) -> { + if (acc.isEmpty()) return element; + return acc + " " + element; + }), pres.getAbsolutePath()); + BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream())); + StringBuilder errorString = new StringBuilder(); + while(stdError.ready()) { + errorString.append(stdError.readLine()); + if(stdError.ready()) { + errorString.append("\n"); + } + } + log.error(errorString.toString()); + if (exitVal == 127) { + return ""; + } else { + throw new RuntimeException(errorString.toString()); + } + } + } else if (pres == null) { + throw new NullPointerException("Presentation is null"); + } else if (!pres.isFile()) { + throw new RuntimeException("Presentation is not a file"); + } else { + throw new RuntimeException("Unexpected error occurred while identifying mime type."); } - return mimeType; } public static Boolean isPresentationMimeTypeValid(File pres, String fileExtension) { - String mimeType = detectMimeType(pres); + String mimeType = ""; - // This makes sure that if the file command doesn't exist it will simply validate as - // correct mime type because this command is not used anywhere else. - if (mimeType == null) return true; + try { + mimeType = detectMimeType(pres); + } catch (IOException e) { + log.error("Could not read file [{}], message: [{}]", pres.getAbsolutePath(), e.getMessage()); + } catch (InterruptedException e) { + log.error("Flow interrupted for file [{}], message: [{}]", pres.getAbsolutePath(), e.getMessage()); + } catch (NullPointerException e) { + log.error("File [{}] cannot be null, [{}]", pres.getAbsolutePath(), e.getMessage()); + } catch (RuntimeException e) { + log.error("Error in 'detectMimeType' function, [{}]", e.getMessage()); + } - if (mimeType == "") return false; + // The only case where we skip the validation is when the bash command + // doesn't exist, for more information on that, see: + // https://github.com/bigbluebutton/bigbluebutton/issues/16363 + if (mimeType.equals("")) return true; if (!mimeTypeUtils.getValidMimeTypes().contains(mimeType)) return false; From 8aebe9734b82697e989ab67e7c3120100b084806 Mon Sep 17 00:00:00 2001 From: GuiLeme Date: Mon, 30 Jan 2023 17:39:02 -0300 Subject: [PATCH 07/14] [detect-mime-improvements] - changes in review --- .../presentation/SupportedFileTypes.java | 89 ++++++++----------- 1 file changed, 38 insertions(+), 51 deletions(-) diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java index 763b2dc9c6..f80bad1c19 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java @@ -96,47 +96,43 @@ public final class SupportedFileTypes { * But none of them was as successful as the linux based command */ public static String detectMimeType(File pres) throws IOException, InterruptedException { - if (pres != null && pres.isFile()){ - ProcessBuilder processBuilder = new ProcessBuilder(); - processBuilder.command("bash", "-c", "file -b --mime-type " + pres.getAbsolutePath()); - Process process = processBuilder.start(); - StringBuilder output = new StringBuilder(); - BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); - String line; - while ((line = reader.readLine()) != null) { - output.append(line + "\n"); - } - int exitVal = process.waitFor(); - if (exitVal == 0) { - return output.toString().trim(); - } else { - log.error("Error while executing command '{}' for file {};", - processBuilder.command().subList(2, processBuilder.command().size()).stream().reduce("", - (acc, element) -> { - if (acc.isEmpty()) return element; - return acc + " " + element; - }), pres.getAbsolutePath()); - BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream())); - StringBuilder errorString = new StringBuilder(); - while(stdError.ready()) { - errorString.append(stdError.readLine()); - if(stdError.ready()) { - errorString.append("\n"); - } - } - log.error(errorString.toString()); - if (exitVal == 127) { - return ""; - } else { - throw new RuntimeException(errorString.toString()); - } - } - } else if (pres == null) { - throw new NullPointerException("Presentation is null"); - } else if (!pres.isFile()) { - throw new RuntimeException("Presentation is not a file"); + + if (pres == null) throw new NullPointerException("Presentation is null"); + if (!pres.isFile()) throw new RuntimeException("Presentation is not a file"); + + ProcessBuilder processBuilder = new ProcessBuilder(); + processBuilder.command("bash", "-c", "file -b --mime-type " + pres.getAbsolutePath()); + Process process = processBuilder.start(); + StringBuilder output = new StringBuilder(); + BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + output.append(line + "\n"); + } + int exitVal = process.waitFor(); + if (exitVal == 0) { + return output.toString().trim(); } else { - throw new RuntimeException("Unexpected error occurred while identifying mime type."); + log.error("Error while executing command '{}' for file {};", + processBuilder.command().subList(2, processBuilder.command().size()).stream().reduce("", + (acc, element) -> { + if (acc.isEmpty()) return element; + return acc + " " + element; + }), pres.getAbsolutePath()); + BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream())); + StringBuilder errorString = new StringBuilder(); + while(stdError.ready()) { + errorString.append(stdError.readLine()); + if(stdError.ready()) { + errorString.append("\n"); + } + } + log.error(errorString.toString()); + if (exitVal == 127) { // skip case error = 127 - command not found + return ""; + } else { + throw new RuntimeException(errorString.toString()); + } } } @@ -145,19 +141,10 @@ public final class SupportedFileTypes { try { mimeType = detectMimeType(pres); - } catch (IOException e) { - log.error("Could not read file [{}], message: [{}]", pres.getAbsolutePath(), e.getMessage()); - } catch (InterruptedException e) { - log.error("Flow interrupted for file [{}], message: [{}]", pres.getAbsolutePath(), e.getMessage()); - } catch (NullPointerException e) { - log.error("File [{}] cannot be null, [{}]", pres.getAbsolutePath(), e.getMessage()); - } catch (RuntimeException e) { - log.error("Error in 'detectMimeType' function, [{}]", e.getMessage()); + } catch (Exception e) { + log.error("Error while detecting mimeType for file [{}]: {}", pres.getAbsolutePath(), e.getMessage()); } - // The only case where we skip the validation is when the bash command - // doesn't exist, for more information on that, see: - // https://github.com/bigbluebutton/bigbluebutton/issues/16363 if (mimeType.equals("")) return true; if (!mimeTypeUtils.getValidMimeTypes().contains(mimeType)) return false; From 7a3253f27c5839547f40eba5e4d053197f665323 Mon Sep 17 00:00:00 2001 From: "transifex-integration[bot]" <43880903+transifex-integration[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 07:47:32 +0000 Subject: [PATCH 08/14] Apply translations in fr translation completed for the source file '/bigbluebutton-html5/public/locales/en.json' on the 'fr' language. --- bigbluebutton-html5/public/locales/fr.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bigbluebutton-html5/public/locales/fr.json b/bigbluebutton-html5/public/locales/fr.json index 6f212a934c..0980521f0d 100644 --- a/bigbluebutton-html5/public/locales/fr.json +++ b/bigbluebutton-html5/public/locales/fr.json @@ -247,7 +247,7 @@ "app.presentationUploader.exportingTimeout": "L'export dure trop longtemps...", "app.presentationUploader.export": "Envoi dans la discussion", "app.presentationUploader.export.linkAvailable": "Le lien de téléchargement {0} est disponible dans la discussion publique", - "app.presentationUploader.export.notAccessibleWarning": "peut ne pas être accessible", + "app.presentationUploader.export.notAccessibleWarning": "Probablement non conforme aux règles d'accessibilité", "app.presentationUploader.currentPresentationLabel": "Présentation courante", "app.presentationUploder.extraHint": "IMPORTANT: Le volume d'un fichier ne doit pas excéder {0} MB et {1} pages.", "app.presentationUploder.uploadLabel": "Télécharger", @@ -266,6 +266,7 @@ "app.presentationUploder.rejectedError": "Le(s) fichier(s) sélectionné(s) a (ont) été rejeté()s. Veuillez vérifier leur format.", "app.presentationUploder.connectionClosedError": "Interruption due à une connectivité faible. Veuillez essayer à nouveau.", "app.presentationUploder.upload.progress": "Chargement ({0}%)", + "app.presentationUploder.conversion.204": "Pas de contenu a capturer", "app.presentationUploder.upload.413": "Le fichier est trop volumineux, il dépasse le maximum de {0} Mo", "app.presentationUploder.genericError": "Oups, quelque chose s'est mal passé...", "app.presentationUploder.upload.408": "Le jeton de demande de téléversement a expiré.", @@ -915,6 +916,7 @@ "app.connection-status.no": "Non", "app.connection-status.notification": "Une perte de votre connexion a été détectée", "app.connection-status.offline": "Hors ligne", + "app.connection-status.clientNotRespondingWarning": "Le client ne répond pas", "app.connection-status.audioUploadRate": "Taux d'envoi audio", "app.connection-status.audioDownloadRate": "Taux de réception audio", "app.connection-status.videoUploadRate": "Taux d'envoi vidéo", From e654ad0477b41f644ff7090218884bddd25e4c7e Mon Sep 17 00:00:00 2001 From: Gustavo Trott Date: Tue, 31 Jan 2023 11:05:14 -0300 Subject: [PATCH 09/14] Use method getContentTypeFor to detect mimeType as alternative when failed using file --- .../presentation/SupportedFileTypes.java | 89 ++++++++++--------- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java index f80bad1c19..eaee3e6add 100755 --- a/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java +++ b/bbb-common-web/src/main/java/org/bigbluebutton/presentation/SupportedFileTypes.java @@ -28,6 +28,7 @@ import java.io.BufferedReader; import java.io.File; import java.io.IOException; import java.io.InputStreamReader; +import java.net.URLConnection; import java.util.ArrayList; import java.util.List; import java.util.Collections; @@ -95,59 +96,63 @@ public final class SupportedFileTypes { * - MimetypesFileTypeMap fileTypeMap.getContentType(File file); * But none of them was as successful as the linux based command */ - public static String detectMimeType(File pres) throws IOException, InterruptedException { + public static String detectMimeType(File pres) { + try { + if (pres == null) throw new NullPointerException("Presentation is null"); + if (!pres.isFile()) throw new RuntimeException("Presentation is not a file"); - if (pres == null) throw new NullPointerException("Presentation is null"); - if (!pres.isFile()) throw new RuntimeException("Presentation is not a file"); + ProcessBuilder processBuilder = new ProcessBuilder(); + processBuilder.command("bash", "-c", "file -b --mime-type \"" + pres.getAbsolutePath() + "\""); + Process process = processBuilder.start(); + StringBuilder output = new StringBuilder(); + BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); + String line; + while ((line = reader.readLine()) != null) { + output.append(line + "\n"); + } + int exitVal = process.waitFor(); + if (exitVal == 0) { + return output.toString().trim(); + } else { + String executedCommand = processBuilder.command().toArray(new String[0])[2]; - ProcessBuilder processBuilder = new ProcessBuilder(); - processBuilder.command("bash", "-c", "file -b --mime-type " + pres.getAbsolutePath()); - Process process = processBuilder.start(); - StringBuilder output = new StringBuilder(); - BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); - String line; - while ((line = reader.readLine()) != null) { - output.append(line + "\n"); - } - int exitVal = process.waitFor(); - if (exitVal == 0) { - return output.toString().trim(); - } else { - log.error("Error while executing command '{}' for file {};", - processBuilder.command().subList(2, processBuilder.command().size()).stream().reduce("", - (acc, element) -> { - if (acc.isEmpty()) return element; - return acc + " " + element; - }), pres.getAbsolutePath()); - BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream())); - StringBuilder errorString = new StringBuilder(); - while(stdError.ready()) { - errorString.append(stdError.readLine()); - if(stdError.ready()) { - errorString.append("\n"); + //Read error stream + BufferedReader stdError = new BufferedReader(new InputStreamReader(process.getErrorStream())); + StringBuilder errorString = new StringBuilder(); + while (stdError.ready()) { + errorString.append(stdError.readLine()); + if (stdError.ready()) { + errorString.append("\n"); + } + } + + log.error("Error while executing command '{}': {}", executedCommand, errorString); + + if (exitVal == 127) { + // 127 - command not found + // use Java method to detect in this case (based on file name) + return URLConnection.getFileNameMap().getContentTypeFor(pres.getAbsolutePath()); + } else { + throw new RuntimeException(errorString.toString()); } } - log.error(errorString.toString()); - if (exitVal == 127) { // skip case error = 127 - command not found - return ""; - } else { - throw new RuntimeException(errorString.toString()); - } + } catch (Exception e) { + log.error("Error while executing detectMimeType: {}", e.getMessage()); } + + return ""; } public static Boolean isPresentationMimeTypeValid(File pres, String fileExtension) { - String mimeType = ""; + String mimeType = detectMimeType(pres); - try { - mimeType = detectMimeType(pres); - } catch (Exception e) { - log.error("Error while detecting mimeType for file [{}]: {}", pres.getAbsolutePath(), e.getMessage()); + if (mimeType == null || mimeType.equals("")) { + return false; } - if (mimeType.equals("")) return true; - - if (!mimeTypeUtils.getValidMimeTypes().contains(mimeType)) return false; + if (!mimeTypeUtils.getValidMimeTypes().contains(mimeType)) { + return false; + } if (!mimeTypeUtils.extensionMatchMimeType(mimeType, fileExtension)) { log.error("File with extension [{}] doesn't match with mimeType [{}].", fileExtension, mimeType); From 3a1b0f43825dc03f676fbcbc8043131067525831 Mon Sep 17 00:00:00 2001 From: KDSBrowne Date: Tue, 31 Jan 2023 16:34:23 +0000 Subject: [PATCH 10/14] fix blank options and question for smartslide yes/no poll --- .../imports/ui/components/presentation/service.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bigbluebutton-html5/imports/ui/components/presentation/service.js b/bigbluebutton-html5/imports/ui/components/presentation/service.js index 7ce55a3428..5bd3a46301 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/service.js +++ b/bigbluebutton-html5/imports/ui/components/presentation/service.js @@ -83,7 +83,7 @@ const parseCurrentSlideContent = (yesValue, noValue, abstentionValue, trueValue, content, } = currentSlide; - const questionRegex = /.*?\?$/gm; + const questionRegex = /.*?\?/gm; const question = safeMatch(questionRegex, content, ''); const doubleQuestionRegex = /\?{2}/gm; @@ -95,6 +95,11 @@ const parseCurrentSlideContent = (yesValue, noValue, abstentionValue, trueValue, const pollRegex = /[1-9A-Ia-i][.)].*/g; let optionsPoll = safeMatch(pollRegex, content, []); const optionsWithLabels = []; + + if (hasYN) { + optionsPoll = ['Yes', 'No']; + } + if (optionsPoll) { optionsPoll = optionsPoll.map((opt) => { const MAX_CHAR_LIMIT = 30; From 2d169bcce1ccd5bac0690b103f66d83a25bb67e1 Mon Sep 17 00:00:00 2001 From: KDSBrowne Date: Tue, 31 Jan 2023 18:31:59 +0000 Subject: [PATCH 11/14] use formatted label for custom poll options when available --- bigbluebutton-html5/imports/ui/components/polling/component.jsx | 2 +- .../imports/ui/components/presentation/service.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/polling/component.jsx b/bigbluebutton-html5/imports/ui/components/polling/component.jsx index ee72afa14e..58e1e6828f 100644 --- a/bigbluebutton-html5/imports/ui/components/polling/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/polling/component.jsx @@ -148,7 +148,7 @@ class Polling extends Component { {answers.map((pollAnswer) => { const formattedMessageIndex = pollAnswer?.key?.toLowerCase(); let label = pollAnswer.key; - if (defaultPoll && pollAnswerIds[formattedMessageIndex]) { + if ((defaultPoll || pollType.includes('CUSTOM')) && pollAnswerIds[formattedMessageIndex]) { label = intl.formatMessage(pollAnswerIds[formattedMessageIndex]); } diff --git a/bigbluebutton-html5/imports/ui/components/presentation/service.js b/bigbluebutton-html5/imports/ui/components/presentation/service.js index 5bd3a46301..4cfddefe15 100755 --- a/bigbluebutton-html5/imports/ui/components/presentation/service.js +++ b/bigbluebutton-html5/imports/ui/components/presentation/service.js @@ -97,7 +97,7 @@ const parseCurrentSlideContent = (yesValue, noValue, abstentionValue, trueValue, const optionsWithLabels = []; if (hasYN) { - optionsPoll = ['Yes', 'No']; + optionsPoll = ['yes', 'no']; } if (optionsPoll) { From d56ba5c388a360a5ebf8dd54e0a56ae36739691a Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Wed, 1 Feb 2023 11:58:19 -0500 Subject: [PATCH 12/14] ci: drop bbb-playback-video from CI --- .github/workflows/automated-tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/automated-tests.yml b/.github/workflows/automated-tests.yml index f95643a76b..3cacf5a908 100644 --- a/.github/workflows/automated-tests.yml +++ b/.github/workflows/automated-tests.yml @@ -33,7 +33,6 @@ jobs: - run: ./build/setup.sh bbb-playback-podcast - run: ./build/setup.sh bbb-playback-presentation - run: ./build/setup.sh bbb-playback-screenshare - - run: ./build/setup.sh bbb-playback-video - run: ./build/setup.sh bbb-record-core - run: ./build/setup.sh bbb-web - run: ./build/setup.sh bbb-webrtc-sfu From 40b69dd34619a0a49454f7c69aff5bccab3b79cf Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Wed, 1 Feb 2023 17:22:25 +0000 Subject: [PATCH 13/14] build: bigbluebutton should not depend on optional packages --- .github/workflows/automated-tests.yml | 1 + build/packages-template/bigbluebutton/build.sh | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/automated-tests.yml b/.github/workflows/automated-tests.yml index 3cacf5a908..f95643a76b 100644 --- a/.github/workflows/automated-tests.yml +++ b/.github/workflows/automated-tests.yml @@ -33,6 +33,7 @@ jobs: - run: ./build/setup.sh bbb-playback-podcast - run: ./build/setup.sh bbb-playback-presentation - run: ./build/setup.sh bbb-playback-screenshare + - run: ./build/setup.sh bbb-playback-video - run: ./build/setup.sh bbb-record-core - run: ./build/setup.sh bbb-web - run: ./build/setup.sh bbb-webrtc-sfu diff --git a/build/packages-template/bigbluebutton/build.sh b/build/packages-template/bigbluebutton/build.sh index b2f9bd28a5..7f8b408718 100755 --- a/build/packages-template/bigbluebutton/build.sh +++ b/build/packages-template/bigbluebutton/build.sh @@ -21,17 +21,12 @@ bbb-freeswitch-core bbb-freeswitch-sounds bbb-fsesl-akka bbb-html5 -bbb-html5-nodejs bbb-learning-dashboard bbb-libreoffice-docker bbb-mkclean bbb-pads bbb-playback -bbb-playback-notes bbb-playback-presentation -bbb-playback-podcast -bbb-playback-screenshare -bbb-playback-video bbb-record-core bbb-web bbb-webrtc-sfu" From d6ab5f6a080f4c67fbcef3b1401bc5402118620f Mon Sep 17 00:00:00 2001 From: Anton Georgiev Date: Wed, 1 Feb 2023 12:44:18 -0500 Subject: [PATCH 14/14] chore: bump bbb-playback to v5.0.0-rc.1 --- bbb-playback.placeholder.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bbb-playback.placeholder.sh b/bbb-playback.placeholder.sh index 40524f8034..92383b10ad 100755 --- a/bbb-playback.placeholder.sh +++ b/bbb-playback.placeholder.sh @@ -1 +1 @@ -git clone --branch v5.0.0-beta.2 --depth 1 https://github.com/bigbluebutton/bbb-playback bbb-playback +git clone --branch v5.0.0-rc.1 --depth 1 https://github.com/bigbluebutton/bbb-playback bbb-playback