-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_demo.sh
More file actions
executable file
·78 lines (66 loc) · 3.03 KB
/
Copy pathsetup_demo.sh
File metadata and controls
executable file
·78 lines (66 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# setup_demo.sh - Quick setup script for demo
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ Microsoft Graph Red Team Framework - Demo Setup ║"
echo "╚══════════════════════════════════════════════════════════╝"
echo ""
# Check if virtual environment exists
if [ ! -d "venv311" ]; then
echo "❌ Virtual environment not found (venv311)"
echo "Creating new virtual environment..."
python3.11 -m venv venv311
fi
# Activate virtual environment
echo "✓ Activating virtual environment..."
source venv311/bin/activate
# Install/upgrade dependencies
echo "✓ Installing dependencies..."
pip install -q --upgrade pip
pip install -q -r requirements.txt
# Check for .env file
if [ ! -f ".env" ]; then
echo "⚠️ No .env file found"
echo "Creating .env template..."
echo "OPENAI_API_KEY=your-openai-key-here" > .env
echo "⚠️ Please edit .env and add your OpenAI API key"
fi
# Check for token.txt
if [ ! -f "token.txt" ]; then
echo "⚠️ No token.txt file found"
touch token.txt
echo "⚠️ Please add your Microsoft Graph access token to token.txt"
fi
echo ""
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ Setup Status ║"
echo "╚══════════════════════════════════════════════════════════╝"
# Check OpenAI key
if grep -q "your-openai-key-here" .env 2>/dev/null || ! grep -q "OPENAI_API_KEY" .env 2>/dev/null; then
echo " [ ] OpenAI API Key - NOT CONFIGURED"
echo " → Edit .env and add your key"
else
echo " [✓] OpenAI API Key - Configured"
fi
# Check token
if [ ! -s "token.txt" ]; then
echo " [ ] Graph Token - NOT CONFIGURED"
echo " → Add your token to token.txt"
else
echo " [✓] Graph Token - Present"
fi
echo " [✓] Dependencies - Installed"
echo ""
# Test OpenAI connection
echo "Testing OpenAI API connection..."
python test_openai.py
echo ""
echo "╔══════════════════════════════════════════════════════════╗"
echo "║ Ready to Demo! ║"
echo "╚══════════════════════════════════════════════════════════╝"
echo ""
echo "Run the demo with:"
echo " source venv311/bin/activate && python main_demo.py"
echo ""
echo "Or standard mode:"
echo " source venv311/bin/activate && python main.py"
echo ""