mirror of
https://github.com/kopia/kopia.git
synced 2026-10-20 05:14:00 -04:00
Allow building without UI (#1614)
This commit is contained in:
1 parent
c641559284
commit
5bf8e7c570
4 files changed
+32
No files matched your search
@@ -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:
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !nohtmlui
|
||||
// +build !nohtmlui
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
@@ -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>
|
||||
Reference in new issue
Block a user