add a quick version check until release machinery gets sorted
This commit is contained in:
parent
79fd165948
commit
8bd4136bdc
|
@ -2,6 +2,8 @@ changelog
|
||||||
|
|
||||||
-- next
|
-- next
|
||||||
|
|
||||||
|
+ Version string in binary.
|
||||||
|
|
||||||
++ Make it easier to upgrade by decoupling data dir from ".".
|
++ Make it easier to upgrade by decoupling data dir from ".".
|
||||||
|
|
||||||
+ Amend changelog for 0.8.0 in include omitted elements:
|
+ Amend changelog for 0.8.0 in include omitted elements:
|
||||||
|
|
|
@ -143,6 +143,10 @@ Restart.
|
||||||
There's also a
|
There's also a
|
||||||
.Pa blob.db
|
.Pa blob.db
|
||||||
file which is important to backup and restore.
|
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
|
.Ss SECURITY
|
||||||
.Nm
|
.Nm
|
||||||
is not currently hardened against SSRF, server side request forgery.
|
is not currently hardened against SSRF, server side request forgery.
|
||||||
|
|
6
honk.go
6
honk.go
|
@ -22,11 +22,14 @@ import (
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
notrand "math/rand"
|
notrand "math/rand"
|
||||||
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var honkVersion = "honk 0.8.0-dev"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
notrand.Seed(time.Now().Unix())
|
notrand.Seed(time.Now().Unix())
|
||||||
}
|
}
|
||||||
|
@ -208,6 +211,9 @@ func main() {
|
||||||
initdb()
|
initdb()
|
||||||
case "upgrade":
|
case "upgrade":
|
||||||
upgradedb()
|
upgradedb()
|
||||||
|
case "version":
|
||||||
|
fmt.Println(honkVersion)
|
||||||
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
db := opendatabase()
|
db := opendatabase()
|
||||||
dbversion := 0
|
dbversion := 0
|
||||||
|
|
|
@ -2,5 +2,6 @@
|
||||||
<main>
|
<main>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
{{ .AboutMsg }}
|
{{ .AboutMsg }}
|
||||||
|
<p style="text-align:right"><small>version: {{ .HonkVersion }}</small>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
1
web.go
1
web.go
|
@ -1800,6 +1800,7 @@ func servehtml(w http.ResponseWriter, r *http.Request) {
|
||||||
templinfo := getInfo(r)
|
templinfo := getInfo(r)
|
||||||
templinfo["AboutMsg"] = aboutMsg
|
templinfo["AboutMsg"] = aboutMsg
|
||||||
templinfo["LoginMsg"] = loginMsg
|
templinfo["LoginMsg"] = loginMsg
|
||||||
|
templinfo["HonkVersion"] = honkVersion
|
||||||
if u == nil {
|
if u == nil {
|
||||||
w.Header().Set("Cache-Control", "max-age=60")
|
w.Header().Set("Cache-Control", "max-age=60")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue