mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-10 19:20:15 +08:00
update packr to v2
This commit is contained in:
@@ -6,9 +6,8 @@ COPY . /tun2socks-src
|
|||||||
RUN apk add --update --no-cache \
|
RUN apk add --update --no-cache \
|
||||||
gcc git make musl-dev \
|
gcc git make musl-dev \
|
||||||
&& go mod download \
|
&& go mod download \
|
||||||
&& go get -u github.com/gobuffalo/packr/packr \
|
&& go get -u github.com/gobuffalo/packr/v2/packr2 \
|
||||||
&& packr \
|
&& packr2 && packr2 clean && make \
|
||||||
&& make build \
|
|
||||||
&& /tun2socks-src/bin/tun2socks -version
|
&& /tun2socks-src/bin/tun2socks -version
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
@@ -16,7 +15,7 @@ FROM alpine:latest
|
|||||||
COPY ./entrypoint.sh /
|
COPY ./entrypoint.sh /
|
||||||
COPY --from=builder /tun2socks-src/bin/tun2socks /tun2socks
|
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
|
&& chmod +x /entrypoint.sh
|
||||||
|
|
||||||
ENV TUN tun0
|
ENV TUN tun0
|
||||||
|
@@ -16,7 +16,7 @@ import (
|
|||||||
|
|
||||||
C "github.com/xjasonlyu/tun2socks/constant"
|
C "github.com/xjasonlyu/tun2socks/constant"
|
||||||
|
|
||||||
"github.com/gobuffalo/packr"
|
"github.com/gobuffalo/packr/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
const maxClosedSessions = 100
|
const maxClosedSessions = 100
|
||||||
@@ -181,7 +181,7 @@ func (s *Server) Start() error {
|
|||||||
mux.HandleFunc("/", s.serveHTML)
|
mux.HandleFunc("/", s.serveHTML)
|
||||||
mux.HandleFunc("/json", s.serveJSON)
|
mux.HandleFunc("/json", s.serveJSON)
|
||||||
|
|
||||||
box := packr.NewBox("./css")
|
box := packr.New("CSSBox", "./css")
|
||||||
mux.Handle("/css/", http.StripPrefix("/css/", http.FileServer(box)))
|
mux.Handle("/css/", http.StripPrefix("/css/", http.FileServer(box)))
|
||||||
|
|
||||||
s.Server = &http.Server{Addr: s.ServeAddr, Handler: mux}
|
s.Server = &http.Server{Addr: s.ServeAddr, Handler: mux}
|
||||||
|
Reference in New Issue
Block a user