jsonresume
PDF doesn't generate correctly inside Nix sandbox.
#16
Labels
bug
Something isn't working
jsonresume
PDF doesn't generate correctly inside Nix sandbox.
#16
Problem
PDF generation is broken for all current themes inside the Nix sandbox.
End result is that a fully-automated CI/CD process for PDF generation & deployment will build a faulty PDF.
All themes linking remote resources in the HTML will be incorrect in some way, but current themes are completely unreadable.
Cause
Nix sandbox prevents fetching external assets from the internet.
All current themes link to CDN assets for things like
bootstrap
,font-awesome
, other CSS, etc.The
puppeteer-cli
PDF generation command:puppeteer print ./index.html resume.pdf
tries to render the HTML document in a headless Chromium instance, which cannot reach the assets required by the HTML.Potential solutions
Prefetch external assets and specify their hash of fixed-output derivation.
Cons:
nix build
.Pros:
Call
nix build with
--impure` arg in CI workflow.TODO: How to allow internet inside build sandbox?
Cons:
packages.jsonresume-pdf*
packages cannot be built in purenix build
Pros:
Build PDF in separate GitHub Actions workflow
Only build the HTML in the CI workflow.
Create second workflow for running PDF generation.
Run workflow upon GitHub pages deployment.
Call
puppeteer-cli
on GitHub pages URL instead of HTML file.Cons:
Pros:
Patch
jsonresume-theme-*
packages to bundle-in all external assets.Cons:
jsonresume-theme
NPM package.Pros:
buildNpmPackage
that performs this.Rewrite HTML external asset links during HTML generation derivation.
Cons:
rev
+hash
Pros:
The text was updated successfully, but these errors were encountered: