소스 검색

fix merge conflicts

flashmob 8 년 전
부모
커밋
e3b84694ce
6개의 변경된 파일15개의 추가작업 그리고 10개의 파일을 삭제
  1. 3 2
      client.go
  2. 2 2
      config.go
  3. 1 1
      dashboard/dashboard.go
  4. 0 2
      event.go
  5. 8 2
      guerrilla.go
  6. 1 1
      server.go

+ 3 - 2
client.go

@@ -5,12 +5,13 @@ import (
 	"bytes"
 	"crypto/tls"
 	"fmt"
-	"github.com/flashmob/go-guerrilla/log"
-	"github.com/flashmob/go-guerrilla/mail"
 	"net"
 	"net/textproto"
 	"sync"
 	"time"
+
+	"github.com/flashmob/go-guerrilla/log"
+	"github.com/flashmob/go-guerrilla/mail"
 )
 
 // ClientState indicates which part of the SMTP transaction a given client is in.

+ 2 - 2
config.go

@@ -5,13 +5,13 @@ import (
 	"encoding/json"
 	"errors"
 	"fmt"
-	"github.com/flashmob/go-guerrilla/backends"
-	"github.com/flashmob/go-guerrilla/log"
 	"os"
 	"reflect"
 	"strings"
 
+	"github.com/flashmob/go-guerrilla/backends"
 	"github.com/flashmob/go-guerrilla/dashboard"
+	"github.com/flashmob/go-guerrilla/log"
 )
 
 // AppConfig is the holder of the configuration of the app

+ 1 - 1
dashboard/dashboard.go

@@ -7,7 +7,7 @@ import (
 	"time"
 
 	log "github.com/Sirupsen/logrus"
-	_ "github.com/flashmob/go-guerrilla/dashboard/statik"
+	// "github.com/flashmob/go-guerrilla/dashboard/statik"
 	"github.com/gorilla/mux"
 	"github.com/gorilla/websocket"
 	"github.com/rakyll/statik/fs"

+ 0 - 2
event.go

@@ -41,8 +41,6 @@ const (
 	EventConfigServerMaxClients
 	// when a server's TLS config changed
 	EventConfigServerTLSConfig
-	//
-	EventConfigPostLoad
 )
 
 var eventList = [...]string{

+ 8 - 2
guerrilla.go

@@ -3,11 +3,13 @@ package guerrilla
 import (
 	"errors"
 	"fmt"
-	"github.com/flashmob/go-guerrilla/backends"
-	"github.com/flashmob/go-guerrilla/log"
 	"os"
 	"sync"
 	"sync/atomic"
+
+	"github.com/flashmob/go-guerrilla/backends"
+	"github.com/flashmob/go-guerrilla/dashboard"
+	"github.com/flashmob/go-guerrilla/log"
 )
 
 const (
@@ -443,6 +445,10 @@ func (g *guerrilla) Start() error {
 	// wait for all servers to start (or fail)
 	startWG.Wait()
 
+	if g.Config.Dashboard.Enabled {
+		go dashboard.Run(&g.Config.Dashboard)
+	}
+
 	// close, then read any errors
 	close(errs)
 	for err := range errs {

+ 1 - 1
server.go

@@ -287,7 +287,7 @@ func (server *server) handleClient(client *client) {
 	server.log().WithFields(map[string]interface{}{
 		"event": "connect",
 		"id":    client.ID,
-	}).Info("Handle client")
+	}).Infof("Handle client [%s]", client.RemoteIP)
 
 	// Initial greeting
 	greeting := fmt.Sprintf("220 %s SMTP Guerrilla(%s) #%d (%d) %s",