-
Notifications
You must be signed in to change notification settings - Fork 33
fix: authenticate camoufox fetch with GITHUB_TOKEN #309
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: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| ARG NODE_VERSION= | ||
|
|
||
| # Use trixie to be consistent across node versions. | ||
| FROM node:${NODE_VERSION}-trixie-slim | ||
|
Check warning on line 5 in node-playwright-camoufox/Dockerfile
|
||
|
|
||
| # Playwright version is passed in the format `v1.57.0-` (matching the tag | ||
| # format used by the full node-playwright image). Stripped below before | ||
|
|
@@ -135,10 +135,17 @@ | |
| RUN if [ "$SLIM" = "1" ]; then mv package.slim.json package.json; else rm package.slim.json; fi | ||
|
|
||
| # Install default dependencies, print versions of everything | ||
| RUN npm --quiet set progress=false \ | ||
| # | ||
| # `camoufox-js fetch` reads api.github.com, where the whole matrix shares one 60/hour budget. | ||
| # GITHUB_TOKEN lifts it to 1000/hour; a secret, not a build arg, keeps it out of the layers. | ||
| # mode=0444 because this stage runs as myuser and secrets default to root-owned 0400. | ||
| # Without it the build stays unauthenticated and still works. | ||
| RUN --mount=type=secret,id=github_token,mode=0444 \ | ||
| npm --quiet set progress=false \ | ||
| \ | ||
| # Install Camoufox browser | ||
| && PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 npx camoufox-js fetch \ | ||
| && GITHUB_TOKEN="$(cat /run/secrets/github_token 2>/dev/null || true)" \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like we should unset the env variable if the file is not present |
||
| PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 npx camoufox-js fetch \ | ||
| # Overrides the dynamic library used by Firefox to determine trusted root certificates with p11-kit-trust.so, which loads the system certificates. | ||
| && rm -f /home/myuser/.cache/camoufox/libnssckbi.so \ | ||
| && ln -s $(ls -d /usr/lib/*-linux-gnu)/pkcs11/p11-kit-trust.so /home/myuser/.cache/camoufox/libnssckbi.so \ | ||
|
|
||
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.
atClaude tldr this