Allow building without UI (#1614)

This commit is contained in:
Julio Lopez
2021-12-21 20:19:27 -08:00
committed by GitHub
parent c641559284
commit 5bf8e7c570
4 changed files with 32 additions and 0 deletions

View File

@@ -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:

View File

@@ -1,3 +1,6 @@
//go:build !nohtmlui
// +build !nohtmlui
package server
import (

View File

@@ -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)
}

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title>Kopia UI not supported.</title>
</head>
<body>
<p>Kopia UI not supported, use an <a href="https://github.com/kopia/kopia/releases">official build</a>.</p>
<p>When compiling from source use:</p>
<pre>make html-ui && go install -tags embedhtml</pre>
</body>
</html>