A modern platform for visual, flexible, and extensible graph-based investigations. For cybersecurity analysts and investigators.
feat: makefile
dextmorgn5499c41a98b2
diff --git a/.env.example b/.env.exampleindex 60bf5b01..aa6db3d4 100644--- a/.env.example+++ b/.env.example@@ -1,15 +1,10 @@NODE_ENV=production-NEXT_PUBLIC_AUTH_REDIRECT=http://app.flowsint.localhost/auth/callback-HIBP_API_KEY=-ETHERSCAN_API_KEY=-NEXT_PUBLIC_FLOWSINT_API=https://api.flowsint.localhost/api-NEXT_PUBLIC_DOCKER_FLOWSINT_API=http://flowsint-api:5000/api-AUTH_SECRET="superscretchangeitplz"-AUTH_TRUST_HOST=true+AUTH_SECRET=superscretchangeitplzNEO4J_URI_BOLT=bolt://neo4j:7687-NEO4J_URI_WEB=https://neo4j.flowsint.localhostNEO4J_USERNAME=neo4jNEO4J_PASSWORD=password-WHOXY_API_KEY=VITE_API_URL=http://127.0.0.1:5001DATABASE_URL=postgresql://flowsint:flowsint@localhost:5433/flowsint+HIBP_API_KEY=+ETHERSCAN_API_KEY=+WHOXY_API_KEY=diff --git a/Makefile b/Makefilenew file mode 100644index 00000000..515be3d1--- /dev/null+++ b/Makefile@@ -0,0 +1,77 @@+# --- Variables ---+PROJECT_ROOT := $(shell pwd)++# --- Cibles phony (pas des fichiers) ---+.PHONY: install run stop infra api frontend celery clean dev check-env+ENV_DIRS := flowsint-api flowsint-core flowsint-app++# --- Installation des dépendances ---++dev:+ $(MAKE) check-env+ $(MAKE) install+ $(MAKE) run++check-env:+ @echo "🔎 Checking .env files..."+ @for dir in $(ENV_DIRS); do \+ env_file="$$dir/.env"; \+ env_example="$(PROJECT_ROOT)/.env.example"; \+ if [ -f "$$env_file" ]; then \+ echo "✅ Using existing .env in $$dir"; \+ else \+ echo "❌ .env missing in $$dir, copying from .env.example"; \+ cp "$$env_example" "$$env_file"; \+ fi; \+ done++install:+ @echo "🚀 Installing Flowsint project modules..."+ @if ! command -v poetry >/dev/null 2>&1; then \+ echo "❌ Poetry is not installed. Please install it:"; \+ echo "pipx install poetry"; \+ echo "or"; \+ echo "curl -sSL https://install.python-poetry.org | python3 -"; \+ exit 1; \+ fi+ poetry config virtualenvs.in-project true --local+ poetry env use python3.12+ docker compose up -d+ poetry install+ cd $(PROJECT_ROOT)/flowsint-core && poetry install+ cd $(PROJECT_ROOT)/flowsint-transforms && poetry install+ cd $(PROJECT_ROOT)/flowsint-api && poetry install && poetry run alembic upgrade head+ cd $(PROJECT_ROOT)/flowsint-app && yarn install+ @echo "✅ All modules installed successfully!"++# --- Services Docker only ---+infra:+ docker compose up -d++# --- Lancer chaque service individuellement ---+api:+ cd $(PROJECT_ROOT)/flowsint-api && poetry run uvicorn app.main:app --host 0.0.0.0 --port 5001 --reload++frontend:+ cd $(PROJECT_ROOT)/flowsint-app && npx electron-vite dev++celery:+ cd $(PROJECT_ROOT)/flowsint-core && poetry run celery -A flowsint_core.core.celery worker --loglevel=info --pool=solo++# --- Lancer tous les services (API + Front + Celery) ---+run: infra+ $(MAKE) -j3 api frontend celery++# --- stop all ---+stop:+ @echo "🛑 Stopping all services..."+ -docker compose down++# --- Nettoyage complet ---+clean:+ @echo "🧹 Removing containers, volumes and venvs..."+ docker compose down -v --remove-orphans+ rm -rf $(PROJECT_ROOT)/flowsint-app/node_modules+ rm -rf $(PROJECT_ROOT)/flowsint-core/.venv+ rm -rf $(PROJECT_ROOT)/flowsint-transforms/.venv+ rm -rf $(PROJECT_ROOT)/flowsint-api/.venvdiff --git a/install.sh b/install.shdeleted file mode 100755index 373277e8..00000000--- a/install.sh+++ /dev/null@@ -1,27 +0,0 @@-#!/bin/bash-set -e--echo "🚀 Installing Flowsint Project modules..."--if ! command -v poetry &> /dev/null; then- echo "❌ Poetry is not installed. Please install Poetry first:"- echo "curl -sSL https://install.python-poetry.org | python3 -"- exit 1-fi--# Create project venv in .venv-poetry config virtualenvs.in-project true --local--# Ensure Poetry uses the correct Python version-echo "🐍 Configuring Poetry to use Python 3.12..."-poetry env use python3.12--# Install all dependencies (local modules with path = editable install)-poetry install--echo "✅ All modules installed successfully!"-echo "🎯 Next steps:"-echo "1. Set up your environment variables in .env files"-echo "2. Start the API server: cd flowsint-api && poetry run uvicorn app.main:app --reload"-echo "3. Start the frontend: cd flowsint-app && npm install && npm start"-diff --git a/start.sh b/start.shdeleted file mode 100755index eb3bf30e..00000000--- a/start.sh+++ /dev/null@@ -1,47 +0,0 @@-#!/bin/bash--PROJECT_ROOT="$(cd "$(dirname "$0")" && pwd)"--echo "Starting Flowsint project services..."--cleanup() {- echo "🛑 Stopping all services..."- kill $API_PID $FRONTEND_PID $CELERY_PID 2>/dev/null || true-}-trap cleanup EXIT--start_service() {- local name="$1"- shift- echo "▶️ Starting $name..."- "$@" &- local pid=$!- sleep 2- if ! kill -0 $pid 2>/dev/null; then- echo "❌ $name failed to start (check logs)."- return 1- fi- echo "✅ $name started (PID: $pid)"- echo ""- eval "$2=$pid" # stocker le PID dans la variable donnée-}-cd "$PROJECT_ROOT/"-docker compose up -d--cd "$PROJECT_ROOT/flowsint-api"-start_service "API server" poetry run uvicorn app.main:app --host 0.0.0.0 --port 5001 --reload--cd "$PROJECT_ROOT/flowsint-app"-start_service "Frontend" npx electron-vite dev--cd "$PROJECT_ROOT/flowsint-core"-start_service "Celery worker" poetry run celery -A flowsint_core.core.celery worker --loglevel=info--echo "📊 Service status:"-echo " - API server (PID: $API_PID): http://localhost:5001"-echo " - Frontend (PID: $FRONTEND_PID)"-echo " - Celery worker (PID: $CELERY_PID)"-echo ""-echo "🛑 Press Ctrl+C to stop all services"--wait