This commit is contained in:
		
							
								
								
									
										25
									
								
								server.go
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								server.go
									
									
									
									
									
								
							| @ -22,7 +22,7 @@ import ( | |||||||
| 	"sync" | 	"sync" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| var VERSION = "1.4.1" | var VERSION = "1.4.4" | ||||||
|  |  | ||||||
| func packageName(name string) string { | func packageName(name string) string { | ||||||
| 	if index := strings.Index(name, "_"); index != -1 { | 	if index := strings.Index(name, "_"); index != -1 { | ||||||
| @ -60,6 +60,11 @@ func main() { | |||||||
| 		os.Exit(0) | 		os.Exit(0) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | 	log.WithFields(log.Fields{ | ||||||
|  | 		"version": VERSION, | ||||||
|  | 		"runtimeVersion": runtime.Version(), | ||||||
|  | 	}).Info("Starting deb-simple") | ||||||
|  |  | ||||||
| 	file, err := ioutil.ReadFile(*configFile) | 	file, err := ioutil.ReadFile(*configFile) | ||||||
|  |  | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| @ -148,11 +153,21 @@ func main() { | |||||||
| 	bind := fmt.Sprintf(":%d", conf.Http.Port) | 	bind := fmt.Sprintf(":%d", conf.Http.Port) | ||||||
|  |  | ||||||
| 	if conf.Http.SSL { | 	if conf.Http.SSL { | ||||||
| 		log.Info("running with SSL enabled") | 		log.WithFields(log.Fields{ | ||||||
| 		log.Fatalln(http.ListenAndServeTLS(bind, conf.Http.SSLCert, conf.Http.SSLKey, mux)) | 			"bind": bind, | ||||||
|  | 			"certFile": conf.Http.SSLCert, | ||||||
|  | 			"keyFile": conf.Http.SSLKey, | ||||||
|  | 		}).Info("Starting with SSL enabled") | ||||||
|  |  | ||||||
|  | 		err = http.ListenAndServeTLS(bind, conf.Http.SSLCert, conf.Http.SSLKey, mux) | ||||||
| 	} else { | 	} else { | ||||||
| 		log.Info("running without SSL enabled") | 		log.WithField("bind", bind).Info("Starting without SSL enabled") | ||||||
| 		log.Fatalln(http.ListenAndServe(bind, mux)) |  | ||||||
|  | 		err = http.ListenAndServe(bind, mux) | ||||||
|  | 	} | ||||||
|  |  | ||||||
|  | 	if err != nil { | ||||||
|  | 		log.WithError(err).Fatalln("Unable to start or keep running due to error") | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user