betatim / notebook-as-pdf

Save Jupyter Notebooks as PDF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails when run as root

ian-r-rose opened this issue · comments

Thanks for this! As much as I like LaTeX on occasion, it's nice to have another option.

I have found that this exporter fails when run as root due to Chrome sandboxing policies. Might we add an option to turn off sandboxing?

cf. ian-r-rose@9d92490

Sounds like a good idea. Do you understand/know what the sandbox does/is good for? What bad (or good) things happen when you turn it off?

To be honest, I haven't really done my homework here yet. I'm sure it's there for good reasons, but I ran into a case where I didn't really have a choice.

I'll do a bit of research and report back.

Feel free to open a PR already. If we can't (quickly) figure out what bad stuff will happen then maybe it can't be that bad?? Maybe?

So, the sandboxing (as the name suggests) is intended to prevent untrusted code from being executed on the system. The universe of bad stuff that could happen in that case is pretty large.

Apparently sandboxing cannot work if you run as root. So in order to do this, you have to explicitly disable sandboxing.
The more recommended way to proceed is to create a new user (as is done in the juptyer stacks, as well as the example dockerfile in the puppeteer docs.

In my particular case, I am somewhat constrained in needing to be root, so it would still be useful to expose the option, even if it is mostly a bad idea.