mirror of https://github.com/statping/statping
				
				
				
			CLI fixes for PORT and IP/HOST
							parent
							
								
									622d697c6b
								
							
						
					
					
						commit
						de051d4bcd
					
				| 
						 | 
				
			
			@ -24,12 +24,4 @@ func parseFlags(cmd *cobra.Command) {
 | 
			
		|||
 | 
			
		||||
	cmd.PersistentFlags().StringVarP(&configFile, "config", "c", utils.Directory+"/config.yml", "path to config.yml file")
 | 
			
		||||
	utils.Params.BindPFlag("config", cmd.PersistentFlags().Lookup("config"))
 | 
			
		||||
 | 
			
		||||
	if utils.Params.GetString("SERVER_IP") != ipAddress {
 | 
			
		||||
		utils.Params.Set("SERVER_IP", ipAddress)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if utils.Params.GetInt("SERVER_PORT") != port {
 | 
			
		||||
		utils.Params.Set("SERVER_PORT", port)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -25,8 +25,6 @@ func InitEnvs() {
 | 
			
		|||
		defaultDir = "."
 | 
			
		||||
	}
 | 
			
		||||
	Params.Set("VERSION", version)
 | 
			
		||||
	Params.SetDefault("SERVER_IP", "0.0.0.0")
 | 
			
		||||
	Params.SetDefault("SERVER_PORT", 8080)
 | 
			
		||||
	Params.SetDefault("DISABLE_HTTP", false)
 | 
			
		||||
	Params.SetDefault("STATPING_DIR", defaultDir)
 | 
			
		||||
	Params.SetDefault("GO_ENV", "production")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue