Print githash and build time at startup

This commit is contained in:
WithoutPants
2019-08-21 14:07:25 +10:00
parent 32a4f34c7c
commit 4983437a34
3 changed files with 34 additions and 9 deletions

View File

@@ -5,6 +5,15 @@ import (
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"runtime/debug"
"strconv"
"strings"
"github.com/99designs/gqlgen/handler"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
@@ -16,16 +25,11 @@ import (
"github.com/stashapp/stash/pkg/manager/paths"
"github.com/stashapp/stash/pkg/models"
"github.com/stashapp/stash/pkg/utils"
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"runtime/debug"
"strconv"
"strings"
)
var buildstamp string = ""
var githash string = ""
var uiBox *packr.Box
//var legacyUiBox *packr.Box
@@ -154,6 +158,7 @@ func Start() {
}
go func() {
printVersion()
logger.Infof("stash is running on HTTPS at https://" + address + "/")
logger.Fatal(httpsServer.ListenAndServeTLS("", ""))
}()
@@ -164,12 +169,17 @@ func Start() {
}
go func() {
printVersion()
logger.Infof("stash is running on HTTP at http://" + address + "/")
logger.Fatal(server.ListenAndServe())
}()
}
}
func printVersion() {
fmt.Printf("stash version: %s (%s)\n", githash, buildstamp)
}
func makeTLSConfig() *tls.Config {
cert, err := ioutil.ReadFile(paths.GetSSLCert())
if err != nil {