Helper Scripts
Table of Contents
I replaced OnlyOffice with Collabora in my lab. I was able to extend their WOPI example to produce a Minimum Viable Product. As it stands now, the software is feature complete for my use case. From there, I mount my data to my NFS storage and sync that folder with Dropbox. This lets me use a filebrowser for my currently in work documents. I can then access those contents from my reMarkable using the Dropbox integration. Unfortunately, the reMarkable reads PDFs and not docx. To combat this problem, I have created a nightly script to convert the files to PDF. This is easily packaged into a container and run as a kubernetes cronjob. Since my NFS storage is also a persistent volume claim, I can reuse the same ReadWriteMany mount for both my Waffle WOPI server and the wrapper script to libreoffice.
The Script
#!/usr/bin/env bash
# Defaults: mounted /data directory
input_dir=""
output_dir=""
# Ensure output directory exists
# Convert all .docx → .pdf
files=(""/*.docx)
if [; then
fi
The Dockerfile
FROM debian:bullseye-slim
# Install LibreOffice (soffice)
RUN apt-get update && apt-get install -y libreoffice && rm -rf /var/lib/apt/lists/*
# Working directory for mounted data
WORKDIR /data
# Copy script
COPY convert.sh /usr/local/bin/convert.sh
RUN chmod +x /usr/local/bin/convert.sh
# Default entrypoint
ENTRYPOINT ["/usr/local/bin/convert.sh"]
The Cronjob
apiVersion: batch/v1
kind: CronJob
metadata:
name: remarkable-dropbox-helper
namespace: collabora
spec:
concurrencyPolicy: Forbid
failedJobsHistoryLimit: 1
jobTemplate:
metadata:
name: remarkable-dropbox-helper
spec:
template:
spec:
containers:
- image: docker-domain/remarkable-dropbox-helper:latest
command:
imagePullPolicy: Always
name: remarkable-dropbox-helper
volumeMounts:
- mountPath: /data
name: remarkable-dropbox-helper-pvc
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: regsecret
restartPolicy: OnFailure
terminationGracePeriodSeconds: 30
volumes:
- name: remarkable-dropbox-helper-pvc
persistentVolumeClaim:
claimName: middleware-files-pvc
schedule: '@daily'
timeZone: Europe/Helsinki
successfulJobsHistoryLimit: 1
suspend: false