Browse Source

fixes design-bestseller apache log tail

Tobias von Dewitz 5 years ago
parent
commit
8f6d7bd4e4
3 changed files with 5 additions and 4 deletions
  1. 1 1
      Makefile
  2. 3 2
      apache.go
  3. 1 1
      build-deb.sh

+ 1 - 1
Makefile

@@ -5,7 +5,7 @@ all:
 	docker run --rm -v $(PWD):/root/go/src/git.scraperwall.com/scw/munchclient -w /root/go/src/git.scraperwall.com/scw/munchclient registry.scw.systems/centos7-build:latest make compile
 
 all-debian:
-	docker run --rm -v $(PWD):/go/src/git.scraperwall.com/scw/munchclient -w /go/src/git.scraperwall.com/scw/munchclient scraperwall/debian-build:latest make compile
+	docker run --rm -v $(PWD):/go/src/git.scraperwall.com/scw/munchclient -w /go/src/git.scraperwall.com/scw/munchclient registry.scw.systems/debian-build:latest make compile
 
 compile:
 	env GOOS=linux GOARCH=amd64 go build -tags netgo -ldflags "-s -X main.Version=$(VERSION) -X main.BuildDate=$(BUILD)"

+ 3 - 2
apache.go

@@ -172,11 +172,12 @@ func apacheLogCapture(logfile string) {
 		var virtualHost string
 		vhost := logEntry.VirtualHost
 		if vhost != "" {
-			vhostAndPort := strings.Split(logEntry.VirtualHost, ":")
+			vhostAndPort := strings.Split(vhost, ":")
 			virtualHost = vhostAndPort[0]
 
 			if config.UseVhostAsSource {
-				virtualHost = virtualHost[0:strings.Index(virtualHost, ",")]
+				vhosts := strings.Split(vhost, ",")
+				virtualHost = strings.TrimSpace(vhosts[0])
 				vhIP := net.ParseIP(virtualHost)
 				if vhIP != nil {
 					remote = virtualHost

+ 1 - 1
build-deb.sh

@@ -16,7 +16,7 @@ install -m 644 munchclient.toml $DESTDIR/usr/share/$NAME/$NAME.toml
 # install -m 644 munchclient.service $DESTDIR/etc/systemd/system/$NAME.service
 # install -m 644 ca-chain.cert.pem $DESTDIR/usr/share/$NAME/
 
-docker run -i -t --rm -v $PWD:/go/src/git.scraperwall.com/scw/munchclient -w /go/src/git.scraperwall.com/scw/munchclient registry.scw.systems/debian-build:latest \
+docker run -i -t --rm -v $PWD:/go/src/git.scraperwall.com/scw/munchclient -w /go/src/git.scraperwall.com/scw/munchclient $DOCKER_IMAGE \
 fpm -s dir -t deb -C $DESTDIR --name $NAME \
   --version $VERSION \
   --iteration $ITERATION \