mirror of
https://github.com/kopia/kopia.git
synced 2026-03-30 12:03:39 -04:00
Allow building without UI (#1614)
This commit is contained in:
1
Makefile
1
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:
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//go:build !nohtmlui
|
||||
// +build !nohtmlui
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
|
||||
17
internal/server/htmlui_fallback.go
Normal file
17
internal/server/htmlui_fallback.go
Normal 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)
|
||||
}
|
||||
11
internal/server/index.html
Normal file
11
internal/server/index.html
Normal 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>
|
||||
Reference in New Issue
Block a user