Add OnlyOffice #8

Open
opened 2026-03-14 15:21:58 +00:00 by ineiti · 1 comment

I'm trying to add OnlyOffice by following the docker-compose.yaml from the official repo:

https://github.com/cryptpad/cryptpad/blob/main/docker-compose.yml

% git diff HEAD
diff --git a/compose.yml b/compose.yml
index 62309ce..2b3c925 100644
--- a/compose.yml
+++ b/compose.yml
@@ -16,6 +16,7 @@ services:
       - "CPAD_HTTP2_DISABLE=true"
       - "CPAD_TRUST_PROXY=1"
       - "CPAD_CONF=/cryptpad/config/config.js"
+      - "CPAD_INSTALL_ONLYOFFICE=yes"
     volumes:
       - cryptpad_blob:/cryptpad/blob
       - cryptpad_block:/cryptpad/block
@@ -23,6 +24,8 @@ services:
       - cryptpad_data:/cryptpad/data
       - cryptpad_files:/cryptpad/datastore
       - cryptpad_config:/cryptpad/config/
+      - cryptpad_oo_dist:/cryptpad/www/common/onlyoffice/dist
+      - cryptpad_oo_conf:/cryptpad/onlyoffice-conf
     configs:
       - source: config_js
         target: /cryptpad/config/config.js
@@ -35,6 +38,7 @@ services:
         - "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}"
         - "coop-cloud.${STACK_NAME}.version=0.5.2+v2026.2.0"
         - "backupbot.backup=true"
+        - "backupbot.backup.volumes.cryptpad_oo_dist=false"
     healthcheck:
       test: ["CMD", "curl", "-f", "http://localhost:3000"]
       interval: 30s
@@ -76,6 +80,8 @@ volumes:
   cryptpad_data:
   cryptpad_files:
   cryptpad_config:
+  cryptpad_oo_dist:
+  cryptpad_oo_conf:
 
 configs:
   config_js:

But when I start cryptpad, I get the following errors in the logs:

cryptpad_something_app: ?2026-03-14T14:11:15.945134438Z ./install-onlyoffice.sh: line 134: /cryptpad/onlyoffice-conf/onlyoffice.properties: Permission denied

If I remove the volumes in the docker-compose.yaml, it installs successfully. Does anybody have an idea how I can get this installed correctly?

I'm trying to add OnlyOffice by following the docker-compose.yaml from the official repo: https://github.com/cryptpad/cryptpad/blob/main/docker-compose.yml ```patch % git diff HEAD diff --git a/compose.yml b/compose.yml index 62309ce..2b3c925 100644 --- a/compose.yml +++ b/compose.yml @@ -16,6 +16,7 @@ services: - "CPAD_HTTP2_DISABLE=true" - "CPAD_TRUST_PROXY=1" - "CPAD_CONF=/cryptpad/config/config.js" + - "CPAD_INSTALL_ONLYOFFICE=yes" volumes: - cryptpad_blob:/cryptpad/blob - cryptpad_block:/cryptpad/block @@ -23,6 +24,8 @@ services: - cryptpad_data:/cryptpad/data - cryptpad_files:/cryptpad/datastore - cryptpad_config:/cryptpad/config/ + - cryptpad_oo_dist:/cryptpad/www/common/onlyoffice/dist + - cryptpad_oo_conf:/cryptpad/onlyoffice-conf configs: - source: config_js target: /cryptpad/config/config.js @@ -35,6 +38,7 @@ services: - "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-120}" - "coop-cloud.${STACK_NAME}.version=0.5.2+v2026.2.0" - "backupbot.backup=true" + - "backupbot.backup.volumes.cryptpad_oo_dist=false" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000"] interval: 30s @@ -76,6 +80,8 @@ volumes: cryptpad_data: cryptpad_files: cryptpad_config: + cryptpad_oo_dist: + cryptpad_oo_conf: configs: config_js: ``` But when I start cryptpad, I get the following errors in the logs: ``` cryptpad_something_app: ?2026-03-14T14:11:15.945134438Z ./install-onlyoffice.sh: line 134: /cryptpad/onlyoffice-conf/onlyoffice.properties: Permission denied ``` If I remove the volumes in the docker-compose.yaml, it installs successfully. Does anybody have an idea how I can get this installed correctly?
Author

So when creating new directories in docker in the volume section, and if the directory doesn't exist yet, it is created as root:root! Which makes the installation fail, as cryptpad is initialised with 4001:4001...

This is what Claude came up with - not sure if it's the correct thing to do. Specifically the missing healthcheck and no dependency from the app to the init-onlyoffice-dirs makes this more a hack than a good solution:

 % git diff
diff --git a/compose.yml b/compose.yml
index 2b3c925..650e7e3 100644
--- a/compose.yml
+++ b/compose.yml
@@ -2,8 +2,19 @@
 version: "3.8"
 
 services:
+  init-onlyoffice-dirs:
+    image: busybox
+    user: root
+    command: >
+        chown -R 4001:4001 /cryptpad/www/common/onlyoffice/dist /cryptpad/onlyoffice-conf
+    volumes:
+      - cryptpad_oo_dist:/cryptpad/www/common/onlyoffice/dist
+      - cryptpad_oo_conf:/cryptpad/onlyoffice-conf/
+
   app:
     image: cryptpad/cryptpad:version-2026.2.0
+    depends_on:
+      - init-onlyoffice-dirs
     command: ["npm", "start"]
     networks:
       - backend
@@ -25,7 +36,7 @@ services:
       - cryptpad_files:/cryptpad/datastore
       - cryptpad_config:/cryptpad/config/
       - cryptpad_oo_dist:/cryptpad/www/common/onlyoffice/dist
-      - cryptpad_oo_conf:/cryptpad/onlyoffice-conf
+      - cryptpad_oo_conf:/cryptpad/onlyoffice-conf/
     configs:
       - source: config_js
         target: /cryptpad/config/config.js
So when creating new directories in docker in the `volume` section, and if the directory doesn't exist yet, it is created as `root:root`! Which makes the installation fail, as cryptpad is initialised with `4001:4001`... This is what Claude came up with - not sure if it's the correct thing to do. Specifically the missing `healthcheck` and no dependency from the `app` to the `init-onlyoffice-dirs` makes this more a hack than a good solution: ```patch % git diff diff --git a/compose.yml b/compose.yml index 2b3c925..650e7e3 100644 --- a/compose.yml +++ b/compose.yml @@ -2,8 +2,19 @@ version: "3.8" services: + init-onlyoffice-dirs: + image: busybox + user: root + command: > + chown -R 4001:4001 /cryptpad/www/common/onlyoffice/dist /cryptpad/onlyoffice-conf + volumes: + - cryptpad_oo_dist:/cryptpad/www/common/onlyoffice/dist + - cryptpad_oo_conf:/cryptpad/onlyoffice-conf/ + app: image: cryptpad/cryptpad:version-2026.2.0 + depends_on: + - init-onlyoffice-dirs command: ["npm", "start"] networks: - backend @@ -25,7 +36,7 @@ services: - cryptpad_files:/cryptpad/datastore - cryptpad_config:/cryptpad/config/ - cryptpad_oo_dist:/cryptpad/www/common/onlyoffice/dist - - cryptpad_oo_conf:/cryptpad/onlyoffice-conf + - cryptpad_oo_conf:/cryptpad/onlyoffice-conf/ configs: - source: config_js target: /cryptpad/config/config.js ```
Sign in to join this conversation.
No description provided.