nix: replace wkhtmltopdf with weasyprint#1895
Conversation
This commit adds back the ability to run a development VM with docspell. See updated documentation for examples.
|
|
||
| wkhtmlpdf = { | ||
| command = { | ||
| program = "${pkgs.wkhtmltopdf}/bin/wkhtmltopdf"; |
There was a problem hiding this comment.
I think we should rather use the config option for weasyprint which has been added in the last release. I think I just missed to update the nix config values accordingly :( You can then switch to weasyprint by setting html-converter = weasyprint (see defaults)
There was a problem hiding this comment.
Got it. One thing to note - if pkgs.wkhtmltopdf is at all mentioned in the joex config - nix will complain about the insecure package. So, I think the changes should be:
- Add
html-converter, default toweasyprint - Add
weasyprintset of options, enable by default - Disable
wkhtmltopdfby default, add some documentation note about the package being not secure
There was a problem hiding this comment.
Yes that sounds great! I think we can just leave wkhtmltopdf empty or so, users could still set it if they want to.
|
While trying to implement |
Strange! I think then the config option which converter to use did not load correctly. 🤔 wkhtmltopdf should not be tried if weasyprint is set. But the config looks ok to me. Edit: I just ran the json config through the config reader code and it produces the correct config object - weasyprint is set as converter. It's either some bug or perhaps it was not restarted? |
Oh my…!? Just realized that you debugged some issue almost at new years eve 😱 hopefully you stopped very soon and had some better times then! 😄 |
I killed and redeployed the dev-vm to make sure. May this be a bug?
Thanks :) I did have some down-time between the NY preparations and got some work done on this. Hope you had great holidays! I have created a temporary branch with this config generator. To reproduce (if you have a machine with Nix): # clone my temporary branch
git clone --depth=1 -b nix-wkhtmltopdf-replace-wip git@github.com:VTimofeenko/docspell.git
cd docspell/nix
# This will build a VM and bring up docspell
nix run '.#nixosConfigurations.dev-vm.config.system.build.vm'.
# To ssh into the machine and proxy the docspell port
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 64022 -L64000:localhost:7880 root@localhostafter that open |
|
Thank you for all the details!! I'll try it out and report back. It must be some bug then, that I could not yet reproduce. Edit: Oh 🤦🏼 I'm sorry! I overlooked the text file part. I have no idea why I didn't see it the other day, it is quite obvious! I need to fix this - currently text files are not working with weasyprint sadly 😞 Edit 2: For testing you can use a HTML file, this should be running weasyprint instead of wkhtmltopdf for the new config. |
|
Hi @VTimofeenko - I'm currently not sure if you wait for me? I think you have something done / in the doing regarding the weasyprint config option right? I'm sorry if I missed something 😅 |
092fff0 to
8fef423
Compare
|
Hey! Sorry for the delay - just got around to review my local changes. I emptied out the default command for wkhtmltopdf, added html-converter and weasyprint option. The dev-vm builds and converts an HTML file successfully and without complaining about qt being insecure |
|
Oh no, no need for sorry! I'm sorry if my wording implied this, was not intentional! I wasn't quite sure if there was something on my side. Thanks a lot! |
|
All good :) |
Wkhtmltopdf is deemed insecure and requires a full build of qtwebengine. I am working on replacing wkhtmltopdf with weasyprint in Nix module definitions.
See #1873 for more background