Skip to main content

A simple tool to share files and directories over LAN or internet.

Project description

ShareDir

ShareDir is a simple and convenient Python-based tool that allows you to share files and directories over LAN or the internet using a single command. Whether you're looking to stream movies from your laptop to your phone, share files between devices connected to the same WiFi network, or host a directory from your VPS, ShareDir makes it easy with an embedded HTTP server and passphrase protection.

The tool generates a shareable URL, including a secure passphrase, that can be shared across devices. You can scan the auto generaed QR code for easy file and folder sharing.

Features

  • Simple File and Directory Sharing: Share files and entire directories over LAN or the internet with just one command.
  • QR Code for Quick Access: The tool generates a QR code, making it easy to access the shareable URL from any device.
  • Passphrase Protection: Each session is protected with a generated passphrase to prevent unauthorized access.
  • Blacklist: IPs with excessive failed login attempts are blacklisted for a set duration to prevent bruteforcing or dictionary attacks.
  • Dark Mode Interface: Built-in support for dark mode in the web interface for comfortable browsing.
  • LAN and Internet Access: Share files within your local network or use a public IP address from a VPS to share across the internet.

Installation

There are two ways to install ShareDir: via pip or cloning the repository directly from GitHub.

Option 1: Install via pip

The easiest way to install ShareDir is by using pip. You can install the tool with the following command:

pip install sharedir

Option 2: Install via git clone

You can also install ShareDir by cloning the repository from GitHub and manually installing the dependencies:

  1. Clone the repository:

    git clone https://github.com/spignelon/ShareDir.git
    cd ShareDir
    
  2. Install the dependencies using pip:

    pip install -r requirements.txt
    

Usage

ShareDir allows you to share a file or directory over LAN or the internet using a single command. Below are the usage instructions for both installation methods.

Basic Usage

After installation, you can share a file or directory by running the following command:

sharedir /path/to/file/or/directory

This command will start a local HTTP server that serves the specified file or directory. The server will display a shareable URL and a QR code for quick access.

Options

  • path (required): The path to the file or directory you wish to share.
  • --passphrase-length or -p (optional): Specify the number of words in the passphrase (default is 4).

Example

To share a directory named movies with a passphrase of 6 words:

sharedir ~/movies -p 6

OR

python sharedir/sharedir.py ~/movies -p 6

This will output something like:

Generated passphrase: grape-apple-banana-orange-kiwi-lemon
Access URL: http://192.168.1.100:44447/?passphrase=grape-apple-banana-orange-kiwi-lemon

You can access this URL from any device connected to the same network, or scan the displayed QR code with your phone.

Accessing Files

Once the server is running, navigate to the provided URL in a web browser or use the QR code. You'll be prompted to enter the passphrase in the URL parameters. For example:

http://192.168.1.100:44447/?passphrase=grape-apple-banana-orange-kiwi-lemon

From here, you can browse and download files directly from the web interface.

Sharing Over the Internet

If you're on a VPS with a public IP, the tool will automatically generate a QR code and the URL using your VPS's public IP. Share this URL with to device on the internet to access the shared directory or file.

License

This project is licensed under the GNU Affero General Public License v3.0. See the LICENSE file for details.
GNU AGPLv3.0 Image

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

sharedir-1.0.1.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

sharedir-1.0.1-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

File details

Details for the file sharedir-1.0.1.tar.gz.

File metadata

  • Download URL: sharedir-1.0.1.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for sharedir-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ac8f66b6bacb9b7ea1a8694e3a32f2ea1d56eac373f3a36e9b65cb2f4499c6ce
MD5 f9c2303eb382e24a4b52572264094359
BLAKE2b-256 9f70f509842a5fb672939bfaedf10ae557afb6fd4c7c20c0e27d98b23864d493

See more details on using hashes here.

File details

Details for the file sharedir-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sharedir-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for sharedir-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8caaeb67ef72e700c5ebfb5687fb975212b65409f62c627e09c2ce7f088086fa
MD5 e80ee9b34ce48702883b2e9614cd6445
BLAKE2b-256 1269379c377cc932190b3ebd40a6cf3a6543211c1881dadc516d55c8feb8552d

See more details on using hashes here.

Supported by

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