feat: Add Ollama AI integration for automatic mail template generation

 New Features:
- 🤖 AI-powered mail template generation with Ollama
- 📧 Test mail sending with preview
- 🔧 Ollama server and model management
- 🎨 Beautiful AI generation dialog in Templates page
- ⚙️ Ollama settings panel with connection test

Backend:
- Add ollama.service.js - Ollama API integration
- Add ollama.controller.js - Template generation endpoint
- Add ollama.routes.js - /api/ollama/* routes
- Support for multiple Ollama models (llama3.2, mistral, gemma)
- JSON-formatted AI responses with subject + HTML body
- Configurable server URL and model selection

Frontend:
- Settings: Ollama configuration panel
  - Server URL input
  - Model selection
  - Connection test with model listing
- Templates: AI generation dialog
  - Company name, scenario, employee info inputs
  - Custom prompt for AI instructions
  - Auto-save to database
  - Test mail sending functionality

Documentation:
- OLLAMA_SETUP.md - Comprehensive setup guide
- Installation instructions
- Model recommendations
- Usage examples
- Troubleshooting

Tech Stack:
- Ollama API integration (REST)
- Axios HTTP client
- React dialogs with MUI
- Self-hosted AI (privacy-friendly)
- Zero external API dependencies

Example Usage:
  Company: Garanti Bankası
  Scenario: Account security warning
  → AI generates professional phishing test mail in seconds!
This commit is contained in:
salvacybersec
2025-11-10 21:13:58 +03:00
parent d41ff7671e
commit af0510e486
8 changed files with 1121 additions and 7 deletions

View File

@@ -7,10 +7,11 @@ Güvenlik farkındalık eğitimleri için basit ve etkili phishing test yönetim
- 🏢 **Şirket Bazlı Yönetim** - Her şirket için ayrı tracking
- 📧 **Gmail Entegrasyonu** - App Password ile kolay mail gönderimi
- 💬 **Telegram Bildirimleri** - Gerçek zamanlı tıklama bildirimleri
- 🤖 **Ollama AI Entegrasyonu** - AI ile otomatik mail şablonu oluşturma
- 📊 **Detaylı İstatistikler** - IP, konum, cihaz bilgileri
- 💾 **SQLite** - Tek dosya, kolay yedekleme
- 🎨 **Modern UI** - React ile responsive admin paneli
- ✉️ **Mail Şablonları** - HTML editör ve önizleme paneli
- ✉️ **Mail Şablonları** - HTML editör, önizleme ve test gönderimi
## 🚀 Hızlı Başlangıç
@@ -47,7 +48,7 @@ oltalama/
│ │ ├── controllers/ ✅ 7 dosya (auth, company, token, vb.)
│ │ ├── models/ ✅ 6 model + ilişkiler
│ │ ├── routes/ ✅ 7 route dosyası
│ │ ├── services/ ✅ Mail, Telegram, Token
│ │ ├── services/ ✅ Mail, Telegram, Token, Ollama AI
│ │ ├── utils/ ✅ GeoIP, User-Agent, Token Generator
│ │ └── app.js ✅
│ └── database/ ✅ oltalama.db (3 şirket, 2 şablon)
@@ -239,6 +240,7 @@ node scripts/change-password.js
- **Ana Doküman:** `README.md` (bu dosya)
- **Sunucu Kurulumu:** `DEPLOYMENT.md` 🚀 (Production kurulum)
- **Ollama AI Entegrasyonu:** `OLLAMA_SETUP.md` 🤖 (AI mail şablon oluşturma)
- **Domain Yapılandırma:** `docs/DOMAIN_SETUP.md` 🌐 (Tek/İki domain)
- **Nginx Proxy Manager:** `docs/NGINX_PROXY_MANAGER.md` 🔄 (Reverse proxy)
- **Güvenlik Rehberi:** `SECURITY.md` 🔒 (Güvenlik en iyi uygulamaları)