Cambio nome

This commit is contained in:
2026-03-19 16:58:23 +01:00
parent c34d6bb080
commit 83e494e171
29 changed files with 105 additions and 105 deletions
@@ -1,4 +1,4 @@
"""Initial schema tutte le tabelle PecFlow Fase 1
"""Initial schema tutte le tabelle PEChub Fase 1
Revision ID: 0001
Revises:
+1 -1
View File
@@ -1 +1 @@
# PecFlow Backend
# PEChub Backend
+3 -3
View File
@@ -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 -1
View File
@@ -1,5 +1,5 @@
"""
Eccezioni applicative custom per PecFlow.
Eccezioni applicative custom per PEChub.
"""
from fastapi import HTTPException, status
+1 -1
View File
@@ -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
View File
@@ -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,
+1 -1
View File
@@ -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.)
+1 -1
View File
@@ -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()
+1 -1
View File
@@ -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)
+2 -2
View File
@@ -3,9 +3,9 @@ requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "pecflow-backend"
name = "pechub-backend"
version = "1.0.0"
description = "PecFlow Backend API per gestione PEC SaaS"
description = "PEChub Backend API per gestione PEC SaaS"
requires-python = ">=3.12"
dependencies = [
+2 -2
View File
@@ -143,8 +143,8 @@ class TestCreateSendJob:
json={
"mailbox_id": str(active_mailbox.id),
"to_addresses": ["matteo1801@spidmail.it"],
"subject": "Test PecFlow Fase 4",
"body_text": "Messaggio di test inviato da PecFlow.",
"subject": "Test PEChub Fase 4",
"body_text": "Messaggio di test inviato da PEChub.",
},
headers=auth_headers,
)