4310a5cc2d
Frontend: - Vite + React 18 + TypeScript + Tailwind v4 + Shadcn/ui - React Flow v12 canvas with all 11 node types and 5 edge types - Dark theme with project design system (cyan, green, orange, purple accents) - Collapsible sidebar, toolbar, detail panel - Zustand store for canvas state - Demo data with 10 nodes and 10 edges Backend: - FastAPI + SQLAlchemy async + SQLite (Python 3.13) - DB models: Node, Edge, CanvasState, PendingDevice, ScanRun - REST API routes: auth, nodes, edges, canvas, scan, status (WebSocket) - JWT auth + bcrypt via config.yml - Pydantic v2 schemas Infra: - GitHub Actions quality + security workflows - .gitignore, .env.example, verify-tooling.sh, security-check.sh
42 lines
1.3 KiB
Bash
Executable File
42 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "Running security checks..."
|
|
|
|
# Check .env is not staged
|
|
if git diff --cached --name-only | grep -E '^\.env$|^\.env\.' | grep -v '\.example$'; then
|
|
echo "ERROR: .env file is staged for commit!"
|
|
exit 1
|
|
fi
|
|
|
|
# Check for common secret patterns in staged files
|
|
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM)
|
|
if [ -n "$STAGED_FILES" ]; then
|
|
if echo "$STAGED_FILES" | xargs grep -l -E '(password|secret|api_key|apikey|token)\s*[:=]\s*["\047][^"\047]{8,}["\047]' 2>/dev/null; then
|
|
echo "WARNING: Possible secrets found in staged files - please verify"
|
|
fi
|
|
fi
|
|
|
|
# Check for SQLite DB being committed
|
|
if git diff --cached --name-only | grep -E '\.db$'; then
|
|
echo "ERROR: SQLite database file is staged for commit!"
|
|
exit 1
|
|
fi
|
|
|
|
# Dependency audit (frontend)
|
|
if [ -f "frontend/package.json" ]; then
|
|
echo "Checking npm dependencies..."
|
|
cd frontend && npm audit --audit-level=high 2>/dev/null || echo "Warning: npm audit found issues"
|
|
cd ..
|
|
fi
|
|
|
|
# Python dependency check
|
|
if [ -f "backend/requirements.txt" ]; then
|
|
if command -v safety &> /dev/null; then
|
|
echo "Checking Python dependencies..."
|
|
safety check -r backend/requirements.txt 2>/dev/null || echo "Warning: safety found issues"
|
|
fi
|
|
fi
|
|
|
|
echo "Security checks complete!"
|