41 lines
790 B
Go
41 lines
790 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
"reichard.io/imagini/cmd"
|
|
"reichard.io/imagini/internal/sessions"
|
|
)
|
|
|
|
var globalSessions *sessions.Manager
|
|
|
|
type UTCFormatter struct {
|
|
log.Formatter
|
|
}
|
|
|
|
func (u UTCFormatter) Format(e *log.Entry) ([]byte, error) {
|
|
e.Time = e.Time.UTC()
|
|
return u.Formatter.Format(e)
|
|
}
|
|
|
|
func main() {
|
|
log.SetFormatter(UTCFormatter{&log.TextFormatter{FullTimestamp: true}})
|
|
|
|
log.Info("Starging Imagini")
|
|
app := &cli.App{
|
|
Name: "Imagini",
|
|
Usage: "A self hosted photo library.",
|
|
Commands: []*cli.Command{
|
|
&cmd.CmdServe,
|
|
&cmd.CmdDBTest,
|
|
},
|
|
}
|
|
err := app.Run(os.Args)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|