mirror of
https://github.com/getsentry/self-hosted.git
synced 2025-12-08 19:46:14 +00:00
fix: js-sdk directory/file permission should be set correctly (#3616)
This commit is contained in:
parent
b0c3090b17
commit
d350bd4b7d
@ -20,14 +20,21 @@ echo $total_directories
|
|||||||
test "5" == "$total_directories"
|
test "5" == "$total_directories"
|
||||||
echo "Pass"
|
echo "Pass"
|
||||||
|
|
||||||
# `sdk_tree` should output "5 directories, 17 files"
|
# `sdk_tree` should output "6 directories, 23 files"
|
||||||
echo "$sdk_tree"
|
echo "$sdk_tree"
|
||||||
test "5 directories, 17 files" == "$(echo "$sdk_tree")"
|
test "6 directories, 23 files" == "$(echo "$sdk_tree")"
|
||||||
echo "Pass"
|
echo "Pass"
|
||||||
|
|
||||||
# Files should all be >1k (ensure they are not empty)
|
# Files should all be >1k (ensure they are not empty)
|
||||||
echo "Testing file sizes"
|
echo "Testing file sizes"
|
||||||
test "17" == "$non_empty_file_count"
|
test "23" == "$non_empty_file_count"
|
||||||
|
echo "Pass"
|
||||||
|
|
||||||
|
# Files should be owned by the root user
|
||||||
|
echo "Testing file ownership"
|
||||||
|
directory_owners=$(echo "$sdk_files" | awk '$3=="root" { print $0 }' | wc -l)
|
||||||
|
echo "$directory_owners"
|
||||||
|
test "$directory_owners" == "8"
|
||||||
echo "Pass"
|
echo "Pass"
|
||||||
|
|
||||||
report_success
|
report_success
|
||||||
|
|||||||
@ -27,14 +27,20 @@ if [[ "${SETUP_JS_SDK_ASSETS:-}" == "1" ]]; then
|
|||||||
latest_js_v6=$(echo "$loader_registry" | $jq -r '.versions | reverse | map(select(.|any(.; startswith("6.")))) | .[0]')
|
latest_js_v6=$(echo "$loader_registry" | $jq -r '.versions | reverse | map(select(.|any(.; startswith("6.")))) | .[0]')
|
||||||
latest_js_v7=$(echo "$loader_registry" | $jq -r '.versions | reverse | map(select(.|any(.; startswith("7.")))) | .[0]')
|
latest_js_v7=$(echo "$loader_registry" | $jq -r '.versions | reverse | map(select(.|any(.; startswith("7.")))) | .[0]')
|
||||||
latest_js_v8=$(echo "$loader_registry" | $jq -r '.versions | reverse | map(select(.|any(.; startswith("8.")))) | .[0]')
|
latest_js_v8=$(echo "$loader_registry" | $jq -r '.versions | reverse | map(select(.|any(.; startswith("8.")))) | .[0]')
|
||||||
|
latest_js_v9=$(echo "$loader_registry" | $jq -r '.versions | reverse | map(select(.|any(.; startswith("9.")))) | .[0]')
|
||||||
|
|
||||||
echo "Found JS SDKs: v${latest_js_v4}, v${latest_js_v5}, v${latest_js_v6}, v${latest_js_v7}, v${latest_js_v8}"
|
echo "Found JS SDKs: v${latest_js_v4}, v${latest_js_v5}, v${latest_js_v6}, v${latest_js_v7}, v${latest_js_v8}, v${latest_js_v9}"
|
||||||
|
|
||||||
versions="{$latest_js_v4,$latest_js_v5,$latest_js_v6,$latest_js_v7,$latest_js_v8}"
|
versions="{$latest_js_v4,$latest_js_v5,$latest_js_v6,$latest_js_v7,$latest_js_v8,$latest_js_v9}"
|
||||||
variants="{bundle,bundle.tracing,bundle.tracing.replay,bundle.replay,bundle.tracing.replay.feedback,bundle.feedback}"
|
variants="{bundle,bundle.tracing,bundle.tracing.replay,bundle.replay,bundle.tracing.replay.feedback,bundle.feedback}"
|
||||||
|
|
||||||
# Download those versions & variants using curl
|
# Download those versions & variants using curl
|
||||||
$dcr --no-deps --rm -v "sentry-nginx-www:/var/www" nginx curl -w '%{response_code} %{url}\n' --no-progress-meter --compressed --retry 3 --create-dirs -fLo "/var/www/js-sdk/#1/#2.min.js" "https://browser.sentry-cdn.com/${versions}/${variants}.min.js" || true
|
$dcr --no-deps --rm -v "sentry-nginx-www:/var/www" nginx curl -w '%{response_code} %{url}\n' --no-progress-meter --compressed --retry 3 --create-dirs -fLo "/var/www/js-sdk/#1/#2.min.js" "https://browser.sentry-cdn.com/${versions}/${variants}.min.js" || true
|
||||||
|
|
||||||
|
# Make sure permissions are correct
|
||||||
|
# See https://github.com/getsentry/self-hosted/issues/3614 for reported issue
|
||||||
|
$dcr --no-deps --rm -v "sentry-nginx-www:/var/www" nginx find /var/www/js-sdk -type d -exec chmod 755 {} \;
|
||||||
|
$dcr --no-deps --rm -v "sentry-nginx-www:/var/www" nginx find /var/www/js-sdk -type f -exec chmod 644 {} \;
|
||||||
|
|
||||||
echo "${_endgroup}"
|
echo "${_endgroup}"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user