Skip to content

Commit 682dd1f

Browse files
committed
General docs improvements
1 parent 4a6b240 commit 682dd1f

1 file changed

Lines changed: 49 additions & 3 deletions

File tree

README.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,62 @@ If you're running `Docker Toolbox` then start a web browser session to <http://1
4343
4444
## Environment variables
4545

46+
All container behaviour is controlled by environment variables, processed by [`main/docker-entrypoint.sh`](main/docker-entrypoint.sh) at startup and written into `PreConfig.js` / `PostConfig.js` inside the deployed webapp.
47+
48+
### Certificate and SSL
49+
4650
* **LETS_ENCRYPT_ENABLED**: Enables Let's Encrypt certificate instead of self-signed; default `false`
4751
* **PUBLIC_DNS**: DNS domain to be used as certificate "CN" record; default `draw.example.com`
4852
* **ORGANISATION_UNIT**: Organisation unit to be used as certificate "OU" record; default `Cloud Native Application`
4953
* **ORGANISATION**: Organisation name to be used as certificate "O" record; default `example inc`
5054
* **CITY**: City name to be used as certificate "L" record; default `Paris`
5155
* **STATE**: State name to be used as certificate "ST" record; default `Paris`
5256
* **COUNTRY_CODE**: Country code to be used as certificate "C" record; default `FR`
53-
* **KEYSTORE_PASS**: ".keystore"/.jks" store password; default `V3ry1nS3cur3P4ssw0rd`
57+
* **KEYSTORE_PASS**: ".keystore"/".jks" store password; default `V3ry1nS3cur3P4ssw0rd`
5458
* **KEY_PASS**: Private key password; default `<ref:KEYSTORE_PASS>`
55-
* **ENABLE_DRAWIO_PROXY**: Set to `1` to enable the `/proxy` endpoint (ProxyServlet) which allows embedding images from external URLs; default disabled
59+
60+
### Deployment URL
61+
62+
* **DRAWIO_SERVER_URL**: Public deployment URL **with a trailing slash**, e.g. `https://drawio.example.com/`, or `https://www.example.com/drawio/` if deployed into a sub-path. When a sub-path is present the entrypoint also updates the Tomcat context path automatically. Default unset (the webapp is served at `/`).
63+
* **DRAWIO_BASE_URL**: (Optional, backwards-compat) Same URL **without** a trailing slash, used by the viewer/lightbox/embed code paths. Only needed if `DRAWIO_SERVER_URL` is not set; the entrypoint derives whichever one is missing. If both are set, both pass through unchanged.
64+
* **DRAWIO_VIEWER_URL**: Optional URL of a hosted viewer JS bundle, e.g. `https://drawio.example.com/js/viewer.min.js`.
65+
* **DRAWIO_LIGHTBOX_URL**: Optional lightbox URL, e.g. `https://drawio.example.com`.
66+
67+
### Editor configuration
68+
69+
* **DRAWIO_CONFIG**: JSON configuration object for the diagram editor — written verbatim into `window.DRAWIO_CONFIG`. See <https://www.drawio.com/doc/faq/configure-diagram-editor>. Must be valid JSON, not arbitrary JavaScript.
70+
* **DRAWIO_CSP_HEADER**: Override the default Content-Security-Policy `<meta>` injected into the page. Defaults to a hard-coded policy in [`docker-entrypoint.sh`](main/docker-entrypoint.sh) — start from that policy when customising.
71+
* **ENABLE_DRAWIO_PROXY**: Set to `1` to enable the `/proxy` endpoint (ProxyServlet) which allows embedding images from external URLs; default disabled.
72+
73+
### Export server integration
74+
75+
* **DRAWIO_SELF_CONTAINED**: Set to `1` to route export requests through Tomcat's `ExportProxyServlet` (`/service/0`) instead of calling the export server directly. Use this when the export server is only reachable inside the docker network.
76+
* **EXPORT_URL**: Without `DRAWIO_SELF_CONTAINED`, set this to any value to make the webapp call `/service/0` for exports. With `DRAWIO_SELF_CONTAINED=1` the same routing is enabled automatically. The actual upstream URL is read by the proxy servlet from `web.xml`.
77+
78+
### Google Drive integration
79+
80+
See [`self-contained/README.md`](self-contained/README.md#google-drive) for how to register the OAuth app.
81+
82+
* **DRAWIO_GOOGLE_CLIENT_ID**: OAuth client ID. Unset = Google Drive integration disabled.
83+
* **DRAWIO_GOOGLE_CLIENT_SECRET**: OAuth client secret.
84+
* **DRAWIO_GOOGLE_APP_ID**: Google project number (the numeric prefix of the client ID, before the first `-`).
85+
* **DRAWIO_GOOGLE_VIEWER_CLIENT_ID** / **DRAWIO_GOOGLE_VIEWER_CLIENT_SECRET** / **DRAWIO_GOOGLE_VIEWER_APP_ID**: Optional separate read-only credentials for a viewer deployment.
86+
87+
### Microsoft OneDrive integration
88+
89+
See [`self-contained/README.md`](self-contained/README.md#microsoft-onedrive) for redirect-URI requirements.
90+
91+
* **DRAWIO_MSGRAPH_CLIENT_ID**: Azure app client ID. Unset = OneDrive integration disabled.
92+
* **DRAWIO_MSGRAPH_CLIENT_SECRET**: Azure app client secret.
93+
* **DRAWIO_MSGRAPH_TENANT_ID**: Tenant ID for single-tenant Azure apps.
94+
95+
### GitLab integration
96+
97+
See [`self-contained/README.md`](self-contained/README.md#gitlab) for OAuth-app setup.
98+
99+
* **DRAWIO_GITLAB_ID**: OAuth application ID. Unset = GitLab integration disabled.
100+
* **DRAWIO_GITLAB_SECRET**: OAuth application secret.
101+
* **DRAWIO_GITLAB_URL**: GitLab base URL **without** any path, e.g. `https://gitlab.com` or `https://gitlab.example.com`. The entrypoint appends `/oauth/token` itself for server-side auth, and uses this value as the base of the client-side `/oauth/authorize` URL — adding a path here breaks both. When this is set to anything other than `https://gitlab.com` the entrypoint also writes `Editor.enableCustomGitLabUrl = true;` into `PostConfig.js`, which is required by the client to allow self-hosted instances.
56102

57103
## HTTPS SSL Certificate via Let's Encrypt
58104

@@ -72,7 +118,7 @@ Notice that mapping port 80 to container's port 80 allows certbot to work in sta
72118

73119
## Changing draw.io configuration
74120

75-
Configuration is managed by `DRAWIO_*` environment variables. For a list of these variables, check the `docker-entrypoint.sh` file in the `main` directory. For example, these variables allow enabling integration with Google Drive, OneDrive, ...
121+
All draw.io configuration is driven by the `DRAWIO_*` environment variables listed in the [Environment variables](#environment-variables) section above. For integrations that need an OAuth app (Google Drive, Microsoft OneDrive, GitLab), the step-by-step app-registration instructions live in [`self-contained/README.md`](self-contained/README.md).
76122

77123
## Reference
78124

0 commit comments

Comments
 (0)