From 6d9105abfb937f8ae01f4b8c0da0a7b27e61fc91 Mon Sep 17 00:00:00 2001 From: Zack Date: Thu, 4 Jul 2019 18:20:25 -0700 Subject: [PATCH 01/20] Docker (#134) * docker file works * add docker info --- Dockerfile | 15 +++++++++++++++ README.md | 6 ++++++ 2 files changed, 21 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..9cfa3bc4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:1.12-alpine as builder +RUN apk add --no-cache git +WORKDIR /go/croc +COPY . . +RUN go build -v + +FROM alpine:latest +EXPOSE 9009 +EXPOSE 9010 +EXPOSE 9011 +EXPOSE 9012 +EXPOSE 9013 +COPY --from=builder /go/croc/croc /croc +ENTRYPOINT ["/croc"] +CMD ["relay"] diff --git a/README.md b/README.md index 02c87acf..43320429 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,12 @@ You can send files using your relay by entering `--relay` to change the relay th $ croc --relay "myrelay.example.com:9009" send [filename] ``` +If it's easier you can also run a relay with Docker: + + +``` +$ docker run -d -p 9009:9009 -p 9010:9010 -p 9011:9011 -p 9012:9012 -p 9013:9013 schollz/croc +``` ## License From 57564314b0da7d174a5d70c52683a89829906864 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sat, 6 Jul 2019 10:17:37 -0600 Subject: [PATCH 02/20] bump 6.0.11 --- README.md | 2 +- src/cli/cli.go | 4 ++-- src/install/default.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 43320429..df1c1d8e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ src="https://user-images.githubusercontent.com/6550035/46709024-9b23ad00-cbf6-11e8-9fb2-ca8b20b7dbec.jpg" width="408px" border="0" alt="croc">
-Version +Version Build
 Status diff --git a/src/cli/cli.go b/src/cli/cli.go index 9932fc06..05d93dd2 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -27,7 +27,7 @@ func Run() (err error) { app := cli.NewApp() app.Name = "croc" if Version == "" { - Version = "v6.0.10-1d744f1" + Version = "v6.0.11-6d9105a" } app.Version = Version app.Compiled = time.Now() @@ -66,7 +66,7 @@ func Run() (err error) { cli.BoolFlag{Name: "debug", Usage: "increase verbosity (a lot)"}, cli.BoolFlag{Name: "yes", Usage: "automatically agree to all prompts"}, cli.BoolFlag{Name: "stdout", Usage: "redirect file to stdout"}, - cli.StringFlag{Name: "relay", Value: "198.199.67.130:9009", Usage: "address of the relay"}, + cli.StringFlag{Name: "relay", Value: "142.93.177.120:9009", Usage: "address of the relay"}, cli.StringFlag{Name: "out", Value: ".", Usage: "specify an output folder to receive the file"}, } app.EnableBashCompletion = true diff --git a/src/install/default.txt b/src/install/default.txt index 8376570d..871fa92f 100644 --- a/src/install/default.txt +++ b/src/install/default.txt @@ -33,7 +33,7 @@ install_croc() croc_os="unsupported" croc_arch="unknown" croc_arm="" - croc_version="6.0.10" + croc_version="6.0.11" # Termux on Android has $PREFIX set which already ends with /usr From 6091e9348e1250141ea871a83e50605a8aae6659 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Mon, 8 Jul 2019 14:21:29 -0600 Subject: [PATCH 03/20] update deps --- go.mod | 8 ++++---- go.sum | 18 ++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index f7af347e..6d7dc8b6 100644 --- a/go.mod +++ b/go.mod @@ -12,15 +12,15 @@ require ( github.com/pkg/errors v0.8.1 github.com/schollz/logger v1.0.1 github.com/schollz/mnemonicode v1.0.1 - github.com/schollz/pake v1.1.0 + github.com/schollz/pake v1.1.1 github.com/schollz/peerdiscovery v1.4.0 github.com/schollz/progressbar/v2 v2.13.2 github.com/schollz/spinner v0.0.0-20180925172146-6bbc5f7804f9 github.com/spaolacci/murmur3 v1.1.0 // indirect github.com/stretchr/testify v1.3.0 github.com/urfave/cli v1.20.0 - golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56 - golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 // indirect - golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f // indirect + golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 + golang.org/x/net v0.0.0-20190628185345-da137c7871d7 // indirect + golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect golang.org/x/text v0.3.2 // indirect ) diff --git a/go.sum b/go.sum index 9712ccc2..5936a422 100644 --- a/go.sum +++ b/go.sum @@ -28,8 +28,8 @@ github.com/schollz/logger v1.0.1 h1:BuBAU+euqphM0Ny9qFVScl4RSxatis4nCHIkOxO2cUU= github.com/schollz/logger v1.0.1/go.mod h1:P6F4/dGMGcx8wh+kG1zrNEd4vnNpEBY/mwEMd/vn6AM= github.com/schollz/mnemonicode v1.0.1 h1:LiH5hwADZwjwnfXsaD4xgnMyTAtaKHN+e5AyjRU6WSU= github.com/schollz/mnemonicode v1.0.1/go.mod h1:cl4UAOhUV0mkdjMj/QYaUZbZZdF8BnOqoz8rHMzwboY= -github.com/schollz/pake v1.1.0 h1:+tYqsPVkuirFpmeRePjYTUhIHHKLufdmd7QfuspaXCk= -github.com/schollz/pake v1.1.0/go.mod h1:pL7Z08gnQ4OQ3G27s5e5T6TEzp6cFc5GzCwLm0f75Io= +github.com/schollz/pake v1.1.1 h1:QKeojDWzdAdtRC4m89b6HAxw/8gjqrVu7r4SAOxOFg8= +github.com/schollz/pake v1.1.1/go.mod h1:aWMxQ1jwqZRwk3StflHcdyzPR+CyW5W7+WIZD6Y3dEY= github.com/schollz/peerdiscovery v1.4.0 h1:wJWiJUBSMY2io9eIG1+gauXm8WD6sJVN5M+pLd4fYZQ= github.com/schollz/peerdiscovery v1.4.0/go.mod h1:DXj/7VvxAkUuSZNabx3q8t524uWbrhMPxeX151kvvHs= github.com/schollz/progressbar/v2 v2.9.1/go.mod h1:l6tn6yU6ZdQoF8lwX/VoAUQ3FjhCbrcZDnl9xeWZzYw= @@ -43,28 +43,26 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/tscholl2/siec v0.0.0-20180721101609-21667da05937 h1:lhssCpSe3TjKcbvUoPzFMuv9oUyZDgI3Cmgolfw2C90= github.com/tscholl2/siec v0.0.0-20180721101609-21667da05937/go.mod h1:KL9+ubr1JZdaKjgAaHr+tCytEncXBa1pR6FjbTsOJnw= github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56 h1:ZpKuNIejY8P0ExLOVyKhb0WsgG8UdvHXe6TWjY7eL6k= -golang.org/x/crypto v0.0.0-20190617133340-57b3e21c3d56/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= +golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980 h1:dfGZHvZk057jK2MCeWus/TowKpJ8y4AmooUzdBSR9GU= -golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f h1:25KHgbfyiSm6vwQLbM3zZIe1v9p/3ea4Rz+nnM5K/i4= -golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= From fe231fa67a7cbe62fb400d303801b59633e97b7e Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sun, 14 Jul 2019 19:31:44 -0700 Subject: [PATCH 04/20] remove machineid from deps --- go.mod | 1 - go.sum | 2 -- src/croc/croc.go | 14 +------------- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 435a1492..64e91b88 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,6 @@ go 1.12 require ( github.com/OneOfOne/xxhash v1.2.5 // indirect github.com/cespare/xxhash v1.1.0 - github.com/denisbrodbeck/machineid v1.0.1 github.com/fatih/color v1.7.0 // indirect github.com/kalafut/imohash v1.0.0 github.com/mattn/go-colorable v0.1.2 // indirect diff --git a/go.sum b/go.sum index 824d377c..bf0333f4 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,6 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/denisbrodbeck/machineid v1.0.1 h1:geKr9qtkB876mXguW2X6TU4ZynleN6ezuMSRhl4D7AQ= -github.com/denisbrodbeck/machineid v1.0.1/go.mod h1:dJUwb7PTidGDeYyUBmXZ2GphQBbjJCrnectwCyxcUSI= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/kalafut/imohash v1.0.0 h1:LgCJ+p/BwM2HKpOxFopkeddpzVCfm15EtXMroXD1SYE= diff --git a/src/croc/croc.go b/src/croc/croc.go index 242094cf..ae4c6fce 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -17,7 +17,6 @@ import ( "sync" "time" - "github.com/denisbrodbeck/machineid" "github.com/pkg/errors" "github.com/schollz/croc/v6/src/comm" "github.com/schollz/croc/v6/src/compress" @@ -88,7 +87,6 @@ type Client struct { bar *progressbar.ProgressBar spinner *spinner.Spinner - machineID string firstSend bool mutex *sync.Mutex @@ -117,7 +115,6 @@ type RemoteFileRequest struct { } type SenderInfo struct { - MachineID string FilesToTransfer []FileInfo } @@ -216,15 +213,7 @@ func (c *Client) Send(options TransferOptions) (err error) { if len(c.FilesToTransfer) == 1 { fname = fmt.Sprintf("'%s'", c.FilesToTransfer[0].Name) } - machID, macIDerr := machineid.ID() - if macIDerr != nil { - log.Error(macIDerr) - return - } - if len(machID) > 6 { - machID = machID[:6] - } - c.machineID = machID + fmt.Fprintf(os.Stderr, "Sending %s (%s)\n", fname, utils.ByteCountDecimal(totalFilesSize)) fmt.Fprintf(os.Stderr, "Code is: %s\nOn the other computer run\n\ncroc %s\n", c.Options.SharedSecret, c.Options.SharedSecret) // // c.spinner.Suffix = " waiting for recipient..." @@ -641,7 +630,6 @@ func (c *Client) updateState() (err error) { if c.Options.IsSender && c.Step1ChannelSecured && !c.Step2FileInfoTransfered { var b []byte b, err = json.Marshal(SenderInfo{ - MachineID: c.machineID, FilesToTransfer: c.FilesToTransfer, }) if err != nil { From fbbdd1bcfed8f88df714c862eb3e0c301334cf61 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sun, 14 Jul 2019 20:32:42 -0600 Subject: [PATCH 05/20] update deps --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 21f536bf..b3fee5f1 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,6 @@ require ( github.com/urfave/cli v1.20.0 golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 golang.org/x/net v0.0.0-20190628185345-da137c7871d7 // indirect - golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb // indirect + golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 // indirect golang.org/x/text v0.3.2 // indirect ) diff --git a/go.sum b/go.sum index 7f3ffdb1..57097ae9 100644 --- a/go.sum +++ b/go.sum @@ -59,8 +59,8 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 h1:LepdCS8Gf/MVejFIt8lsiexZATdoGVyp5bcyS+rYoUI= +golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= From 928ee1f4962f439e2c78c8487d77767d4ecd19da Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sun, 14 Jul 2019 20:33:47 -0600 Subject: [PATCH 06/20] bump 6.0.12 --- README.md | 2 +- src/cli/cli.go | 2 +- src/install/default.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index df1c1d8e..917d4757 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ src="https://user-images.githubusercontent.com/6550035/46709024-9b23ad00-cbf6-11e8-9fb2-ca8b20b7dbec.jpg" width="408px" border="0" alt="croc">
-Version +Version Build
 Status diff --git a/src/cli/cli.go b/src/cli/cli.go index 05d93dd2..5ddc1d58 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -27,7 +27,7 @@ func Run() (err error) { app := cli.NewApp() app.Name = "croc" if Version == "" { - Version = "v6.0.11-6d9105a" + Version = "v6.0.12-fbbdd1b" } app.Version = Version app.Compiled = time.Now() diff --git a/src/install/default.txt b/src/install/default.txt index 871fa92f..0c0ebe1c 100644 --- a/src/install/default.txt +++ b/src/install/default.txt @@ -33,7 +33,7 @@ install_croc() croc_os="unsupported" croc_arch="unknown" croc_arm="" - croc_version="6.0.11" + croc_version="6.0.12" # Termux on Android has $PREFIX set which already ends with /usr From 9968bbf82439ec8151735bde0bda2136224fb72b Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 17 Jul 2019 13:04:03 -0600 Subject: [PATCH 07/20] addressing issue #141 the local relay is not being used and then the connection is refused but it still hangs in that case is that the sender should give up, prompting the user to try again --- src/croc/croc.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/croc/croc.go b/src/croc/croc.go index ae4c6fce..fdbc326e 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -223,6 +223,8 @@ func (c *Client) Send(options TransferOptions) (err error) { errchan := make(chan error, 1) if !c.Options.DisableLocal { + // add two things to the error channel + errchan = make(chan error, 2) // setup the relay locally for _, port := range c.Options.RelayPorts { @@ -287,6 +289,7 @@ func (c *Client) Send(options TransferOptions) (err error) { if err != nil { err = errors.Wrap(err, fmt.Sprintf("could not connect to %s", c.Options.RelayAddress)) log.Debug(err) + errchan <- err return } log.Debugf("connection established: %+v", conn) @@ -320,7 +323,15 @@ func (c *Client) Send(options TransferOptions) (err error) { errchan <- c.transfer(options) }() - return <-errchan + err = <-errchan + if err == nil { + // return if no error + return + } + if !c.Options.DisableLocal { + err = <-errchan + } + return err } // Receive will receive a file From 8b178881cff9bc91cd776b284897d0d6245692dd Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 17 Jul 2019 14:12:48 -0600 Subject: [PATCH 08/20] display relay in UI if not using default Fixes #143 --- src/cli/cli.go | 3 ++- src/croc/croc.go | 6 +++++- src/models/constants.go | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index 5ddc1d58..073be839 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -13,6 +13,7 @@ import ( "time" "github.com/schollz/croc/v6/src/croc" + "github.com/schollz/croc/v6/src/models" "github.com/schollz/croc/v6/src/tcp" "github.com/schollz/croc/v6/src/utils" "github.com/urfave/cli" @@ -66,7 +67,7 @@ func Run() (err error) { cli.BoolFlag{Name: "debug", Usage: "increase verbosity (a lot)"}, cli.BoolFlag{Name: "yes", Usage: "automatically agree to all prompts"}, cli.BoolFlag{Name: "stdout", Usage: "redirect file to stdout"}, - cli.StringFlag{Name: "relay", Value: "142.93.177.120:9009", Usage: "address of the relay"}, + cli.StringFlag{Name: "relay", Value: models.DEFAULT_RELAY, Usage: "address of the relay"}, cli.StringFlag{Name: "out", Value: ".", Usage: "specify an output folder to receive the file"}, } app.EnableBashCompletion = true diff --git a/src/croc/croc.go b/src/croc/croc.go index fdbc326e..d05af884 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -215,7 +215,11 @@ func (c *Client) Send(options TransferOptions) (err error) { } fmt.Fprintf(os.Stderr, "Sending %s (%s)\n", fname, utils.ByteCountDecimal(totalFilesSize)) - fmt.Fprintf(os.Stderr, "Code is: %s\nOn the other computer run\n\ncroc %s\n", c.Options.SharedSecret, c.Options.SharedSecret) + otherRelay := "" + if c.Options.RelayAddress != models.DEFAULT_RELAY { + otherRelay = "--relay " + c.Options.RelayAddress + " " + } + fmt.Fprintf(os.Stderr, "Code is: %s\nOn the other computer run\n\ncroc %s%s\n", c.Options.SharedSecret, otherRelay, c.Options.SharedSecret) // // c.spinner.Suffix = " waiting for recipient..." // c.spinner.Start() // create channel for quitting diff --git a/src/models/constants.go b/src/models/constants.go index f1b11e6e..acb20a7b 100644 --- a/src/models/constants.go +++ b/src/models/constants.go @@ -1,3 +1,4 @@ package models const TCP_BUFFER_SIZE = 1024 * 64 +const DEFAULT_RELAY = "142.93.177.120:9009" From 68ddbe7f149ff805042bd6dcb748136f6eb2cd37 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 17 Jul 2019 14:33:02 -0600 Subject: [PATCH 09/20] small change --- src/cli/cli.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index 073be839..5ff21244 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -5,7 +5,6 @@ import ( "fmt" "io" "io/ioutil" - "log" "os" "path/filepath" "runtime" @@ -16,6 +15,7 @@ import ( "github.com/schollz/croc/v6/src/models" "github.com/schollz/croc/v6/src/tcp" "github.com/schollz/croc/v6/src/utils" + log "github.com/schollz/logger" "github.com/urfave/cli" ) @@ -64,6 +64,7 @@ func Run() (err error) { }, } app.Flags = []cli.Flag{ + cli.BoolFlag{Name: "config", Usage: "save these settings to reuse next time"}, cli.BoolFlag{Name: "debug", Usage: "increase verbosity (a lot)"}, cli.BoolFlag{Name: "yes", Usage: "automatically agree to all prompts"}, cli.BoolFlag{Name: "stdout", Usage: "redirect file to stdout"}, @@ -95,8 +96,20 @@ func Run() (err error) { // return croc.SaveDefaultConfig() // } -func send(c *cli.Context) (err error) { +func makeConfigDir() (err error) { + homedir, err := os.UserHomeDir() + if err != nil { + log.Error(err) + return + } + log.SetLevel("debug") + log.Debugf("creating home directory %s", homedir) + return +} +func send(c *cli.Context) (err error) { + makeConfigDir() + os.Exit(0) var fnames []string stat, _ := os.Stdin.Stat() if (stat.Mode() & os.ModeCharDevice) == 0 { @@ -116,7 +129,7 @@ func send(c *cli.Context) (err error) { defer func() { err = os.Remove(fnames[0]) if err != nil { - log.Println(err) + log.Error(err) } }() } else { From f18c2eae7e3f98cfcc11656acc3bac5b9a6fca60 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 17 Jul 2019 15:55:43 -0600 Subject: [PATCH 10/20] add get config dir --- src/cli/cli.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index 5ff21244..82c85ab2 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -6,6 +6,7 @@ import ( "io" "io/ioutil" "os" + "path" "path/filepath" "runtime" "strings" @@ -96,14 +97,19 @@ func Run() (err error) { // return croc.SaveDefaultConfig() // } -func makeConfigDir() (err error) { - homedir, err := os.UserHomeDir() +func getConfigDir() (homedir string, err error) { + homedir, err = os.UserHomeDir() if err != nil { log.Error(err) return } log.SetLevel("debug") - log.Debugf("creating home directory %s", homedir) + homedir = path.Join(homedir, ".config", "croc") + if _, err := os.Stat(homedir); os.IsNotExist(err) { + log.Debugf("creating home directory %s", homedir) + err = os.MkdirAll(homedir, 0700) + + } return } From 1d7976a61a13b08fe6768f86a9578c5dcc0b5502 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 17 Jul 2019 16:19:32 -0600 Subject: [PATCH 11/20] save send remember --- src/cli/cli.go | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index 82c85ab2..a93bfc4d 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -1,6 +1,7 @@ package cli import ( + "encoding/json" "errors" "fmt" "io" @@ -65,7 +66,7 @@ func Run() (err error) { }, } app.Flags = []cli.Flag{ - cli.BoolFlag{Name: "config", Usage: "save these settings to reuse next time"}, + cli.BoolFlag{Name: "remember", Usage: "save these settings to reuse next time"}, cli.BoolFlag{Name: "debug", Usage: "increase verbosity (a lot)"}, cli.BoolFlag{Name: "yes", Usage: "automatically agree to all prompts"}, cli.BoolFlag{Name: "stdout", Usage: "redirect file to stdout"}, @@ -103,19 +104,26 @@ func getConfigDir() (homedir string, err error) { log.Error(err) return } - log.SetLevel("debug") homedir = path.Join(homedir, ".config", "croc") if _, err := os.Stat(homedir); os.IsNotExist(err) { log.Debugf("creating home directory %s", homedir) err = os.MkdirAll(homedir, 0700) - } return } func send(c *cli.Context) (err error) { - makeConfigDir() - os.Exit(0) + if c.GlobalBool("debug") { + log.SetLevel("debug") + log.Debug("debug mode on") + } + configFile, err := getConfigDir() + if err != nil { + log.Error(err) + return + } + configFile = path.Join(configFile, "send.json") + var fnames []string stat, _ := os.Stdin.Stat() if (stat.Mode() & os.ModeCharDevice) == 0 { @@ -181,7 +189,7 @@ func send(c *cli.Context) (err error) { paths = append(paths, filepath.ToSlash(fname)) } } - cr, err := croc.New(croc.Options{ + crocOptions := croc.Options{ SharedSecret: sharedSecret, IsSender: true, Debug: c.GlobalBool("debug"), @@ -190,11 +198,29 @@ func send(c *cli.Context) (err error) { Stdout: c.GlobalBool("stdout"), DisableLocal: c.Bool("no-local"), RelayPorts: strings.Split(c.String("ports"), ","), - }) + } + cr, err := croc.New(crocOptions) if err != nil { return } + // save the config + if c.GlobalBool("remember") { + log.Debug("saving config file") + var bConfig []byte + bConfig, err = json.MarshalIndent(crocOptions, "", " ") + if err != nil { + log.Error(err) + return + } + err = ioutil.WriteFile(configFile, bConfig, 0644) + if err != nil { + log.Error(err) + return + } + log.Debugf("wrote %s", configFile) + } + err = cr.Send(croc.TransferOptions{ PathToFiles: paths, KeepPathInRemote: haveFolder, From 54fb8aec9d72d6956ed1d3dbfe3b4080c038755f Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 17 Jul 2019 17:23:50 -0600 Subject: [PATCH 12/20] how to check if flag is set? --- src/cli/cli.go | 68 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 17 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index a93bfc4d..0db8a518 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -124,6 +124,47 @@ func send(c *cli.Context) (err error) { } configFile = path.Join(configFile, "send.json") + var crocOptions croc.Options + b, errOpen := ioutil.ReadFile(configFile) + if errOpen == nil { + err = json.Unmarshal(b, &crocOptions) + if err != nil { + log.Error(err) + return + } + // update anything that has changed + if crocOptions.Debug != c.GlobalBool("debug") { + crocOptions.Debug = c.GlobalBool("debug") + } + if crocOptions.NoPrompt != c.GlobalBool("yes") { + crocOptions.NoPrompt = c.GlobalBool("yes") + } + if crocOptions.RelayAddress != c.GlobalString("relay") { + crocOptions.RelayAddress = c.GlobalString("relay") + } + if crocOptions.Stdout != c.GlobalBool("stdout") { + crocOptions.Stdout = c.GlobalBool("stdout") + } + if crocOptions.DisableLocal != c.Bool("no-local") { + crocOptions.DisableLocal = c.Bool("no-local") + } + // TODO: add ports + if c.String("code") != "" { + crocOptions.SharedSecret = "" + } + } else { + crocOptions = croc.Options{ + SharedSecret: "", + IsSender: true, + Debug: c.GlobalBool("debug"), + NoPrompt: c.GlobalBool("yes"), + RelayAddress: c.GlobalString("relay"), + Stdout: c.GlobalBool("stdout"), + DisableLocal: c.Bool("no-local"), + RelayPorts: strings.Split(c.String("ports"), ","), + } + } + var fnames []string stat, _ := os.Stdin.Stat() if (stat.Mode() & os.ModeCharDevice) == 0 { @@ -153,14 +194,12 @@ func send(c *cli.Context) (err error) { return errors.New("must specify file: croc send [filename]") } - var sharedSecret string if c.String("code") != "" { - sharedSecret = c.String("code") + crocOptions.SharedSecret = c.String("code") } - // cr.LoadConfig() - if len(sharedSecret) == 0 { + if len(crocOptions.SharedSecret) == 0 { // generate code phrase - sharedSecret = utils.GetRandomName() + crocOptions.SharedSecret = utils.GetRandomName() } haveFolder := false @@ -189,16 +228,7 @@ func send(c *cli.Context) (err error) { paths = append(paths, filepath.ToSlash(fname)) } } - crocOptions := croc.Options{ - SharedSecret: sharedSecret, - IsSender: true, - Debug: c.GlobalBool("debug"), - NoPrompt: c.GlobalBool("yes"), - RelayAddress: c.GlobalString("relay"), - Stdout: c.GlobalBool("stdout"), - DisableLocal: c.Bool("no-local"), - RelayPorts: strings.Split(c.String("ports"), ","), - } + cr, err := croc.New(crocOptions) if err != nil { return @@ -208,6 +238,10 @@ func send(c *cli.Context) (err error) { if c.GlobalBool("remember") { log.Debug("saving config file") var bConfig []byte + // if the code wasn't set, don't save it + if c.String("code") == "" { + crocOptions.SharedSecret = "" + } bConfig, err = json.MarshalIndent(crocOptions, "", " ") if err != nil { log.Error(err) @@ -231,8 +265,8 @@ func send(c *cli.Context) (err error) { func receive(c *cli.Context) (err error) { var sharedSecret string - if c.GlobalString("code") != "" { - sharedSecret = c.GlobalString("code") + if c.String("code") != "" { + sharedSecret = c.String("code") } if c.Args().First() != "" { sharedSecret = c.Args().First() From 97d18e1fbf1afff630f0e0fbaa21adf6c102a5ba Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 17 Jul 2019 17:26:42 -0600 Subject: [PATCH 13/20] toggling parameters --- src/cli/cli.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index 0db8a518..cc6e66f5 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -126,7 +126,7 @@ func send(c *cli.Context) (err error) { var crocOptions croc.Options b, errOpen := ioutil.ReadFile(configFile) - if errOpen == nil { + if errOpen == nil && !c.GlobalBool("remember") { err = json.Unmarshal(b, &crocOptions) if err != nil { log.Error(err) @@ -136,19 +136,22 @@ func send(c *cli.Context) (err error) { if crocOptions.Debug != c.GlobalBool("debug") { crocOptions.Debug = c.GlobalBool("debug") } - if crocOptions.NoPrompt != c.GlobalBool("yes") { + if c.GlobalBool("yes") { crocOptions.NoPrompt = c.GlobalBool("yes") } if crocOptions.RelayAddress != c.GlobalString("relay") { crocOptions.RelayAddress = c.GlobalString("relay") } - if crocOptions.Stdout != c.GlobalBool("stdout") { + if c.GlobalBool("stdout") { crocOptions.Stdout = c.GlobalBool("stdout") } - if crocOptions.DisableLocal != c.Bool("no-local") { + // TODO: use c.IsSet + + if c.Bool("no-local") { crocOptions.DisableLocal = c.Bool("no-local") } // TODO: add ports + if c.String("code") != "" { crocOptions.SharedSecret = "" } From 252e96a6702aa7589094b06eee41ea6c844f307c Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 17 Jul 2019 18:06:52 -0600 Subject: [PATCH 14/20] simplify toggling --- src/cli/cli.go | 56 +++++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 35 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index cc6e66f5..ad3f5a1d 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -124,47 +124,36 @@ func send(c *cli.Context) (err error) { } configFile = path.Join(configFile, "send.json") - var crocOptions croc.Options + crocOptions := croc.Options{ + SharedSecret: c.String("code"), + IsSender: true, + Debug: c.GlobalBool("debug"), + NoPrompt: c.GlobalBool("yes"), + RelayAddress: c.GlobalString("relay"), + Stdout: c.GlobalBool("stdout"), + DisableLocal: c.Bool("no-local"), + RelayPorts: strings.Split(c.String("ports"), ","), + } b, errOpen := ioutil.ReadFile(configFile) if errOpen == nil && !c.GlobalBool("remember") { - err = json.Unmarshal(b, &crocOptions) + var rememberedOptions croc.Options + err = json.Unmarshal(b, &rememberedOptions) if err != nil { log.Error(err) return } - // update anything that has changed - if crocOptions.Debug != c.GlobalBool("debug") { - crocOptions.Debug = c.GlobalBool("debug") + // update anything that isn't explicitly set + if !c.GlobalIsSet("relay") { + crocOptions.RelayAddress = rememberedOptions.RelayAddress } - if c.GlobalBool("yes") { - crocOptions.NoPrompt = c.GlobalBool("yes") + if !c.IsSet("no-local") { + crocOptions.DisableLocal = rememberedOptions.DisableLocal } - if crocOptions.RelayAddress != c.GlobalString("relay") { - crocOptions.RelayAddress = c.GlobalString("relay") + if !c.IsSet("ports") { + crocOptions.RelayPorts = rememberedOptions.RelayPorts } - if c.GlobalBool("stdout") { - crocOptions.Stdout = c.GlobalBool("stdout") - } - // TODO: use c.IsSet - - if c.Bool("no-local") { - crocOptions.DisableLocal = c.Bool("no-local") - } - // TODO: add ports - - if c.String("code") != "" { - crocOptions.SharedSecret = "" - } - } else { - crocOptions = croc.Options{ - SharedSecret: "", - IsSender: true, - Debug: c.GlobalBool("debug"), - NoPrompt: c.GlobalBool("yes"), - RelayAddress: c.GlobalString("relay"), - Stdout: c.GlobalBool("stdout"), - DisableLocal: c.Bool("no-local"), - RelayPorts: strings.Split(c.String("ports"), ","), + if !c.IsSet("code") { + crocOptions.SharedSecret = rememberedOptions.SharedSecret } } @@ -197,9 +186,6 @@ func send(c *cli.Context) (err error) { return errors.New("must specify file: croc send [filename]") } - if c.String("code") != "" { - crocOptions.SharedSecret = c.String("code") - } if len(crocOptions.SharedSecret) == 0 { // generate code phrase crocOptions.SharedSecret = utils.GetRandomName() From 6a8bdccb66863c45fbd1865ba2d3bba1cab9f1a1 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Wed, 17 Jul 2019 18:16:50 -0600 Subject: [PATCH 15/20] add receiver config --- src/cli/cli.go | 61 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index ad3f5a1d..8c723463 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -253,28 +253,55 @@ func send(c *cli.Context) (err error) { } func receive(c *cli.Context) (err error) { - var sharedSecret string - if c.String("code") != "" { - sharedSecret = c.String("code") - } - if c.Args().First() != "" { - sharedSecret = c.Args().First() - } - if sharedSecret == "" { - sharedSecret = utils.GetInput("Enter receive code: ") - } - if c.GlobalString("out") != "" { - os.Chdir(c.GlobalString("out")) - } - - cr, err := croc.New(croc.Options{ - SharedSecret: sharedSecret, + crocOptions := croc.Options{ + SharedSecret: c.String("code"), IsSender: false, Debug: c.GlobalBool("debug"), NoPrompt: c.GlobalBool("yes"), RelayAddress: c.GlobalString("relay"), Stdout: c.GlobalBool("stdout"), - }) + } + if c.Args().First() != "" { + crocOptions.SharedSecret = c.Args().First() + } + + // load options here + if c.GlobalBool("debug") { + log.SetLevel("debug") + log.Debug("debug mode on") + } + configFile, err := getConfigDir() + if err != nil { + log.Error(err) + return + } + configFile = path.Join(configFile, "receive.json") + b, errOpen := ioutil.ReadFile(configFile) + if errOpen == nil && !c.GlobalBool("remember") { + var rememberedOptions croc.Options + err = json.Unmarshal(b, &rememberedOptions) + if err != nil { + log.Error(err) + return + } + // update anything that isn't explicitly set + if !c.GlobalIsSet("relay") { + crocOptions.RelayAddress = rememberedOptions.RelayAddress + } + if crocOptions.SharedSecret == "" { + crocOptions.SharedSecret = rememberedOptions.SharedSecret + } + } + + if crocOptions.SharedSecret == "" { + crocOptions.SharedSecret = utils.GetInput("Enter receive code: ") + } + if c.GlobalString("out") != "" { + os.Chdir(c.GlobalString("out")) + } + + cr, err := croc.New(crocOptions) + if err != nil { return } From 7fcf45cece5d4ae9db771d86a5b3069db85117f8 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 18 Jul 2019 06:06:56 -0700 Subject: [PATCH 16/20] remove unused code --- src/cli/cli.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index 8c723463..3afa9455 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -94,10 +94,6 @@ func Run() (err error) { return app.Run(os.Args) } -// func saveDefaultConfig(c *cli.Context) error { -// return croc.SaveDefaultConfig() -// } - func getConfigDir() (homedir string, err error) { homedir, err = os.UserHomeDir() if err != nil { @@ -329,14 +325,3 @@ func relay(c *cli.Context) (err error) { } return tcp.Run(debugString, ports[0], tcpPorts) } - -// func dirSize(path string) (int64, error) { -// var size int64 -// err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error { -// if !info.IsDir() { -// size += info.Size() -// } -// return err -// }) -// return size, err -// } From 256e0c51fa14522b3f4cfd2a8a0410e7a068884b Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 18 Jul 2019 06:13:11 -0700 Subject: [PATCH 17/20] add save file for receiver --- src/cli/cli.go | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/cli/cli.go b/src/cli/cli.go index 3afa9455..300b8f12 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -284,6 +284,9 @@ func receive(c *cli.Context) (err error) { if !c.GlobalIsSet("relay") { crocOptions.RelayAddress = rememberedOptions.RelayAddress } + if !c.GlobalIsSet("yes") { + crocOptions.NoPrompt = rememberedOptions.NoPrompt + } if crocOptions.SharedSecret == "" { crocOptions.SharedSecret = rememberedOptions.SharedSecret } @@ -297,10 +300,27 @@ func receive(c *cli.Context) (err error) { } cr, err := croc.New(crocOptions) - if err != nil { return } + + // save the config + if c.GlobalBool("remember") { + log.Debug("saving config file") + var bConfig []byte + bConfig, err = json.MarshalIndent(crocOptions, "", " ") + if err != nil { + log.Error(err) + return + } + err = ioutil.WriteFile(configFile, bConfig, 0644) + if err != nil { + log.Error(err) + return + } + log.Debugf("wrote %s", configFile) + } + err = cr.Receive() return } From edc97915bdfd35cc41180f5c995762413ecfe86c Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 18 Jul 2019 06:17:15 -0700 Subject: [PATCH 18/20] don't keep debug --- src/cli/cli.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cli/cli.go b/src/cli/cli.go index 300b8f12..e63a285c 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -112,6 +112,8 @@ func send(c *cli.Context) (err error) { if c.GlobalBool("debug") { log.SetLevel("debug") log.Debug("debug mode on") + } else { + log.SetLevel("info") } configFile, err := getConfigDir() if err != nil { @@ -265,6 +267,8 @@ func receive(c *cli.Context) (err error) { if c.GlobalBool("debug") { log.SetLevel("debug") log.Debug("debug mode on") + } else { + log.SetLevel("info") } configFile, err := getConfigDir() if err != nil { From 6f3141833096a58b1ab3e50a5281e4f33b9b1604 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 18 Jul 2019 07:22:03 -0600 Subject: [PATCH 19/20] add --remember --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 917d4757..1abb87c5 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ $ croc code-phrase The code phrase is used to establish password-authenticated key agreement ([PAKE](https://en.wikipedia.org/wiki/Password-authenticated_key_agreement)) which generates a secret key for the sender and recipient to use for end-to-end encryption. +There are a number of configurable options (see `--help`). A set of options (like custom relay, ports, and code phrase) can be set using `--remember`. ### Custom code phrase @@ -85,7 +86,6 @@ You can send with your own code phrase (must be more than 4 characters). $ croc send --code [code-phrase] [file(s)-or-folder] ``` - ### Use pipes - stdin and stdout You can pipe to `croc`: From 336f3148545baad2a71d75808130563b0a737c17 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Thu, 18 Jul 2019 07:22:38 -0600 Subject: [PATCH 20/20] bump 6.1.0 --- README.md | 2 +- src/cli/cli.go | 2 +- src/install/default.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1abb87c5..967ed674 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ src="https://user-images.githubusercontent.com/6550035/46709024-9b23ad00-cbf6-11e8-9fb2-ca8b20b7dbec.jpg" width="408px" border="0" alt="croc">
-Version +Version Build
 Status diff --git a/src/cli/cli.go b/src/cli/cli.go index e63a285c..5ff771a8 100644 --- a/src/cli/cli.go +++ b/src/cli/cli.go @@ -30,7 +30,7 @@ func Run() (err error) { app := cli.NewApp() app.Name = "croc" if Version == "" { - Version = "v6.0.12-fbbdd1b" + Version = "v6.1.0-6f31418" } app.Version = Version app.Compiled = time.Now() diff --git a/src/install/default.txt b/src/install/default.txt index 0c0ebe1c..792fd4c8 100644 --- a/src/install/default.txt +++ b/src/install/default.txt @@ -33,7 +33,7 @@ install_croc() croc_os="unsupported" croc_arch="unknown" croc_arm="" - croc_version="6.0.12" + croc_version="6.1.0" # Termux on Android has $PREFIX set which already ends with /usr