-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get rid of CSP script-src unsafe-inline
- Loading branch information
Sebastian Dobe
committed
Jul 1, 2023
1 parent
af0d32a
commit 7de918d
Showing
19 changed files
with
379 additions
and
121 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,38 @@ | ||
#!/bin/bash | ||
|
||
npm run build | ||
rm -rf ../static/v1/* | ||
rm -rf ../templates/html/* | ||
|
||
mkdir ../templates/html | ||
mkdir -p ../static/v1 | ||
rm -rf ../static/v1/* | ||
rm -rf ../templates/html/* | ||
|
||
cp -r build/* ../static/v1/ | ||
npm run build | ||
|
||
cp build/index.html ../templates/html/index.html | ||
pages=( | ||
"../templates/html/*.html" | ||
"../templates/html/oidc/*.html" | ||
"../templates/html/users/*.html" | ||
"../templates/html/users/{id}/reset/*.html" | ||
) | ||
|
||
for file in $(find build -name *.html); do | ||
cp "$file" ../templates/html/ | ||
for folder in "${pages[@]}"; do | ||
for html in $folder; do | ||
# for pre-rendering colors | ||
sed -i 's/#6b3d99;/{{ col_act1 }};/g' "$html" | ||
sed -i 's/#714d99;/{{ col_act1a }};/g' "$html" | ||
sed -i 's/#388c51;/{{ col_act2 }};/g' "$html" | ||
sed -i 's/#4d8c62;/{{ col_act2a }};/g' "$html" | ||
sed -i 's/#3d5d99;/{{ col_acnt }};/g' "$html" | ||
sed -i 's/#36486b;/{{ col_acnta }};/g' "$html" | ||
sed -i 's/#43993d;/{{ col_ok }};/g' "$html" | ||
sed -i 's/#993d49;/{{ col_err }};/g' "$html" | ||
sed -i 's/#545454;/{{ col_glow }};/g' "$html" | ||
sed -i 's/#b2b2b2;/{{ col_gmid }};/g' "$html" | ||
sed -i 's/#f2f2f2;/{{ col_ghigh }};/g' "$html" | ||
sed -i 's/#383838;/{{ col_text }};/g' "$html" | ||
sed -i 's/#f7f7f7;/{{ col_bg }};/g' "$html" | ||
# for the nonce in the CSP for script files | ||
sed -i 's/<link /<link nonce="{{ nonce }}" /g' "$html" | ||
sed -i 's/<script>/<script nonce="{{ nonce }}">/g' "$html" | ||
done; | ||
done | ||
|
||
for html in ../templates/html/*; do | ||
sed -i 's/#6b3d99;/{{ col_act1 }};/g' "$html" | ||
sed -i 's/#714d99;/{{ col_act1a }};/g' "$html" | ||
sed -i 's/#388c51;/{{ col_act2 }};/g' "$html" | ||
sed -i 's/#4d8c62;/{{ col_act2a }};/g' "$html" | ||
sed -i 's/#3d5d99;/{{ col_acnt }};/g' "$html" | ||
sed -i 's/#36486b;/{{ col_acnta }};/g' "$html" | ||
sed -i 's/#43993d;/{{ col_ok }};/g' "$html" | ||
sed -i 's/#993d49;/{{ col_err }};/g' "$html" | ||
sed -i 's/#545454;/{{ col_glow }};/g' "$html" | ||
sed -i 's/#b2b2b2;/{{ col_gmid }};/g' "$html" | ||
sed -i 's/#f2f2f2;/{{ col_ghigh }};/g' "$html" | ||
sed -i 's/#383838;/{{ col_text }};/g' "$html" | ||
sed -i 's/#f7f7f7;/{{ col_bg }};/g' "$html" | ||
done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.