[add] better log page, [add] admin users page, [add] admin nav
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
@@ -43,6 +45,28 @@ func (u UTCFormatter) Format(e *log.Entry) ([]byte, error) {
|
||||
return u.Formatter.Format(e)
|
||||
}
|
||||
|
||||
// TODO
|
||||
var commitDetails = func() string {
|
||||
commitDetails := "unknown"
|
||||
|
||||
if info, ok := debug.ReadBuildInfo(); ok {
|
||||
for _, setting := range info.Settings {
|
||||
if setting.Key == "vcs.revision" {
|
||||
commitDetails = setting.Value[0:7]
|
||||
} else if setting.Key == "vcs.modified" {
|
||||
if setting.Value == "true" {
|
||||
commitDetails += "-dirty"
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println(setting.Key)
|
||||
fmt.Println(setting.Value)
|
||||
}
|
||||
}
|
||||
|
||||
return commitDetails
|
||||
}()
|
||||
|
||||
func Load() *Config {
|
||||
c := &Config{
|
||||
Version: "0.0.1",
|
||||
|
||||
Reference in New Issue
Block a user