Add sub-projects

This commit is contained in:
2025-04-16 15:08:51 +02:00
parent 2dbf216d37
commit db538adfdd
22 changed files with 1157 additions and 0 deletions

View File

@ -0,0 +1,26 @@
"""Settings management."""
import os
from pathlib import Path
from pydantic import BaseModel
from dotenv import load_dotenv
DEFAULT_DATABASE = "sshecret.db"
load_dotenv()
class BackendSettings(BaseModel):
"""Backend Settings."""
db_file: Path
regenerate_tokens: bool = False
def get_settings() -> BackendSettings:
"""Get settings."""
db_filename = os.getenv("SSHECRET_DATABASE") or DEFAULT_DATABASE
db_file = Path(db_filename).absolute()
return BackendSettings(db_file=db_file)