Because draw.io is a desktop application built atop Electron, it requires a running X server to draw a window, even if it's just opening to perform a CLI export. Whilst there's some talk (jgraph/drawio-desktop#127) of a headless option, it doesn't have feature parity with the desktop app. In headless scenarios it must be used in conjunction with Xvfb or its simpler wrapper xvfb-run.
Chrome's sandboxing means we need to be able to pass the --no-sandbox option or create an additional user in which to run the service.
I think we should:
[x] Document the additional dependencies and use of xvfb-run to get the plugin working in headless configurations.
[x] #14 Add a drawio_args plugin setting that allows adding additional options to the end of the command. Note that my testing discovered an argument parsing bug in the CLI that causes option values to jump around if options that don't expect arguments are provided ahead of options that do expect them.
There are a couple of problems here:
draw.io
is a desktop application built atop Electron, it requires a running X server to draw a window, even if it's just opening to perform a CLI export. Whilst there's some talk (jgraph/drawio-desktop#127) of a headless option, it doesn't have feature parity with the desktop app. In headless scenarios it must be used in conjunction withXvfb
or its simpler wrapperxvfb-run
.--no-sandbox
option or create an additional user in which to run the service.I think we should:
xvfb-run
to get the plugin working in headless configurations.drawio_args
plugin setting that allows adding additional options to the end of the command. Note that my testing discovered an argument parsing bug in the CLI that causes option values to jump around if options that don't expect arguments are provided ahead of options that do expect them.