feat: indie status page MVP -- FastAPI + SQLite
- 8 DB models (services, incidents, monitors, subscribers, etc.) - Full CRUD API for services, incidents, monitors - Public status page with live data - Incident detail page with timeline - API key authentication - Uptime monitoring scheduler - 13 tests passing - TECHNICAL_DESIGN.md with full spec
This commit is contained in:
commit
902133edd3
4655 changed files with 1342691 additions and 0 deletions
44
app/config.py
Normal file
44
app/config.py
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
from pydantic_settings import BaseSettings
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
"""Application settings loaded from environment variables or .env file."""
|
||||
|
||||
# App
|
||||
app_name: str = "Indie Status Page"
|
||||
database_url: str = "sqlite+aiosqlite:///./data/statuspage.db"
|
||||
secret_key: str = "change-me-to-a-random-string"
|
||||
admin_api_key: str = "change-me-to-a-secure-api-key"
|
||||
debug: bool = False
|
||||
|
||||
# Site
|
||||
site_name: str = "My SaaS Status"
|
||||
site_url: str = "http://localhost:8000"
|
||||
site_logo_url: str = ""
|
||||
site_accent_color: str = "#4f46e5"
|
||||
|
||||
# SMTP
|
||||
smtp_host: str = ""
|
||||
smtp_port: int = 587
|
||||
smtp_user: str = ""
|
||||
smtp_pass: str = ""
|
||||
smtp_from: str = "noreply@example.com"
|
||||
|
||||
# Webhook
|
||||
webhook_notify_url: str = ""
|
||||
|
||||
# Uptime monitoring
|
||||
monitor_check_interval: int = 60
|
||||
|
||||
model_config = {"env_file": ".env", "env_file_encoding": "utf-8"}
|
||||
|
||||
@property
|
||||
def db_path(self) -> Path:
|
||||
"""Extract filesystem path from SQLite URL for directory creation."""
|
||||
# Remove the sqlite+aiosqlite:/// prefix
|
||||
path_str = self.database_url.replace("sqlite+aiosqlite:///", "")
|
||||
return Path(path_str)
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Loading…
Add table
Add a link
Reference in a new issue