-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drawio command-line requires setuid and network namespace manipulation #144
Comments
Since the draw.io application uses Electron, it’s basically wrapped in Chrome and it’s Chrome that requires this permission. However, there’s the I managed to run However, while displaying the version (with That doesn’t have anything to do with this issue right here though. |
Note we've improved the docker images of both draw.io and the Node base image export back-end that we use in the online version. The initial instructions are at https://github.com/jgraph/drawio/blob/master/etc/docker/README.md and the image export docker stuff at https://github.com/jgraph/docker-drawio/tree/master/image-export. I think that is better suited to being a docker image, so I'd rather apply effort at giving that the API needed than fixing this issue. |
@davidjgraph Thanks, I managed to have the standalone export server running in a matter of minutes, which is awesome! 👍 (The API docs are a bit confusing though.) However, I’d love to be able to export to SVG instead of PDF, because (as far as I can see) SVGs ignore the drawing canvas and are auto-cropped to just the contents, PDFs are not. This makes it easier to embed them into my LaTeX document(s), without having to think in advance about how big the drawing is supposed to be (in the final document) while I’m drawing. I might find a way to auto-crop PDFs or extract just the drawing, but this feels more of a hassle than having SVG export in the first place. Or do you have any other suggestions? |
Well, this really doesn’t belong into this ticket, but in case anyone else tries to do something similar: I’m now using pdfcrop (package curl --data 'format=pdf' --data-urlencode 'xml@my-drawing.drawio' http://localhost:8000/ | pdfcrop - my-drawing.pdf (Assuming you have the standalone export server running on port 8000 and an input image in draw.io’s XML format in Works good enough for me, thanks! 😉 |
Was there a solution to being able to run drawio in a docker container? I'm trying to use sphinxcontrib-drawio as part of my CI but this all runs on in a docker container and I'm getting the |
@rickyjames35 I didn’t find any solution. As I said in #144 (comment), running |
This is a sub-task of #127.
I'm trying to package draw.io into a docker container for easy command-line export usage. However, drawio requires elevated permissions even when used for command-line export that make it inconvenient to use with docker. Here is what happens when it is run from a docker container:
Add the setuid bit to the chrome-sandbox isn't sufficient. Doing so results in a different permissions error:
The workaround is to run with SYS_ADMIN kernel capabilities (setuid bit is not needed in this case):
Requiring elevated privileges to do export on the command-line is probably counter productive to security and certainly makes using it with docker annoying.
The text was updated successfully, but these errors were encountered: