- Add data_sources.yaml for configurable data source URLs - Add data_sources.py to load config with database override support - Add arcgis_landing_points and arcgis_cable_landing_relation collectors - Change visualization API to query arcgis_landing_points - Add /api/v1/datasources/configs/all endpoint - Update Earth to fetch from API instead of static files - Fix scheduler collector ID mappings
47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
from functools import lru_cache
|
|
from pathlib import Path
|
|
from typing import List
|
|
import os
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
PROJECT_NAME: str = "Intelligent Planet Plan"
|
|
VERSION: str = "1.0.0"
|
|
API_V1_STR: str = "/api/v1"
|
|
SECRET_KEY: str = "your-secret-key-change-in-production"
|
|
ALGORITHM: str = "HS256"
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 0
|
|
REFRESH_TOKEN_EXPIRE_DAYS: int = 0
|
|
|
|
POSTGRES_SERVER: str = "localhost"
|
|
POSTGRES_USER: str = "postgres"
|
|
POSTGRES_PASSWORD: str = "postgres"
|
|
POSTGRES_DB: str = "planet_db"
|
|
DATABASE_URL: str = f"postgresql+asyncpg://postgres:postgres@localhost:5432/planet_db"
|
|
|
|
REDIS_SERVER: str = "localhost"
|
|
REDIS_PORT: int = 6379
|
|
REDIS_DB: int = 0
|
|
|
|
CORS_ORIGINS: List[str] = ["http://localhost:3000", "http://localhost:8000"]
|
|
|
|
@property
|
|
def REDIS_URL(self) -> str:
|
|
return os.getenv(
|
|
"REDIS_URL", f"redis://{self.REDIS_SERVER}:{self.REDIS_PORT}/{self.REDIS_DB}"
|
|
)
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
case_sensitive = True
|
|
|
|
|
|
@lru_cache()
|
|
def get_settings() -> Settings:
|
|
return Settings()
|
|
|
|
|
|
settings = get_settings()
|