feat: Email-Eingangsverarbeitung für Destinatäre implementieren
Some checks failed
CI/CD Pipeline / test (push) Has been cancelled
CI/CD Pipeline / deploy (push) Has been cancelled
Code Quality / quality (push) Has been cancelled

Neues System zur automatischen Verarbeitung eingehender E-Mails von
Destinatären. IMAP-Polling alle 15 Minuten via Celery Beat, automatische
Zuordnung zu Destinatären anhand der E-Mail-Adresse, Upload von Anhängen
zu Paperless-NGX.

Umfasst:
- DestinataerEmailEingang Model mit Status-Tracking
- Celery Task für IMAP-Polling und Paperless-Integration
- Web-UI (Liste + Detail) mit Such- und Filterfunktion
- Admin-Interface mit Bulk-Actions
- Agent-Dokumentation (SysAdmin, RentmeisterAI)
- Dev-Environment Modernisierung (docker compose v2)

Reviewed by: SysAdmin (STI-15), RentmeisterAI (STI-16)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Stiftung CEO Agent
2026-03-09 21:11:22 +00:00
parent 6c8ddbb4f0
commit 4b21f553c3
16 changed files with 1554 additions and 49 deletions

View File

@@ -1,70 +1,68 @@
#!/bin/bash
# Development setup script
# Development setup script for Stiftungsmanagement
# Uses compose.dev.yml for isolated development environment
set -e
echo "🚀 Setting up Stiftung development environment..."
COMPOSE_FILE="compose.dev.yml"
PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
cd "$PROJECT_DIR"
echo "Setting up Stiftung development environment..."
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "Docker is not running. Please start Docker first."
echo "Docker is not running. Please start Docker first."
echo ""
echo "Install Docker: https://docs.docker.com/engine/install/"
echo "Or install Docker Desktop: https://docs.docker.com/desktop/"
exit 1
fi
# Check if .env exists
if [ ! -f ".env" ]; then
echo "📝 Creating .env file from template..."
cp env-template.txt .env
echo "✅ Please edit .env file with your configuration"
fi
# Start services
echo "🐳 Starting Docker services..."
docker-compose up -d
echo "Starting Docker services with $COMPOSE_FILE..."
docker compose -f "$COMPOSE_FILE" up -d --build
# Wait for database to be ready
echo "Waiting for database to be ready..."
sleep 10
echo "Waiting for database to be ready..."
until docker compose -f "$COMPOSE_FILE" exec -T db pg_isready -U postgres -d stiftung_dev > /dev/null 2>&1; do
sleep 2
done
echo "Database is ready."
# Run migrations
echo "🔄 Running database migrations..."
docker-compose exec web python manage.py migrate
echo "Running database migrations..."
docker compose -f "$COMPOSE_FILE" exec -T web python manage.py migrate
# Create superuser if needed
echo "👤 Creating superuser (if needed)..."
docker-compose exec web python manage.py shell << 'EOF'
# Collect static files
echo "Collecting static files..."
docker compose -f "$COMPOSE_FILE" exec -T web python manage.py collectstatic --noinput
# Create superuser if none exists
echo "Checking for superuser..."
docker compose -f "$COMPOSE_FILE" exec -T web python manage.py shell -c "
from django.contrib.auth import get_user_model
User = get_user_model()
if not User.objects.filter(is_superuser=True).exists():
print("No superuser found. Please create one:")
exit()
print('No superuser found. Create one with:')
print(' docker compose -f $COMPOSE_FILE exec web python manage.py createsuperuser')
else:
print("Superuser already exists")
EOF
# Collect static files
echo "📦 Collecting static files..."
docker-compose exec web python manage.py collectstatic --noinput
# Check health
echo "🏥 Checking application health..."
sleep 5
if curl -f -s http://localhost:8000/health/ > /dev/null; then
echo "✅ Application is healthy!"
else
echo "❌ Application health check failed"
fi
print('Superuser already exists.')
"
echo ""
echo "🎉 Development environment is ready!"
echo "Development environment is ready!"
echo ""
echo "📊 Services:"
echo " - Application: http://localhost:8000"
echo " - Admin: http://localhost:8000/admin/"
echo " - HelpBox Admin: http://localhost:8000/help-box/admin/"
echo "Services:"
echo " Django App: http://localhost:18081"
echo " Paperless: http://localhost:8082"
echo " Gramps Web: http://localhost:18090"
echo " PostgreSQL: localhost:5433 (user: postgres, pass: postgres_dev, db: stiftung_dev)"
echo ""
echo "🛠️ Useful commands:"
echo " - View logs: docker-compose logs -f web"
echo " - Run tests: docker-compose exec web python manage.py test"
echo " - Django shell: docker-compose exec web python manage.py shell"
echo " - Create superuser: docker-compose exec web python manage.py createsuperuser"
echo "Useful commands:"
echo " Logs: docker compose -f $COMPOSE_FILE logs -f web"
echo " Tests: docker compose -f $COMPOSE_FILE exec web python manage.py test"
echo " Django shell: docker compose -f $COMPOSE_FILE exec web python manage.py shell"
echo " Superuser: docker compose -f $COMPOSE_FILE exec web python manage.py createsuperuser"
echo " Stop: docker compose -f $COMPOSE_FILE down"
echo " Reset (wipe): docker compose -f $COMPOSE_FILE down -v"