From fbda8fd19ec40d6b60631b81cdb227b9dd923cf4 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 31 Aug 2020 13:05:28 +0800 Subject: [PATCH] update packr to v2 --- Dockerfile | 7 +++---- component/session/server.go | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index f8272ff..b173d73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,9 +6,8 @@ COPY . /tun2socks-src RUN apk add --update --no-cache \ gcc git make musl-dev \ && go mod download \ - && go get -u github.com/gobuffalo/packr/packr \ - && packr \ - && make build \ + && go get -u github.com/gobuffalo/packr/v2/packr2 \ + && packr2 && packr2 clean && make \ && /tun2socks-src/bin/tun2socks -version FROM alpine:latest @@ -16,7 +15,7 @@ FROM alpine:latest COPY ./entrypoint.sh / COPY --from=builder /tun2socks-src/bin/tun2socks /tun2socks -RUN apk add --update --no-cache iptables iproute2 \ +RUN apk add --update --no-cache iptables iproute2 ca-certificates\ && chmod +x /entrypoint.sh ENV TUN tun0 diff --git a/component/session/server.go b/component/session/server.go index 5a52319..6d4a1b5 100644 --- a/component/session/server.go +++ b/component/session/server.go @@ -16,7 +16,7 @@ import ( C "github.com/xjasonlyu/tun2socks/constant" - "github.com/gobuffalo/packr" + "github.com/gobuffalo/packr/v2" ) const maxClosedSessions = 100 @@ -181,7 +181,7 @@ func (s *Server) Start() error { mux.HandleFunc("/", s.serveHTML) mux.HandleFunc("/json", s.serveJSON) - box := packr.NewBox("./css") + box := packr.New("CSSBox", "./css") mux.Handle("/css/", http.StripPrefix("/css/", http.FileServer(box))) s.Server = &http.Server{Addr: s.ServeAddr, Handler: mux}