version.go, footer.html: display version

Closes https://gitlab.com/commento/commento/issues/122
This commit is contained in:
Adhityaa Chandrasekar 2019-04-20 20:59:30 -04:00
parent 1d1cd46c2b
commit e46f9cf9e7
4 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package main
func main() { func main() {
exitIfError(loggerCreate()) exitIfError(loggerCreate())
exitIfError(versionPrint())
exitIfError(configParse()) exitIfError(configParse())
exitIfError(dbConnect(5)) exitIfError(dbConnect(5))
exitIfError(migrate()) exitIfError(migrate())

View File

@ -36,6 +36,7 @@ func fileDetemplate(f string) ([]byte, error) {
x = strings.Replace(x, "[[[.Origin]]]", os.Getenv("ORIGIN"), -1) x = strings.Replace(x, "[[[.Origin]]]", os.Getenv("ORIGIN"), -1)
x = strings.Replace(x, "[[[.CdnPrefix]]]", os.Getenv("CDN_PREFIX"), -1) x = strings.Replace(x, "[[[.CdnPrefix]]]", os.Getenv("CDN_PREFIX"), -1)
x = strings.Replace(x, "[[[.Footer]]]", footer, -1) x = strings.Replace(x, "[[[.Footer]]]", footer, -1)
x = strings.Replace(x, "[[[.Version]]]", version, -1)
return []byte(x), nil return []byte(x), nil
} }

View File

@ -9,6 +9,11 @@ import (
"time" "time"
) )
func versionPrint() error {
logger.Infof("starting Commento %s", version)
return nil
}
func versionCheckStart() error { func versionCheckStart() error {
go func() { go func() {
printedError := false printedError := false

View File

@ -19,4 +19,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="copyright">
Commento [[[.Version]]]
</div>
</div> </div>