HaveFun.cz

HaveUp


HaveUp is a simple command line utility for uploading files via scp. The idea is that you upload a file to a public folder on your web server which can then share the file.

HaveUp uploads the file and then gives you the URL, so you can easily share the link.

Requirements

Download

https://secure.havefun.cz/~aither/pub/releases/haveup.py

Usage

First, HaveUp needs to be configured. Configuration file is located at ~/.config/HaveFun.cz/HaveUp.conf.

[DEFAULT]
UploadUrl = user@host:/path
PublicUrl = http://myserver.tld/public/path
HashName = false
checksum =
keep_checksum = false

Run HaveUp:

$ haveup myfile.txt [more files...]
myfile.txt: http://myserver.tld/public/path/myfile.txt

As the files are sequentially uploaded, HaveUp will print resulting URLs, and it will also put the URLs in X selection (paste with middle mouse button) if xsel is available.

Subdirectories

You can upload to a subdirectory:

$ haveup -d mysubdir myfile.txt [more files...]
myfile.txt: http://myserver.tld/public/path/mysubdir/myfile.txt

Classes

It is possible to define custom classes which can override default settings. For example:

[release]
SubDir = pub/releases
checksum = md5,sha1,sha256
keep_checksum = true

[share]
SubDir = share
HashName = true

Now when class release is selected, the file will be uploaded to subdirectory pub/releases and checksums will be computed and uploaded alongside. If share is chosen, it will be uploaded to subdirectory share and it’s name will be hashed, so it doesn’t reveal the real name.

$ haveup -cshare myfile.txt
myfile.txt: http://myserver.tld/public/path/share/4a0696e759bd62b728f956517f9ecec08a0f5851.txt

It’s not necessary to write whole class name. It’s original beginning is sufficient. In this case, you could just use -cr or -cs.

Configuration options can also be overruled by command line options.

Checksums

Option checksum accepts a list of hashing algorithms separated by a comma. There is no finite list of supported algorithms, it calls command <alg>sum.

Option keep_checksum determines if the computed checksum is also kept locally or only uploaded to remote server.

License

HaveUp is released under GNU/GPL.