mirror of https://github.com/statping/statping
Merge pull request #662 from statping/cli-fixes
CLI fixes for PORT and IP/HOSTpull/679/head v0.90.50
commit
bb118f1a2c
|
@ -1,3 +1,7 @@
|
|||
# 0.90.50 (06-13-2020)
|
||||
- Removed PORT, replaced with SERVER_PORT
|
||||
- Removed HOST/IP, replaced with SERVER_IP
|
||||
|
||||
# 0.90.49 (06-12-2020)
|
||||
- Added additional prometheus /metrics for better debugging
|
||||
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"github.com/statping/statping/types/checkins"
|
||||
"github.com/statping/statping/types/failures"
|
||||
"github.com/statping/statping/types/groups"
|
||||
"github.com/statping/statping/types/hits"
|
||||
"github.com/statping/statping/types/incidents"
|
||||
"github.com/statping/statping/types/messages"
|
||||
"github.com/statping/statping/types/notifications"
|
||||
"github.com/statping/statping/types/services"
|
||||
"github.com/statping/statping/types/users"
|
||||
)
|
||||
|
||||
var (
|
||||
// DbSession stores the Statping database session
|
||||
DbModels []interface{}
|
||||
)
|
||||
|
||||
func init() {
|
||||
DbModels = []interface{}{&services.Service{}, &users.User{}, &hits.Hit{}, &failures.Failure{}, &messages.Message{}, &groups.Group{}, &checkins.Checkin{}, &checkins.CheckinHit{}, ¬ifications.Notification{}, &incidents.Incident{}, &incidents.IncidentUpdate{}}
|
||||
}
|
|
@ -20,7 +20,7 @@ func parseFlags(cmd *cobra.Command) {
|
|||
utils.Params.BindPFlag("port", cmd.PersistentFlags().Lookup("port"))
|
||||
|
||||
cmd.PersistentFlags().IntVarP(&verboseMode, "verbose", "v", 2, "verbose logging")
|
||||
utils.Params.BindPFlag("VERBOSE", cmd.PersistentFlags().Lookup("verbose"))
|
||||
utils.Params.BindPFlag("verbose", cmd.PersistentFlags().Lookup("verbose"))
|
||||
|
||||
cmd.PersistentFlags().StringVarP(&configFile, "config", "c", utils.Directory+"/config.yml", "path to config.yml file")
|
||||
utils.Params.BindPFlag("config", cmd.PersistentFlags().Lookup("config"))
|
||||
|
|
|
@ -80,6 +80,9 @@ func start() {
|
|||
|
||||
log.Info(fmt.Sprintf("Starting Statping v%s", VERSION))
|
||||
|
||||
utils.Params.Set("SERVER_IP", ipAddress)
|
||||
utils.Params.Set("SERVER_PORT", port)
|
||||
|
||||
confgs, err = configs.LoadConfigs(configFile)
|
||||
if err != nil {
|
||||
log.Infoln("Starting in Setup Mode")
|
||||
|
|
|
@ -143,6 +143,7 @@ func removeJwtToken(w http.ResponseWriter) {
|
|||
Name: cookieKey,
|
||||
Value: "",
|
||||
Expires: time.Now(),
|
||||
MaxAge: -1,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -40,8 +40,8 @@ func RunHTTPServer() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
ip := utils.Params.GetString("HOST")
|
||||
host := fmt.Sprintf("%v:%v", ip, utils.Params.GetInt("PORT"))
|
||||
ip := utils.Params.GetString("SERVER_IP")
|
||||
host := fmt.Sprintf("%v:%v", ip, utils.Params.GetInt("SERVER_PORT"))
|
||||
key := utils.FileExists(utils.Directory + "/server.key")
|
||||
cert := utils.FileExists(utils.Directory + "/server.crt")
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@ func InitEnvs() {
|
|||
defaultDir = "."
|
||||
}
|
||||
Params.Set("VERSION", version)
|
||||
Params.SetDefault("PORT", 8080)
|
||||
Params.SetDefault("HOST", "0.0.0.0")
|
||||
Params.SetDefault("DISABLE_HTTP", false)
|
||||
Params.SetDefault("STATPING_DIR", defaultDir)
|
||||
Params.SetDefault("GO_ENV", "production")
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.90.49
|
||||
0.90.50
|
||||
|
|
Loading…
Reference in New Issue