add subcommand that prints licenses, and link to licenses from the webadmin/webaccount/webmail interfaces

This commit is contained in:
Mechiel Lukkien
2024-10-04 09:31:31 +02:00
parent 7d3f307156
commit 8f7fc3773b
57 changed files with 1844 additions and 4 deletions

View File

@ -164,6 +164,15 @@ func handle(apiHandler http.Handler, isForwarded bool, w http.ResponseWriter, r
http.Error(w, "405 - method not allowed - use get", http.StatusMethodNotAllowed)
}
return
} else if r.URL.Path == "/licenses.txt" {
switch r.Method {
case "GET", "HEAD":
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
mox.LicensesWrite(w)
default:
http.Error(w, "405 - method not allowed - use get", http.StatusMethodNotAllowed)
}
return
}
isAPI := strings.HasPrefix(r.URL.Path, "/api/")

View File

@ -1782,7 +1782,7 @@ const crumbs = (...l) => {
];
};
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);
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 age = (date, future, nowSecs) => {
if (!nowSecs) {
nowSecs = new Date().getTime() / 1000;

View File

@ -197,6 +197,7 @@ const footer = dom.div(
moxversion, ' ',
moxgoversion, ' ',
moxgoos, '/', moxgoarch,
', ', dom.a(attr.href('licenses.txt'), 'licenses')
)
const age = (date: Date, future: boolean, nowSecs: number) => {