From e46f9cf9e79d793bf85bd14d1d005b77f6023a35 Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Sat, 20 Apr 2019 20:59:30 -0400 Subject: [PATCH] version.go, footer.html: display version Closes https://gitlab.com/commento/commento/issues/122 --- api/main.go | 1 + api/router_static.go | 1 + api/version.go | 5 +++++ frontend/footer.html | 3 +++ 4 files changed, 10 insertions(+) diff --git a/api/main.go b/api/main.go index 8133976..148b48c 100644 --- a/api/main.go +++ b/api/main.go @@ -2,6 +2,7 @@ package main func main() { exitIfError(loggerCreate()) + exitIfError(versionPrint()) exitIfError(configParse()) exitIfError(dbConnect(5)) exitIfError(migrate()) diff --git a/api/router_static.go b/api/router_static.go index 5cdbce0..8e77c4e 100644 --- a/api/router_static.go +++ b/api/router_static.go @@ -36,6 +36,7 @@ func fileDetemplate(f string) ([]byte, error) { x = strings.Replace(x, "[[[.Origin]]]", os.Getenv("ORIGIN"), -1) x = strings.Replace(x, "[[[.CdnPrefix]]]", os.Getenv("CDN_PREFIX"), -1) x = strings.Replace(x, "[[[.Footer]]]", footer, -1) + x = strings.Replace(x, "[[[.Version]]]", version, -1) return []byte(x), nil } diff --git a/api/version.go b/api/version.go index d3f8884..1f46e67 100644 --- a/api/version.go +++ b/api/version.go @@ -9,6 +9,11 @@ import ( "time" ) +func versionPrint() error { + logger.Infof("starting Commento %s", version) + return nil +} + func versionCheckStart() error { go func() { printedError := false diff --git a/frontend/footer.html b/frontend/footer.html index f0bd3ad..313388e 100644 --- a/frontend/footer.html +++ b/frontend/footer.html @@ -19,4 +19,7 @@ +