Skip to content

Commit

Permalink
office-conversion: switch from jodconverter to collabora
Browse files Browse the repository at this point in the history
  • Loading branch information
alangecker committed Nov 24, 2024
1 parent c740f55 commit c298e05
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 34 deletions.
16 changes: 7 additions & 9 deletions docker-compose.tmpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
22 changes: 14 additions & 8 deletions mod/bbb-web/office-convert.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}"

# The timeout is important.

timeout $(printf %03d $timeoutSecs)s curl -F "data=@${source}" -k https://collabora:9980/cool/convert-to/$convertTo > "${dest}"

exit 0
exit 0
17 changes: 0 additions & 17 deletions mod/jodconverter/Dockerfile

This file was deleted.

0 comments on commit c298e05

Please sign in to comment.