Hi Alexandre,
The DS Serverâs example application works fine, when the onlyoffice container is contacted directly (not through a proxy).
In our case, we use Traefik in front of the DS server, in order to add an additional control layer and provide SSL connectivity.
Our Traefik v2 config within docker-compose (amended for security) is:
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.onlyoffice-headers.headers.customrequestheaders.accessControlAllowOriginList=*"
- "traefik.http.middlewares.onlyoffice-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
#- "traefik.http.middlewares.onlyoffice-headers.headers.customrequestheaders.X-Forwarded-Host=hostregexp(`{host:.+}`) && PathPrefix(`/onlyoffice/`)"
#- "traefik.http.middlewares.onlyoffice-stripprefix.stripprefix.prefixes=/onlyoffice"
- "traefik.http.routers.onlyoffice.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.onlyoffice.entrypoints=onlyoffice-sec"
- "traefik.http.routers.onlyoffice.middlewares=onlyoffice-headers"
- "traefik.http.routers.onlyoffice.service=onlyoffice"
- "traefik.http.routers.onlyoffice.tls=true"
- "traefik.http.services.onlyoffice.loadbalancer.server.port=80"
- "traefik.http.services.onlyoffice.loadbalancer.passhostheader=true"
networks:
- intnet
- traefik
Note the two commented lines. We tried to setup onlyoffice DS as https://myserver.mydomain.com/onlyoffice/ . In that case, the example application (which normally works) was not operational, as it tries to load editor JS files from the root (/) and not through the desired subpath (/onlyoffice/). [any suggestion on that? is that a bug of the example application?]
Thus, we decided to go forward with the integration by hosting owncloud (v10.13.1.3) and onlyoffice in two different ports.
Intnet is the name of the internal network, whereas traefik is the name of the Traefik network.
The respective owncloud Trafik setup is:
labels:
- "traefik.enable=true"
- "traefik.http.middlewares.oc-rep.redirectregex.regex=https://(.*)/.well-known/(card|cal)dav"
- "traefik.http.middlewares.oc-rep.redirectregex.replacement=https://$$1/remote.php/dav/"
- "traefik.http.middlewares.oc-rep.redirectregex.permanent=true"
- "traefik.http.middlewares.oc-header.headers.referrerPolicy=no-referrer"
- "traefik.http.middlewares.oc-header.headers.stsSeconds=31536000"
- "traefik.http.middlewares.oc-header.headers.forceSTSHeader=true"
- "traefik.http.middlewares.oc-header.headers.stsPreload=true"
- "traefik.http.middlewares.oc-header.headers.stsIncludeSubdomains=true"
- "traefik.http.middlewares.oc-header.headers.browserXssFilter=true"
- "traefik.http.middlewares.oc-header.headers.customRequestHeaders.X-Forwarded-Proto=https"
- "traefik.http.middlewares.oc-header.headers.customRequestHeaders.X-XSS-Protection=0"
- "traefik.http.routers.owncloud.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.owncloud.entrypoints=websecure"
- "traefik.http.routers.owncloud.service=owncloud"
- "traefik.http.routers.owncloud.middlewares=oc-rep,oc-header"
- "traefik.http.routers.owncloud.tls=true"
- "traefik.http.services.owncloud.loadbalancer.server.port=8080"
networks:
- intnet
- traefik
The relevant IP information (two networks) are:
172.18.0.7/172.22.0.4 â Traefik proxy server
172.18.0.8/172.22.0.2 â Onlyoffice document server
172.18.0.3/172.22.0.3 â Owncloud server
Those said, when we enter all the above into the integrationâs (v8.2.1) parameters, we get an OK as a response at the top of the screen when clicking Save.
Within Owncloudâs logs, we get:
172.18.0.7 - - [17/Sep/2023:12:15:51 +0000] "GET /apps/onlyoffice/ajax/template HTTP/1.1" 200 631 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0"
172.22.0.2 - - [17/Sep/2023:12:16:04 +0000] "GET /apps/onlyoffice/empty?doc=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJlbXB0eSJ9.WY9Jfdw2rlPpFrU9fyOAbuH5CWedrSP5hbkb1tHRMpI HTTP/1.1" 200 8063 "-" "Node.js/6.13"
172.18.0.7 - - [17/Sep/2023:12:16:04 +0000] "PUT /apps/onlyoffice/ajax/settings/address HTTP/1.1" 200 923 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0"
Checking internal connectivity, we get as cURL headers response from onlyoffice (internal) â Owncloud (internal):
HTTP/1.1 302 Found
Date: Sun, 17 Sep 2023 12:06:02 GMT
Server: Apache
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
X-Robots-Tag: none
X-Frame-Options: SAMEORIGIN
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Set-Cookie: ocyx6e1vuynu=2ggos09088l3g6dvg3kbb068rc; path=/; HttpOnly; SameSite=lax
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: oc_sessionPassphrase=M%2FKRQ%2Bur6elbuvOkgmF0Dh7XD0T8IUDfcMLPH9B1tfxj3shobAubp97ohnfVyzI8olQK2ID8XN26UJqUUJRrcuPeceKpdzh0hc5zCikIw7zfNsj20X6RIMu1xce2Gk09; expires=Sun, 17-Sep-2023 12:26:02 GMT; Max-Age=1200; path=/; HttpOnly; SameSite=lax
Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; frame-src *; img-src * data: blob:; font-src 'self' data:; media-src *; connect-src *
Location: http://owncloud_server:8080/login
Content-Type: text/html; charset=UTF-8
and from Owncloud (internal) â Onlyoffice (internal):
HTTP/1.1 302 Moved Temporarily
Server: nginx
Date: Sun, 17 Sep 2023 12:07:07 GMT
Content-Type: text/html
Content-Length: 138
Connection: keep-alive
Location: http://onlyoffice-documentserver
⌠thus connectivity exists.
Now, when we try to open/preview a document from within Owncloud, we get within the Onlyofficeâs converter/out.log multiple entries of the type:
[2023-09-17T12:00:06.234] [ERROR] [localhost] [conv_2107323555_jpeg] [userId] nodeJS - error downloadFile:url=http://owncloud_server:8080/apps/onlyoffice/download?doc=eyJ0eXAivsdo90ffWWDvsdvsGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJkb3dubG9hZCIsImZpbGVJZCI6OTQwMSwidXNlcklkIjoiQWRtaW5pc3RyYXRvciJ9._OF2D38QUlbV4hvsdse3r32rfed-pGNltiYWUHBrzhqIVI;attempt=2;code:undefined;connect:undefined Error: Error response: statusCode:404; headers:{"date":"Sun, 17 Sep 2023 12:00:06 GMT","server":"Apache","x-content-type-options":"nosniff","x-xss-protection":"0","x-robots-tag":"none","x-frame-options":"SAMEORIGIN","x-download-options":"noopen","x-permitted-cross-domain-policies":"none","set-cookie":["ocyx6e1vuynu=2a2u6pc0e5121ji1h0reh0rm6i; path=/; HttpOnly; SameSite=lax","oc_sessionPassphrase=w8b1rMM%2BiBztIaagsbsafasfa2us1vZ1j6Dst2RCsvHw7DmPHy%2BPRHaXGax5fHu8JoZ4DnWFdDrW8PYXyk6ssX0QzKG%2B4capiW31W0QmAaEoaflSDUWz2JTCUVo1t2bc; expires=Sun, 17-Sep-2023 12:20:06 GMT; Max-Age=1200; path=/; HttpOnly; SameSite=lax"],"expires":"Thu, 19 Nov 1981 08:52:00 GMT","cache-control":"no-cache, no-store, must-revalidate","pragma":"no-cache","content-security-policy":"default-src 'none';manifest-src 'self';script-src 'self' 'unsafe-eval';style-src 'self' 'unsafe-inline';img-src 'self' data: blob:;font-src 'self';connect-src 'self';media-src 'self'","content-length":"29","keep-alive":"timeout=5, max=100","connection":"Keep-Alive","content-type":"application/json; charset=utf-8"};
at Request.fResponse (/snapshot/server/build/server/Common/sources/utils.js)
at Request.emit (events.js:400:28)
at Request.onRequestResponse (/snapshot/server/build/server/Common/node_modules/request/request.js:1059:10)
at ClientRequest.emit (events.js:400:28)
at HTTPParser.parserOnIncomingClient (_http_client.js:647:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:127:17)
at Socket.socketOnData (_http_client.js:515:22)
at Socket.emit (events.js:400:28)
at addChunk (internal/streams/readable.js:293:12)
at readableAddChunk (internal/streams/readable.js:267:9)
at Socket.Readable.push (internal/streams/readable.js:206:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23)
Meanwhile, from Owncloudâs logs:
172.22.0.2 - - [17/Sep/2023:12:01:20 +0000] "GET /apps/onlyoffice/download?doc=eyJ0eXAivsdo90ffWWDvsdvsGciOiJIUzI1NiJ9.eyJhY3Rpb24iOiJkb3dubG9hZCIsImZpbGVJZCI6OTQwMSwidXNlcklkIjoiQWRtaW5pc3RyYXRvciJ9._OF2D38QUlbV4hvsdse3r32rfed-pGNltiYWUHBrzhqIVI HTTP/1.1" 404 1063 "-" "Node.js/6.13"
I sent you via PM a WeTransfer link regarding the logs from the documentserver.
Any help is greatly appreciated!