diff --git a/.cursor/rules/asset-hashing-csp.mdc b/.cursor/rules/asset-hashing-csp.mdc new file mode 100644 index 0000000..06a31c9 --- /dev/null +++ b/.cursor/rules/asset-hashing-csp.mdc @@ -0,0 +1,23 @@ +--- +description: +globs: *.js,*.css +alwaysApply: false +--- +# Asset Hashing and CSP Update Rule + +This rule ensures that all `.js` and `.css` assets are properly hashed and their integrity hashes are updated in `index.html` and added to the Content Security Policy (CSP) in the `Caddyfile` during every build and push process. + +## Process to Follow + +1. **Hash Calculation**: Before building the Docker image, calculate the SHA256 hash for each `.js` and `.css` file in the `docker/resume/` directory using a command like `shasum -a 256 filename | awk '{print $1}' | xxd -r -p | base64`. +2. **Update index.html**: Update the `integrity` attribute in the ` diff --git a/docker/resume/index.html-E b/docker/resume/index.html-E index f5102b6..c6c80ad 100644 --- a/docker/resume/index.html-E +++ b/docker/resume/index.html-E @@ -5,6 +5,7 @@ Colin Knapp Portfolio +