Self-hosted Docker Compose manager. - Backend: FastAPI + docker-py + SQLite (JWT auth, file-first stacks, lifecycle, live status, WebSocket logs, docker-run converter, audit log) - Frontend: React + Vite + Tailwind (login/setup, dashboard, stacks, stack detail, Monaco editor, dark/light theme) - Deployment: docker-compose.yml, Dockerfiles, nginx reverse proxy Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
23 lines
448 B
Python
23 lines
448 B
Python
"""Audit log helper."""
|
|
from __future__ import annotations
|
|
|
|
from typing import Optional
|
|
|
|
from sqlmodel import Session
|
|
|
|
from models.audit import AuditLog
|
|
|
|
|
|
def record(
|
|
session: Session,
|
|
*,
|
|
user: str,
|
|
action: str,
|
|
target: str,
|
|
detail: Optional[str] = None,
|
|
ip: Optional[str] = None,
|
|
) -> None:
|
|
entry = AuditLog(user=user, action=action, target=target, detail=detail, ip=ip)
|
|
session.add(entry)
|
|
session.commit()
|