@@ -62,23 +62,79 @@ docker run --rm -it -p 8080:8080 -v "$(pwd)/build":/data/cozy-app/***my-app*** c
6262
6363## Only-Office document server
6464
65- The ` cozy/onlyoffice-dev ` docker image can be used for local development on
66- Linux (the ` --net=host ` option doesn't work on macOS). Just start it with:
65+ ### Option 1: With Helper Script
66+
67+ Use the helper script that works on both Linux and macOS:
68+
69+ ``` bash
70+ ./scripts/start-oo.sh
71+ ```
72+
73+ The script automatically:
74+ - Collects all instance hostnames from cozy-stack
75+ - Starts OnlyOffice with proper ` --add-host ` mappings
76+ - Waits for OnlyOffice to be ready
77+
78+ ### Option 2: Manual Docker Command
79+
80+ ** For macOS and Linux (port mapping):**
6781
6882``` bash
69- $ docker run -it --rm --name=oodev --net=host cozy/onlyoffice-dev
83+ docker run -d --name onlyoffice-ds \
84+ -p 8000:80 \
85+ -e JWT_ENABLED=false \
86+ -e ALLOW_PRIVATE_IP_ADDRESS=true \
87+ -e ALLOW_META_IP_ADDRESS=true \
88+ --add-host=cozy.localhost:host-gateway \
89+ onlyoffice/documentserver:latest
7090```
7191
72- and run the stack with:
92+ ** For Linux only ( ` --net=host ` ): **
7393
7494``` bash
75- $ cozy-stack serve --disable-csp --onlyoffice-url=http://localhost:8000 --onlyoffice-inbox-secret=inbox_secret --onlyoffice-outbox-secret=outbox_secret
76- $ cozy-stack features defaults ' {"drive.office": {"enabled": true, "write": true}}'
95+ docker run -d --name onlyoffice-ds \
96+ --net=host \
97+ -e JWT_ENABLED=false \
98+ -e ALLOW_PRIVATE_IP_ADDRESS=true \
99+ -e ALLOW_META_IP_ADDRESS=true \
100+ -e DS_PORT=8000 \
101+ onlyoffice/documentserver:latest
102+ ```
103+
104+ ### Configure cozy-stack
105+
106+ Add to your ` ~/.cozy/cozy.yaml ` :
107+
108+ ``` yaml
109+ contexts :
110+ default :
111+ onlyoffice_url : http://localhost:8000/
112+
113+ office :
114+ default :
115+ onlyoffice_url : http://localhost:8000/
116+ onlyoffice_inbox_secret : " "
117+ onlyoffice_outbox_secret : " "
77118` ` `
78119
79- If you need to rebuild it, you can do that with:
120+ ### Enable Feature Flag
80121
81122` ` ` bash
82- $ cd scripts/onlyoffice-dev
83- $ docker build -t " cozy/onlyoffice-dev" .
123+ cozy-stack features defaults '{"drive.office" : {"enabled": true, "write": true}}'
84124` ` `
125+
126+ ### Troubleshooting
127+
128+ **OnlyOffice can't download the document:**
129+ - Check OnlyOffice logs: ` docker logs onlyoffice-ds`
130+ - Look for DNS errors like `ENOTFOUND cozy.localhost`
131+ - Ensure `--add-host` flag was applied : ` docker exec onlyoffice-ds cat /etc/hosts | grep cozy`
132+ - Ensure `ALLOW_PRIVATE_IP_ADDRESS=true` is set
133+
134+ **"Download failed" error in editor:**
135+ - The Document Server can't reach cozy-stack
136+ - Verify connectivity : ` docker exec onlyoffice-ds wget -qO- http://cozy.localhost:8080/`
137+
138+ **No "Open with OnlyOffice" option in Drive:**
139+ - Check feature flag : ` cozy-stack features show`
140+ - Verify context has `onlyoffice_url` : check `/settings/context` endpoint
0 commit comments