Skip to main content

Make file sharing easier

Project description

Sales pitch

- Ever felt the pain of transferring files to your peers?

- Yeah, well we've got Facebook and email to transfer them.

- What if you file is bigger than 25MB? What if you want to transfer a 10GB archive or a VM image?

Not everyone has big USB sticks or external hard drives with them all the time. Online file sharing services are cool, however, there are 2 things I dislike about them:

  1. Sending any file to a peer means uploading it on a server first and then my peer has to download it which is a total waste of traffic. What if my bandwidth is low?
  2. Privacy concerns - I don't want someone potentially snooping on my files.

Peer-to-peer should be easy, especially when connected to the same network! How do we do it then?

Read on.

What is this project about?

lansync is an application that simplifies file transfers between peers connected to the same network.

It is a wrapper around the popular rsync tool. The way rsync works is really clever and it's quite easy to synchronize files on different machines.

The issue is that 99% of the time rsync is used with ssh and having ssh access to someone's computer is not desirable (at least from their point of view).

Fortunately, you can use rsync with ssh by severely limiting the access you have over that channel. To be more precise you are allowed only to run rsync --server on the receiving side.

Demo

Here you can see a simple example. The client on the left wants to send test.txt to the client on the left. You can see that both machines have different ip addresses but are on the same network. Before running lansync the rsync command fails dues to missing permissions, but once the public key of the machine on the right is imported, rsync succeeds and the file is successfully sent.

Currently key importing can be done in several ways with -i or --import:

  • Raw string of passed
  • Read from a file
  • Github username

Note that for each of the last two, if multiple keys are found, they will all be added.

Now since you are importing other people's (hopefully ones you trust) keys it would be a good idea to limit the share directory in some way. You don't want people trolling you by sending 100GB files just do troll you and leave with without any free space.

Share size limit

How does it work?

When you run lansync --size <some size> a file is created with that size on your machine in the ~/.lansync/ directory. Afterwards that file is formatted as a disk image and a single ext4 partition is setup.

Mounting filesystems requires sudo access so it has been left up to you to mount the new filesystem in you share directory. The application tells you how to do that exactly in a secure way.

Essentially, people are sharing files to your virtual filesystem that you can delete anytime you want without affecting the rest of your system.

Installation

Currently I do no provide a single binary so I recommend installing dependencies in a virtual environment:

$ git clone git@github.com:ViktorBarzin/lansync.git
$ pip install -r requirements.txt

See help with

$ python lansync.py -h

TODO:

  • add PyPi package/binary
  • smb support

Known issues

  • Since the app is composed of multiple files, moving any of them to another directory may result if failure to run. (Paths are painful)

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

lansync-0.0.1.tar.gz (88.3 kB view details)

Uploaded Source

Built Distribution

lansync-0.0.1-py3-none-any.whl (88.9 kB view details)

Uploaded Python 3

File details

Details for the file lansync-0.0.1.tar.gz.

File metadata

  • Download URL: lansync-0.0.1.tar.gz
  • Upload date:
  • Size: 88.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for lansync-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c90932dde75f0097c8a8360174cd9166eca79fbb6a234fe08f9356d6a71dc0ba
MD5 827ba66c2a01a76067417a7083fe10a1
BLAKE2b-256 1f097db970f614f09a2ae416978a80e9633d6905b8a87bba1b94446b82a7c461

See more details on using hashes here.

File details

Details for the file lansync-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: lansync-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 88.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

File hashes

Hashes for lansync-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4b4f4d896163818ffbc24bfa92f3d7504c676c4d249654afe1887f8aad45d54
MD5 2b437a5b1a5603c0ecf680e14debaf98
BLAKE2b-256 2b403568eb07d1606021cd796cb87cb49bee4adf801c9d25868d8318286e3532

See more details on using hashes here.

Supported by

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