include LICENSE in build, display in about tab

Also fixes last commit, user cache wasn't refreshed in ApplySettings, is
now.
This commit is contained in:
Harvey Tindall
2021-03-01 00:32:09 +00:00
parent fa7da1b23f
commit bd05a4b35a
4 changed files with 11 additions and 0 deletions
+8
View File
@@ -1,6 +1,7 @@
package main
import (
"io/fs"
"net/http"
"strconv"
"strings"
@@ -68,6 +69,12 @@ func (app *appContext) AdminPage(gc *gin.Context) {
emailEnabled, _ := app.config.Section("invite_emails").Key("enabled").Bool()
notificationsEnabled, _ := app.config.Section("notifications").Key("enabled").Bool()
ombiEnabled := app.config.Section("ombi").Key("enabled").MustBool(false)
var license string
l, err := fs.ReadFile(localFS, "LICENSE")
if err != nil {
license = ""
}
license = string(l)
gcHTML(gc, http.StatusOK, "admin.html", gin.H{
"urlBase": app.getURLBase(gc),
"cssClass": app.cssClass,
@@ -82,6 +89,7 @@ func (app *appContext) AdminPage(gc *gin.Context) {
"quantityStrings": app.storage.lang.Admin[lang].QuantityStrings,
"language": app.storage.lang.Admin[lang].JSON,
"langName": lang,
"license": license,
})
}