feat: add build id from commit hash (#1095)

* fix old ref

* capture git commit as build ID

* generate new types

* display build on Site Settings page

* fix extras crash it extras is none
This commit is contained in:
Hayden
2022-03-24 20:29:01 -08:00
committed by GitHub
parent 7f102f513d
commit ffb3b45ac2
11 changed files with 21 additions and 16 deletions

View File

@@ -32,6 +32,8 @@ class AppSettings(BaseSettings):
TOKEN_TIME: int = 48 # Time in Hours
SECRET: str
GIT_COMMIT_HASH: str = "unknown"
ALLOW_SIGNUP: bool = True
@property

View File

@@ -31,8 +31,8 @@ def recipe_extras(func):
if extras is None:
extras = []
extras = [{"key": key, "value": value} for key, value in extras.items()]
else:
extras = [{"key": key, "value": value} for key, value in extras.items()]
return func(*args, extras=extras, **kwargs)

View File

@@ -26,6 +26,7 @@ class AdminAboutController(BaseAdminController):
db_url=settings.DB_URL_PUBLIC,
default_group=settings.DEFAULT_GROUP,
allow_signup=settings.ALLOW_SIGNUP,
build_id=settings.GIT_COMMIT_HASH,
)
@router.get("/statistics", response_model=AppStatistics)

View File

@@ -23,6 +23,7 @@ class AdminAboutInfo(AppInfo):
db_type: str
db_url: str | None
default_group: str
build_id: str
class CheckAppConfig(CamelModel):