Skip to content

Commit

Permalink
Fix csp replace
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinrais committed Feb 7, 2022
1 parent b05812e commit 9e7e83d
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
- build
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:
yarn-build:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ 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
4 changes: 2 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ INDEX_HTML_FILE="/usr/share/nginx/html/index.html";
if [ -z "${VUE_APP_AVATAR_BASE_URL}" ]; then
echo "[Warn] VUE_APP_AVATAR_BASE_URL env value is not defined, it can cause problem on profile avatar image loading !"
else
sed -i "s/img-src/img-src '$VUE_APP_AVATAR_BASE_URL'/g" $NGINX_CONF_FILE
sed -i "s~img-src~img-src '$VUE_APP_AVATAR_BASE_URL'~g" $NGINX_CONF_FILE
fi

# Replace env in index.html
Expand All @@ -44,7 +44,7 @@ else

sed -i "s/$HEAD_TAG/$GA_TAG\n$HEAD_TAG/g" $INDEX_HTML_FILE

sed -i "s/script-src/script-src 'https://www.google-analytics.com'/g" $NGINX_CONF_FILE
sed -i "s~script-src~script-src 'https://www.google-analytics.com'~g" $NGINX_CONF_FILE
fi

echo "[Info] Starting Nginx ..."
Expand Down

0 comments on commit 9e7e83d

Please sign in to comment.