Add base kubernetes support
This commit is contained in:
@@ -19,9 +19,23 @@ class TenantSettings(BaseServiceSettings):
|
||||
SERVICE_NAME: str = "tenant-service"
|
||||
DESCRIPTION: str = "Multi-tenant management and subscription service"
|
||||
|
||||
# Database Configuration
|
||||
DATABASE_URL: str = os.getenv("TENANT_DATABASE_URL",
|
||||
"postgresql+asyncpg://tenant_user:tenant_pass123@tenant-db:5432/tenant_db")
|
||||
# Database configuration (secure approach - build from components)
|
||||
@property
|
||||
def DATABASE_URL(self) -> str:
|
||||
"""Build database URL from secure components"""
|
||||
# Try complete URL first (for backward compatibility)
|
||||
complete_url = os.getenv("TENANT_DATABASE_URL")
|
||||
if complete_url:
|
||||
return complete_url
|
||||
|
||||
# Build from components (secure approach)
|
||||
user = os.getenv("TENANT_DB_USER", "tenant_user")
|
||||
password = os.getenv("TENANT_DB_PASSWORD", "tenant_pass123")
|
||||
host = os.getenv("TENANT_DB_HOST", "localhost")
|
||||
port = os.getenv("TENANT_DB_PORT", "5432")
|
||||
name = os.getenv("TENANT_DB_NAME", "tenant_db")
|
||||
|
||||
return f"postgresql+asyncpg://{user}:{password}@{host}:{port}/{name}"
|
||||
|
||||
# Redis Database (dedicated for tenant data)
|
||||
REDIS_DB: int = 4
|
||||
|
||||
Reference in New Issue
Block a user