mirror of
https://github.com/hrfee/jfa-go.git
synced 2024-12-21 16:40: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:
parent
d2c7bf06f7
commit
ab3989f233
@ -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
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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
|
||||
|
||||
|
@ -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}",
|
||||
|
6
main.go
6
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)
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
@ -1,9 +1,12 @@
|
||||
//go:build !tray
|
||||
// +build !tray
|
||||
|
||||
package main
|
||||
|
||||
var TRAY = false
|
||||
|
||||
func BuildTagsTray() {}
|
||||
|
||||
func RunTray() {}
|
||||
|
||||
func QuitTray() {}
|
||||
|
4
tray.go
4
tray.go
@ -15,6 +15,10 @@ import (
|
||||
|
||||
var TRAY = true
|
||||
|
||||
func BuildTagsTray() {
|
||||
buildTags = append(buildTags, "tray")
|
||||
}
|
||||
|
||||
func RunTray() {
|
||||
systray.Run(onReady, onExit)
|
||||
}
|
||||
|
1
views.go
1
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,
|
||||
|
Loading…
Reference in New Issue
Block a user