Skip to main content

A secure, zero-config CLI file server with upload capabilities and encrypted transport

Project description

๐Ÿช Skyhook

A secure, zero-config CLI file server with upload capabilities and encrypted transport

Skyhook is a modern replacement for python -m http.server with authentication, HTTPS support, and file upload capabilities. Perfect for quickly sharing files between machines or within a local network.

โœจ Features

  • ๐Ÿ” Secure by Default: Optional HTTP Basic Auth and self-signed SSL certificates
  • ๐Ÿ“ค Upload Support: Drag-and-drop file uploads via web interface
  • โšก Fast: Launch a server in any directory in under 1 second
  • ๐ŸŽจ Modern UI: Beautiful, responsive web interface that works on mobile
  • ๐Ÿ” Search & Filter: Quickly find files in large directories
  • ๐Ÿ›ก๏ธ Security Hardened: Path sanitization prevents directory traversal attacks
  • ๐Ÿ“ฑ Mobile Friendly: Upload files from your phone's browser

๐Ÿš€ Quick Start

Installation

pip install skyhook-rayan

Or install from source:

git clone https://github.com/rayan-1005/skyhook.git
cd skyhook
pip install -e .

Basic Usage

# Serve current directory on port 8000
skyhook

# Serve a specific directory
skyhook /path/to/files

# Custom port
skyhook --port 8080

# Enable authentication
skyhook --auth username:password

# Enable HTTPS with self-signed certificate
skyhook --ssl

# Full configuration
skyhook /data --port 8443 --auth admin:secret --ssl

๐Ÿ“– Usage Examples

Simple File Sharing

Share files in the current directory:

skyhook

Then visit http://localhost:8000 in your browser.

Secure File Transfer

Enable authentication and HTTPS for secure transfers:

skyhook --auth myuser:mypass --ssl

Access via https://localhost:8000 (you'll need to accept the self-signed certificate warning).

Remote Access

Bind to all interfaces to allow remote connections:

skyhook --host 0.0.0.0 --port 8000 --auth user:pass

Now accessible from other devices on your network at http://YOUR_IP:8000.

Quick File Upload

Upload files to a specific directory:

cd /tmp/uploads
skyhook --auth upload:secret

Open the URL in your browser and drag files to upload.

๐ŸŽฏ Use Cases

  • Dev Workflow: Quickly share build artifacts between machines
  • Network Transfers: Move files between computers without USB drives
  • Mobile Uploads: Upload photos from your phone to your computer
  • Team Collaboration: Share files within a local network
  • Remote Work: Securely transfer files to/from a remote server

๐Ÿ”’ Security Features

Authentication

HTTP Basic Authentication protects your files from unauthorized access:

skyhook --auth username:password

Credentials are checked using constant-time comparison to prevent timing attacks.

SSL/TLS Encryption

Enable HTTPS to encrypt all traffic:

skyhook --ssl

Skyhook automatically generates a self-signed certificate. For production use, configure a proper certificate with a reverse proxy like nginx.

Path Sanitization

All file paths are strictly validated to prevent directory traversal attacks. Attempts to access files outside the served directory are blocked:

# These attacks are automatically prevented:
../../../etc/passwd  โŒ Blocked
../../secret.txt     โŒ Blocked
/etc/hosts           โŒ Blocked

๐Ÿ”ง CLI Reference

Usage: skyhook [PATH] [OPTIONS]

Arguments:
  PATH  Directory to serve [default: current directory]

Options:
  -p, --port INTEGER       Port to bind to [default: 8000]
  -h, --host TEXT          Host interface to bind to [default: 0.0.0.0]
  -a, --auth TEXT          Enable auth (format: username:password)
  --ssl                    Enable HTTPS with self-signed certificate
  --reload                 Enable auto-reload for development
  --help                   Show this message and exit

Commands:
  run    Start the file server (default command)
  version  Show Skyhook version

๐ŸŒ API Endpoints

Skyhook provides a RESTful API:

Endpoint Method Description
/ GET List root directory
/browse/{path} GET List specific directory
/download/{path} GET Download a file
/upload POST Upload files
/health GET Health check

Upload via curl

# Upload single file
curl -F "files=@myfile.txt" http://localhost:8000/upload

# Upload with authentication
curl -u username:password -F "files=@myfile.txt" http://localhost:8000/upload

# Upload multiple files
curl -F "files=@file1.txt" -F "files=@file2.txt" http://localhost:8000/upload

# Upload to subdirectory
curl -F "files=@myfile.txt" -F "path=subdir" http://localhost:8000/upload

๐Ÿงช Development

Running Tests

# Install development dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/ -v

# Run security tests specifically
pytest tests/test_skyhook.py::TestSecurity -v

Project Structure

skyhook/
โ”œโ”€โ”€ src/
โ”‚   โ””โ”€โ”€ skyhook/
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ”œโ”€โ”€ main.py          # CLI entrypoint
โ”‚       โ”œโ”€โ”€ server.py        # FastAPI application
โ”‚       โ”œโ”€โ”€ security.py      # Auth & SSL logic
โ”‚       โ””โ”€โ”€ templates/
โ”‚           โ””โ”€โ”€ index.html   # Web UI
โ”œโ”€โ”€ tests/
โ”‚   โ””โ”€โ”€ test_skyhook.py      # Test suite
โ”œโ”€โ”€ pyproject.toml           # Project metadata
โ””โ”€โ”€ README.md

๐Ÿ“Š Performance

  • Memory footprint: < 100MB during 1GB file transfers
  • Startup time: < 1 second
  • Concurrent uploads: Supported via async I/O
  • Large files: Handled efficiently with chunked streaming

๐Ÿ—บ๏ธ Roadmap

v1.1 (Planned)

  • Support for .zip folder downloads
  • Directory compression on-the-fly
  • File preview for common formats

v1.2 (Planned)

  • Searchable file indexing for deep directories
  • Advanced filtering (by date, size, type)
  • Thumbnail generation for images

v2.0 (Future)

  • P2P mode using WebRTC (bypass firewalls)
  • End-to-end encryption
  • Multi-user support with permissions

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“ License

MIT License - see LICENSE file for details

๐Ÿ™ Acknowledgments

โš ๏ธ Security Notes

  • Self-signed SSL certificates will trigger browser warnings (this is expected)
  • For production use, configure proper SSL certificates via reverse proxy
  • Always use authentication when exposing to untrusted networks
  • Keep dependencies updated for security patches

๐Ÿ“ž Support


Made with โค๏ธ by the Rayan

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

skyhook_rayan-1.1.1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

skyhook_rayan-1.1.1-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file skyhook_rayan-1.1.1.tar.gz.

File metadata

  • Download URL: skyhook_rayan-1.1.1.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for skyhook_rayan-1.1.1.tar.gz
Algorithm Hash digest
SHA256 5d35efdb93942918e9106d9f682577c1f63e593c3e7041a000285bb4a2fc556a
MD5 d594a37d3651aa31c1ebb3941f07b3f7
BLAKE2b-256 34df3fc0acd6b25d1d59f6232c850b141846536030afabee29e98c0da83eae06

See more details on using hashes here.

File details

Details for the file skyhook_rayan-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: skyhook_rayan-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for skyhook_rayan-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f60d2cd5bffa9d3127e1c96ebe63e5a9e4d323d03facb6984fc20f0f7850e9aa
MD5 541a6da801378f2b4446591194bb601e
BLAKE2b-256 17b7ea386e7f71261cf4f7ed649def194ea1ded18e10abe7670624bb43efb560

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