From 2c7387523f69e7974896a5bfb96bdc4c97ee1ae5 Mon Sep 17 00:00:00 2001 From: notplants <@notplants> Date: Mon, 26 Jan 2026 18:18:16 -0500 Subject: [PATCH] automatic wopi configuration --- README.md | 5 ++++- abra.sh | 2 +- compose.yml | 21 ++++++++++++--------- schedule_wopi.sh | 13 +++++++++++++ scheduler_cron.tmpl | 1 - 5 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 schedule_wopi.sh delete mode 100644 scheduler_cron.tmpl diff --git a/README.md b/README.md index 15267b6..c0bdf31 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,14 @@ This recipe requires four domains. One domain for drive, and one for minio which - make sure to set MINIO_DOMAIN, COLLABORA_DOMAIN, ONLY_OFFICE_DOMAIN to the domains you set up for each. * `abra app deploy ` * `abra app cmd backend migrate` # creates database tables -* `abra app cmd backend trigger_wopi` # connects only office & collabora (if they stop working, try running this again) * `abra app restart minio-createbuckets` (Note: this will appear to fail, but probably worked! Check `abra app logs minio-createbuckets`) You should then be able to visit the landing page of your app, but not yet to login. To login, you need to deploy and integrate single sign on (described below in the "Configure Authentication" section). +Wopi discovery is supposed to happen automatically, but if collabora/onlyoffice are not connecting, you can try running: + +* `abra app cmd backend trigger_wopi` # connects only office & collabora (if they stop working, try running this again) + ## Configure Authentication diff --git a/abra.sh b/abra.sh index 62177d1..7308fc9 100755 --- a/abra.sh +++ b/abra.sh @@ -4,7 +4,7 @@ export ABRA_ENTRYPOINT_VERSION=v5 export NGINX_CONF_VERSION=v6 export ONLYOFFICE_CONF_VERSION=v2 export PG_BACKUP_VERSION=v3 -export SCHEDULER_CRON_VERSION=v1 +export SCHEDULE_WOPI_VERSION=v1 environment() { # this exports all the secrets as environment variables diff --git a/compose.yml b/compose.yml index cf5bc81..be4a52c 100644 --- a/compose.yml +++ b/compose.yml @@ -131,8 +131,8 @@ services: - postgres_p - email_pass - # this may be unnecesary once the PR is merge to use celery beat - # but this is a cron job workaround for now https://github.com/suitenumerique/drive/issues/484 + # this may be unecessary once the PR is merged to use celery beat + # but this is a workaround for now https://github.com/suitenumerique/drive/issues/484 scheduler: image: lasuite/drive-backend:main user: ${DOCKER_USER:-1000} @@ -143,11 +143,14 @@ services: - redis environment: <<: [ *common-env, *postgres-env ] - entrypoint: ["/abra-entrypoint.sh", "/usr/local/bin/entrypoint"] configs: - - source: scheduler_cron - target: /etc/crontabs/root - command: ["crond", "-f", "-l", "2"] + - source: schedule_wopi + target: /app/schedule_wopi.sh + mode: 0755 + - source: abra_entrypoint + target: /abra-entrypoint.sh + mode: 0555 + entrypoint: ["/app/schedule_wopi.sh"] secrets: - django_sk - django_sp @@ -387,9 +390,9 @@ configs: pg_backup: name: ${STACK_NAME}_pg_backup_${PG_BACKUP_VERSION} file: pg_backup.sh - scheduler_cron: - name: ${STACK_NAME}_scheduler_cron_${SCHEDULER_CRON_VERSION} - file: scheduler_cron.tmpl + schedule_wopi: + name: ${STACK_NAME}_schedule_wopi_${SCHEDULE_WOPI_VERSION} + file: schedule_wopi.sh template_driver: golang abra_entrypoint: name: ${STACK_NAME}_entrypoint_${ABRA_ENTRYPOINT_VERSION} diff --git a/schedule_wopi.sh b/schedule_wopi.sh new file mode 100644 index 0000000..7594153 --- /dev/null +++ b/schedule_wopi.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +while true; do + echo "Running WOPI job at $(date)" + # source env + . /abra-entrypoint.sh -e + # run python command + python manage.py trigger_wopi_configuration + echo "++ completed wopi trigger. now sleeping." + # wait before next run + sleep 1800 # 1800 seconds = 30 minutes +done \ No newline at end of file diff --git a/scheduler_cron.tmpl b/scheduler_cron.tmpl deleted file mode 100644 index 50bf0d1..0000000 --- a/scheduler_cron.tmpl +++ /dev/null @@ -1 +0,0 @@ -*/5 * * * * cd /app && python manage.py trigger_wopi_configuration >> /proc/1/fd/1 2>&1 \ No newline at end of file