Upgrade configuration and Docker stack to v2.0.0

This commit is contained in:
2026-06-22 14:49:56 -04:00
parent 2f2a5e9b4a
commit 0d2ecbd218
19 changed files with 779 additions and 495 deletions
+2 -2
View File
@@ -44,8 +44,8 @@ async def get_db() -> AsyncSession:
async def init_db():
"""Crée toutes les tables et initialise un client par défaut si nécessaire."""
import secrets
import hashlib
from sqlalchemy import select
from app.dependencies.auth import hash_api_key
from app.models.client import APIClient, ClientPlan
async with engine.begin() as conn:
@@ -59,7 +59,7 @@ async def init_db():
if result.scalar_one_or_none() is None:
# Table vide -> Création du client bootstrap
raw_key = secrets.token_urlsafe(32)
key_hash = hashlib.sha256(raw_key.encode("utf-8")).hexdigest()
key_hash = hash_api_key(raw_key)
bootstrap_client = APIClient(
name="Default Admin",