forked from sensu/uchiwa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
uchiwa.go
47 lines (37 loc) · 1.38 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
42
43
44
45
46
47
package main
import (
"flag"
"github.com/contegix/uchiwa/uchiwa"
"github.com/contegix/uchiwa/uchiwa/audit"
"github.com/contegix/uchiwa/uchiwa/auth"
"github.com/contegix/uchiwa/uchiwa/config"
"github.com/contegix/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)
authentication := auth.New(config.Uchiwa.Auth)
if config.Uchiwa.Auth.Driver == "simple" {
authentication.Simple(config.Uchiwa.Users)
} else {
authentication.None()
}
// Audit
audit.Log = audit.LogMock
// filters
uchiwa.FilterAggregates = filters.FilterAggregates
uchiwa.FilterChecks = filters.FilterChecks
uchiwa.FilterClients = filters.FilterClients
uchiwa.FilterDatacenters = filters.FilterDatacenters
uchiwa.FilterEvents = filters.FilterEvents
uchiwa.FilterStashes = filters.FilterStashes
uchiwa.FilterSubscriptions = filters.FilterSubscriptions
uchiwa.FilterGetRequest = filters.GetRequest
uchiwa.FilterPostRequest = filters.PostRequest
uchiwa.FilterSensuData = filters.SensuData
u.WebServer(publicPath, authentication)
}