Skip to content

Commit

Permalink
trying to fix csp , allow to inject avatars source to csp in nginx co…
Browse files Browse the repository at this point in the history
…nfig
  • Loading branch information
yassinrais committed Feb 7, 2022
1 parent e3c5662 commit b10cbe6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ on:
- build
env:
IMAGE: saferwall/ui
VUE_APP_CSP_HOSTS: "*.saferwall.com saferwall.com"
VUE_APP_ANALYTICS_GOOGLE_TAG: UA-111524273-1
VUE_APP_CSP_HOSTS: "*.saferwall.com saferwall.com"
VUE_APP_BASE_URI: "https://saferwall.com/"
VUE_APP_API_BASE_URL: "https://api.saferwall.com/v1/"
VUE_APP_AVATAR_BASE_URL: "https://avatar.saferwall.com/"

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: UI Release
on: workflow_dispatch
env:
IMAGE: saferwall/ui
VUE_APP_ANALYTICS_GOOGLE_TAG: UA-111524273-1
VUE_APP_CSP_HOSTS: "*.saferwall.com saferwall.com"
VUE_APP_BASE_URI: "https://saferwall.com/"
VUE_APP_API_BASE_URL: "https://api.saferwall.com/v1/"
VUE_APP_AVATAR_BASE_URL: "https://avatar.saferwall.com/"

jobs:
docker-release:
Expand Down
6 changes: 4 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ do
fi

envsubst '$VUE_APP_BASE_URI' < $file.tmpl.js > $file
envsubst '$VUE_APP_API_BASE_URL' < $file > $file
envsubst '$VUE_APP_AVATAR_BASE_URL' < $file > $file
cp $file $file.tmpl.js
envsubst '$VUE_APP_API_BASE_URL' < $file.tmpl.js > $file
cp $file $file.tmpl.js
envsubst '$VUE_APP_AVATAR_BASE_URL' < $file.tmpl.js > $file
done

# -------------
Expand Down
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ server {
add_header X-Frame-Options "DENY";
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Content-Security-Policy "script-src 'unsafe-eval' 'unsafe-inline' 'self'; style-src 'unsafe-inline' fonts.googleapis.com 'self'; s object-src 'none'; base-uri 'self'; form-action 'self'; img-src 'self' data:;";
add_header Content-Security-Policy "script-src 'unsafe-eval' 'unsafe-inline' 'self'; style-src 'unsafe-inline' fonts.googleapis.com 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; img-src 'self' data:;";

location / {
try_files $uri $uri/ @rewrites;
Expand Down

0 comments on commit b10cbe6

Please sign in to comment.