diff --git a/external.go b/external.go index f769125..b493317 100644 --- a/external.go +++ b/external.go @@ -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 diff --git a/html/admin.html b/html/admin.html index 497706d..7eaea80 100644 --- a/html/admin.html +++ b/html/admin.html @@ -51,6 +51,7 @@

{{ .strings.commitNoun }} {{ .commit }}

{{ .strings.buildTime }} {{ .buildTime }}

{{ .strings.builtBy }} {{ .builtBy }}

+

{{ .strings.buildTags }} {{ .buildTags }}

github wiki/docs diff --git a/internal.go b/internal.go index a2fc105..050e346 100644 --- a/internal.go +++ b/internal.go @@ -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 diff --git a/lang/admin/en-us.json b/lang/admin/en-us.json index 8514dbc..eed6603 100644 --- a/lang/admin/en-us.json +++ b/lang/admin/en-us.json @@ -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}", diff --git a/main.go b/main.go index bb17766..98e6698 100644 --- a/main.go +++ b/main.go @@ -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) diff --git a/matrix_crypto.go b/matrix_crypto.go index 19f7b92..30416ea 100644 --- a/matrix_crypto.go +++ b/matrix_crypto.go @@ -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 { diff --git a/matrix_nocrypto.go b/matrix_nocrypto.go index e46d621..8a2f84e 100644 --- a/matrix_nocrypto.go +++ b/matrix_nocrypto.go @@ -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) { diff --git a/notray.go b/notray.go index b51efca..369dafd 100644 --- a/notray.go +++ b/notray.go @@ -1,9 +1,12 @@ +//go:build !tray // +build !tray package main var TRAY = false +func BuildTagsTray() {} + func RunTray() {} func QuitTray() {} diff --git a/tray.go b/tray.go index 135a06b..7d1bc4f 100644 --- a/tray.go +++ b/tray.go @@ -15,6 +15,10 @@ import ( var TRAY = true +func BuildTagsTray() { + buildTags = append(buildTags, "tray") +} + func RunTray() { systray.Run(onReady, onExit) } diff --git a/views.go b/views.go index 4e36901..76169ed 100644 --- a/views.go +++ b/views.go @@ -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,