Skip to main content

Uploads data to a remote www directory via scp and returns a public url.

Project description

Uploads data to a remote www directory via scp and returns a public url.

Install

Easiest way is to install via pip:

pip install drop

there are currently no dependencies other than python 2.7 or python 3.4.

To install manually: copy drop/drop.py to any location of your preference

Configure

A configuration file is required, it can be located at /etc/drop.cfg, ~/.drop.cfg or it’s location passed via command line option –config-file.

A sample config file would be:

[DEFAULT]
# reference to the default destination (section name):
destination = hawo

# You can set the following defaults:
# Location of the scp command, can be relative or absolute path:
scp = scp
# default length (in characters) for hashfilenames (max. 28)
hashlength = 28
# default chmod to apply to uploaded files (already applied localy and uploaded with -p)
# 436 this is 0o644
chmod = 436

# Destinations:
[hawo]
# remote server dns or alias from .ssh/config and may also include username (user@server):
remoteserver = ente
# remote directory can be relative (to home directory) or absolute:
remotedir = public_html/d/
# publishing url, this must represent the above directory:
url = http://hawo.net/~sijuhamm/d/
# all defaults can be overwritten for any destination. For example the hashlength:
hashlength = 10

The DEFAULT section configures default values for all other sections and the default destination. All other sections are so called destination sections. They can be selected via the –destination command line parameter.

Usage

You can pase a file by argument:

$ drop defaults.cfg
http://hawo.net/~sijuhamm/d/NcT0jFb5.cfg

or any content via stdin:

$ date | ./drop.py
http://hawo.net/~sijuhamm/d/ephtK9DY

The filename at the remote location is actually a partial sha1 checksum of the file. The length of the checksum can be set in the configuration file. The extension is preserved when possible and can also be overwritten with the –extension parameter.

The full help message reads as follows:

usage: drop [-h] [--destination DESTINATION] [--extension EXTENSION]
            [--config-file CONFIG_FILE] [--test]
            [infile]

Uploads data to a remote www directory via scp and returns a public url.

positional arguments:
  infile

optional arguments:
  -h, --help            show this help message and exit
  --destination DESTINATION, -d DESTINATION
                        Name of destination as found in configuration file.
  --extension EXTENSION, -e EXTENSION
                        Overwrites extension on uploaded file.
  --config-file CONFIG_FILE, -c CONFIG_FILE
  --test                Runs a test on destination.

TODOs

Upcoming features:
  • automatic copying of url to clipboard

  • (maybe) support for other upload destinations

  • multiple file upload

  • compression and archiving before uploading (optional)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

drop-0.2.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

drop-0.2.0.macosx-10.10-x86_64.tar.gz (5.9 kB view details)

Uploaded Source

File details

Details for the file drop-0.2.0.tar.gz.

File metadata

  • Download URL: drop-0.2.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for drop-0.2.0.tar.gz
Algorithm Hash digest
SHA256 76d22600f870f069cd91f763076e7ddf89329cda595df1ff580e0ac1185b0510
MD5 7294e585e321afc85facf453d27817e9
BLAKE2b-256 50e5fb3d2c7189c344e2d0b9009aa997c3b2028bdf6dab61f02642cc1fceeacb

See more details on using hashes here.

File details

Details for the file drop-0.2.0.macosx-10.10-x86_64.tar.gz.

File metadata

File hashes

Hashes for drop-0.2.0.macosx-10.10-x86_64.tar.gz
Algorithm Hash digest
SHA256 0c723655f592d916addae96896c17911fb370c912acc3ef9b25533fb88913210
MD5 c787b00e01e5671863ec45e9f3082c62
BLAKE2b-256 6ba39e089935b408788393fa5c8e5276ba09e1dd2fafe9e9a4c48948316d7b3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page