Skip to content

Commit

Permalink
fix: ul/dl error on cow(#56, #57), change default valid-days to 0(unl…
Browse files Browse the repository at this point in the history
…imited)
  • Loading branch information
Mikubill committed Feb 10, 2022
1 parent c06b27f commit 2a8dbdd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2a8dbdd

Please sign in to comment.