Build [v1.4.0] - Audit Dashboard & LDAP Restoration

This commit is contained in:
Daniel Bedeleanu
2026-04-12 09:39:17 +03:00
parent 5cceba21f4
commit f3d861b1a2
23 changed files with 973 additions and 382 deletions

View File

@@ -5,8 +5,9 @@ from slowapi import Limiter
from slowapi.util import get_remote_address
from . import models
from .database import engine
from .routers import items, operations, users, categories
from .routers import items, operations, users, categories, admin_db
from .logger import log
from .scheduler import scheduler, sync_scheduler_config
# Create the database tables
from .database import DATA_DIR, db_path
@@ -33,7 +34,7 @@ app.add_middleware(
CORSMiddleware,
allow_origins=ALLOWED_ORIGINS,
allow_credentials=True,
allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allow_methods=["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
allow_headers=["*"],
)
@@ -45,6 +46,13 @@ app.include_router(items.router)
app.include_router(operations.router)
app.include_router(users.router)
app.include_router(categories.router)
app.include_router(admin_db.router)
@app.on_event("startup")
def startup_event():
log.info("[STARTUP] Starting background scheduler...")
scheduler.start()
sync_scheduler_config()
@app.get("/")
def read_root():