Initial InfraPulse scaffold

This commit is contained in:
Keith Smith
2026-05-22 17:36:40 -06:00
commit a707186a5e
92 changed files with 6918 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
from sqlalchemy import select
from sqlalchemy.orm import Session
from app.auth.security import hash_password
from app.core.config import settings
from app.models import User
def ensure_initial_admin(db: Session) -> None:
existing = db.scalar(select(User).where(User.email == settings.initial_admin_email))
if existing:
return
user = User(
email=settings.initial_admin_email,
display_name="Initial Owner",
hashed_password=hash_password(settings.initial_admin_password),
role="owner",
is_active=True,
)
db.add(user)
db.commit()