mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 00:13:47 +03:00
include goversion used to compile mox in the mox version
This commit is contained in:
parent
636bb91df6
commit
d7f057709f
10 changed files with 19 additions and 15 deletions
|
@ -164,7 +164,7 @@ during those commands instead of during "data".
|
||||||
|
|
||||||
loadLoglevel(log, fallbackLevel)
|
loadLoglevel(log, fallbackLevel)
|
||||||
|
|
||||||
golog.Printf("mox, version %s, %s %s/%s", moxvar.Version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
golog.Printf("mox, version %s %s/%s", moxvar.Version, runtime.GOOS, runtime.GOARCH)
|
||||||
golog.Print("")
|
golog.Print("")
|
||||||
golog.Printf("the default user is mox@localhost, with password moxmoxmox")
|
golog.Printf("the default user is mox@localhost, with password moxmoxmox")
|
||||||
golog.Printf("the default admin password is moxadmin")
|
golog.Printf("the default admin password is moxadmin")
|
||||||
|
|
2
main.go
2
main.go
|
@ -2845,7 +2845,7 @@ func cmdVersion(c *cmd) {
|
||||||
c.Usage()
|
c.Usage()
|
||||||
}
|
}
|
||||||
fmt.Println(moxvar.Version)
|
fmt.Println(moxvar.Version)
|
||||||
fmt.Printf("%s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
fmt.Printf("%s/%s\n", runtime.GOOS, runtime.GOARCH)
|
||||||
}
|
}
|
||||||
|
|
||||||
func cmdWebapi(c *cmd) {
|
func cmdWebapi(c *cmd) {
|
||||||
|
|
|
@ -19,7 +19,7 @@ func StoreLastKnown(v updates.Version) error {
|
||||||
// LastKnown returns the last known version that has been mentioned in an update
|
// LastKnown returns the last known version that has been mentioned in an update
|
||||||
// email, or the current application.
|
// email, or the current application.
|
||||||
func LastKnown() (current, lastknown updates.Version, mtime time.Time, rerr error) {
|
func LastKnown() (current, lastknown updates.Version, mtime time.Time, rerr error) {
|
||||||
curv, curerr := updates.ParseVersion(moxvar.Version)
|
curv, curerr := updates.ParseVersion(moxvar.VersionBare)
|
||||||
|
|
||||||
p := DataDirPath("lastknownversion")
|
p := DataDirPath("lastknownversion")
|
||||||
fi, _ := os.Stat(p)
|
fi, _ := os.Stat(p)
|
||||||
|
@ -44,7 +44,7 @@ func LastKnown() (current, lastknown updates.Version, mtime time.Time, rerr erro
|
||||||
} else if lasterr == nil {
|
} else if lasterr == nil {
|
||||||
return curv, lastknown, mtime, nil
|
return curv, lastknown, mtime, nil
|
||||||
}
|
}
|
||||||
if moxvar.Version == "(devel)" {
|
if strings.HasPrefix(moxvar.Version, "(devel)") {
|
||||||
return curv, updates.Version{}, mtime, fmt.Errorf("development version")
|
return curv, updates.Version{}, mtime, fmt.Errorf("development version")
|
||||||
}
|
}
|
||||||
return curv, updates.Version{}, mtime, fmt.Errorf("parsing version: %w", err)
|
return curv, updates.Version{}, mtime, fmt.Errorf("parsing version: %w", err)
|
||||||
|
|
|
@ -125,7 +125,7 @@ func (a *WebappFile) Serve(ctx context.Context, log mlog.Log, w http.ResponseWri
|
||||||
}
|
}
|
||||||
var b bytes.Buffer
|
var b bytes.Buffer
|
||||||
b.Write(html[:index])
|
b.Write(html[:index])
|
||||||
fmt.Fprintf(&b, "<script>\n// Javascript is generated from typescript, don't modify the javascript because changes will be lost.\nconst moxversion = \"%s\";\nconst moxgoversion = \"%s\";\nconst moxgoos = \"%s\";\nconst moxgoarch = \"%s\";\n", moxvar.Version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
|
fmt.Fprintf(&b, "<script>\n// Javascript is generated from typescript, don't modify the javascript because changes will be lost.\nconst moxversion = \"%s\";\nconst moxgoos = \"%s\";\nconst moxgoarch = \"%s\";\n", moxvar.Version, runtime.GOOS, runtime.GOARCH)
|
||||||
b.Write(js)
|
b.Write(js)
|
||||||
b.WriteString("\t\t</script>")
|
b.WriteString("\t\t</script>")
|
||||||
b.Write(html[index+len(script):])
|
b.Write(html[index+len(script):])
|
||||||
|
|
|
@ -2,16 +2,24 @@
|
||||||
package moxvar
|
package moxvar
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"runtime"
|
||||||
"runtime/debug"
|
"runtime/debug"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Version is set at runtime based on the Go module used to build.
|
// Version is set at runtime based on the Go module used to build.
|
||||||
var Version = "(devel)"
|
var Version string
|
||||||
|
|
||||||
// VersionBare does not add a "+modifications" or other suffix to the version.
|
// VersionBare does not add a "+modifications", goversion or other suffix to the version.
|
||||||
var VersionBare = "(devel)"
|
var VersionBare string
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
Version = "(devel)"
|
||||||
|
VersionBare = "(devel)"
|
||||||
|
|
||||||
|
defer func() {
|
||||||
|
Version += "-" + runtime.Version()
|
||||||
|
}()
|
||||||
|
|
||||||
buildInfo, ok := debug.ReadBuildInfo()
|
buildInfo, ok := debug.ReadBuildInfo()
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
// From HTML.
|
// From HTML.
|
||||||
declare let page: HTMLElement
|
declare let page: HTMLElement
|
||||||
declare let moxversion: string
|
declare let moxversion: string
|
||||||
declare let moxgoversion: string
|
|
||||||
declare let moxgoos: string
|
declare let moxgoos: string
|
||||||
declare let moxgoarch: string
|
declare let moxgoarch: string
|
||||||
|
|
||||||
|
|
|
@ -1782,7 +1782,7 @@ const crumbs = (...l) => {
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
const errmsg = (err) => '' + (err.message || '(no error message)');
|
const errmsg = (err) => '' + (err.message || '(no error message)');
|
||||||
const footer = dom.div(style({ marginTop: '6ex', opacity: 0.75 }), link('https://www.xmox.nl', 'mox'), ' ', moxversion, ' ', moxgoversion, ' ', moxgoos, '/', moxgoarch, ', ', dom.a(attr.href('licenses.txt'), 'licenses'));
|
const footer = dom.div(style({ marginTop: '6ex', opacity: 0.75 }), link('https://www.xmox.nl', 'mox'), ' ', moxversion, ' ', moxgoos, '/', moxgoarch, ', ', dom.a(attr.href('licenses.txt'), 'licenses'));
|
||||||
const age = (date, future, nowSecs) => {
|
const age = (date, future, nowSecs) => {
|
||||||
if (!nowSecs) {
|
if (!nowSecs) {
|
||||||
nowSecs = new Date().getTime() / 1000;
|
nowSecs = new Date().getTime() / 1000;
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
// From HTML.
|
// From HTML.
|
||||||
declare let page: HTMLElement
|
declare let page: HTMLElement
|
||||||
declare let moxversion: string
|
declare let moxversion: string
|
||||||
declare let moxgoversion: string
|
|
||||||
declare let moxgoos: string
|
declare let moxgoos: string
|
||||||
declare let moxgoarch: string
|
declare let moxgoarch: string
|
||||||
|
|
||||||
|
@ -195,7 +194,6 @@ const footer = dom.div(
|
||||||
link('https://www.xmox.nl', 'mox'),
|
link('https://www.xmox.nl', 'mox'),
|
||||||
' ',
|
' ',
|
||||||
moxversion, ' ',
|
moxversion, ' ',
|
||||||
moxgoversion, ' ',
|
|
||||||
moxgoos, '/', moxgoarch,
|
moxgoos, '/', moxgoarch,
|
||||||
', ', dom.a(attr.href('licenses.txt'), 'licenses')
|
', ', dom.a(attr.href('licenses.txt'), 'licenses')
|
||||||
)
|
)
|
||||||
|
|
|
@ -2513,7 +2513,7 @@ const cmdHelp = async () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.alert('"mailto:" protocol handler unregistered.');
|
window.alert('"mailto:" protocol handler unregistered.');
|
||||||
})), dom.div(style({ marginTop: '2ex' }), 'Mox is open source email server software, this is version ', moxversion, ', built with ', moxgoversion, ', see ', dom.a(attr.href('licenses.txt'), 'licenses'), '.', dom.br(), 'Feedback, including bug reports, is appreciated! ', link('https://github.com/mjl-/mox/issues/new')))));
|
})), dom.div(style({ marginTop: '2ex' }), 'Mox is open source email server software, this is version ', moxversion, ', see ', dom.a(attr.href('licenses.txt'), 'licenses'), '.', dom.br(), 'Feedback, including bug reports, is appreciated! ', link('https://github.com/mjl-/mox/issues/new')))));
|
||||||
};
|
};
|
||||||
// Show tooltips for either the focused element, or otherwise for all elements
|
// Show tooltips for either the focused element, or otherwise for all elements
|
||||||
// that aren't reachable with tabindex and aren't marked specially to prevent
|
// that aren't reachable with tabindex and aren't marked specially to prevent
|
||||||
|
|
|
@ -131,7 +131,6 @@ ensureCSS('.autosize::after', {content: 'attr(data-value)', marginRight: '1em',
|
||||||
// From HTML.
|
// From HTML.
|
||||||
declare let page: HTMLElement
|
declare let page: HTMLElement
|
||||||
declare let moxversion: string
|
declare let moxversion: string
|
||||||
declare let moxgoversion: string
|
|
||||||
declare let moxgoos: string
|
declare let moxgoos: string
|
||||||
declare let moxgoarch: string
|
declare let moxgoarch: string
|
||||||
|
|
||||||
|
@ -1335,7 +1334,7 @@ const cmdHelp = async () => {
|
||||||
window.alert('"mailto:" protocol handler unregistered.')
|
window.alert('"mailto:" protocol handler unregistered.')
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
dom.div(style({marginTop: '2ex'}), 'Mox is open source email server software, this is version ', moxversion, ', built with ', moxgoversion, ', see ', dom.a(attr.href('licenses.txt'), 'licenses'), '.', dom.br(), 'Feedback, including bug reports, is appreciated! ', link('https://github.com/mjl-/mox/issues/new')),
|
dom.div(style({marginTop: '2ex'}), 'Mox is open source email server software, this is version ', moxversion, ', see ', dom.a(attr.href('licenses.txt'), 'licenses'), '.', dom.br(), 'Feedback, including bug reports, is appreciated! ', link('https://github.com/mjl-/mox/issues/new')),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue