all repos — honk @ 8d77d070c508923536f02eb75cde84f96930f920

my fork of honk

add a quick version check until release machinery gets sorted
Ted Unangst tedu@tedunangst.com
Fri, 01 Nov 2019 17:36:04 -0400
commit

8d77d070c508923536f02eb75cde84f96930f920

parent

270c3980a18b8833d2b48b9d80943d9f47082dbf

5 files changed, 14 insertions(+), 0 deletions(-)

jump to
M docs/changelog.txtdocs/changelog.txt

@@ -2,6 +2,8 @@ changelog

-- next ++ Version string in binary. + ++ Make it easier to upgrade by decoupling data dir from ".". + Amend changelog for 0.8.0 in include omitted elements:
M docs/honk.8docs/honk.8

@@ -143,6 +143,10 @@ .Pp

There's also a .Pa blob.db file which is important to backup and restore. +.Pp +The current version of the honk binary may be printed with the +.Ic version +command. .Ss SECURITY .Nm is not currently hardened against SSRF, server side request forgery.
M honk.gohonk.go

@@ -22,10 +22,13 @@ "fmt"

"html/template" "log" notrand "math/rand" + "os" "strconv" "strings" "time" ) + +var honkVersion = "honk 0.8.0-dev" func init() { notrand.Seed(time.Now().Unix())

@@ -208,6 +211,9 @@ case "init":

initdb() case "upgrade": upgradedb() + case "version": + fmt.Println(honkVersion) + os.Exit(0) } db := opendatabase() dbversion := 0
M views/about.htmlviews/about.html

@@ -2,5 +2,6 @@ {{ template "header.html" . }}

<main> <div class="info"> {{ .AboutMsg }} +<p style="text-align:right"><small>version: {{ .HonkVersion }}</small> </div> </main>
M web.goweb.go

@@ -1800,6 +1800,7 @@ u := login.GetUserInfo(r)

templinfo := getInfo(r) templinfo["AboutMsg"] = aboutMsg templinfo["LoginMsg"] = loginMsg + templinfo["HonkVersion"] = honkVersion if u == nil { w.Header().Set("Cache-Control", "max-age=60") }