mirror of
https://github.com/yogeshojha/rengine.git
synced 2026-10-20 23:31:31 +02:00
- Added `clean_name` function to `validation.py` for name validation with max length. - Simplified docstrings in `dnsx` client, parser, and service files for clarity. - Enhanced error handling in `ViewDNSService` to prevent disabling keys on rate limits. - Improved WHOIS service to handle concurrent inserts gracefully with integrity checks. - Updated `Settings` class in worker config to inherit from `BaseAppSettings`. - Added new dependencies in `pyproject.toml` for `apprise` and `cryptography`.
47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class BaseAppSettings(BaseSettings):
|
|
APP_NAME: str = "reNgine"
|
|
DEBUG: bool = False
|
|
APP_VERSION: str = "3.0.0"
|
|
|
|
LOG_LEVEL: str = "INFO"
|
|
|
|
POSTGRES_HOST: str = "db"
|
|
POSTGRES_PORT: int = 5432
|
|
POSTGRES_USER: str = "rengine"
|
|
POSTGRES_PASSWORD: str = "rengine" # noqa: S105
|
|
POSTGRES_DB: str = "rengine"
|
|
|
|
@property
|
|
def database_url_async(self) -> str:
|
|
return (
|
|
f"postgresql+asyncpg://{self.POSTGRES_USER}:{self.POSTGRES_PASSWORD}"
|
|
f"@{self.POSTGRES_HOST}:{self.POSTGRES_PORT}/{self.POSTGRES_DB}"
|
|
)
|
|
|
|
@property
|
|
def database_url_sync(self) -> str:
|
|
return (
|
|
f"postgresql://{self.POSTGRES_USER}:{self.POSTGRES_PASSWORD}"
|
|
f"@{self.POSTGRES_HOST}:{self.POSTGRES_PORT}/{self.POSTGRES_DB}"
|
|
)
|
|
|
|
REDIS_HOST: str = "redis"
|
|
REDIS_PORT: int = 6379
|
|
REDIS_DB: int = 0
|
|
|
|
@property
|
|
def redis_url(self) -> str:
|
|
return f"redis://{self.REDIS_HOST}:{self.REDIS_PORT}/{self.REDIS_DB}"
|
|
|
|
@property
|
|
def celery_broker_url(self) -> str:
|
|
return self.redis_url
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
extra = "ignore"
|