mirror of
https://github.com/idrainformatica/PecFlow.git
synced 2026-06-16 12:45:42 +02:00
Cambio nome
This commit is contained in:
@@ -1 +1 @@
|
||||
# PecFlow Backend
|
||||
# PEChub Backend
|
||||
|
||||
@@ -34,8 +34,8 @@ class Settings(BaseSettings):
|
||||
encryption_key: str = "0" * 64
|
||||
|
||||
# ── Database ──────────────────────────────────────────────────────────────
|
||||
database_url: str = "postgresql+asyncpg://pecflow:pecflow_dev_password@db:5432/pecflow"
|
||||
database_url_sync: str = "postgresql://pecflow:pecflow_dev_password@db:5432/pecflow"
|
||||
database_url: str = "postgresql+asyncpg://pechub:pechub_dev_password@db:5432/pechub"
|
||||
database_url_sync: str = "postgresql://pechub:pechub_dev_password@db:5432/pechub"
|
||||
|
||||
# ── Redis ─────────────────────────────────────────────────────────────────
|
||||
redis_url: str = "redis://redis:6379/0"
|
||||
@@ -44,7 +44,7 @@ class Settings(BaseSettings):
|
||||
minio_endpoint: str = "minio:9000"
|
||||
minio_access_key: str = "minioadmin"
|
||||
minio_secret_key: str = "minioadmin"
|
||||
minio_bucket: str = "pecflow"
|
||||
minio_bucket: str = "pechub"
|
||||
minio_use_ssl: bool = False
|
||||
|
||||
# ── CORS ──────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Eccezioni applicative custom per PecFlow.
|
||||
Eccezioni applicative custom per PEChub.
|
||||
"""
|
||||
|
||||
from fastapi import HTTPException, status
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"""
|
||||
Structured logging per PecFlow.
|
||||
Structured logging per PEChub.
|
||||
In produzione (LOG_JSON=true) emette log JSON per aggregatori (Loki, ELK).
|
||||
In sviluppo emette log leggibili colorati.
|
||||
"""
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
|
||||
|
||||
setup_logging()
|
||||
logger.info(
|
||||
"🚀 PecFlow Backend avviato",
|
||||
"🚀 PEChub Backend avviato",
|
||||
extra={"env": settings.app_env, "debug": settings.app_debug},
|
||||
)
|
||||
|
||||
@@ -53,14 +53,14 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
|
||||
from app.services.send_service import close_arq_pool
|
||||
await close_arq_pool()
|
||||
await engine.dispose()
|
||||
logger.info("🛑 PecFlow Backend fermato")
|
||||
logger.info("🛑 PEChub Backend fermato")
|
||||
|
||||
|
||||
# ─── Applicazione FastAPI ─────────────────────────────────────────────────────
|
||||
limiter = Limiter(key_func=get_remote_address, default_limits=["200/minute"])
|
||||
|
||||
app = FastAPI(
|
||||
title="PecFlow API",
|
||||
title="PEChub API",
|
||||
description="API per la gestione PEC SaaS multi-tenant",
|
||||
version="1.0.0",
|
||||
docs_url="/docs" if not settings.is_production else None,
|
||||
|
||||
@@ -109,7 +109,7 @@ class NotificationChannel(Base):
|
||||
|
||||
class NotificationRule(Base):
|
||||
"""
|
||||
Regola: evento PecFlow → canale di notifica.
|
||||
Regola: evento PEChub → canale di notifica.
|
||||
|
||||
event_type: new_message | state_changed | anomaly | send_failed | ...
|
||||
filter: JSONB con condizioni opzionali (mailbox_id, state, ecc.)
|
||||
|
||||
@@ -26,7 +26,7 @@ class TenantCreateRequest(BaseModel):
|
||||
@field_validator("slug")
|
||||
@classmethod
|
||||
def validate_slug(cls, v: str) -> str:
|
||||
reserved = {"api", "admin", "www", "mail", "smtp", "imap", "pecflow", "app"}
|
||||
reserved = {"api", "admin", "www", "mail", "smtp", "imap", "pechub", "app"}
|
||||
if v in reserved:
|
||||
raise ValueError(f"Slug '{v}' riservato")
|
||||
return v.lower()
|
||||
|
||||
@@ -209,7 +209,7 @@ class AuthService:
|
||||
|
||||
# Genera URI otpauth://
|
||||
totp = pyotp.TOTP(secret)
|
||||
uri = totp.provisioning_uri(name=user.email, issuer_name="PecFlow")
|
||||
uri = totp.provisioning_uri(name=user.email, issuer_name="PEChub")
|
||||
|
||||
# Genera QR code
|
||||
qr = qrcode.QRCode(version=1, box_size=6, border=4)
|
||||
|
||||
Reference in New Issue
Block a user