task-queue-system/README.md

53 lines
1.6 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Task Queue System v0.3.0
**FastAPI + PostgreSQL + RabbitMQ** mit produktionsreifen Mail-Prüfungen:
- MXValidation, SPFValidation, **TLSCheck**, **CertValidity**, **MTASTSCheck**, **TLSRPTCheck**
- **Task-Abhängigkeiten**: z.B. TLS & CertValidity warten auf MXValidation
- TLS-Checks mit STARTTLS (Port 25), TLS-Version/Cipher, Zertifikatsdaten & Gültigkeit
- MTA-STS (Policy-Datei + TXT-Id) und TLS-RPT (rua)
## Quickstart
```bash
docker-compose up -d
export DATABASE_URL="postgresql+asyncpg://postgres:postgres@localhost:5432/tasks"
export RABBITMQ_URL="amqp://guest:guest@localhost/"
export RABBITMQ_EXCHANGE="tasks"
export MAX_RETRIES=3
export DNS_TIMEOUT=3.0; export DNS_LIFETIME=5.0; export SMTP_TIMEOUT=10.0
# API
uvicorn app.api:app --host 0.0.0.0 --port 8000 --reload
# Worker
python -m app.workers.mail_mx_worker
python -m app.workers.mail_spf_worker
python -m app.workers.mail_tls_worker
python -m app.workers.mail_cert_worker
python -m app.workers.mail_mtasts_worker
python -m app.workers.mail_tlsrpt_worker
# CLI
python -m app.cli create-job MailCheck --domain example.com
```
## Tasks & Dependencies
```
MailCheck
├─ MXValidation (no deps)
├─ SPFValidation (no deps)
├─ TLSCheck (depends on: MXValidation)
├─ CertValidity (depends on: MXValidation)
├─ MTASTSCheck (no deps)
└─ TLSRPTCheck (no deps)
```
## API
- `POST /jobs``{ job_type: "MailCheck", domain: "example.com" }`
- `GET /jobs/{job_id}`
## Hinweise
- Für Produktion: Migrationen mit Alembic.
- MTA-STS-Datei: `https://mta-sts.<domain>/.well-known/mta-sts.txt`
- TLS nur Port 25 (STARTTLS). 465/587 nicht erforderlich laut Anforderung.