auto_sigma_rule_generator/Makefile
2025-07-08 09:10:25 -05:00

70 lines
2.3 KiB
Makefile

.PHONY: help start stop restart build logs clean dev setup
# Default target
help:
@echo "CVE-SIGMA Auto Generator - Available Commands:"
@echo "=============================================="
@echo " make start - Start the application"
@echo " make stop - Stop the application"
@echo " make restart - Restart the application"
@echo " make build - Build and start with fresh images"
@echo " make logs - Show application logs"
@echo " make clean - Stop and remove all containers/volumes"
@echo " make dev - Start in development mode"
@echo " make setup - Initial setup (copy .env, etc.)"
@echo " make help - Show this help message"
# Initial setup
setup:
@echo "🔧 Setting up CVE-SIGMA Auto Generator..."
@if [ ! -f .env ]; then \
cp .env.example .env; \
echo "✅ .env file created from .env.example"; \
echo "💡 Edit .env to add your NVD API key for better rate limits"; \
else \
echo "✅ .env file already exists"; \
fi
# Start the application
start: setup
@echo "🚀 Starting CVE-SIGMA Auto Generator..."
docker-compose up -d
@echo "✅ Application started!"
@echo "🌐 Frontend: http://localhost:3000"
@echo "🔧 Backend: http://localhost:8000"
@echo "📚 API Docs: http://localhost:8000/docs"
# Stop the application
stop:
@echo "🛑 Stopping CVE-SIGMA Auto Generator..."
docker-compose down
@echo "✅ Application stopped!"
# Restart the application
restart: stop start
# Build and start with fresh images
build: setup
@echo "🔨 Building and starting CVE-SIGMA Auto Generator..."
docker-compose up -d --build
@echo "✅ Application built and started!"
# Show logs
logs:
@echo "📋 Application logs (press Ctrl+C to exit):"
docker-compose logs -f
# Clean everything
clean:
@echo "🧹 Cleaning up CVE-SIGMA Auto Generator..."
docker-compose down -v --remove-orphans
docker system prune -f
@echo "✅ Cleanup complete!"
# Development mode (with hot reload)
dev: setup
@echo "🔧 Starting in development mode..."
docker-compose -f docker-compose.yml up -d db redis
@echo "💡 Database and Redis started. Run backend and frontend locally for development."
@echo " Backend: cd backend && pip install -r requirements.txt && uvicorn main:app --reload"
@echo " Frontend: cd frontend && npm install && npm start"