diff --git a/Makefile b/Makefile index 8f0ff43a1..ccf59196e 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,7 @@ endif install: go install $(KOPIA_BUILD_FLAGS) -tags "$(KOPIA_BUILD_TAGS)" +install-noui: KOPIA_BUILD_TAGS=nohtmlui install-noui: install install-race: diff --git a/internal/server/htmlui_embed.go b/internal/server/htmlui_embed.go index ff032f33e..fbd6eb11d 100644 --- a/internal/server/htmlui_embed.go +++ b/internal/server/htmlui_embed.go @@ -1,3 +1,6 @@ +//go:build !nohtmlui +// +build !nohtmlui + package server import ( diff --git a/internal/server/htmlui_fallback.go b/internal/server/htmlui_fallback.go new file mode 100644 index 000000000..102ade083 --- /dev/null +++ b/internal/server/htmlui_fallback.go @@ -0,0 +1,17 @@ +//go:build nohtmlui +// +build nohtmlui + +package server + +import ( + "embed" + "net/http" +) + +//go:embed index.html +var data embed.FS + +// AssetFile return a http.FileSystem instance that data backend by asset. +func AssetFile() http.FileSystem { + return http.FS(data) +} diff --git a/internal/server/index.html b/internal/server/index.html new file mode 100644 index 000000000..7a89e56ff --- /dev/null +++ b/internal/server/index.html @@ -0,0 +1,11 @@ + + + + Kopia UI not supported. + + +

Kopia UI not supported, use an official build.

+

When compiling from source use:

+
make html-ui && go install -tags embedhtml
+ +