diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 628bf14..8fdfbe3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: - name: install uses: actions/setup-go@v1 with: - go-version: 1.14.x + go-version: 1.16.x - name: checkout uses: actions/checkout@v1 @@ -20,4 +20,3 @@ jobs: CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o cowtransfer-beta -ldflags "-w -s -X main.build=beta" . && tar czf bin/cowtransfer-beta-linux-arm64.tar.gz cowtransfer-beta CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o cowtransfer-beta -ldflags "-w -s -X main.build=beta" . && tar czf bin/cowtransfer-beta-darwin-amd64.tar.gz cowtransfer-beta CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o cowtransfer-beta -ldflags "-w -s -X main.build=beta" . && tar czf bin/cowtransfer-beta-linux-amd64.tar.gz cowtransfer-beta - chmod +x cowtransfer-beta && ./cowtransfer-beta cowtransfer-beta diff --git a/go.mod b/go.mod index db6c1e4..37fae7e 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,6 @@ require ( github.com/fatih/color v1.13.0 // indirect github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect - github.com/orcaman/concurrent-map v0.0.0-20210501183033-44dafcb38ecc - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect + github.com/orcaman/concurrent-map v1.0.0 + golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect ) diff --git a/go.sum b/go.sum index 2264c68..e38e9df 100644 --- a/go.sum +++ b/go.sum @@ -54,6 +54,8 @@ github.com/orcaman/concurrent-map v0.0.0-20210106121528-16402b402231 h1:fa50YL1p github.com/orcaman/concurrent-map v0.0.0-20210106121528-16402b402231/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/orcaman/concurrent-map v0.0.0-20210501183033-44dafcb38ecc h1:Ak86L+yDSOzKFa7WM5bf5itSOo1e3Xh8bm5YCMUXIjQ= github.com/orcaman/concurrent-map v0.0.0-20210501183033-44dafcb38ecc/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= +github.com/orcaman/concurrent-map v1.0.0 h1:I/2A2XPCb4IuQWcQhBhSwGfiuybl/J0ev9HDbW65HOY= +github.com/orcaman/concurrent-map v1.0.0/go.mod h1:Lu3tH6HLW3feq74c2GC+jIMS/K2CFcDWnWD9XkenwhI= github.com/rivo/uniseg v0.1.0 h1:+2KBaVoUmb9XzDsrx/Ct0W/EYOSFf/nWTauy++DprtY= github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= @@ -87,3 +89,5 @@ golang.org/x/sys v0.0.0-20211015200801-69063c4bb744 h1:KzbpndAYEM+4oHRp9JmB2ewj0 golang.org/x/sys v0.0.0-20211015200801-69063c4bb744/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158 h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= +golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/main.go b/main.go index ce97d9b..8cc4a37 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,7 @@ func init() { addFlag(&runConfig.passCode, []string{"password"}, "", "Set password") addFlag(&runConfig.version, []string{"version"}, false, "Print version and exit") addFlag(&runConfig.silentMode, []string{"silent"}, false, "Enable silent mode") - addFlag(&runConfig.validDays, []string{"valid"}, 1, "Valid Days (default 1)") + addFlag(&runConfig.validDays, []string{"valid"}, 0, "Valid Days") flag.Usage = printUsage flag.Parse() diff --git a/uploader.go b/uploader.go index 4318ab2..a4d56e0 100644 --- a/uploader.go +++ b/uploader.go @@ -15,11 +15,11 @@ import ( ) const ( - prepareSend = "https://cowtransfer.com/api/transfer/preparesend" + prepareSend = "https://cowtransfer.com/api/transfer/v2/preparesend" setPassword = "https://cowtransfer.com/api/transfer/v2/bindpasscode" - beforeUpload = "https://cowtransfer.com/api/transfer/beforeupload" - uploadFinish = "https://cowtransfer.com/api/transfer/uploaded" - uploadComplete = "https://cowtransfer.com/api/transfer/complete" + beforeUpload = "https://cowtransfer.com/api/transfer/v2/beforeupload" + uploadFinish = "https://cowtransfer.com/api/transfer/v2/uploaded" + uploadComplete = "https://cowtransfer.com/api/transfer/v2/complete" initUpload = "https://upload.qiniup.com/buckets/cftransfer/objects/%s/uploads" doUpload = "https://upload.qiniup.com/buckets/cftransfer/objects/%s/uploads/%s/%d" finUpload = "https://upload.qiniup.com/buckets/cftransfer/objects/%s/uploads/%s"