mirror of
https://github.com/hrfee/jfa-go.git
synced 2025-04-03 17:52:52 +00:00
Compare commits
8 Commits
2d7f44eeec
...
0e7245e6b9
Author | SHA1 | Date | |
---|---|---|---|
0e7245e6b9 | |||
59e9d457c2 | |||
48be756e48 | |||
ab3989f233 | |||
d2c7bf06f7 | |||
3f59312dfc | |||
d62add0195 | |||
fd32b73132 |
@ -16,8 +16,9 @@ builds:
|
||||
flags:
|
||||
- -tags={{ .Env.JFA_GO_TAG }}
|
||||
ldflags:
|
||||
- -X main.version={{.Env.JFA_GO_VERSION}} -X main.commit={{.ShortCommit}} -X main.updater=binary {{.Env.JFA_GO_STRIP}} -X main.cssVersion={{.Env.JFA_GO_CSS_VERSION}} -X main.buildTimeUnix={{.Env.JFA_GO_BUILD_TIME}} -X main.builtBy="{{.Env.JFA_GO_BUILT_BY}}"
|
||||
- -X main.version={{.Env.JFA_GO_VERSION}} -X main.commit={{.ShortCommit}} -X main.updater={{.Env.JFA_GO_UPDATER}} {{.Env.JFA_GO_STRIP}} -X main.cssVersion={{.Env.JFA_GO_CSS_VERSION}} -X main.buildTimeUnix={{.Env.JFA_GO_BUILD_TIME}} -X main.builtBy="{{.Env.JFA_GO_BUILT_BY}}"
|
||||
goos:
|
||||
- linux
|
||||
- darwin
|
||||
- windows
|
||||
goarch:
|
||||
@ -35,7 +36,7 @@ builds:
|
||||
flags:
|
||||
- -tags=e2ee,{{ .Env.JFA_GO_TAG }}
|
||||
ldflags:
|
||||
- -X main.version={{.Env.JFA_GO_VERSION}} -X main.commit={{.ShortCommit}} -X main.updater=binary {{.Env.JFA_GO_STRIP}} -X main.cssVersion={{.Env.JFA_GO_CSS_VERSION}} -X main.buildTimeUnix={{.Env.JFA_GO_BUILD_TIME}} -X main.builtBy="{{.Env.JFA_GO_BUILT_BY}}"
|
||||
- -X main.version={{.Env.JFA_GO_VERSION}} -X main.commit={{.ShortCommit}} -X main.updater={{.Env.JFA_GO_UPDATER}} {{.Env.JFA_GO_STRIP}} -X main.cssVersion={{.Env.JFA_GO_CSS_VERSION}} -X main.buildTimeUnix={{.Env.JFA_GO_BUILD_TIME}} -X main.builtBy="{{.Env.JFA_GO_BUILT_BY}}"
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
@ -51,7 +52,7 @@ builds:
|
||||
flags:
|
||||
- -tags=tray,{{ .Env.JFA_GO_TAG }}
|
||||
ldflags:
|
||||
- -X main.version={{.Env.JFA_GO_VERSION}} -X main.commit={{.ShortCommit}} -X main.updater=binary {{.Env.JFA_GO_STRIP}} -X main.cssVersion={{.Env.JFA_GO_CSS_VERSION}} -X main.buildTimeUnix={{.Env.JFA_GO_BUILD_TIME}} -X main.builtBy="{{.Env.JFA_GO_BUILT_BY}}" -H=windowsgui
|
||||
- -X main.version={{.Env.JFA_GO_VERSION}} -X main.commit={{.ShortCommit}} -X main.updater={{.Env.JFA_GO_UPDATER}} {{.Env.JFA_GO_STRIP}} -X main.cssVersion={{.Env.JFA_GO_CSS_VERSION}} -X main.buildTimeUnix={{.Env.JFA_GO_BUILD_TIME}} -X main.builtBy="{{.Env.JFA_GO_BUILT_BY}}" -H=windowsgui
|
||||
goos:
|
||||
- windows
|
||||
goarch:
|
||||
@ -66,7 +67,7 @@ builds:
|
||||
flags:
|
||||
- -tags=tray,e2ee,{{ .Env.JFA_GO_TAG }}
|
||||
ldflags:
|
||||
- -X main.version={{.Env.JFA_GO_VERSION}} -X main.commit={{.ShortCommit}} -X main.updater=binary {{.Env.JFA_GO_STRIP}} -X main.cssVersion={{.Env.JFA_GO_CSS_VERSION}} -X main.buildTimeUnix={{.Env.JFA_GO_BUILD_TIME}} -X main.builtBy="{{.Env.JFA_GO_BUILT_BY}}"
|
||||
- -X main.version={{.Env.JFA_GO_VERSION}} -X main.commit={{.ShortCommit}} -X main.updater={{.Env.JFA_GO_UPDATER}} {{.Env.JFA_GO_STRIP}} -X main.cssVersion={{.Env.JFA_GO_CSS_VERSION}} -X main.buildTimeUnix={{.Env.JFA_GO_BUILD_TIME}} -X main.builtBy="{{.Env.JFA_GO_BUILT_BY}}"
|
||||
goos:
|
||||
- linux
|
||||
goarch:
|
||||
@ -95,7 +96,6 @@ archives:
|
||||
- id: notray
|
||||
builds:
|
||||
- notray
|
||||
- notray-e2ee
|
||||
format: zip
|
||||
name_template: >-
|
||||
{{ .ProjectName }}_{{ .Version }}_
|
||||
@ -103,6 +103,16 @@ archives:
|
||||
{{- else }}{{- title .Os }}{{ end }}_
|
||||
{{- if eq .Arch "amd64" }}x86_64
|
||||
{{- else }}{{ .Arch }}{{ end }}
|
||||
- id: notray-e2ee
|
||||
builds:
|
||||
- notray-e2ee
|
||||
format: zip
|
||||
name_template: >-
|
||||
{{ .ProjectName }}_{{ .Version }}_MatrixE2EE_
|
||||
{{- if eq .Os "darwin" }}macOS
|
||||
{{- else }}{{- title .Os }}{{ end }}_
|
||||
{{- if eq .Arch "amd64" }}x86_64
|
||||
{{- else }}{{ .Arch }}{{ end }}
|
||||
checksum:
|
||||
name_template: 'checksums.txt'
|
||||
snapshot:
|
||||
@ -124,7 +134,7 @@ nfpms:
|
||||
vendor: hrfee.dev
|
||||
version_metadata: git
|
||||
builds:
|
||||
- notray
|
||||
- notray-e2ee
|
||||
contents:
|
||||
- src: ./LICENSE
|
||||
dst: /usr/share/licenses/jfa-go
|
||||
@ -132,6 +142,16 @@ nfpms:
|
||||
- apk
|
||||
- deb
|
||||
- rpm
|
||||
overrides:
|
||||
deb:
|
||||
dependencies:
|
||||
- libolm-dev
|
||||
rpm:
|
||||
dependencies:
|
||||
- libolm
|
||||
apk:
|
||||
dependencies:
|
||||
- olm
|
||||
- id: tray
|
||||
file_name_template: '{{ .ProjectName }}{{ if .IsSnapshot }}-git{{ end }}_TrayIcon_{{ .Arch }}_{{ if .IsSnapshot }}{{ .ShortCommit }}{{ else }}v{{ .Version }}{{ end }}'
|
||||
package_name: jfa-go-tray
|
||||
@ -158,9 +178,12 @@ nfpms:
|
||||
- jfa-go
|
||||
dependencies:
|
||||
- libayatana-appindicator
|
||||
- libolm-dev
|
||||
rpm:
|
||||
dependencies:
|
||||
- libappindicator-gtk3
|
||||
- libolm
|
||||
apk:
|
||||
dependencies:
|
||||
- libayatana-appindicator
|
||||
- olm
|
||||
|
@ -1,21 +1,22 @@
|
||||
# Use this instead if hrfee/jfa-go-build-docker doesn't support your architecture
|
||||
# FROM --platform=$BUILDPLATFORM golang:latest AS support
|
||||
FROM --platform=$BUILDPLATFORM docker.io/hrfee/jfa-go-build-docker:latest AS support
|
||||
# FROM --platform=$BUILDPLATFORM jfa-go-bd AS support
|
||||
ARG BUILT_BY
|
||||
ENV JFA_GO_BUILT_BY=$BUILT_BY
|
||||
|
||||
COPY . /opt/build
|
||||
|
||||
# RUN curl -sfL https://goreleaser.com/static/run > /goreleaser && chmod +x /goreleaser
|
||||
RUN cd /opt/build; INTERNAL=off ./scripts/version.sh /goreleaser build --auto-snapshot --skip=validate --clean --id notray-e2ee
|
||||
RUN cd /opt/build; INTERNAL=off UPDATER=docker ./scripts/version.sh /goreleaser build --snapshot --skip=validate --clean --id notray-e2ee
|
||||
RUN mv /opt/build/dist/*_linux_arm_6 /opt/build/dist/placeholder_linux_arm
|
||||
RUN sed -i 's#id="password_resets-watch_directory" placeholder="/config/jellyfin"#id="password_resets-watch_directory" value="/jf" disabled#g' /opt/build/build/data/html/setup.html
|
||||
|
||||
FROM golang:bookworm AS final
|
||||
ARG TARGETARCH
|
||||
|
||||
RUN echo hello from arch ${TARGETARCH}
|
||||
COPY --from=support /opt/build/dist/*_linux_${TARGETARCH}* /opt/jfa-go
|
||||
COPY --from=support /opt/build/build/data /opt/jfa-go/
|
||||
COPY --from=support /opt/build/build/data /opt/jfa-go/data
|
||||
|
||||
RUN apt-get update -y && apt-get install libolm-dev -y
|
||||
|
||||
|
@ -59,6 +59,8 @@ jfa-go is a user management app for [Jellyfin](https://github.com/jellyfin/jelly
|
||||
|
||||
**Note**: `TrayIcon` builds include a tray icon to start/stop/restart, and an option to automatically start when you log-in to your computer. For Linux users, these builds depend on the `libappindicator3-1`/`libappindicator-gtk3`/`libappindicator` package for Debian/Ubuntu, Fedora, and Alpine respectively.
|
||||
|
||||
`MatrixE2EE` builds (and Linux `TrayIcon` builds) include support for end-to-end encryption for the Matrix bot, but require the `libolm(-dev)` dependency. `.deb/.rpm/.apk` packages list this dependency, and docker images include it.
|
||||
|
||||
##### [Docker](https://hub.docker.com/r/hrfee/jfa-go)
|
||||
```sh
|
||||
docker create \
|
||||
@ -88,7 +90,7 @@ sudo apt-get update
|
||||
# For servers
|
||||
sudo apt-get install jfa-go
|
||||
# ------
|
||||
# For desktops/servers with GUI (has dependencies)
|
||||
# For desktops/servers with GUI (may pull in lots of dependencies)
|
||||
sudo apt-get install jfa-go-tray
|
||||
# ------
|
||||
```
|
||||
|
@ -1311,6 +1311,14 @@
|
||||
"type": "bool",
|
||||
"value": true,
|
||||
"description": "Enable end-to-end encryption for messages."
|
||||
},
|
||||
"e2ee_note": {
|
||||
"name": "End-to-end encryption:",
|
||||
"type": "note",
|
||||
"value": "",
|
||||
"depends_true": "enabled",
|
||||
"required": "false",
|
||||
"description": "If the setting is not visible to you, your jfa-go version does not include the feature. See the wiki for more information."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -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() {}
|
||||
|
@ -24,6 +24,13 @@ else
|
||||
export JFA_GO_TAG="external"
|
||||
fi
|
||||
|
||||
if [[ -z "${UPDATER}" ]]; then
|
||||
export UPDATER=on
|
||||
export JFA_GO_UPDATER=binary
|
||||
else
|
||||
export JFA_GO_UPDATER=$UPDATER
|
||||
fi
|
||||
|
||||
JFA_GO_VERSION=$(git describe --exact-match HEAD 2> /dev/null || echo 'vgit')
|
||||
TIMEOUT=60m
|
||||
|
||||
|
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)
|
||||
}
|
||||
|
14
updater.go
14
updater.go
@ -363,11 +363,17 @@ func getBuildName() string {
|
||||
if arch == "" {
|
||||
return ""
|
||||
}
|
||||
tray := ""
|
||||
if TRAY {
|
||||
tray = "TrayIcon_"
|
||||
// Tray builds always have E2EE but aren't labelled as so,
|
||||
// hence the specific ordering here.
|
||||
subtype := ""
|
||||
if MatrixE2EE() {
|
||||
subtype = "MatrixE2EE_"
|
||||
}
|
||||
return tray + operatingSystem + "_" + arch
|
||||
if TRAY {
|
||||
subtype = "TrayIcon_"
|
||||
}
|
||||
|
||||
return subtype + operatingSystem + "_" + arch
|
||||
}
|
||||
|
||||
func (ud *Updater) downloadInternal(assets *[]GHAsset, tag Tag) (applyUpdate ApplyUpdate, status int, err error) {
|
||||
|
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