Major changes: - Add TLD price scraper with Porkbun API (886+ TLDs, no API key needed) - Fix .ch domain checker using rdap.nic.ch custom RDAP - Integrate database for TLD price history tracking - Add admin endpoints for manual scrape and stats - Extend scheduler with daily TLD price scrape job (03:00 UTC) - Update API to use DB data with static fallback - Update README with complete documentation New files: - backend/app/services/tld_scraper/ (scraper package) - TLD_TRACKING_PLAN.md (implementation plan) API changes: - POST /admin/scrape-tld-prices - trigger manual scrape - GET /admin/tld-prices/stats - database statistics - GET /tld-prices/overview now uses DB data
47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
"""Application configuration using pydantic-settings."""
|
|
from functools import lru_cache
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings loaded from environment variables."""
|
|
|
|
# Database
|
|
database_url: str = "sqlite+aiosqlite:///./domainwatch.db"
|
|
|
|
# JWT Settings
|
|
secret_key: str = "dev-secret-key-change-in-production"
|
|
algorithm: str = "HS256"
|
|
access_token_expire_minutes: int = 1440 # 24 hours
|
|
|
|
# App Settings
|
|
app_name: str = "DomainWatch"
|
|
debug: bool = True
|
|
|
|
# Email Settings (optional)
|
|
smtp_host: str = ""
|
|
smtp_port: int = 587
|
|
smtp_user: str = ""
|
|
smtp_password: str = ""
|
|
email_from: str = ""
|
|
|
|
# CORS Settings
|
|
cors_origins: str = "http://localhost:3000,http://127.0.0.1:3000"
|
|
|
|
# Scheduler Settings
|
|
check_hour: int = 6
|
|
check_minute: int = 0
|
|
scheduler_check_interval_hours: int = 24
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
env_file_encoding = "utf-8"
|
|
extra = "ignore" # Ignore extra fields in .env
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
"""Get cached settings instance."""
|
|
return Settings()
|
|
|