diff --git a/Makefile b/Makefile index 93e5407f3..560c0faa0 100644 --- a/Makefile +++ b/Makefile @@ -101,10 +101,15 @@ ifndef SKIP_CHECK_CLEAN endif # Create release build tarballs for all supported platforms. Linux compilation happens under Docker. -release: check-clean +release: check-clean generate-statik $(MAKE) release-build GOOS=darwin GOARCH=amd64 $(MAKE) release-build GOOS=linux GOARCH=amd64 +# Create release build tarballs for all supported platforms. Same as `release`, but without embedded Lattice UI. +release-sans-ui: check-clean + rm -f statik/statik.go + $(MAKE) release-build GOOS=darwin GOARCH=amd64 + $(MAKE) release-build GOOS=linux GOARCH=amd64 # try (e.g.) internal/clustertests/docker-compose-replication2.yml DOCKER_COMPOSE=internal/clustertests/docker-compose.yml diff --git a/ctl/server.go b/ctl/server.go index a64b63749..968b2bd6d 100644 --- a/ctl/server.go +++ b/ctl/server.go @@ -39,7 +39,7 @@ func BuildServerFlags(cmd *cobra.Command, srv *server.Command) { SetTLSConfig(flags, "", &srv.Config.TLS.CertificatePath, &srv.Config.TLS.CertificateKeyPath, &srv.Config.TLS.CACertPath, &srv.Config.TLS.SkipVerify, &srv.Config.TLS.EnableClientVerification) // Handler - flags.StringSliceVarP(&srv.Config.Handler.AllowedOrigins, "handler.allowed-origins", "", []string{}, "Comma separated list of allowed origin URIs (for CORS/Lattice UI).") + flags.StringSliceVarP(&srv.Config.Handler.AllowedOrigins, "handler.allowed-origins", "", []string{}, "Comma separated list of allowed origin URIs (for CORS/Web UI).") // Cluster flags.BoolVarP(&srv.Config.Cluster.Disabled, "cluster.disabled", "", srv.Config.Cluster.Disabled, "Disabled multi-node cluster communication (used for testing)") diff --git a/http/handler.go b/http/handler.go index c8953984c..60624e5e8 100644 --- a/http/handler.go +++ b/http/handler.go @@ -468,7 +468,7 @@ type statikHandler struct { func NewStatikHandler(h *Handler) statikHandler { fs, err := h.fileSystem.New() if err == nil { - h.logger.Printf("enabled Lattice UI (%s) at %s", h.api.LatticeVersion(), h.api.Node().URI) + h.logger.Printf("enabled Web UI (%s) at %s", h.api.LatticeVersion(), h.api.Node().URI) } return statikHandler{ @@ -479,7 +479,18 @@ func NewStatikHandler(h *Handler) statikHandler { func (s statikHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { if strings.HasPrefix(r.UserAgent(), "curl") { - http.Error(w, "Welcome. Pilosa is running. Visit https://www.pilosa.com/docs/ for more information or try the Lattice UI by visiting this URL in your browser.", http.StatusNotFound) + msg := "Welcome. Pilosa v" + s.handler.api.Version() + " is running. Visit https://www.pilosa.com/docs/ for more information." + if s.statikFS != nil { + msg += " Try the Web UI by visiting this URL in your browser." + } + http.Error(w, msg, http.StatusNotFound) + return + } + + if s.statikFS == nil { + msg := "Web UI is not available. Please run `make generate-statik` before building Pilosa with `make install`." + s.handler.logger.Printf(msg) + http.Error(w, msg, http.StatusInternalServerError) return } @@ -490,12 +501,6 @@ func (s statikHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { r.URL = url } - if s.statikFS == nil { - msg := "Lattice UI is not available. Please run `make generate-statik` before building Pilosa with `make install`." - s.handler.logger.Printf(msg) - http.Error(w, msg, http.StatusInternalServerError) - return - } http.FileServer(s.statikFS).ServeHTTP(w, r) }