-
Notifications
You must be signed in to change notification settings - Fork 1
Add pdf-lib Support to n8n Container #109
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
base: main
Are you sure you want to change the base?
Conversation
- Added PDF_LIB_VERSION argument to specify the version of pdf-lib. - Included pdf-lib installation in the npm install command to enhance PDF processing capabilities. These changes improve the n8n environment by enabling support for PDF manipulation features.
- Added pdf-lib to NODE_FUNCTION_ALLOW_EXTERNAL to enhance PDF processing capabilities within n8n. This change improves the functionality of the n8n environment by enabling support for additional PDF manipulation features.
WalkthroughModified Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
Dockerfile.n8n (2)
14-19: Document npm install flags and verify package installation compatibility.The npm install uses several flags (--legacy-peer-deps, --unsafe-perm, --ignore-scripts) that warrant documentation. Ensure that pdf-lib installs cleanly with these flags and that --legacy-peer-deps doesn't mask actual peer dependency conflicts that could cause runtime issues.
Consider adding an inline comment explaining the purpose of these flags, especially --unsafe-perm, which permits elevated permissions during npm installation.
Apply this diff to add clarifying comments:
# Install git for backup script and other packages + install external packages in one layer USER root RUN set -eux; \ apk add --no-cache git=2.49.1-r0 && \ + # Install external npm packages globally for use in Code/Function nodes + # --legacy-peer-deps: allows compatible peer dependency versions + # --unsafe-perm: permits npm install to run as root in container context npm install -g --no-audit --no-fund --ignore-scripts \ --legacy-peer-deps --no-workspaces \ --unsafe-perm \
23-23: Add inline documentation for NODE_FUNCTION_ALLOW_EXTERNAL.The environment variable correctly lists all globally installed packages, enabling their use within n8n Code/Function nodes. Consider adding a comment to explain its purpose for future maintainers.
Apply this diff to add documentation:
# Configure external modules allowlist used by Code/Function nodes +# Comma-separated list of npm packages available via require() in Code nodes ENV NODE_FUNCTION_ALLOW_EXTERNAL="showdown,slackify-markdown,pdf-lib"
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Dockerfile.n8n(2 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
Dockerfile.{n8n,temporal}
📄 CodeRabbit inference engine (.cursor/rules/docker-configuration.mdc)
Custom Docker images must be defined using Dockerfile.n8n and Dockerfile.temporal, each extending their respective official base images with custom configurations
Files:
Dockerfile.n8n
Dockerfile.n8n
📄 CodeRabbit inference engine (.cursor/rules/project-structure.mdc)
Use Dockerfile.n8n for custom n8n image configuration.
Files:
Dockerfile.n8n
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
PR: speedandfunction/automatization#0
File: .cursor/rules/project-structure.mdc:0-0
Timestamp: 2025-07-28T16:44:50.073Z
Learning: Applies to Dockerfile.n8n : Use Dockerfile.n8n for custom n8n image configuration.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Docker Security Scanning (n8n, Dockerfile.n8n, n8n-test:latest)
- GitHub Check: Service Availability Check
🔇 Additional comments (1)
Dockerfile.n8n (1)
8-8: No issues found with pdf-lib@1.17.1.The version 1.17.1 is the latest published version on npm and has no known security vulnerabilities reported in public trackers or the project advisories. The exact version pin (rather than a range) is appropriate for stability and reproducibility in this context.
🔍 Vulnerabilities of
|
| digest | sha256:be96ff1a608da9eab5e91d533e5e2a5bb7362ddfb37cc309963c76bcb8861b20 |
| vulnerabilities | |
| platform | linux/amd64 |
| size | 342 MB |
| packages | 1848 |
📦 Base Image node:22-alpine
Description
Description
Description
Description | ||||||||||||||||||||||||||||||||
Description
Description
| ||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||
Description
| ||||||||||||||||||||||||||||||||
Description
|
|
1 similar comment
|



Summary
Adds pdf-lib package to the n8n Docker container to enable PDF manipulation capabilities in workflows.
Changes
Technical Details
require('pdf-lib')Benefits
Summary by CodeRabbit