From 77517079a7b68090627cd5c37e50ff3271be2286 Mon Sep 17 00:00:00 2001 From: Leopere Date: Sat, 10 May 2025 17:14:38 -0400 Subject: [PATCH] update to rules and tests --- .cursor/rules/asset-hashing-csp.mdc | 23 +++++++++++++++++++++++ .cursor/rules/test-suite-integrity.mdc | 26 ++++++++++++++++++++++++++ build-test-deploy.sh | 13 ++++++++++++- docker/resume/Dockerfile | 1 + docker/resume/favicon.ico | 1 + docker/resume/index.html | 1 + docker/resume/index.html-E | 1 + 7 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .cursor/rules/asset-hashing-csp.mdc create mode 100644 .cursor/rules/test-suite-integrity.mdc create mode 100644 docker/resume/favicon.ico 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 +