feat: 完善服务监控与下游重投
This commit is contained in:
@@ -42,6 +42,7 @@ npm --prefix api ci --include=dev
|
||||
|
||||
echo "[deploy] Verifying dependency security mitigations"
|
||||
npm run security:verify
|
||||
npm run deploy:verify
|
||||
|
||||
echo "[deploy] Generating Prisma client and applying migrations"
|
||||
npm --prefix api run prisma:generate
|
||||
@@ -69,13 +70,20 @@ echo "[deploy] Installing restricted security boundary"
|
||||
bash "$APP_DIR/tools/security/install-security-agent.sh"
|
||||
|
||||
echo "[deploy] Ensuring HTTP response compression"
|
||||
cat >/etc/nginx/conf.d/cmpp-compression.conf <<'EOF'
|
||||
compression_config=/etc/nginx/conf.d/cmpp-compression.conf
|
||||
: >"$compression_config"
|
||||
if grep -RqsE --exclude='cmpp-compression.conf' '^[[:space:]]*gzip[[:space:]]+on;' \
|
||||
/etc/nginx/nginx.conf /etc/nginx/conf.d /etc/nginx/sites-enabled 2>/dev/null; then
|
||||
echo "[deploy] Reusing existing Nginx gzip configuration"
|
||||
else
|
||||
cat >"$compression_config" <<'EOF'
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_min_length 1024;
|
||||
gzip_comp_level 5;
|
||||
gzip_types application/json application/javascript text/javascript text/css text/plain text/csv image/svg+xml;
|
||||
EOF
|
||||
fi
|
||||
nginx -t
|
||||
|
||||
echo "[deploy] Restarting services"
|
||||
|
||||
Reference in New Issue
Block a user