This repository has been archived on 2026-02-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
breakpilot-pwa/geo-service/config.py
Benjamin Admin 21a844cb8a fix: Restore all files lost during destructive rebase
A previous `git pull --rebase origin main` dropped 177 local commits,
losing 3400+ files across admin-v2, backend, studio-v2, website,
klausur-service, and many other services. The partial restore attempt
(660295e2) only recovered some files.

This commit restores all missing files from pre-rebase ref 98933f5e
while preserving post-rebase additions (night-scheduler, night-mode UI,
NightModeWidget dashboard integration).

Restored features include:
- AI Module Sidebar (FAB), OCR Labeling, OCR Compare
- GPU Dashboard, RAG Pipeline, Magic Help
- Klausur-Korrektur (8 files), Abitur-Archiv (5+ files)
- Companion, Zeugnisse-Crawler, Screen Flow
- Full backend, studio-v2, website, klausur-service
- All compliance SDKs, agent-core, voice-service
- CI/CD configs, documentation, scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:51:32 +01:00

100 lines
2.7 KiB
Python

"""
GeoEdu Service Configuration
Environment-based configuration with Pydantic Settings
"""
from functools import lru_cache
from typing import Optional
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
"""Application settings loaded from environment variables."""
model_config = SettingsConfigDict(
env_file=".env",
env_file_encoding="utf-8",
case_sensitive=False,
)
# Service Config
port: int = 8088
environment: str = "development"
debug: bool = False
# JWT Authentication
jwt_secret: str = "your-super-secret-jwt-key"
jwt_algorithm: str = "HS256"
jwt_expiration_hours: int = 24
# PostgreSQL (PostGIS)
database_url: str = "postgresql+asyncpg://breakpilot:breakpilot123@postgres:5432/breakpilot_db"
# MinIO (S3-compatible storage)
minio_endpoint: str = "minio:9000"
minio_access_key: str = "breakpilot"
minio_secret_key: str = "breakpilot123"
minio_bucket: str = "breakpilot-geo"
minio_secure: bool = False
# Ollama (LLM for learning nodes)
ollama_base_url: str = "http://host.docker.internal:11434"
ollama_model: str = "qwen2.5:14b"
ollama_timeout: int = 120
# Data Directories
osm_data_dir: str = "/app/data/osm"
dem_data_dir: str = "/app/data/dem"
tile_cache_dir: str = "/app/cache/tiles"
bundle_dir: str = "/app/bundles"
# Tile Server Config
default_pmtiles_file: str = "germany.pmtiles"
tile_cache_max_size_gb: float = 50.0
# DEM Config
dem_resolution: str = "GLO-30" # 30m Copernicus DEM
terrain_tile_size: int = 256
# AOI Limits (DSGVO data minimization)
max_aoi_size_km2: float = 4.0 # Max 4 km² per AOI
max_aoi_per_user: int = 10
aoi_retention_days: int = 30 # Auto-delete after 30 days
# Learning Nodes
max_nodes_per_aoi: int = 20
supported_themes: list[str] = [
"topographie",
"landnutzung",
"orientierung",
"geologie",
"hydrologie",
"vegetation",
]
# CORS (for frontend access)
cors_origins: list[str] = [
"http://localhost:3000",
"http://localhost:3001",
"http://localhost:8088",
]
@property
def pmtiles_path(self) -> str:
"""Full path to PMTiles file."""
return f"{self.osm_data_dir}/{self.default_pmtiles_file}"
@property
def is_development(self) -> bool:
"""Check if running in development mode."""
return self.environment == "development"
@lru_cache
def get_settings() -> Settings:
"""Get cached settings instance."""
return Settings()
# Export settings instance for convenience
settings = get_settings()