1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-09-16 17:30:11 +00:00

admin: add build tags to "About"

build tags like e2ee and external are now included in the about page.
This commit is contained in:
Harvey Tindall 2024-08-11 17:55:12 +01:00
parent d2c7bf06f7
commit ab3989f233
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2
10 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,4 @@
//go:build external
// +build external
package main
@ -12,6 +13,8 @@ import (
const binaryType = "external"
func BuildTagsExternal() { buildTags = append(buildTags, "external") }
var localFS dirFS
var langFS dirFS

View File

@ -51,6 +51,7 @@
<p>{{ .strings.commitNoun }} <span class="text-black dark:text-white font-mono bg-inherit">{{ .commit }}</span></p>
<p>{{ .strings.buildTime }} <span class="text-black dark:text-white font-mono bg-inherit">{{ .buildTime }}</span></p>
<p>{{ .strings.builtBy }} <span class="text-black dark:text-white font-mono bg-inherit">{{ .builtBy }}</span></p>
<p>{{ .strings.buildTags }} <span class="text-black dark:text-white font-mono bg-inherit">{{ .buildTags }}</span></p>
<div class="flex flex-row flex-wrap gap-2 my-2">
<a class="button ~neutral lang-link" href="https://github.com/hrfee/jfa-go"><i class="ri-github-line mr-2"></i>github</a>
<a class="button ~urge lang-link" href="https://wiki.jfa-go.com">wiki/docs</a>

View File

@ -1,3 +1,4 @@
//go:build !external
// +build !external
package main
@ -10,6 +11,8 @@ import (
const binaryType = "internal"
func BuildTagsExternal() {}
//go:embed data data/html data/web data/web/css data/web/js
var loFS embed.FS

View File

@ -146,6 +146,7 @@
"postSignupCardDescription": "Card shown to user after signing up. Overrides \"Success Message\". Overriden by \"Auto redirect on success\" setting.",
"buildTime": "Build Time",
"builtBy": "Built By",
"buildTags": "Build Tags",
"loginNotAdmin": "Not an Admin?",
"referrer": "Referrer",
"accountLinked": "{contactMethod} linked: {user}",

View File

@ -60,6 +60,7 @@ var (
commit string
buildTimeUnix string
builtBy string
buildTags []string
_LOADBAK *string
LOADBAK = ""
)
@ -740,6 +741,11 @@ func printVersion() {
const SYSTEMD_SERVICE = "jfa-go.service"
func main() {
// Generate list of "-tags" for about page.
BuildTagsE2EE()
BuildTagsTray()
BuildTagsExternal()
f, err := logOutput()
if err != nil {
fmt.Printf(lm.FailedLogging, err)

View File

@ -16,6 +16,10 @@ type Crypto struct {
helper *cryptohelper.CryptoHelper
}
func BuildTagsE2EE() {
buildTags = append(buildTags, "e2ee")
}
func MatrixE2EE() bool { return true }
func InitMatrixCrypto(d *MatrixDaemon) error {

View File

@ -7,6 +7,8 @@ import "maunium.net/go/mautrix/id"
type Crypto struct{}
func BuildTagsE2EE() {}
func MatrixE2EE() bool { return false }
func InitMatrixCrypto(d *MatrixDaemon) (err error) {

View File

@ -1,9 +1,12 @@
//go:build !tray
// +build !tray
package main
var TRAY = false
func BuildTagsTray() {}
func RunTray() {}
func QuitTray() {}

View File

@ -15,6 +15,10 @@ import (
var TRAY = true
func BuildTagsTray() {
buildTags = append(buildTags, "tray")
}
func RunTray() {
systray.Run(onReady, onExit)
}

View File

@ -174,6 +174,7 @@ func (app *appContext) AdminPage(gc *gin.Context) {
"commit": commit,
"buildTime": buildTime,
"builtBy": builtBy,
"buildTags": buildTags,
"username": !app.config.Section("email").Key("no_username").MustBool(false),
"strings": app.storage.lang.Admin[lang].Strings,
"quantityStrings": app.storage.lang.Admin[lang].QuantityStrings,