skyhook-rayan 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- skyhook_rayan-1.0.0/PKG-INFO +313 -0
- skyhook_rayan-1.0.0/README.md +282 -0
- skyhook_rayan-1.0.0/pyproject.toml +56 -0
- skyhook_rayan-1.0.0/setup.cfg +4 -0
- skyhook_rayan-1.0.0/src/skyhook/__init__.py +10 -0
- skyhook_rayan-1.0.0/src/skyhook/main.py +157 -0
- skyhook_rayan-1.0.0/src/skyhook/security.py +173 -0
- skyhook_rayan-1.0.0/src/skyhook/server.py +250 -0
- skyhook_rayan-1.0.0/src/skyhook/templates/index.html +480 -0
- skyhook_rayan-1.0.0/src/skyhook_rayan.egg-info/PKG-INFO +313 -0
- skyhook_rayan-1.0.0/src/skyhook_rayan.egg-info/SOURCES.txt +14 -0
- skyhook_rayan-1.0.0/src/skyhook_rayan.egg-info/dependency_links.txt +1 -0
- skyhook_rayan-1.0.0/src/skyhook_rayan.egg-info/entry_points.txt +2 -0
- skyhook_rayan-1.0.0/src/skyhook_rayan.egg-info/requires.txt +11 -0
- skyhook_rayan-1.0.0/src/skyhook_rayan.egg-info/top_level.txt +1 -0
- skyhook_rayan-1.0.0/tests/test_skyhook.py +248 -0
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: skyhook-rayan
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A secure, zero-config CLI file server with upload capabilities and encrypted transport
|
|
5
|
+
Author: Skyhook Contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/skyhook/skyhook
|
|
8
|
+
Project-URL: Documentation, https://github.com/skyhook/skyhook#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/skyhook/skyhook
|
|
10
|
+
Keywords: file-server,upload,cli,fastapi,security
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Requires-Python: >=3.9
|
|
20
|
+
Description-Content-Type: text/markdown
|
|
21
|
+
Requires-Dist: fastapi>=0.109.0
|
|
22
|
+
Requires-Dist: uvicorn[standard]>=0.27.0
|
|
23
|
+
Requires-Dist: python-multipart>=0.0.6
|
|
24
|
+
Requires-Dist: jinja2>=3.1.2
|
|
25
|
+
Requires-Dist: typer>=0.9.0
|
|
26
|
+
Requires-Dist: cryptography>=41.0.0
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
30
|
+
Requires-Dist: httpx>=0.26.0; extra == "dev"
|
|
31
|
+
|
|
32
|
+
# π Skyhook
|
|
33
|
+
|
|
34
|
+
> A secure, zero-config CLI file server with upload capabilities and encrypted transport
|
|
35
|
+
|
|
36
|
+
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.
|
|
37
|
+
|
|
38
|
+
## β¨ Features
|
|
39
|
+
|
|
40
|
+
- **π Secure by Default**: Optional HTTP Basic Auth and self-signed SSL certificates
|
|
41
|
+
- **π€ Upload Support**: Drag-and-drop file uploads via web interface
|
|
42
|
+
- **β‘ Fast**: Launch a server in any directory in under 1 second
|
|
43
|
+
- **π¨ Modern UI**: Beautiful, responsive web interface that works on mobile
|
|
44
|
+
- **π Search & Filter**: Quickly find files in large directories
|
|
45
|
+
- **π‘οΈ Security Hardened**: Path sanitization prevents directory traversal attacks
|
|
46
|
+
- **π± Mobile Friendly**: Upload files from your phone's browser
|
|
47
|
+
|
|
48
|
+
## π Quick Start
|
|
49
|
+
|
|
50
|
+
### Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pip install skyhook
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Or install from source:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
git clone https://github.com/skyhook/skyhook.git
|
|
60
|
+
cd skyhook
|
|
61
|
+
pip install -e .
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Basic Usage
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
# Serve current directory on port 8000
|
|
68
|
+
skyhook
|
|
69
|
+
|
|
70
|
+
# Serve a specific directory
|
|
71
|
+
skyhook /path/to/files
|
|
72
|
+
|
|
73
|
+
# Custom port
|
|
74
|
+
skyhook --port 8080
|
|
75
|
+
|
|
76
|
+
# Enable authentication
|
|
77
|
+
skyhook --auth username:password
|
|
78
|
+
|
|
79
|
+
# Enable HTTPS with self-signed certificate
|
|
80
|
+
skyhook --ssl
|
|
81
|
+
|
|
82
|
+
# Full configuration
|
|
83
|
+
skyhook /data --port 8443 --auth admin:secret --ssl
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## π Usage Examples
|
|
87
|
+
|
|
88
|
+
### Simple File Sharing
|
|
89
|
+
|
|
90
|
+
Share files in the current directory:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
skyhook
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Then visit `http://localhost:8000` in your browser.
|
|
97
|
+
|
|
98
|
+
### Secure File Transfer
|
|
99
|
+
|
|
100
|
+
Enable authentication and HTTPS for secure transfers:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
skyhook --auth myuser:mypass --ssl
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Access via `https://localhost:8000` (you'll need to accept the self-signed certificate warning).
|
|
107
|
+
|
|
108
|
+
### Remote Access
|
|
109
|
+
|
|
110
|
+
Bind to all interfaces to allow remote connections:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
skyhook --host 0.0.0.0 --port 8000 --auth user:pass
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Now accessible from other devices on your network at `http://YOUR_IP:8000`.
|
|
117
|
+
|
|
118
|
+
### Quick File Upload
|
|
119
|
+
|
|
120
|
+
Upload files to a specific directory:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
cd /tmp/uploads
|
|
124
|
+
skyhook --auth upload:secret
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Open the URL in your browser and drag files to upload.
|
|
128
|
+
|
|
129
|
+
## π― Use Cases
|
|
130
|
+
|
|
131
|
+
- **Dev Workflow**: Quickly share build artifacts between machines
|
|
132
|
+
- **Network Transfers**: Move files between computers without USB drives
|
|
133
|
+
- **Mobile Uploads**: Upload photos from your phone to your computer
|
|
134
|
+
- **Team Collaboration**: Share files within a local network
|
|
135
|
+
- **Remote Work**: Securely transfer files to/from a remote server
|
|
136
|
+
|
|
137
|
+
## π Security Features
|
|
138
|
+
|
|
139
|
+
### Authentication
|
|
140
|
+
|
|
141
|
+
HTTP Basic Authentication protects your files from unauthorized access:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
skyhook --auth username:password
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Credentials are checked using constant-time comparison to prevent timing attacks.
|
|
148
|
+
|
|
149
|
+
### SSL/TLS Encryption
|
|
150
|
+
|
|
151
|
+
Enable HTTPS to encrypt all traffic:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
skyhook --ssl
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Skyhook automatically generates a self-signed certificate. For production use, configure a proper certificate with a reverse proxy like nginx.
|
|
158
|
+
|
|
159
|
+
### Path Sanitization
|
|
160
|
+
|
|
161
|
+
All file paths are strictly validated to prevent directory traversal attacks. Attempts to access files outside the served directory are blocked:
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
# These attacks are automatically prevented:
|
|
165
|
+
../../../etc/passwd β Blocked
|
|
166
|
+
../../secret.txt β Blocked
|
|
167
|
+
/etc/hosts β Blocked
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## π§ CLI Reference
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
Usage: skyhook [PATH] [OPTIONS]
|
|
174
|
+
|
|
175
|
+
Arguments:
|
|
176
|
+
PATH Directory to serve [default: current directory]
|
|
177
|
+
|
|
178
|
+
Options:
|
|
179
|
+
-p, --port INTEGER Port to bind to [default: 8000]
|
|
180
|
+
-h, --host TEXT Host interface to bind to [default: 0.0.0.0]
|
|
181
|
+
-a, --auth TEXT Enable auth (format: username:password)
|
|
182
|
+
--ssl Enable HTTPS with self-signed certificate
|
|
183
|
+
--reload Enable auto-reload for development
|
|
184
|
+
--help Show this message and exit
|
|
185
|
+
|
|
186
|
+
Commands:
|
|
187
|
+
serve Start the file server (default command)
|
|
188
|
+
version Show Skyhook version
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## π API Endpoints
|
|
192
|
+
|
|
193
|
+
Skyhook provides a RESTful API:
|
|
194
|
+
|
|
195
|
+
| Endpoint | Method | Description |
|
|
196
|
+
| ------------------ | ------ | ----------------------- |
|
|
197
|
+
| `/` | GET | List root directory |
|
|
198
|
+
| `/browse/{path}` | GET | List specific directory |
|
|
199
|
+
| `/download/{path}` | GET | Download a file |
|
|
200
|
+
| `/upload` | POST | Upload files |
|
|
201
|
+
| `/health` | GET | Health check |
|
|
202
|
+
|
|
203
|
+
### Upload via curl
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Upload single file
|
|
207
|
+
curl -F "files=@myfile.txt" http://localhost:8000/upload
|
|
208
|
+
|
|
209
|
+
# Upload with authentication
|
|
210
|
+
curl -u username:password -F "files=@myfile.txt" http://localhost:8000/upload
|
|
211
|
+
|
|
212
|
+
# Upload multiple files
|
|
213
|
+
curl -F "files=@file1.txt" -F "files=@file2.txt" http://localhost:8000/upload
|
|
214
|
+
|
|
215
|
+
# Upload to subdirectory
|
|
216
|
+
curl -F "files=@myfile.txt" -F "path=subdir" http://localhost:8000/upload
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## π§ͺ Development
|
|
220
|
+
|
|
221
|
+
### Running Tests
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# Install development dependencies
|
|
225
|
+
pip install -e ".[dev]"
|
|
226
|
+
|
|
227
|
+
# Run tests
|
|
228
|
+
pytest tests/ -v
|
|
229
|
+
|
|
230
|
+
# Run security tests specifically
|
|
231
|
+
pytest tests/test_skyhook.py::TestSecurity -v
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Project Structure
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
skyhook/
|
|
238
|
+
βββ src/
|
|
239
|
+
β βββ skyhook/
|
|
240
|
+
β βββ __init__.py
|
|
241
|
+
β βββ main.py # CLI entrypoint
|
|
242
|
+
β βββ server.py # FastAPI application
|
|
243
|
+
β βββ security.py # Auth & SSL logic
|
|
244
|
+
β βββ templates/
|
|
245
|
+
β βββ index.html # Web UI
|
|
246
|
+
βββ tests/
|
|
247
|
+
β βββ test_skyhook.py # Test suite
|
|
248
|
+
βββ pyproject.toml # Project metadata
|
|
249
|
+
βββ README.md
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## π Performance
|
|
253
|
+
|
|
254
|
+
- **Memory footprint**: < 100MB during 1GB file transfers
|
|
255
|
+
- **Startup time**: < 1 second
|
|
256
|
+
- **Concurrent uploads**: Supported via async I/O
|
|
257
|
+
- **Large files**: Handled efficiently with chunked streaming
|
|
258
|
+
|
|
259
|
+
## πΊοΈ Roadmap
|
|
260
|
+
|
|
261
|
+
### v1.1 (Planned)
|
|
262
|
+
|
|
263
|
+
- [ ] Support for `.zip` folder downloads
|
|
264
|
+
- [ ] Directory compression on-the-fly
|
|
265
|
+
- [ ] File preview for common formats
|
|
266
|
+
|
|
267
|
+
### v1.2 (Planned)
|
|
268
|
+
|
|
269
|
+
- [ ] Searchable file indexing for deep directories
|
|
270
|
+
- [ ] Advanced filtering (by date, size, type)
|
|
271
|
+
- [ ] Thumbnail generation for images
|
|
272
|
+
|
|
273
|
+
### v2.0 (Future)
|
|
274
|
+
|
|
275
|
+
- [ ] P2P mode using WebRTC (bypass firewalls)
|
|
276
|
+
- [ ] End-to-end encryption
|
|
277
|
+
- [ ] Multi-user support with permissions
|
|
278
|
+
|
|
279
|
+
## π€ Contributing
|
|
280
|
+
|
|
281
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
282
|
+
|
|
283
|
+
1. Fork the repository
|
|
284
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
285
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
286
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
287
|
+
5. Open a Pull Request
|
|
288
|
+
|
|
289
|
+
## π License
|
|
290
|
+
|
|
291
|
+
MIT License - see LICENSE file for details
|
|
292
|
+
|
|
293
|
+
## π Acknowledgments
|
|
294
|
+
|
|
295
|
+
- Built with [FastAPI](https://fastapi.tiangolo.com/)
|
|
296
|
+
- Powered by [Uvicorn](https://www.uvicorn.org/)
|
|
297
|
+
- CLI built with [Typer](https://typer.tiangolo.com/)
|
|
298
|
+
|
|
299
|
+
## β οΈ Security Notes
|
|
300
|
+
|
|
301
|
+
- Self-signed SSL certificates will trigger browser warnings (this is expected)
|
|
302
|
+
- For production use, configure proper SSL certificates via reverse proxy
|
|
303
|
+
- Always use authentication when exposing to untrusted networks
|
|
304
|
+
- Keep dependencies updated for security patches
|
|
305
|
+
|
|
306
|
+
## π Support
|
|
307
|
+
|
|
308
|
+
- Issues: [GitHub Issues](https://github.com/skyhook/skyhook/issues)
|
|
309
|
+
- Documentation: [GitHub Wiki](https://github.com/skyhook/skyhook/wiki)
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
Made with β€οΈ by the Skyhook team
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# π Skyhook
|
|
2
|
+
|
|
3
|
+
> A secure, zero-config CLI file server with upload capabilities and encrypted transport
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
## β¨ Features
|
|
8
|
+
|
|
9
|
+
- **π Secure by Default**: Optional HTTP Basic Auth and self-signed SSL certificates
|
|
10
|
+
- **π€ Upload Support**: Drag-and-drop file uploads via web interface
|
|
11
|
+
- **β‘ Fast**: Launch a server in any directory in under 1 second
|
|
12
|
+
- **π¨ Modern UI**: Beautiful, responsive web interface that works on mobile
|
|
13
|
+
- **π Search & Filter**: Quickly find files in large directories
|
|
14
|
+
- **π‘οΈ Security Hardened**: Path sanitization prevents directory traversal attacks
|
|
15
|
+
- **π± Mobile Friendly**: Upload files from your phone's browser
|
|
16
|
+
|
|
17
|
+
## π Quick Start
|
|
18
|
+
|
|
19
|
+
### Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install skyhook
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or install from source:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
git clone https://github.com/skyhook/skyhook.git
|
|
29
|
+
cd skyhook
|
|
30
|
+
pip install -e .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Basic Usage
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Serve current directory on port 8000
|
|
37
|
+
skyhook
|
|
38
|
+
|
|
39
|
+
# Serve a specific directory
|
|
40
|
+
skyhook /path/to/files
|
|
41
|
+
|
|
42
|
+
# Custom port
|
|
43
|
+
skyhook --port 8080
|
|
44
|
+
|
|
45
|
+
# Enable authentication
|
|
46
|
+
skyhook --auth username:password
|
|
47
|
+
|
|
48
|
+
# Enable HTTPS with self-signed certificate
|
|
49
|
+
skyhook --ssl
|
|
50
|
+
|
|
51
|
+
# Full configuration
|
|
52
|
+
skyhook /data --port 8443 --auth admin:secret --ssl
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## π Usage Examples
|
|
56
|
+
|
|
57
|
+
### Simple File Sharing
|
|
58
|
+
|
|
59
|
+
Share files in the current directory:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
skyhook
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Then visit `http://localhost:8000` in your browser.
|
|
66
|
+
|
|
67
|
+
### Secure File Transfer
|
|
68
|
+
|
|
69
|
+
Enable authentication and HTTPS for secure transfers:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
skyhook --auth myuser:mypass --ssl
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Access via `https://localhost:8000` (you'll need to accept the self-signed certificate warning).
|
|
76
|
+
|
|
77
|
+
### Remote Access
|
|
78
|
+
|
|
79
|
+
Bind to all interfaces to allow remote connections:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
skyhook --host 0.0.0.0 --port 8000 --auth user:pass
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Now accessible from other devices on your network at `http://YOUR_IP:8000`.
|
|
86
|
+
|
|
87
|
+
### Quick File Upload
|
|
88
|
+
|
|
89
|
+
Upload files to a specific directory:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
cd /tmp/uploads
|
|
93
|
+
skyhook --auth upload:secret
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Open the URL in your browser and drag files to upload.
|
|
97
|
+
|
|
98
|
+
## π― Use Cases
|
|
99
|
+
|
|
100
|
+
- **Dev Workflow**: Quickly share build artifacts between machines
|
|
101
|
+
- **Network Transfers**: Move files between computers without USB drives
|
|
102
|
+
- **Mobile Uploads**: Upload photos from your phone to your computer
|
|
103
|
+
- **Team Collaboration**: Share files within a local network
|
|
104
|
+
- **Remote Work**: Securely transfer files to/from a remote server
|
|
105
|
+
|
|
106
|
+
## π Security Features
|
|
107
|
+
|
|
108
|
+
### Authentication
|
|
109
|
+
|
|
110
|
+
HTTP Basic Authentication protects your files from unauthorized access:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
skyhook --auth username:password
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Credentials are checked using constant-time comparison to prevent timing attacks.
|
|
117
|
+
|
|
118
|
+
### SSL/TLS Encryption
|
|
119
|
+
|
|
120
|
+
Enable HTTPS to encrypt all traffic:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
skyhook --ssl
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Skyhook automatically generates a self-signed certificate. For production use, configure a proper certificate with a reverse proxy like nginx.
|
|
127
|
+
|
|
128
|
+
### Path Sanitization
|
|
129
|
+
|
|
130
|
+
All file paths are strictly validated to prevent directory traversal attacks. Attempts to access files outside the served directory are blocked:
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
# These attacks are automatically prevented:
|
|
134
|
+
../../../etc/passwd β Blocked
|
|
135
|
+
../../secret.txt β Blocked
|
|
136
|
+
/etc/hosts β Blocked
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## π§ CLI Reference
|
|
140
|
+
|
|
141
|
+
```
|
|
142
|
+
Usage: skyhook [PATH] [OPTIONS]
|
|
143
|
+
|
|
144
|
+
Arguments:
|
|
145
|
+
PATH Directory to serve [default: current directory]
|
|
146
|
+
|
|
147
|
+
Options:
|
|
148
|
+
-p, --port INTEGER Port to bind to [default: 8000]
|
|
149
|
+
-h, --host TEXT Host interface to bind to [default: 0.0.0.0]
|
|
150
|
+
-a, --auth TEXT Enable auth (format: username:password)
|
|
151
|
+
--ssl Enable HTTPS with self-signed certificate
|
|
152
|
+
--reload Enable auto-reload for development
|
|
153
|
+
--help Show this message and exit
|
|
154
|
+
|
|
155
|
+
Commands:
|
|
156
|
+
serve Start the file server (default command)
|
|
157
|
+
version Show Skyhook version
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## π API Endpoints
|
|
161
|
+
|
|
162
|
+
Skyhook provides a RESTful API:
|
|
163
|
+
|
|
164
|
+
| Endpoint | Method | Description |
|
|
165
|
+
| ------------------ | ------ | ----------------------- |
|
|
166
|
+
| `/` | GET | List root directory |
|
|
167
|
+
| `/browse/{path}` | GET | List specific directory |
|
|
168
|
+
| `/download/{path}` | GET | Download a file |
|
|
169
|
+
| `/upload` | POST | Upload files |
|
|
170
|
+
| `/health` | GET | Health check |
|
|
171
|
+
|
|
172
|
+
### Upload via curl
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# Upload single file
|
|
176
|
+
curl -F "files=@myfile.txt" http://localhost:8000/upload
|
|
177
|
+
|
|
178
|
+
# Upload with authentication
|
|
179
|
+
curl -u username:password -F "files=@myfile.txt" http://localhost:8000/upload
|
|
180
|
+
|
|
181
|
+
# Upload multiple files
|
|
182
|
+
curl -F "files=@file1.txt" -F "files=@file2.txt" http://localhost:8000/upload
|
|
183
|
+
|
|
184
|
+
# Upload to subdirectory
|
|
185
|
+
curl -F "files=@myfile.txt" -F "path=subdir" http://localhost:8000/upload
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## π§ͺ Development
|
|
189
|
+
|
|
190
|
+
### Running Tests
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
# Install development dependencies
|
|
194
|
+
pip install -e ".[dev]"
|
|
195
|
+
|
|
196
|
+
# Run tests
|
|
197
|
+
pytest tests/ -v
|
|
198
|
+
|
|
199
|
+
# Run security tests specifically
|
|
200
|
+
pytest tests/test_skyhook.py::TestSecurity -v
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Project Structure
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
skyhook/
|
|
207
|
+
βββ src/
|
|
208
|
+
β βββ skyhook/
|
|
209
|
+
β βββ __init__.py
|
|
210
|
+
β βββ main.py # CLI entrypoint
|
|
211
|
+
β βββ server.py # FastAPI application
|
|
212
|
+
β βββ security.py # Auth & SSL logic
|
|
213
|
+
β βββ templates/
|
|
214
|
+
β βββ index.html # Web UI
|
|
215
|
+
βββ tests/
|
|
216
|
+
β βββ test_skyhook.py # Test suite
|
|
217
|
+
βββ pyproject.toml # Project metadata
|
|
218
|
+
βββ README.md
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## π Performance
|
|
222
|
+
|
|
223
|
+
- **Memory footprint**: < 100MB during 1GB file transfers
|
|
224
|
+
- **Startup time**: < 1 second
|
|
225
|
+
- **Concurrent uploads**: Supported via async I/O
|
|
226
|
+
- **Large files**: Handled efficiently with chunked streaming
|
|
227
|
+
|
|
228
|
+
## πΊοΈ Roadmap
|
|
229
|
+
|
|
230
|
+
### v1.1 (Planned)
|
|
231
|
+
|
|
232
|
+
- [ ] Support for `.zip` folder downloads
|
|
233
|
+
- [ ] Directory compression on-the-fly
|
|
234
|
+
- [ ] File preview for common formats
|
|
235
|
+
|
|
236
|
+
### v1.2 (Planned)
|
|
237
|
+
|
|
238
|
+
- [ ] Searchable file indexing for deep directories
|
|
239
|
+
- [ ] Advanced filtering (by date, size, type)
|
|
240
|
+
- [ ] Thumbnail generation for images
|
|
241
|
+
|
|
242
|
+
### v2.0 (Future)
|
|
243
|
+
|
|
244
|
+
- [ ] P2P mode using WebRTC (bypass firewalls)
|
|
245
|
+
- [ ] End-to-end encryption
|
|
246
|
+
- [ ] Multi-user support with permissions
|
|
247
|
+
|
|
248
|
+
## π€ Contributing
|
|
249
|
+
|
|
250
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
251
|
+
|
|
252
|
+
1. Fork the repository
|
|
253
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
254
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
255
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
256
|
+
5. Open a Pull Request
|
|
257
|
+
|
|
258
|
+
## π License
|
|
259
|
+
|
|
260
|
+
MIT License - see LICENSE file for details
|
|
261
|
+
|
|
262
|
+
## π Acknowledgments
|
|
263
|
+
|
|
264
|
+
- Built with [FastAPI](https://fastapi.tiangolo.com/)
|
|
265
|
+
- Powered by [Uvicorn](https://www.uvicorn.org/)
|
|
266
|
+
- CLI built with [Typer](https://typer.tiangolo.com/)
|
|
267
|
+
|
|
268
|
+
## β οΈ Security Notes
|
|
269
|
+
|
|
270
|
+
- Self-signed SSL certificates will trigger browser warnings (this is expected)
|
|
271
|
+
- For production use, configure proper SSL certificates via reverse proxy
|
|
272
|
+
- Always use authentication when exposing to untrusted networks
|
|
273
|
+
- Keep dependencies updated for security patches
|
|
274
|
+
|
|
275
|
+
## π Support
|
|
276
|
+
|
|
277
|
+
- Issues: [GitHub Issues](https://github.com/skyhook/skyhook/issues)
|
|
278
|
+
- Documentation: [GitHub Wiki](https://github.com/skyhook/skyhook/wiki)
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
Made with β€οΈ by the Skyhook team
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "skyhook-rayan"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "A secure, zero-config CLI file server with upload capabilities and encrypted transport"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Skyhook Contributors"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["file-server", "upload", "cli", "fastapi", "security"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.9",
|
|
22
|
+
"Programming Language :: Python :: 3.10",
|
|
23
|
+
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
dependencies = [
|
|
28
|
+
"fastapi>=0.109.0",
|
|
29
|
+
"uvicorn[standard]>=0.27.0",
|
|
30
|
+
"python-multipart>=0.0.6",
|
|
31
|
+
"jinja2>=3.1.2",
|
|
32
|
+
"typer>=0.9.0",
|
|
33
|
+
"cryptography>=41.0.0",
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
dev = [
|
|
38
|
+
"pytest>=7.4.0",
|
|
39
|
+
"pytest-asyncio>=0.21.0",
|
|
40
|
+
"httpx>=0.26.0",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
[project.scripts]
|
|
44
|
+
skyhook = "skyhook.main:app"
|
|
45
|
+
|
|
46
|
+
[project.urls]
|
|
47
|
+
Homepage = "https://github.com/skyhook/skyhook"
|
|
48
|
+
Documentation = "https://github.com/skyhook/skyhook#readme"
|
|
49
|
+
Repository = "https://github.com/skyhook/skyhook"
|
|
50
|
+
|
|
51
|
+
[tool.setuptools.packages.find]
|
|
52
|
+
where = ["src"]
|
|
53
|
+
include = ["skyhook*"]
|
|
54
|
+
|
|
55
|
+
[tool.setuptools.package-data]
|
|
56
|
+
skyhook = ["templates/*.html"]
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""Skyhook - Secure file server with upload capabilities."""
|
|
2
|
+
|
|
3
|
+
__version__ = "1.0.0"
|
|
4
|
+
__author__ = "Skyhook Contributors"
|
|
5
|
+
__description__ = "A secure, zero-config CLI file server with upload capabilities and encrypted transport"
|
|
6
|
+
|
|
7
|
+
from .main import app as cli_app
|
|
8
|
+
from .server import create_app
|
|
9
|
+
|
|
10
|
+
__all__ = ["cli_app", "create_app", "__version__"]
|