From 0bbfa32ef649905b36bbe85e6e24e06ca8b88831 Mon Sep 17 00:00:00 2001 From: Anthony Mineo Date: Tue, 16 Mar 2021 20:10:59 -0400 Subject: [PATCH] swap out wget for lftp --- app/t2-stat-parser/ftp.go | 7 ++++++- build/go-t2-stat-parser/Dockerfile | 2 +- docker-compose.yml | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/t2-stat-parser/ftp.go b/app/t2-stat-parser/ftp.go index 374b689..7d0fcf4 100644 --- a/app/t2-stat-parser/ftp.go +++ b/app/t2-stat-parser/ftp.go @@ -31,7 +31,12 @@ func initFTP() { fmt.Println("Downloading stat files from", ftpHOST + ftpPath) - cmd := "wget --recursive --no-passive-ftp -nH --cut-dirs=4 --ftp-user=" + ftpUSER + " --no-parent --ftp-password="+ ftpPW +" -P /app/serverStats/stats/ ftp://" + ftpHOST + ftpPath + // wget is a bit buggy with FTP in v1.20.x + // cmd := "wget --recursive --no-passive-ftp -nH --cut-dirs=4 --ftp-user=" + ftpUSER + " --no-parent --ftp-password="+ ftpPW +" -P /app/serverStats/stats/ ftp://" + ftpHOST + ftpPath + + cmd := "lftp -c 'open "+ftpHOST+"; user "+ftpUSER+" "+ftpPW+"; mirror -e "+ftpPath+" /app/serverStats/stats/; quit'" + + err, out, errout := Shellout(cmd) diff --git a/build/go-t2-stat-parser/Dockerfile b/build/go-t2-stat-parser/Dockerfile index 2a982d2..6e83244 100644 --- a/build/go-t2-stat-parser/Dockerfile +++ b/build/go-t2-stat-parser/Dockerfile @@ -24,7 +24,7 @@ RUN go build -o main . FROM golang:1.14-alpine LABEL maintainer="Anthony Mineo " -RUN apk update && apk add --no-cache wget tzdata +RUN apk update && apk add --no-cache wget tzdata lftp #Set TimeZone ENV TZ=America/New_York diff --git a/docker-compose.yml b/docker-compose.yml index 9e789c6..92a5630 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,7 +24,7 @@ services: constraints: [node.role == manager] parser: - image: "amineo/t2-stats-parser:v0.4.1" + image: "amineo/t2-stats-parser:v0.5.0" build: context: . dockerfile: ./build/go-t2-stat-parser/Dockerfile