From 7d1463296d09ae6524e43472b25643150b33a77f Mon Sep 17 00:00:00 2001 From: Jon Lundy Date: Mon, 23 Nov 2020 20:46:46 -0700 Subject: [PATCH] add app name and version --- pkg/keyproofs/routes.go | 3 +++ pkg/keyproofs/template.go | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/keyproofs/routes.go b/pkg/keyproofs/routes.go index 54edc13..8e0af1d 100644 --- a/pkg/keyproofs/routes.go +++ b/pkg/keyproofs/routes.go @@ -86,6 +86,7 @@ func fmtKey(key promise.Key) string { func (s *identity) get(w http.ResponseWriter, r *http.Request) { log := zlog.Ctx(r.Context()) + cfg := config.FromContext(r.Context()) id := chi.URLParam(r, "id") log.Debug().Str("get ", id).Send() @@ -172,6 +173,8 @@ func (s *identity) get(w http.ResponseWriter, r *http.Request) { }) page := page{Style: defaultStyle} + page.AppName = fmt.Sprintf("%s v%s", cfg.GetString("app-name"), cfg.GetString("app-version")) + // Wait for either entity to resolve or timeout select { diff --git a/pkg/keyproofs/template.go b/pkg/keyproofs/template.go index f5f4953..8f69cd0 100644 --- a/pkg/keyproofs/template.go +++ b/pkg/keyproofs/template.go @@ -1,6 +1,7 @@ package keyproofs type page struct { + AppName string Entity *Entity Style *Style Proofs *Proofs @@ -173,7 +174,7 @@ var pageTPL = `