How to integrate a self-hosted Draw.io instance? #3204
Replies: 2 comments 1 reply
|
The cleanest way to configure web-extensions such as the draw.io one is to use a global You can then specify the url like so: Remember that you also need to update your csp file by including your URL in |
|
Hi Jannik, thanks for your reply - I am still struggling to get it to work. I also found your Readme for the extension package web-app-draw-io: https://github.com/opencloud-eu/web-extensions/blob/main/packages/web-app-draw-io/README.md My aim is to load a locally hosted draw-io instance, which is accessable through drawio.mydomain.net and thereby replace the default url embed.diagrams.net. My configuration I have a /opt/opencloud/config/csp.yaml file: directives: and a /opt/opencloud/config/apps.yaml file: draw-io: The container recreates without an error. Inspecting the Browsers iFrame source for an opend draw-io document: <iframe id="drawio-editor" src="https://embed.diagrams.net?embed=1&chrome=1&picker=0&stealth=1&spin=1&proto=json&ui=minimal" title="Draw.io Editor" class="app-wrapper-content size-full" url="" space="[object Object]" activefiles="[object Object]" currentfilecontext="[object Object]" isfolderloading="false" loadfolderforfilecontext="async t=>{n.value=!0;try{if(t=I(t),I(u)?.term)..... </iframe>I think the "link" is missing between draw-io and die csp.yaml. Where does OC (or the Browser) know from that it should override embed.diagrams.net with drawio.mydomain.net? Any hint welcome ;-) |
Uh oh!
There was an error while loading. Please reload this page.
How to integrate a self-hosted Draw.io instance? (Hardcoded embed.diagrams.net?)
Hello everyone,
I am currently setting up OpenCloud and want to replace the default external Draw.io instance (
embed.diagrams.net) with my own self-hosted Draw.io instance to ensure strict data privacy. My goal is to force the OpenCloud frontend to load the Draw.io iFrame from my local instance (drawio.example.net) instead of the public one.Architecture Overview
My environment consists of separate Docker containers behind a Caddy reverse proxy:
What I have tried so far (and failed)
I spent quite some time trying to override the default URL via configuration files, but the frontend module seems to ignore all of them:
external_appsblock: Mounted a customconfig.jsonvia Docker and added the Draw.io app to theexternal_appsarray, providingurl,baseUrl, andeditorUrlparameters pointing tohttps://drawio.example.net.editorblock: Tried configuring the URL using the"editor": { "drawio": { "url": "..." } }JSON structure.- WEB_CONFIG=/etc/opencloud/config.jsonenvironment variable indocker-compose.yml.The Result:
Checking the browser's network tab confirms that the custom
config.jsonis successfully delivered to the client. However, the Draw.io frontend module (/assets/apps/drawio/js/remoteEntry-*.mjs) completely ignores the provided URLs. The rendered iFrame still hardcodessrc="https://embed.diagrams.net?...".My Question
Is the
embed.diagrams.netURL currently hardcoded in the frontend build, or is there a specific, update-safe way (viaconfig.jsonor docker environment variables) to override the Draw.io URL? How is this correctly done in OpenCloud?KR
trs
All reactions