From 2237286656bf000636e767fdf87ce16660947a6c Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sat, 10 Aug 2024 21:11:11 +0100 Subject: [PATCH] build: enable E2EE by default, partially in CI Makefile enables E2EE by default. Due to the CGO and hence cross compilers required, only linux amd64/arm64/armhf and windows amd64 is being built with the feature included. Uses a new jfa-go-build-docker with arm-linux-gnueabihf-gcc. --- .goreleaser.yml | 25 ++++++++++++++++++++----- Makefile | 2 +- html/admin.html | 2 +- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 0b5bec8..56e1dc1 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -12,15 +12,29 @@ before: - make precompile INTERNAL=on builds: - id: notray + dir: ./ + 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}}" + goos: + - darwin + - windows + goarch: + - arm + - arm64 + - amd64 + - id: notray-e2ee dir: ./ env: - - CGO_ENABLED=0 + - CGO_ENABLED=1 + - CC={{ if eq .Arch "amd64" }}x86_64{{ else }}{{ .Arch }}{{ end }}-linux-gnu{{ if eq .Arch "arm" }}eabihf{{ end }}-gcc + - CXX={{ if eq .Arch "amd64" }}x86_64{{ else }}{{ .Arch }}{{ end }}-linux-gnu{{ if eq .Arch "arm" }}eabihf{{ end }}-gcc + - GOARM={{ if eq .Arch "arm" }}7{{ end }} + flags: + - -tags=e2ee 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}}" goos: - linux - - darwin - - windows goarch: - arm - arm64 @@ -32,7 +46,7 @@ builds: - CC=x86_64-w64-mingw32-gcc - CXX=x86_64-w64-mingw32-g++ flags: - - -tags=tray + - -tags=tray,e2ee 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 goos: @@ -47,7 +61,7 @@ builds: - CXX=x86_64-linux-gnu-gcc - PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:$PKG_CONFIG_PATH flags: - - -tags=tray + - -tags=tray,e2ee 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}}" goos: @@ -78,6 +92,7 @@ archives: - id: notray builds: - notray + - notray-e2ee format: zip name_template: >- {{ .ProjectName }}_{{ .Version }}_ diff --git a/Makefile b/Makefile index d6c0d2d..5eda95d 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,7 @@ endif INTERNAL ?= on TRAY ?= off -E2EE ?= off +E2EE ?= on TAGS := -tags " ifeq ($(INTERNAL), on) diff --git a/html/admin.html b/html/admin.html index 9ecf214..497706d 100644 --- a/html/admin.html +++ b/html/admin.html @@ -918,7 +918,7 @@
{{ .strings.aboutProgram }} - {{ .strings.wiki }} + {{ .strings.wiki }} {{ .strings.userProfiles }}