Giter VIP home page Giter VIP logo

zget's Introduction

zget

Build Status Docs Status Latest Version Supported Python versions License

A simple, Zeroconf-based, peer to peer file transfer utility, for situations where you and your peer are sitting next to each other and want to transfer a file quickly (and can shout the filename across the room).

Files and peers are recognized by the filename they want to transfer, not by their hostnames or IPs.

zget uses the fact that the filename is known to both parties as a basic authentication feature: The sender only advertises the sha1 hash of the filename on the network. Since the receiver must also know the filename, it can look for the sha1 using zeroconf.

If a match was found, a simple HTTP request is made: For transferring the file the actual filename is then requested from the sender. If this filename wasn't correct, the process is aborted.

The only third party dependency is zeroconf, a platform independent pure-Python Zeroconf implementation.

Installation

$ pip install --user zget

If zget cannot be found afterwards you may also need to add

export PATH=$HOME/.local/bin:$PATH

to your .bashrc.

Usage

zget works both ways:

  • zput for sharing a file
  • zget for receiving

Sharing

To share some nice pictures do:

$ zput my_holiday_pictures.zip

then shout

Hey Tom, I am zgetting you my_holiday_pictures.zip!

Tom will then do

$ zget my_holiday_pictures.zip

Done.

Receiving

You want to have some very important annual reports from Marcy:

$ zget annual_reports.xlsx

then shout

Hey Marcy, can you zget me annual_reports.xlsx?

Marcy then does

$ zput annual_reports.xlsx

Boom. Done.

Aliases

Alternatively, in case of really complicated filenames, you can use aliases or have zput generate one for you:

$ zput LICENSE
Download this file using `zget LICENSE` or `zget C6P3`

Also zget can generate an alias so you can initiate the transfer without knowing what file will be transferred.

$ zget
Upload a file using `zput <filename> YHKC`

As of version 0.10 zget will then out the resulting filename from the transfer metadata.

Options

You may inspect the available options using

$ zput -h

or

$ zget -h

Configuration

By default zget uses a random open port and the sending party must be able to accept incoming connections. This may be a problem when you have restrictive firewall settings or multiple network cards.

You may create a config file

  • ~/.zget.cfg on Linux/OSX
  • %APPDATA%/zget/zget.ini on Windows

to permanently set the port number and/or interface zget uses, e.g.

[DEFAULT]
port = 8080
interface = eth0

Note that port numbers below 1024 may require root permissions to be opened.

Python Interface

As of zget 0.8, there exists a Python interface for sending and receiving files as function calls. E.g.:

For sending:

import zget
zget.put("filename", port=2200)

and for receiving:

import zget
zget.get("filename", "filename_to_save_to")

For more information please see the API reference.

Security Considerations

Neither Zeroconf nor HTTP, both technologies used in this tool, should be used on untrusted networks (like public WiFi at a coffee shop).

Additonally, zput announces the filename and aliases as a simple unsalted SHA-1 hash on the network. This means that a malicious party could trivially intercept your transfers by simply generating a large enough number of hashes and then accepting the transfer on behalf of the desired recipient.

In this case you should however notice the attack by the recipient never receiving a file while the sender sees an upload happening.

zget's People

Contributors

asottile avatar nils-werner avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.