diff --git a/docker-compose.tmpl.yml b/docker-compose.tmpl.yml index df9c876..af458e1 100644 --- a/docker-compose.tmpl.yml +++ b/docker-compose.tmpl.yml @@ -19,6 +19,7 @@ services: - redis - etherpad - bbb-pads + - collabora healthcheck: test: wget --no-proxy --no-verbose --tries=1 --spider http://10.7.7.2:8090/bigbluebutton/api || exit 1 start_period: 2m @@ -298,21 +299,18 @@ services: bbb-net: ipv4_address: 10.7.7.32 - jodconverter: - build: mod/jodconverter - image: alangecker/bbb-docker-jodconverter:latest - security_opt: - - 'no-new-privileges:true' + collabora: + image: collabora/code:latest restart: unless-stopped tmpfs: - /tmp - deploy: - resources: - limits: - memory: 512M networks: bbb-net: ipv4_address: 10.7.7.20 + # disable logging (way to verbose) + logging: + driver: none + periodic: build: mod/periodic diff --git a/mod/bbb-web/office-convert.sh b/mod/bbb-web/office-convert.sh index b4c7c9e..f896bfc 100755 --- a/mod/bbb-web/office-convert.sh +++ b/mod/bbb-web/office-convert.sh @@ -7,6 +7,8 @@ PATH="/bin/:/usr/bin/" # Param 1: Input office file path (e.g. "/tmp/test.odt") # Param 2: Output pdf file path (e.g. "/tmp/test.pdf") # Param 3: Destination Format (pdf default) +# Param 4: Timeout (secs) (optional) + if (( $# == 0 )); then echo "Missing parameter 1 (Input office file path)"; exit 1 @@ -16,15 +18,19 @@ elif (( $# == 1 )); then fi; -source="${1}" -dest="${2}" +source="$1" +dest="$2" -#If output format is missing, define PDF +# If output format is missing, define PDF convertTo="${3:-pdf}" -curl -v -X POST "http://jodconverter:8080/lool/convert-to/$convertTo" \ - -H "accept: application/octet-stream" \ - -H "Content-Type: multipart/form-data" \ - -F "data=@${source}" > "${dest}" +# If timeout is missing, define 60 +timeoutSecs="${4:-60}" +# Truncate timeout to max 3 digits (as expected by sudoers) +timeoutSecs="${timeoutSecs:0:3}" -exit 0 \ No newline at end of file +# The timeout is important. + +timeout $(printf %03d $timeoutSecs)s curl -F "data=@${source}" -k https://collabora:9980/cool/convert-to/$convertTo > "${dest}" + +exit 0 diff --git a/mod/jodconverter/Dockerfile b/mod/jodconverter/Dockerfile deleted file mode 100644 index 8ae7e27..0000000 --- a/mod/jodconverter/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM ghcr.io/jodconverter/jodconverter-examples:rest -RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections -RUN sed -i 's/main/main contrib/' /etc/apt/sources.list.d/debian.sources && apt-get update -RUN apt-get update && apt -y install --no-install-recommends \ - fonts-arkpandora \ - fonts-crosextra-carlito \ - fonts-crosextra-caladea \ - fonts-noto \ - fonts-noto-cjk \ - fonts-liberation \ - fontconfig \ - ttf-mscorefonts-installer - - -# avoid "APPLICATION FAILED TO START. Config data location '/etc/app/' does not exist" -# https://github.com/bigbluebutton/docker/issues/178 -CMD ["--spring.config.additional-location=optional:/etc/app/"] \ No newline at end of file