Hub-and-Spoke Umbau: Multi-Tenant Zentrale + Satellite-Agent

- Backend: Customer/Satellite Models, customer_id auf Server/Job/Audit
- Satellite-API: heartbeat, poll (atomares Claiming), logs, result,
  scan-result, health-report - Auth via X-Api-Key (SHA-256 gehasht)
- Job-Queue: pending/claimed/running/success/failed + Stale-Janitor
- Batch-Trigger: ein Job pro Server, Satellite arbeitet sequenziell ab
- Credentials bleiben lokal: nur symbolische credential_ref zentral
- Neues Paket satellite/: Pull-Loop, WinRM/SSH/CAU/Scanner, PyInstaller-tauglich
- Frontend: Kunden-Switcher, Satelliten-View, Polling statt WebSocket
- Entfernt: WebSocket/Socket.io, Redis, zentrale Credentials, JobRunner
- Docs: README/AGENTS/PROMPT auf neue Architektur aktualisiert
This commit is contained in:
B0rbor4d
2026-08-07 03:42:06 +00:00
parent b91dd66fee
commit cc4c3fcecb
72 changed files with 2759 additions and 1642 deletions
+24 -6
View File
@@ -8,24 +8,28 @@ from app.models.update_job import JobStatus, JobType
class JobTriggerRequest(BaseModel):
server_id: int
customer_id: int
type: JobType
# CAU-specific options
cluster_name: str | None = None
# Linux-specific options
# Target server; not required for NETWORK_SCAN
server_id: int | None = None
# Optional parameters
reboot_if_required: bool = False
scan_subnet: str | None = None # e.g. "192.168.1.0/24"
class UpdateJobRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: int
server_id: int
customer_id: int
server_id: int | None
satellite_id: int | None
type: JobType
status: JobStatus
progress_percent: int
current_phase: str | None
started_by: str
created_by: str
claimed_at: datetime | None
started_at: datetime | None
finished_at: datetime | None
error: str | None
@@ -40,3 +44,17 @@ class UpdateLogRead(BaseModel):
timestamp: datetime
level: str
line: str
class BatchJobTriggerRequest(BaseModel):
"""Trigger one job per server (or all servers of a customer)."""
customer_id: int
type: JobType
server_ids: list[int] | None = None # None = all servers of the customer
reboot_if_required: bool = False
class BatchJobTriggerResponse(BaseModel):
created: int
job_ids: list[int]