Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docker/start-nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,19 @@ then
sed -i -r "s/[a-zA-Z]+\.BBS_URL/\"${BBS_SCHEME_BASE}:\/\/${BBS_BASE}\"/g" /var/www/app/gazebo/assets/*.js
fi

# Inject runtime config via window.configEnv
if [[ -n "${CODECOV_GH_APP}" ]]; then
# Only inject if not already present (makes this idempotent across container restarts)
if ! grep -q 'window.configEnv.GH_APP' /var/www/app/gazebo/index.html; then
echo "Setting GH_APP to ${CODECOV_GH_APP}"
# Base64 encode to safely handle all special characters (sed, JS, HTML)
ENCODED_GH_APP=$(printf '%s' "${CODECOV_GH_APP}" | base64 | tr -d '\n')
sed -i 's#<head>#<head><script>window.configEnv=window.configEnv||{};window.configEnv.GH_APP=atob("'"${ENCODED_GH_APP}"'");</script>#' /var/www/app/gazebo/index.html
else
echo "GH_APP already configured, skipping injection"
fi
fi

export DOLLAR='$'
if [ "$CODECOV_FRONTEND_IPV6_DISABLED" ]; then
echo 'Codecov frontend ipv6 disabled'
Expand Down
Loading