Add CI/CD pipeline, feedback modal, Atlas qualys_id fallback, and health endpoint
- Rewrite .gitlab-ci.yml with proper stages, blocking tests, staging environment on dev box, and SSH-based production deploy to 71.85.90.6 - Add POST /api/health endpoint for pipeline verification - Add POST /atlas/hosts/:hostId/refresh-cache for Atlas cache staleness - AtlasSlideOutPanel: auto-resolve qualys_id from Atlas vulnerabilities, prefer qualys_id over active_host_findings_id, retry on failure - Add FeedbackModal component with bug report button in header and feature request in UserMenu, creates GitLab issues via /api/feedback - Fix all frontend test failures (ESM transforms, TextDecoder polyfill, fast-check resolution, App.test.js boilerplate replacement) - Fix root package.json test script to run jest - Add deploy/ directory with staging systemd service and setup script
This commit is contained in:
16
deploy/cve-backend-production.service
Normal file
16
deploy/cve-backend-production.service
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=CVE Dashboard Backend (Express API)
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/home/cve-dashboard/backend
|
||||
ExecStart=/usr/bin/node server.js
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
EnvironmentFile=/home/cve-dashboard/backend/.env
|
||||
StandardOutput=append:/home/cve-dashboard/backend/backend.log
|
||||
StandardError=append:/home/cve-dashboard/backend/backend.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
17
deploy/cve-backend-staging.service
Normal file
17
deploy/cve-backend-staging.service
Normal file
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=CVE Dashboard Backend - Staging (Express API on port 3100)
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=/home/cve-dashboard-staging/backend
|
||||
ExecStart=/usr/bin/node server.js
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
EnvironmentFile=/home/cve-dashboard-staging/backend/.env
|
||||
Environment=PORT=3100
|
||||
StandardOutput=append:/home/cve-dashboard-staging/backend/backend-staging.log
|
||||
StandardError=append:/home/cve-dashboard-staging/backend/backend-staging.log
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
50
deploy/setup-staging.sh
Executable file
50
deploy/setup-staging.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# =============================================================================
|
||||
# One-time setup for the staging environment
|
||||
# Run this once on dashboard-dev to prepare the staging deployment target.
|
||||
# =============================================================================
|
||||
|
||||
set -e
|
||||
|
||||
STAGING_DIR="/home/cve-dashboard-staging"
|
||||
SERVICE_FILE="deploy/cve-backend-staging.service"
|
||||
|
||||
echo "Setting up staging environment..."
|
||||
|
||||
# Create staging directory if it doesn't exist
|
||||
if [ ! -d "$STAGING_DIR" ]; then
|
||||
echo "Creating $STAGING_DIR..."
|
||||
mkdir -p "$STAGING_DIR"
|
||||
fi
|
||||
|
||||
# Copy the staging systemd service
|
||||
echo "Installing staging systemd service..."
|
||||
sudo cp "$SERVICE_FILE" /etc/systemd/system/cve-backend-staging.service
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl enable cve-backend-staging
|
||||
|
||||
# Create staging .env from production template (adjust port)
|
||||
if [ ! -f "$STAGING_DIR/backend/.env" ]; then
|
||||
echo "Creating staging .env..."
|
||||
mkdir -p "$STAGING_DIR/backend"
|
||||
if [ -f "/home/cve-dashboard/backend/.env" ]; then
|
||||
cp /home/cve-dashboard/backend/.env "$STAGING_DIR/backend/.env"
|
||||
# Override port for staging
|
||||
sed -i 's/^PORT=.*/PORT=3100/' "$STAGING_DIR/backend/.env"
|
||||
# If PORT line doesn't exist, add it
|
||||
grep -q "^PORT=" "$STAGING_DIR/backend/.env" || echo "PORT=3100" >> "$STAGING_DIR/backend/.env"
|
||||
else
|
||||
echo "PORT=3100" > "$STAGING_DIR/backend/.env"
|
||||
echo "WARNING: No production .env found. You'll need to configure $STAGING_DIR/backend/.env manually."
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Staging setup complete."
|
||||
echo " Directory: $STAGING_DIR"
|
||||
echo " Service: cve-backend-staging"
|
||||
echo " Port: 3100"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo " 1. Verify $STAGING_DIR/backend/.env has correct DATABASE_URL (use a separate staging DB if possible)"
|
||||
echo " 2. Run a pipeline on main/master to trigger the first staging deploy"
|
||||
Reference in New Issue
Block a user