mirror of
https://github.com/prymitive/karma
synced 2026-05-05 03:16:51 +00:00
Fix listen address and port passing
Only HOST & PORT env variables used by gin internally were really used, pass resulting config to gin so we match documentation, and log it on startup
This commit is contained in:
@@ -25,7 +25,7 @@ labels:
|
||||
keep: []
|
||||
strip: []
|
||||
listen:
|
||||
address: "*"
|
||||
address: "0.0.0.0"
|
||||
port: 8080
|
||||
prefix: /
|
||||
log:
|
||||
|
||||
@@ -62,7 +62,7 @@ func init() {
|
||||
pflag.StringSlice("receivers.strip", []string{},
|
||||
"List of receivers to not display alerts for")
|
||||
|
||||
pflag.String("listen.address", "*", "IP/Hostname to listen on")
|
||||
pflag.String("listen.address", "", "IP/Hostname to listen on")
|
||||
pflag.Int("listen.port", 8080, "HTTP port to listen on")
|
||||
pflag.String("listen.prefix", "/", "URL prefix")
|
||||
|
||||
|
||||
5
main.go
5
main.go
@@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"path"
|
||||
"strings"
|
||||
@@ -150,7 +151,9 @@ func main() {
|
||||
}
|
||||
|
||||
setupRouter(router)
|
||||
err := router.Run()
|
||||
listen := fmt.Sprintf("%s:%d", config.Config.Listen.Address, config.Config.Listen.Port)
|
||||
log.Infof("Listening on %s", listen)
|
||||
err := router.Run(listen)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user