Skip to content

Commit

Permalink
fix: stripe env variables from CDN build
Browse files Browse the repository at this point in the history
  • Loading branch information
andipaetzold committed Oct 23, 2024
1 parent 6957f9e commit 3846895
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion packages/cdn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The `public` folder is hosted at `cdn.f36.contentful.com`.

Run `npm run serve` to start the server locally

## Updating the Geist font to the latest version
### Updating the Geist font to the latest version

> [!IMPORTANT]
> Do not remove, rename or overwrite old versions of the font.
Expand All @@ -16,3 +16,7 @@ Run `npm run serve` to start the server locally
1. Rename the files to include the version: `geist-(mono|sans)-x.x.x.woff2`
1. Create a PR and wait for review
1. Merge the PR. The files are automatically deployed to the CDN

### Build Script

The server is compiled with `js-compute-runtime input.js output.wasm`. The compiled `.wasm` file inlines all environment variables. This is a security risk as the binary might contain api keys. With `env -i`, the server is compiled with a new environment without any environment variables.
2 changes: 1 addition & 1 deletion packages/cdn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"scripts": {
"deploy": "fastly compute deploy",
"prebuild": "npx compute-js-static-publish --build-static",
"build": "js-compute-runtime ./src/index.js ./bin/main.wasm",
"build": "env -i $(which node) ./node_modules/.bin/js-compute-runtime ./src/index.js ./bin/main.wasm",
"serve": "fastly compute serve"
}
}

0 comments on commit 3846895

Please sign in to comment.