diff --git a/Makefile b/Makefile index 840727f2..2fdadd7f 100644 --- a/Makefile +++ b/Makefile @@ -28,10 +28,10 @@ install: @go install -tags netgo ${LDFLAGS} @echo Installed to ${GOPATH}/bin/wrstat -installnonpm: export CGO_ENABLED = 1 -installnonpm: +installnoserver: export CGO_ENABLED = 1 +installnoserver: @rm -f ${GOPATH}/bin/wrstat - @go install -tags netgo ${LDFLAGS} + @go install -tags netgo,noserver ${LDFLAGS} @echo installed to ${GOPATH}/bin/wrstat test: export CGO_ENABLED = 1 diff --git a/cmd/server.go b/cmd/server.go index bcc13153..3a2ec369 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -1,3 +1,6 @@ +//go:build !noserver +// +build !noserver + /******************************************************************************* * Copyright (c) 2022, 2023 Genome Research Ltd. * @@ -42,18 +45,19 @@ import ( ) const sentinelPollFrequencty = 1 * time.Minute -const serverTokenBasename = ".wrstat.servertoken" // options for this cmd. -var serverLogPath string -var serverBind string -var serverCert string -var serverKey string -var oktaURL string -var oktaOAuthIssuer string -var oktaOAuthClientID string -var oktaOAuthClientSecret string -var areasPath string +var ( + serverLogPath string + serverBind string + serverCert string + serverKey string + oktaURL string + oktaOAuthIssuer string + oktaOAuthClientID string + oktaOAuthClientSecret string + areasPath string +) // serverCmd represents the server command. var serverCmd = &cobra.Command{ diff --git a/cmd/where.go b/cmd/where.go index c83c074e..d85f0e3e 100644 --- a/cmd/where.go +++ b/cmd/where.go @@ -48,12 +48,13 @@ type Error string func (e Error) Error() string { return string(e) } const ( - defaultWhereSplits = 2 - defaultSize = "50M" - hoursPerDay = 24 - jwtBasename = ".wrstat.jwt" - errBadGroupArea = Error("unknown group area") - privatePerms os.FileMode = 0600 + defaultWhereSplits = 2 + defaultSize = "50M" + hoursPerDay = 24 + jwtBasename = ".wrstat.jwt" + errBadGroupArea = Error("unknown group area") + privatePerms os.FileMode = 0600 + serverTokenBasename = ".wrstat.servertoken" ) // options for this cmd.