forked from drtoful/certinel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
30 lines (24 loc) · 738 Bytes
/
main.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
package main
import (
_ "embed"
"flag"
"log"
"github.com/pontostroy/certinel/app"
)
//go:embed static/index.html
var indexHtml string
func main() {
var (
dbPath = flag.String("db", "certinel.db", "path to the database store")
httpPort = flag.String("port", "8080", "port for api server")
metricsType = flag.String("metrics.type", "prometheus", "type of metrics server to start")
metricsBind = flag.String("metrics.bind", "127.0.0.1:9090", "host:port on where to bind the metrics to")
)
flag.Parse()
if err := certinel.StoreInit(*dbPath); err != nil {
log.Fatal(err)
}
certinel.StartDomainChecker()
certinel.StartMetricsServer(*metricsType, *metricsBind)
certinel.StartAPIServer(*httpPort, indexHtml)
}