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
Or install from source:
git clone https://github.com/skyhook/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:
serve 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
.zipfolder 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.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
- Issues: GitHub Issues
- Documentation: GitHub Wiki
Made with โค๏ธ by the Skyhook team
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file skyhook_rayan-1.1.0.tar.gz.
File metadata
- Download URL: skyhook_rayan-1.1.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d35a94a82b6766e5d30c16e1f62bb2f6796ee6b139edc97a32cd69815e20881
|
|
| MD5 |
09ce2d0b40e22c7177163febfbc25bcc
|
|
| BLAKE2b-256 |
5a9bb4a983698a0f948e1e48c5f7bb8fd7897f499de0072846f93de56ffc0da2
|
File details
Details for the file skyhook_rayan-1.1.0-py3-none-any.whl.
File metadata
- Download URL: skyhook_rayan-1.1.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49feac6e5e42e80eed649b11ba6eb0c9f3141eedb38ea170d6246b2343ffa04b
|
|
| MD5 |
52fe58bf9b009fab379a7551fd20782b
|
|
| BLAKE2b-256 |
ecea3e6dd0118d07583a4537b1a0b5fe7c9481e3e8508ab9487059216dc37355
|