Skip to content

Commit 8c2598c

Browse files
authored
Merge pull request #321 from onthebed/clawoss/docs/316-wopi-public-base-url
2 parents f22987e + 0629177 commit 8c2598c

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

docs/config/env.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,14 @@ See the [WOPI configuration guide](/config/wopi) for details.
7272
|---|---|---|
7373
| `OXICLOUD_WOPI_ENABLED` | `false` | Enable WOPI |
7474
| `OXICLOUD_WOPI_DISCOVERY_URL` || Collabora/OnlyOffice discovery URL |
75+
| `OXICLOUD_WOPI_BASE_URL` | `OXICLOUD_BASE_URL` | URL the editor uses to call OxiCloud's `/wopi/*` endpoints |
76+
| `OXICLOUD_WOPI_PUBLIC_BASE_URL` | `OXICLOUD_WOPI_BASE_URL` | URL the browser uses to open OxiCloud's WOPI host page and `postMessage` origin |
7577
| `OXICLOUD_WOPI_SECRET` | (JWT secret) | WOPI token signing key |
7678
| `OXICLOUD_WOPI_TOKEN_TTL_SECS` | `86400` | Token lifetime |
7779
| `OXICLOUD_WOPI_LOCK_TTL_SECS` | `1800` | Lock expiration |
7880

81+
When Collabora or OnlyOffice runs on a different hostname, set `OXICLOUD_WOPI_PUBLIC_BASE_URL` to the public OxiCloud URL that the browser can reach. If the editor reaches OxiCloud through a different internal URL, also set `OXICLOUD_WOPI_BASE_URL` for those callbacks.
82+
7983
## Allocator Tuning
8084

8185
These variables are read directly by **mimalloc**, not by OxiCloud's config parser.

docs/config/wopi.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ OXICLOUD_WOPI_DISCOVERY_URL="http://collabora:9980/hosting/discovery"
2929
|---|---|---|
3030
| `OXICLOUD_WOPI_ENABLED` | `false` | Enable WOPI integration |
3131
| `OXICLOUD_WOPI_DISCOVERY_URL` || Editor's WOPI discovery URL |
32+
| `OXICLOUD_WOPI_BASE_URL` | `OXICLOUD_BASE_URL` | URL the editor uses to call OxiCloud's `/wopi/*` endpoints |
33+
| `OXICLOUD_WOPI_PUBLIC_BASE_URL` | `OXICLOUD_WOPI_BASE_URL` | URL the browser uses to open the host page and the `postMessage` origin |
3234
| `OXICLOUD_WOPI_SECRET` | (JWT secret) | Token signing key |
3335
| `OXICLOUD_WOPI_TOKEN_TTL_SECS` | `86400` | Access token lifetime |
3436
| `OXICLOUD_WOPI_LOCK_TTL_SECS` | `1800` | Lock expiration |
3537

38+
If Collabora or OnlyOffice runs on a separate hostname, `OXICLOUD_WOPI_PUBLIC_BASE_URL` should still point to OxiCloud's public URL, not the office URL. Use `OXICLOUD_WOPI_BASE_URL` only when the editor reaches OxiCloud through a different callback URL (for example an internal Docker or cluster address).
39+
3640
## Docker Compose with Collabora
3741

3842
```yaml
@@ -68,8 +72,18 @@ services:
6872
environment:
6973
OXICLOUD_WOPI_ENABLED: "true"
7074
OXICLOUD_WOPI_DISCOVERY_URL: "http://onlyoffice/hosting/discovery"
75+
OXICLOUD_WOPI_PUBLIC_BASE_URL: "https://cloud.example.com"
76+
# Optional when OnlyOffice reaches OxiCloud through a different internal URL.
77+
# Otherwise OxiCloud falls back to OXICLOUD_WOPI_PUBLIC_BASE_URL / OXICLOUD_BASE_URL.
78+
OXICLOUD_WOPI_BASE_URL: "http://oxicloud:8086"
7179
```
7280
81+
In that example:
82+
83+
- the browser loads OxiCloud from `https://cloud.example.com`, so `OXICLOUD_WOPI_PUBLIC_BASE_URL` must use that public OxiCloud URL
84+
- OnlyOffice calls OxiCloud from the Docker network, so `OXICLOUD_WOPI_BASE_URL` can use `http://oxicloud:8086`
85+
- if both the browser and the editor use the same OxiCloud URL, you can omit both variables and rely on `OXICLOUD_BASE_URL`
86+
7387
## WOPI Endpoints
7488

7589
| Method | Endpoint | Description |

example.env

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@ OXICLOUD_WOPI_ENABLED=false
150150
# Example for OnlyOffice: http://onlyoffice/hosting/discovery
151151
#OXICLOUD_WOPI_DISCOVERY_URL=
152152

153+
# Public OxiCloud URL used by the browser for the WOPI host page.
154+
# Keep this on the OxiCloud hostname, even when OnlyOffice/Collabora runs elsewhere.
155+
# Example: https://cloud.example.com
156+
#OXICLOUD_WOPI_PUBLIC_BASE_URL=
157+
158+
# Optional callback URL the editor uses to reach OxiCloud's /wopi/* endpoints.
159+
# Set this only when the editor uses a different internal address than the browser.
160+
# Example: http://oxicloud:8086
161+
#OXICLOUD_WOPI_BASE_URL=
162+
153163
# Secret key for signing WOPI access tokens
154164
# Falls back to OXICLOUD_JWT_SECRET if not set
155165
#OXICLOUD_WOPI_SECRET=

0 commit comments

Comments
 (0)