Skip to main content

Zero-configuration LAN file sharing and real-time text clipboard

Project description

SharedServer

SharedServer is a zero-configuration, login-free LAN file server and real-time text clipboard. It is as easy to start as python -m http.server, while adding uploads, directory browsing, live text synchronization, and allowlisted clipboard actions.

SharedServer has no authentication. Run it only on a trusted home, lab, or development network. Never expose it directly to the public internet.

Features

  • A shared text clipboard synchronized between all open pages over WebSocket
  • A responsive file browser with directory navigation, file sizes, and modification times
  • File uploads from desktop and mobile browsers with live progress
  • Folder creation and safe, non-overwriting uploads
  • Copy actions for allowlisted text and image formats
  • Download-only behavior for other formats such as ZIP, RAR, 7z, EXE, APK, and ISO
  • Protection against path traversal, directory escape, symlink escape, and unsafe filenames
  • No accounts, database, device discovery, template engine, or frontend framework

Requirements

  • Python 3.10 or newer
  • A modern desktop or mobile browser

Installation

Install from PyPI:

pip install sharedserver

Install from source:

git clone https://github.com/NihaoKangkang/sharedserver.git
cd sharedserver
pip install .

Quick start

Run this command from the directory you want to share:

python -m sharedserver 8080

CLI reference

usage: sharedserver [-h] [--host HOST] [-d DIRECTORY] [-c CONFIG]
                    [--max-upload-size MB] [--version]
                    [port]
Argument Description
port Listening port. Uses the configuration value or 8000 by default.
--host HOST Bind address. Defaults to 0.0.0.0.
-d, --directory PATH Directory to share. Defaults to the current directory.
-c, --config PATH YAML configuration file.
--max-upload-size MB Maximum upload size in MiB. Defaults to 1024 MiB.
--version Print the installed version.

CLI arguments override configuration file values. Without --config, SharedServer automatically loads sharedserver.yaml from the current directory when it exists.

Configuration

Copy sharedserver.example.yaml to sharedserver.yaml and edit it as needed:

server:
  host: 0.0.0.0
  port: 8080

share:
  directory: ./
  max_upload_size: 1073741824

clipboard:
  max_text_size: 2097152
  text_extensions:
    - .txt
    - .md
  image_extensions:
    - .png
    - .jpg

Relative shared directory paths are resolved from the configuration file's directory. Custom extension lists replace the defaults, and matching is case-insensitive.

Default text extensions:

.txt .md .json .xml .yaml .yml .csv .log .py .js .html .css .java .c .cpp

Default image extensions:

.png .jpg .jpeg .webp

Security model

  • Every user-supplied path is resolved with Path.resolve() and checked against the shared root.
  • Absolute paths and .. path segments are rejected.
  • Symlinks are hidden from directory listings and rejected by file operations.
  • Upload filenames are stripped of path components, control characters, and unsafe cross-platform characters.
  • Uploads are written to a temporary file and published without overwriting an existing file.
  • Both Content-Length validation and streamed byte counting enforce the upload limit.
  • Clipboard actions and server read endpoints use the same strict extension allowlists.
  • Browser WebSocket connections from a different origin are rejected.
  • Shared text exists only in process memory and is cleared when the server stops.

SharedServer intentionally has no login or authorization layer. Every device that can reach the server can read and write the shared directory and shared text.

Development

Clone the project and create a virtual environment:

git clone https://github.com/NihaoKangkang/sharedserver.git
cd sharedserver
python -m venv .venv

Activate the environment, then install development dependencies:

pip install -e ".[dev]"

Start a development server:

python -m sharedserver 8080 --directory .

License

MIT

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

sharedserver-0.1.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

sharedserver-0.1.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file sharedserver-0.1.0.tar.gz.

File metadata

  • Download URL: sharedserver-0.1.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sharedserver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f309f45b1a467e56cf233bf06f9ba9a783ac6a75e6da7c09a6413b24bff4e652
MD5 a796a28093054b238510eaf47b85b30f
BLAKE2b-256 099c3a72f5f21345f62c3917837f03f359429be847a53a9302c38917c3933e38

See more details on using hashes here.

Provenance

The following attestation bundles were made for sharedserver-0.1.0.tar.gz:

Publisher: publish.yml on NihaoKangkang/sharedserver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sharedserver-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sharedserver-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for sharedserver-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 698bbc9225f3e519021b716dec604f8e5b295a7bd27a7cf34712c70bde172bf7
MD5 e1b01d0545a242f0838d08bab7a12017
BLAKE2b-256 3929ca31a787485d37821f5863a0edf92a06748068b2b22cf1750bf231438676

See more details on using hashes here.

Provenance

The following attestation bundles were made for sharedserver-0.1.0-py3-none-any.whl:

Publisher: publish.yml on NihaoKangkang/sharedserver

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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