forked from sensu/uchiwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uchiwa.go
41 lines (31 loc) · 1.03 KB
/
uchiwa.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package main
import (
"flag"
"github.com/sensu/uchiwa/uchiwa"
"github.com/sensu/uchiwa/uchiwa/audit"
"github.com/sensu/uchiwa/uchiwa/authentication"
"github.com/sensu/uchiwa/uchiwa/authorization"
"github.com/sensu/uchiwa/uchiwa/config"
"github.com/sensu/uchiwa/uchiwa/filters"
)
func main() {
configFile := flag.String("c", "./config.json", "Full or relative path to the configuration file")
configDir := flag.String("d", "", "Full or relative path to the configuration directory, or comma delimited directories")
publicPath := flag.String("p", "public", "Full or relative path to the public directory")
flag.Parse()
config := config.Load(*configFile, *configDir)
u := uchiwa.Init(config)
auth := authentication.New(config.Uchiwa.Auth)
if config.Uchiwa.Auth.Driver == "simple" {
auth.Simple(config.Uchiwa.Users)
} else {
auth.None()
}
// Audit
audit.Log = audit.LogMock
// Authorization
uchiwa.Authorization = &authorization.Uchiwa{}
// Filters
uchiwa.Filters = &filters.Uchiwa{}
u.WebServer(publicPath, auth)
}