Added git commit and build date env and API

This commit is contained in:
Donkie
2023-09-17 10:51:28 +02:00
parent a1a4ad6b45
commit 1a3efd9ea9
6 changed files with 50 additions and 1 deletions

View File

@@ -197,6 +197,8 @@ class Info(BaseModel):
data_dir: str = Field(example="/home/app/.local/share/spoolman")
backups_dir: str = Field(example="/home/app/.local/share/spoolman/backups")
db_type: str = Field(example="sqlite")
git_commit: Optional[str] = Field(example="a1b2c3d")
build_date: Optional[datetime] = Field(example="2021-01-01T00:00:00Z")
class HealthCheck(BaseModel):

View File

@@ -43,6 +43,8 @@ async def info() -> models.Info:
data_dir=str(env.get_data_dir().resolve()),
backups_dir=str(env.get_backups_dir().resolve()),
db_type=str(env.get_database_type() or "sqlite"),
git_commit=env.get_commit_hash(),
build_date=env.get_build_date(),
)