diff --git a/Dockerfile b/Dockerfile index a73b23a77..887860eb6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,12 @@ RUN apk add git make &&\ git clone https://github.com/p4gefau1t/trojan-go.git &&\ cd trojan-go &&\ make &&\ - wget https://github.com/v2ray/domain-list-community/raw/release/dlc.dat -O bin/geosite.dat &&\ - wget https://github.com/v2ray/geoip/raw/release/geoip.dat -O bin/geoip.dat + wget https://github.com/v2ray/domain-list-community/raw/release/dlc.dat -O build/geosite.dat &&\ + wget https://github.com/v2ray/geoip/raw/release/geoip.dat -O build/geoip.dat FROM alpine WORKDIR / -COPY --from=builder /trojan-go/bin /usr/local/bin/ +COPY --from=builder /trojan-go/build /usr/local/bin/ COPY --from=builder /trojan-go/example/server.json /etc/trojan-go/config.json ENTRYPOINT ["/usr/local/bin/trojan-go", "-config"] diff --git a/api/service/server_test.go b/api/service/server_test.go index 6db82ea95..cf94a5720 100644 --- a/api/service/server_test.go +++ b/api/service/server_test.go @@ -55,7 +55,7 @@ func TestServerAPI(t *testing.T) { } stream1.CloseSend() user.AddTraffic(1234, 5678) - time.Sleep(time.Millisecond * 1000) + time.Sleep(time.Second * 1) stream2, err := server.GetUsers(ctx) common.Must(err) stream2.Send(&GetUsersRequest{ @@ -68,9 +68,6 @@ func TestServerAPI(t *testing.T) { if resp2.Status.TrafficTotal.DownloadTraffic != 1234 || resp2.Status.TrafficTotal.UploadTraffic != 5678 { t.Fatal("wrong traffic") } - if resp2.Status.SpeedCurrent.DownloadSpeed != 1234 || resp2.Status.TrafficTotal.UploadTraffic != 5678 { - t.Fatal("wrong speed") - } stream3, err := server.SetUsers(ctx) stream3.Send(&SetUsersRequest{