remove serlfsigned cert
This commit is contained in:
parent
1e2b0dcdb3
commit
423effa1b4
16
sync/main.go
16
sync/main.go
|
@ -26,8 +26,6 @@ func main() {
|
||||||
fmt.Println("PLANNER_API_KEY is empty")
|
fmt.Println("PLANNER_API_KEY is empty")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
crtPath := os.Getenv("PLANNER_CRT_PATH")
|
|
||||||
keyPath := os.Getenv("PLANNER_KEY_PATH")
|
|
||||||
|
|
||||||
repo, err := NewSqlite(dbPath)
|
repo, err := NewSqlite(dbPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -37,20 +35,14 @@ func main() {
|
||||||
|
|
||||||
logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
|
logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
|
||||||
logger.Info("configuration", "configuration", map[string]string{
|
logger.Info("configuration", "configuration", map[string]string{
|
||||||
"dbPath": dbPath,
|
"dbPath": dbPath,
|
||||||
"port": fmt.Sprintf("%d", port),
|
"port": fmt.Sprintf("%d", port),
|
||||||
"apiKey": "***",
|
"apiKey": "***",
|
||||||
"crtPath": crtPath,
|
|
||||||
"keyPath": keyPath,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
address := fmt.Sprintf(":%d", port)
|
address := fmt.Sprintf(":%d", port)
|
||||||
srv := NewServer(repo, apiKey, logger)
|
srv := NewServer(repo, apiKey, logger)
|
||||||
if crtPath != "" || keyPath != "" {
|
go http.ListenAndServe(address, srv)
|
||||||
go http.ListenAndServeTLS(address, crtPath, keyPath, srv)
|
|
||||||
} else {
|
|
||||||
go http.ListenAndServe(address, srv)
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.Info("service started")
|
logger.Info("service started")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue