mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 05:11:06 +02:00
Merge pull request #907 from OlegChuev/main
README polishing, fixed typo in compress package docs
This commit is contained in:
commit
12ae5f8727
3 changed files with 11 additions and 9 deletions
|
@ -40,11 +40,13 @@ curl https://getcroc.schollz.com | bash
|
||||||
### On macOS
|
### On macOS
|
||||||
|
|
||||||
Using [Homebrew](https://brew.sh/):
|
Using [Homebrew](https://brew.sh/):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
brew install croc
|
brew install croc
|
||||||
```
|
```
|
||||||
|
|
||||||
Using [MacPorts](https://www.macports.org/):
|
Using [MacPorts](https://www.macports.org/):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo port selfupdate
|
sudo port selfupdate
|
||||||
sudo port install croc
|
sudo port install croc
|
||||||
|
|
|
@ -141,7 +141,7 @@ func Run() (err error) {
|
||||||
if classicInsecureMode {
|
if classicInsecureMode {
|
||||||
// classic mode not enabled
|
// classic mode not enabled
|
||||||
fmt.Print(`Classic mode is currently ENABLED.
|
fmt.Print(`Classic mode is currently ENABLED.
|
||||||
|
|
||||||
Disabling this mode will prevent the shared secret from being visible
|
Disabling this mode will prevent the shared secret from being visible
|
||||||
on the host's process list when passed via the command line. On a
|
on the host's process list when passed via the command line. On a
|
||||||
multi-user system, this will help ensure that other local users cannot
|
multi-user system, this will help ensure that other local users cannot
|
||||||
|
@ -166,7 +166,7 @@ Do you wish to continue to DISABLE the classic mode? (y/N) `)
|
||||||
// enable classic mode
|
// enable classic mode
|
||||||
// touch the file
|
// touch the file
|
||||||
fmt.Print(`Classic mode is currently DISABLED.
|
fmt.Print(`Classic mode is currently DISABLED.
|
||||||
|
|
||||||
Please note that enabling this mode will make the shared secret visible
|
Please note that enabling this mode will make the shared secret visible
|
||||||
on the host's process list when passed via the command line. On a
|
on the host's process list when passed via the command line. On a
|
||||||
multi-user system, this could allow other local users to access the
|
multi-user system, this could allow other local users to access the
|
||||||
|
@ -404,7 +404,7 @@ func send(c *cli.Context) (err error) {
|
||||||
if (!(runtime.GOOS == "windows") && c.IsSet("code")) || os.Getenv("CROC_SECRET") != "" {
|
if (!(runtime.GOOS == "windows") && c.IsSet("code")) || os.Getenv("CROC_SECRET") != "" {
|
||||||
crocOptions.SharedSecret = os.Getenv("CROC_SECRET")
|
crocOptions.SharedSecret = os.Getenv("CROC_SECRET")
|
||||||
if crocOptions.SharedSecret == "" {
|
if crocOptions.SharedSecret == "" {
|
||||||
fmt.Printf(`On UNIX systems, to send with a custom code phrase,
|
fmt.Printf(`On UNIX systems, to send with a custom code phrase,
|
||||||
you need to set the environmental variable CROC_SECRET:
|
you need to set the environmental variable CROC_SECRET:
|
||||||
|
|
||||||
CROC_SECRET=**** croc send file.txt
|
CROC_SECRET=**** croc send file.txt
|
||||||
|
@ -412,7 +412,7 @@ you need to set the environmental variable CROC_SECRET:
|
||||||
Or you can have the code phrase automatically generated:
|
Or you can have the code phrase automatically generated:
|
||||||
|
|
||||||
croc send file.txt
|
croc send file.txt
|
||||||
|
|
||||||
Or you can go back to the classic croc behavior by enabling classic mode:
|
Or you can go back to the classic croc behavior by enabling classic mode:
|
||||||
|
|
||||||
croc --classic
|
croc --classic
|
||||||
|
@ -660,15 +660,15 @@ func receive(c *cli.Context) (err error) {
|
||||||
} else if !(runtime.GOOS == "windows") && crocOptions.SharedSecret != "" && !classicInsecureMode {
|
} else if !(runtime.GOOS == "windows") && crocOptions.SharedSecret != "" && !classicInsecureMode {
|
||||||
crocOptions.SharedSecret = os.Getenv("CROC_SECRET")
|
crocOptions.SharedSecret = os.Getenv("CROC_SECRET")
|
||||||
if crocOptions.SharedSecret == "" {
|
if crocOptions.SharedSecret == "" {
|
||||||
fmt.Printf(`On UNIX systems, to receive with croc you either need
|
fmt.Printf(`On UNIX systems, to receive with croc you either need
|
||||||
to set a code phrase using your environmental variables:
|
to set a code phrase using your environmental variables:
|
||||||
|
|
||||||
CROC_SECRET=**** croc
|
CROC_SECRET=**** croc
|
||||||
|
|
||||||
Or you can specify the code phrase when you run croc without
|
Or you can specify the code phrase when you run croc without
|
||||||
declaring the secret on the command line:
|
declaring the secret on the command line:
|
||||||
|
|
||||||
croc
|
croc
|
||||||
Enter receive code: ****
|
Enter receive code: ****
|
||||||
|
|
||||||
Or you can go back to the classic croc behavior by enabling classic mode:
|
Or you can go back to the classic croc behavior by enabling classic mode:
|
||||||
|
|
|
@ -43,7 +43,7 @@ func compress(src []byte, dest io.Writer, level int) {
|
||||||
compressor.Close()
|
compressor.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
// compress uses flate to decompress an io.Reader
|
// decompress uses flate to decompress an io.Reader
|
||||||
func decompress(src io.Reader, dest io.Writer) {
|
func decompress(src io.Reader, dest io.Writer) {
|
||||||
decompressor := flate.NewReader(src)
|
decompressor := flate.NewReader(src)
|
||||||
if _, err := io.Copy(dest, decompressor); err != nil {
|
if _, err := io.Copy(dest, decompressor); err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue