cowyodel

command module
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2017 License: MIT Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

cowyodel
Build Status Version Code Coverage

Easily move things between computers using cowyo :cow: :speech_balloon:

cowyodel allows simple and secure sharing of text/data between computers. cowyodel temporarily transfers your data (with optional client-side encryption) to a cowyo server where it resides until the other computer downloads it using the provided secret code phrase.

Demo

asciicast

Getting Started

Install

If you have Go1.7+

go get -u -v github.com/schollz/cowyodel

or just download from the latest releases.

Basic usage

Upload

To share a document with another computer, you first upload it to a cowyo server. By default cowyodel uses cowyo.com, but you can host your own cowyo server as well (see Advanced Usage).

$ cowyodel upload README.md
Uploaded README.md (textual data). Your codephrase: total-perform-retro

View/edit your data:

	https://cowyo.com/total-perform-retro

Download using cowyodel:

	cowyodel download total-perform-retro

or

$ cat README.md | cowyodel upload
Uploaded (textual data). Your codephrase: total-perform-retro

View/edit your data:

	https://cowyo.com/total-perform-retro

Download using cowyodel:

	cowyodel download total-perform-retro

After uploading, you will recieve a code-phrase, in the above example the code-phrase is total-perform-retro. If you don't want to use code phrases, you can also specify your own name using -name, see Advanced Usage below.

The uploads are fully compatible with the cowyo server, so you can view and edit them using the code-phrase (e.g. cowyo.com/total-perform-retro in above example).

Download

On any other computer connected to the internet, you can download the file using the name using cowyodel download code-phrase.

$ cowyodel download total-perform-retro
Wrote text of 'total-perform-retro' to 'README.md'

After downloading, it will be erased from the cowyo.com. If you don't trust this server, you can also specify your own (see Advanced Usage). To prevent this, you can add --store.

Advanced Usage

Persist (and don't delete after first access)
$ cowyodel upload --store FILE
Specify codephrase
$ cowyodel upload --name README.md
Uploaded README.md (textual data). Your codephrase: README.md

It is possible that someone could have used that page (and locked it) which would not allow that page to be used and a message "Locked, must unlock first" will appear.

Client-side encryption
$ cowyodel upload --encrypt README.md
Enter passphrase: 123
Uploaded README.md (textual data). Your codephrase: total-perform-retro

$ cowyodel download total-perform-retro
Enter passphrase: 123
Wrote text of 'total-perform-retro' to 'README.md'

The encryption is fully compatible with the server-side encryption on cowyo.com, so you can still use the web browser to decrypt/encrypt your document.

If the decryption fails, the document will be re-uploaded to the cowyo server.

Binary files

Binary files are Gzipped and then Base64 encoded for transfering to/from the server. cowyodel automatically detects binary data and uploads as such.

$ cowyodel upload /tmp/image.jpg
Uploaded image.jpg (binary data). Your codephrase: empire-cricket-tokyo

Download using cowyodel:

	cowyodel download empire-cricket-tokyo

$ cowyodel download image.jpg
Wrote binary data to 'image.jpg'

$ sha256sum /tmp/image.jpg image.jpg
62a9583758d54e666ff210be3805483bd76ac522ea649f0264de65124943c0b3 */tmp/image.jpg
62a9583758d54e666ff210be3805483bd76ac522ea649f0264de65124943c0b3 *image.jpg

Note: you should not access uploaded binary files at via the web browser as it would risk corrupting them.

Self-hosting cowyo server

You can also host your own cowyo server and use that instead of the default cowyo.com. To host cowyo yourself, just use

$ go get github.com/schollz/cowyo/...
$ cowyo
Running cowyo server (version ) at http://localhost:8050

(If you don't have Go installed, you can also download a release version).

Once you have a self-hosted cowyo server, you just need to specify the server when running cowyodel:

$ cowyodel --server http://localhost:8050 upload FILE
uploaded to total-perform-retro
Help
$ cowyodel -h
NAME:
   cowyodel - upload/download encrypted/unencrypted text/binary to cowyo.com

USAGE:
   Upload a file:
    cowyodel upload README.md
    cat README.md | cowyodel upload
   
   Download a file:
    cowyodel download CODEPHRASE

   Persist (and don't delete after first access):
    cowyodel upload --store FILE

   Specify filename:
    cowyodel upload --name README.md

   Client-side encryption:
    cowyodel upload --encrypt README.md

   Binary-file uploading/downloading:
    cowyodel upload --binary --name image.jpg
    cowyodel download image.jpg

COMMANDS:
     upload, u    upload document
     download, d  download document
     help, h      Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --server value  cowyo server to use (default: "https://cowyo.com")
   --debug         debug mode
   --help, -h      show help
   --version, -v   print the version

Inspiration

This tool was inspired by the following:

cowyodel does not represent a significant innovation over these tools. However, there are some advantages that cowyodel provides:

  • Trust. You can run your own cowyo server on a domain you trust.
  • Direct edting. You can directly edit plaintext documents on the cowyo server using the web interface.
  • Simplicity. The codebase is < 1k LOC, and is straightforward to understand.

Development

To run tests, make sure to start a cowyo server first.

$ go get -u github.com/schollz/cowyo/...
$ cowyo
$ go test

License

MIT

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址