pyservx 1.1.0__tar.gz → 2.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.
- {pyservx-1.1.0 → pyservx-2.0.0}/LICENSE +0 -0
- {pyservx-1.1.0 → pyservx-2.0.0}/MANIFEST.in +0 -0
- pyservx-2.0.0/PKG-INFO +144 -0
- pyservx-2.0.0/README.md +114 -0
- pyservx-2.0.0/frida_tool.py +108 -0
- pyservx-2.0.0/publish_to_pypi.py +196 -0
- pyservx-2.0.0/pyproject.toml +45 -0
- pyservx-2.0.0/pyservx/__init__.py +1 -0
- pyservx-2.0.0/pyservx/file_operations.py +212 -0
- {pyservx-1.1.0 → pyservx-2.0.0}/pyservx/html_generator.py +271 -5
- pyservx-2.0.0/pyservx/request_handler.py +841 -0
- pyservx-2.0.0/pyservx/server.py +313 -0
- pyservx-2.0.0/pyservx-enhanced/install.py +39 -0
- pyservx-2.0.0/pyservx-enhanced/pyservx/__init__.py +1 -0
- pyservx-2.0.0/pyservx-enhanced/pyservx/file_operations.py +211 -0
- pyservx-2.0.0/pyservx-enhanced/pyservx/html_generator.py +888 -0
- pyservx-2.0.0/pyservx-enhanced/pyservx/request_handler.py +1076 -0
- pyservx-2.0.0/pyservx-enhanced/pyservx/server.py +311 -0
- pyservx-2.0.0/pyservx-enhanced/run.py +11 -0
- pyservx-2.0.0/pyservx.egg-info/PKG-INFO +144 -0
- {pyservx-1.1.0 → pyservx-2.0.0}/pyservx.egg-info/SOURCES.txt +9 -0
- {pyservx-1.1.0 → pyservx-2.0.0}/pyservx.egg-info/dependency_links.txt +0 -0
- {pyservx-1.1.0 → pyservx-2.0.0}/pyservx.egg-info/entry_points.txt +0 -0
- {pyservx-1.1.0 → pyservx-2.0.0}/pyservx.egg-info/requires.txt +1 -0
- pyservx-2.0.0/pyservx.egg-info/top_level.txt +2 -0
- pyservx-2.0.0/run.py +10 -0
- {pyservx-1.1.0 → pyservx-2.0.0}/setup.cfg +4 -4
- {pyservx-1.1.0 → pyservx-2.0.0}/tests/test_server.py +0 -0
- pyservx-1.1.0/PKG-INFO +0 -74
- pyservx-1.1.0/README.md +0 -58
- pyservx-1.1.0/pyproject.toml +0 -32
- pyservx-1.1.0/pyservx/__init__.py +0 -1
- pyservx-1.1.0/pyservx/file_operations.py +0 -52
- pyservx-1.1.0/pyservx/request_handler.py +0 -146
- pyservx-1.1.0/pyservx/server.py +0 -160
- pyservx-1.1.0/pyservx.egg-info/PKG-INFO +0 -74
- pyservx-1.1.0/pyservx.egg-info/top_level.txt +0 -1
- pyservx-1.1.0/run.py +0 -15
|
File without changes
|
|
File without changes
|
pyservx-2.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pyservx
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: A feature-rich Python HTTP server for file sharing with retro UI, dark/light themes, notepad, analytics, thumbnails, and QR code access.
|
|
5
|
+
Author-email: Subz3r0x01 <subz3r0x01@protonmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/SubZ3r0-0x01/pyservx
|
|
8
|
+
Project-URL: Repository, https://github.com/SubZ3r0-0x01/pyservx
|
|
9
|
+
Keywords: file server,http server,file sharing,retro ui,qrcode,pyservx,dark mode,light mode,notepad,text editor,file preview,analytics,thumbnails
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Operating System :: OS Independent
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
23
|
+
Classifier: Topic :: System :: Filesystems
|
|
24
|
+
Requires-Python: >=3.6
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: qrcode
|
|
28
|
+
Requires-Dist: Pillow
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# PyServeX – Advanced Python HTTP File Server
|
|
32
|
+
|
|
33
|
+
A feature-rich HTTP server for file sharing with a retro-styled web interface, dark/light themes, built-in notepad, analytics, and advanced file operations.
|
|
34
|
+
|
|
35
|
+
**by Parth Padhiyar (SubZ3r0-0x01)**
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Install using pip:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install pyservx
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Or use pipx for an isolated environment (recommended):
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pipx install pyservx
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Requires Python 3.6 or higher.
|
|
52
|
+
|
|
53
|
+
## Usage
|
|
54
|
+
|
|
55
|
+
Run the server:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pyservx
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Or with custom options:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pyservx --port 8080 --no-qr
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
- The server automatically creates a shared folder in your Downloads directory (`PyServeX-Shared`)
|
|
68
|
+
- Access the web interface at `http://localhost:8088` (or your custom port)
|
|
69
|
+
- Scan the QR code in the terminal to access from mobile devices
|
|
70
|
+
- Use `Ctrl+C` to stop the server
|
|
71
|
+
|
|
72
|
+
## Features
|
|
73
|
+
|
|
74
|
+
### Core Features
|
|
75
|
+
- **Retro "Hacker" UI** with dark/light theme toggle
|
|
76
|
+
- **File and folder browsing** with modern, responsive interface
|
|
77
|
+
- **Download entire folders** as ZIP files
|
|
78
|
+
- **Upload multiple files** simultaneously via drag-and-drop
|
|
79
|
+
- **QR Code Access** for easy mobile device connection
|
|
80
|
+
- **Real-time Progress Tracking** for uploads and downloads with ETA and speed
|
|
81
|
+
- **No File Size Restrictions** - upload files of any size
|
|
82
|
+
|
|
83
|
+
### Advanced Features
|
|
84
|
+
- **Built-in Notepad/Text Editor**
|
|
85
|
+
- Create and edit text files directly in the browser
|
|
86
|
+
- Syntax highlighting support
|
|
87
|
+
- Keyboard shortcuts (Ctrl+S to save)
|
|
88
|
+
- Theme-aware editor
|
|
89
|
+
|
|
90
|
+
- **File Preview System**
|
|
91
|
+
- Images (JPG, PNG, GIF, etc.)
|
|
92
|
+
- PDFs (embedded viewer)
|
|
93
|
+
- Videos (MP4, WebM, OGG)
|
|
94
|
+
- Audio files (MP3, WAV, OGG)
|
|
95
|
+
- Text files with syntax highlighting
|
|
96
|
+
|
|
97
|
+
- **Analytics & Usage Tracking**
|
|
98
|
+
- SQLite-based analytics database
|
|
99
|
+
- Track file access, downloads, and uploads
|
|
100
|
+
- Monitor popular files and usage patterns
|
|
101
|
+
- Client IP and user agent logging
|
|
102
|
+
|
|
103
|
+
- **Enhanced File Operations**
|
|
104
|
+
- Duplicate file detection
|
|
105
|
+
- File hash generation (MD5)
|
|
106
|
+
- Advanced file search with filters
|
|
107
|
+
- Thumbnail generation for images
|
|
108
|
+
- File copy and move operations
|
|
109
|
+
- Archive extraction support
|
|
110
|
+
|
|
111
|
+
- **Smart Configuration**
|
|
112
|
+
- Persistent settings stored in user home directory
|
|
113
|
+
- Automatic shared folder creation in Downloads
|
|
114
|
+
- Configurable analytics and thumbnail generation
|
|
115
|
+
- Custom port support
|
|
116
|
+
|
|
117
|
+
### User Interface
|
|
118
|
+
- **Dark/Light Theme Toggle** with persistent settings
|
|
119
|
+
- **Search Functionality** to quickly find files
|
|
120
|
+
- **File Sorting** by name, size, or date
|
|
121
|
+
- **Responsive Design** for desktop and mobile
|
|
122
|
+
- **Breadcrumb Navigation** for easy folder traversal
|
|
123
|
+
- **File Type Icons** for better visual organization
|
|
124
|
+
|
|
125
|
+
### Security & Privacy
|
|
126
|
+
- **Path Traversal Protection** prevents unauthorized access
|
|
127
|
+
- **Automated `robots.txt`** to prevent search engine indexing
|
|
128
|
+
- **Secure File Operations** with proper validation
|
|
129
|
+
|
|
130
|
+
### Technical Features
|
|
131
|
+
- **Modular Codebase** for easy maintenance and extension
|
|
132
|
+
- **Chunked File Transfer** for efficient large file handling
|
|
133
|
+
- **Progress Callbacks** for real-time feedback
|
|
134
|
+
- **Threaded Server** for concurrent connections
|
|
135
|
+
- **Graceful Shutdown** handling
|
|
136
|
+
|
|
137
|
+
## Requirements
|
|
138
|
+
|
|
139
|
+
- Python 3.6+
|
|
140
|
+
- `qrcode` library (automatically installed with pip)
|
|
141
|
+
|
|
142
|
+
## License
|
|
143
|
+
|
|
144
|
+
MIT License
|
pyservx-2.0.0/README.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# PyServeX – Advanced Python HTTP File Server
|
|
2
|
+
|
|
3
|
+
A feature-rich HTTP server for file sharing with a retro-styled web interface, dark/light themes, built-in notepad, analytics, and advanced file operations.
|
|
4
|
+
|
|
5
|
+
**by Parth Padhiyar (SubZ3r0-0x01)**
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Install using pip:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install pyservx
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or use pipx for an isolated environment (recommended):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pipx install pyservx
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Requires Python 3.6 or higher.
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Run the server:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pyservx
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Or with custom options:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pyservx --port 8080 --no-qr
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- The server automatically creates a shared folder in your Downloads directory (`PyServeX-Shared`)
|
|
38
|
+
- Access the web interface at `http://localhost:8088` (or your custom port)
|
|
39
|
+
- Scan the QR code in the terminal to access from mobile devices
|
|
40
|
+
- Use `Ctrl+C` to stop the server
|
|
41
|
+
|
|
42
|
+
## Features
|
|
43
|
+
|
|
44
|
+
### Core Features
|
|
45
|
+
- **Retro "Hacker" UI** with dark/light theme toggle
|
|
46
|
+
- **File and folder browsing** with modern, responsive interface
|
|
47
|
+
- **Download entire folders** as ZIP files
|
|
48
|
+
- **Upload multiple files** simultaneously via drag-and-drop
|
|
49
|
+
- **QR Code Access** for easy mobile device connection
|
|
50
|
+
- **Real-time Progress Tracking** for uploads and downloads with ETA and speed
|
|
51
|
+
- **No File Size Restrictions** - upload files of any size
|
|
52
|
+
|
|
53
|
+
### Advanced Features
|
|
54
|
+
- **Built-in Notepad/Text Editor**
|
|
55
|
+
- Create and edit text files directly in the browser
|
|
56
|
+
- Syntax highlighting support
|
|
57
|
+
- Keyboard shortcuts (Ctrl+S to save)
|
|
58
|
+
- Theme-aware editor
|
|
59
|
+
|
|
60
|
+
- **File Preview System**
|
|
61
|
+
- Images (JPG, PNG, GIF, etc.)
|
|
62
|
+
- PDFs (embedded viewer)
|
|
63
|
+
- Videos (MP4, WebM, OGG)
|
|
64
|
+
- Audio files (MP3, WAV, OGG)
|
|
65
|
+
- Text files with syntax highlighting
|
|
66
|
+
|
|
67
|
+
- **Analytics & Usage Tracking**
|
|
68
|
+
- SQLite-based analytics database
|
|
69
|
+
- Track file access, downloads, and uploads
|
|
70
|
+
- Monitor popular files and usage patterns
|
|
71
|
+
- Client IP and user agent logging
|
|
72
|
+
|
|
73
|
+
- **Enhanced File Operations**
|
|
74
|
+
- Duplicate file detection
|
|
75
|
+
- File hash generation (MD5)
|
|
76
|
+
- Advanced file search with filters
|
|
77
|
+
- Thumbnail generation for images
|
|
78
|
+
- File copy and move operations
|
|
79
|
+
- Archive extraction support
|
|
80
|
+
|
|
81
|
+
- **Smart Configuration**
|
|
82
|
+
- Persistent settings stored in user home directory
|
|
83
|
+
- Automatic shared folder creation in Downloads
|
|
84
|
+
- Configurable analytics and thumbnail generation
|
|
85
|
+
- Custom port support
|
|
86
|
+
|
|
87
|
+
### User Interface
|
|
88
|
+
- **Dark/Light Theme Toggle** with persistent settings
|
|
89
|
+
- **Search Functionality** to quickly find files
|
|
90
|
+
- **File Sorting** by name, size, or date
|
|
91
|
+
- **Responsive Design** for desktop and mobile
|
|
92
|
+
- **Breadcrumb Navigation** for easy folder traversal
|
|
93
|
+
- **File Type Icons** for better visual organization
|
|
94
|
+
|
|
95
|
+
### Security & Privacy
|
|
96
|
+
- **Path Traversal Protection** prevents unauthorized access
|
|
97
|
+
- **Automated `robots.txt`** to prevent search engine indexing
|
|
98
|
+
- **Secure File Operations** with proper validation
|
|
99
|
+
|
|
100
|
+
### Technical Features
|
|
101
|
+
- **Modular Codebase** for easy maintenance and extension
|
|
102
|
+
- **Chunked File Transfer** for efficient large file handling
|
|
103
|
+
- **Progress Callbacks** for real-time feedback
|
|
104
|
+
- **Threaded Server** for concurrent connections
|
|
105
|
+
- **Graceful Shutdown** handling
|
|
106
|
+
|
|
107
|
+
## Requirements
|
|
108
|
+
|
|
109
|
+
- Python 3.6+
|
|
110
|
+
- `qrcode` library (automatically installed with pip)
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
MIT License
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import subprocess
|
|
3
|
+
import threading
|
|
4
|
+
import time
|
|
5
|
+
|
|
6
|
+
# --- Configuration ---
|
|
7
|
+
FRIDA_SERVER_PATH = "/data/local/tmp"
|
|
8
|
+
FRIDA_SERVER_EXECUTABLE = "frida-server-16.4.1-android-arm64"
|
|
9
|
+
FRIDA_SCRIPTS = ["EMbypass.js", "3.sslPinning.js", "1.RootBypass.js"]
|
|
10
|
+
|
|
11
|
+
def run_command(command, shell=False):
|
|
12
|
+
"""Runs a command and returns its output."""
|
|
13
|
+
try:
|
|
14
|
+
process = subprocess.Popen(
|
|
15
|
+
command,
|
|
16
|
+
stdout=subprocess.PIPE,
|
|
17
|
+
stderr=subprocess.PIPE,
|
|
18
|
+
shell=shell,
|
|
19
|
+
text=True
|
|
20
|
+
)
|
|
21
|
+
stdout, stderr = process.communicate()
|
|
22
|
+
if process.returncode != 0:
|
|
23
|
+
print(f"Error running command: {' '.join(command)}")
|
|
24
|
+
print(f"Stderr: {stderr}")
|
|
25
|
+
return None
|
|
26
|
+
return stdout.strip()
|
|
27
|
+
except FileNotFoundError:
|
|
28
|
+
print(f"Error: Command not found: {command[0]}")
|
|
29
|
+
return None
|
|
30
|
+
|
|
31
|
+
def start_frida_server():
|
|
32
|
+
"""Starts the Frida server on the Android device."""
|
|
33
|
+
print("--- Starting Frida Server ---")
|
|
34
|
+
# Check if the server is already running
|
|
35
|
+
pid = run_command(["adb", "shell", f"pidof {FRIDA_SERVER_EXECUTABLE}"])
|
|
36
|
+
if pid:
|
|
37
|
+
print("Frida server is already running.")
|
|
38
|
+
return True
|
|
39
|
+
|
|
40
|
+
print("Starting Frida server in the background...")
|
|
41
|
+
command = f"adb shell 'su -c "cd {FRIDA_SERVER_PATH} && ./{FRIDA_SERVER_EXECUTABLE} &"'"
|
|
42
|
+
# Since this command runs in the background, we don't need to wait for it.
|
|
43
|
+
# We'll just run it and assume it works. A small delay to ensure it starts.
|
|
44
|
+
subprocess.Popen(command, shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
|
45
|
+
time.sleep(3) # Give the server a moment to start
|
|
46
|
+
|
|
47
|
+
# Verify it's running
|
|
48
|
+
pid = run_command(["adb", "shell", f"pidof {FRIDA_SERVER_EXECUTABLE}"])
|
|
49
|
+
if pid:
|
|
50
|
+
print("Frida server started successfully.")
|
|
51
|
+
return True
|
|
52
|
+
else:
|
|
53
|
+
print("Error: Failed to start Frida server.")
|
|
54
|
+
print("Please ensure that the Frida server executable is located at:")
|
|
55
|
+
print(f"{FRIDA_SERVER_PATH}/{FRIDA_SERVER_EXECUTABLE}")
|
|
56
|
+
print("and that your device is properly rooted.")
|
|
57
|
+
return False
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def get_packages():
|
|
61
|
+
"""Gets a list of all installed packages on the device."""
|
|
62
|
+
print("\n--- Getting list of installed packages ---")
|
|
63
|
+
packages_output = run_command(["adb", "shell", "pm", "list", "packages"])
|
|
64
|
+
if packages_output:
|
|
65
|
+
packages = [line.split(":")[-1] for line in packages_output.splitlines()]
|
|
66
|
+
return sorted(packages)
|
|
67
|
+
return []
|
|
68
|
+
|
|
69
|
+
def main():
|
|
70
|
+
"""Main function to run the tool."""
|
|
71
|
+
if not start_frida_server():
|
|
72
|
+
return
|
|
73
|
+
|
|
74
|
+
packages = get_packages()
|
|
75
|
+
if not packages:
|
|
76
|
+
print("Could not retrieve package list. Exiting.")
|
|
77
|
+
return
|
|
78
|
+
|
|
79
|
+
print("\n--- Select a package to bypass SSL pinning ---")
|
|
80
|
+
for i, pkg in enumerate(packages):
|
|
81
|
+
print(f"[{i+1}] {pkg}")
|
|
82
|
+
|
|
83
|
+
try:
|
|
84
|
+
choice = int(input("\nEnter the number of the package: ")) - 1
|
|
85
|
+
if 0 <= choice < len(packages):
|
|
86
|
+
selected_package = packages[choice]
|
|
87
|
+
print(f"\nYou selected: {selected_package}")
|
|
88
|
+
|
|
89
|
+
# Construct and run the Frida command
|
|
90
|
+
frida_command = ["frida"]
|
|
91
|
+
for script in FRIDA_SCRIPTS:
|
|
92
|
+
frida_command.extend(["-l", script])
|
|
93
|
+
frida_command.extend(["-U", "-f", selected_package, "--pause"])
|
|
94
|
+
|
|
95
|
+
print("\n--- Starting Frida ---")
|
|
96
|
+
print(f"Command: {' '.join(frida_command)}")
|
|
97
|
+
print("Press Ctrl+C to stop the script.")
|
|
98
|
+
|
|
99
|
+
# We use os.system here because frida can be interactive
|
|
100
|
+
os.system(' '.join(frida_command))
|
|
101
|
+
|
|
102
|
+
else:
|
|
103
|
+
print("Invalid choice.")
|
|
104
|
+
except (ValueError, IndexError):
|
|
105
|
+
print("Invalid input. Please enter a number from the list.")
|
|
106
|
+
|
|
107
|
+
if __name__ == "__main__":
|
|
108
|
+
main()
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
PyServeX - Automated PyPI Publishing Script
|
|
4
|
+
Author: Parth Padhiyar (SubZ3r0-0x01)
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import subprocess
|
|
8
|
+
import sys
|
|
9
|
+
import os
|
|
10
|
+
import shutil
|
|
11
|
+
|
|
12
|
+
def run_command(command, description):
|
|
13
|
+
"""Run a command and handle errors"""
|
|
14
|
+
print(f"\n{'='*60}")
|
|
15
|
+
print(f"🔧 {description}")
|
|
16
|
+
print(f"{'='*60}")
|
|
17
|
+
print(f"Running: {command}\n")
|
|
18
|
+
|
|
19
|
+
try:
|
|
20
|
+
# Use list format for better handling of paths with spaces
|
|
21
|
+
if isinstance(command, str):
|
|
22
|
+
result = subprocess.run(command, shell=True, check=True, capture_output=True, text=True)
|
|
23
|
+
else:
|
|
24
|
+
result = subprocess.run(command, check=True, capture_output=True, text=True)
|
|
25
|
+
print(result.stdout)
|
|
26
|
+
if result.stderr:
|
|
27
|
+
print(result.stderr)
|
|
28
|
+
print(f"✅ {description} - SUCCESS")
|
|
29
|
+
return True
|
|
30
|
+
except subprocess.CalledProcessError as e:
|
|
31
|
+
print(f"❌ {description} - FAILED")
|
|
32
|
+
print(f"Error: {e.stderr}")
|
|
33
|
+
return False
|
|
34
|
+
|
|
35
|
+
def clean_build_artifacts():
|
|
36
|
+
"""Remove old build artifacts"""
|
|
37
|
+
print("\n🧹 Cleaning old build artifacts...")
|
|
38
|
+
|
|
39
|
+
dirs_to_remove = ['dist', 'build', 'pyservx.egg-info']
|
|
40
|
+
for dir_name in dirs_to_remove:
|
|
41
|
+
if os.path.exists(dir_name):
|
|
42
|
+
try:
|
|
43
|
+
shutil.rmtree(dir_name)
|
|
44
|
+
print(f" ✅ Removed {dir_name}/")
|
|
45
|
+
except Exception as e:
|
|
46
|
+
print(f" ⚠️ Could not remove {dir_name}/: {e}")
|
|
47
|
+
else:
|
|
48
|
+
print(f" ℹ️ {dir_name}/ does not exist")
|
|
49
|
+
|
|
50
|
+
def check_prerequisites():
|
|
51
|
+
"""Check if required tools are installed"""
|
|
52
|
+
print("\n🔍 Checking prerequisites...")
|
|
53
|
+
|
|
54
|
+
# Check if build is installed
|
|
55
|
+
try:
|
|
56
|
+
subprocess.run([sys.executable, "-m", "build", "--version"],
|
|
57
|
+
capture_output=True, check=True)
|
|
58
|
+
print(" ✅ build is installed")
|
|
59
|
+
except:
|
|
60
|
+
print(" ❌ build is not installed")
|
|
61
|
+
print(" Installing build...")
|
|
62
|
+
subprocess.run([sys.executable, "-m", "pip", "install", "build"], check=True)
|
|
63
|
+
|
|
64
|
+
# Check if twine is installed
|
|
65
|
+
try:
|
|
66
|
+
subprocess.run([sys.executable, "-m", "twine", "--version"],
|
|
67
|
+
capture_output=True, check=True)
|
|
68
|
+
print(" ✅ twine is installed")
|
|
69
|
+
except:
|
|
70
|
+
print(" ❌ twine is not installed")
|
|
71
|
+
print(" Installing twine...")
|
|
72
|
+
subprocess.run([sys.executable, "-m", "pip", "install", "twine"], check=True)
|
|
73
|
+
|
|
74
|
+
def main():
|
|
75
|
+
"""Main publishing workflow"""
|
|
76
|
+
print("""
|
|
77
|
+
╔══════════════════════════════════════════════════════════════╗
|
|
78
|
+
║ ║
|
|
79
|
+
║ PyServeX - PyPI Publishing Script ║
|
|
80
|
+
║ ║
|
|
81
|
+
║ Author: Parth Padhiyar (SubZ3r0-0x01) ║
|
|
82
|
+
║ Version: 1.2.0 ║
|
|
83
|
+
║ ║
|
|
84
|
+
╚══════════════════════════════════════════════════════════════╝
|
|
85
|
+
""")
|
|
86
|
+
|
|
87
|
+
# Check prerequisites
|
|
88
|
+
check_prerequisites()
|
|
89
|
+
|
|
90
|
+
# Clean old builds
|
|
91
|
+
clean_build_artifacts()
|
|
92
|
+
|
|
93
|
+
# Build the package
|
|
94
|
+
if not run_command(
|
|
95
|
+
[sys.executable, "-m", "build"],
|
|
96
|
+
"Building distribution packages"
|
|
97
|
+
):
|
|
98
|
+
print("\n❌ Build failed. Exiting.")
|
|
99
|
+
sys.exit(1)
|
|
100
|
+
|
|
101
|
+
# Check the package
|
|
102
|
+
if not run_command(
|
|
103
|
+
[sys.executable, "-m", "twine", "check", "dist/*"],
|
|
104
|
+
"Checking package validity"
|
|
105
|
+
):
|
|
106
|
+
print("\n⚠️ Package check failed. Review the errors above.")
|
|
107
|
+
response = input("\nDo you want to continue anyway? (y/N): ")
|
|
108
|
+
if response.lower() != 'y':
|
|
109
|
+
sys.exit(1)
|
|
110
|
+
|
|
111
|
+
# Ask user which repository to upload to
|
|
112
|
+
print("\n" + "="*60)
|
|
113
|
+
print("📦 Ready to upload!")
|
|
114
|
+
print("="*60)
|
|
115
|
+
print("\nChoose upload destination:")
|
|
116
|
+
print(" 1. TestPyPI (recommended for testing)")
|
|
117
|
+
print(" 2. PyPI (production)")
|
|
118
|
+
print(" 3. Both (TestPyPI first, then PyPI)")
|
|
119
|
+
print(" 4. Exit")
|
|
120
|
+
|
|
121
|
+
choice = input("\nEnter your choice (1-4): ").strip()
|
|
122
|
+
|
|
123
|
+
if choice == "1":
|
|
124
|
+
# Upload to TestPyPI
|
|
125
|
+
print("\n🚀 Uploading to TestPyPI...")
|
|
126
|
+
run_command(
|
|
127
|
+
[sys.executable, "-m", "twine", "upload", "--repository", "testpypi", "dist/*"],
|
|
128
|
+
"Uploading to TestPyPI"
|
|
129
|
+
)
|
|
130
|
+
print("\n✅ Upload to TestPyPI complete!")
|
|
131
|
+
print("\nTest installation with:")
|
|
132
|
+
print(" pip install --index-url https://test.pypi.org/simple/ --no-deps pyservx")
|
|
133
|
+
|
|
134
|
+
elif choice == "2":
|
|
135
|
+
# Upload to PyPI
|
|
136
|
+
print("\n⚠️ WARNING: You are about to upload to PRODUCTION PyPI!")
|
|
137
|
+
confirm = input("Are you sure? Type 'yes' to confirm: ")
|
|
138
|
+
if confirm.lower() == 'yes':
|
|
139
|
+
print("\n🚀 Uploading to PyPI...")
|
|
140
|
+
run_command(
|
|
141
|
+
[sys.executable, "-m", "twine", "upload", "dist/*"],
|
|
142
|
+
"Uploading to PyPI"
|
|
143
|
+
)
|
|
144
|
+
print("\n✅ Upload to PyPI complete!")
|
|
145
|
+
print("\nInstall with:")
|
|
146
|
+
print(" pip install pyservx")
|
|
147
|
+
else:
|
|
148
|
+
print("\n❌ Upload cancelled.")
|
|
149
|
+
|
|
150
|
+
elif choice == "3":
|
|
151
|
+
# Upload to both
|
|
152
|
+
print("\n🚀 Uploading to TestPyPI first...")
|
|
153
|
+
if run_command(
|
|
154
|
+
[sys.executable, "-m", "twine", "upload", "--repository", "testpypi", "dist/*"],
|
|
155
|
+
"Uploading to TestPyPI"
|
|
156
|
+
):
|
|
157
|
+
print("\n✅ TestPyPI upload successful!")
|
|
158
|
+
print("\n⚠️ Now uploading to PRODUCTION PyPI!")
|
|
159
|
+
confirm = input("Continue to PyPI? Type 'yes' to confirm: ")
|
|
160
|
+
if confirm.lower() == 'yes':
|
|
161
|
+
run_command(
|
|
162
|
+
[sys.executable, "-m", "twine", "upload", "dist/*"],
|
|
163
|
+
"Uploading to PyPI"
|
|
164
|
+
)
|
|
165
|
+
print("\n✅ Upload to PyPI complete!")
|
|
166
|
+
else:
|
|
167
|
+
print("\n❌ PyPI upload cancelled.")
|
|
168
|
+
else:
|
|
169
|
+
print("\n❌ TestPyPI upload failed. Not proceeding to PyPI.")
|
|
170
|
+
|
|
171
|
+
elif choice == "4":
|
|
172
|
+
print("\n👋 Exiting without upload.")
|
|
173
|
+
sys.exit(0)
|
|
174
|
+
else:
|
|
175
|
+
print("\n❌ Invalid choice. Exiting.")
|
|
176
|
+
sys.exit(1)
|
|
177
|
+
|
|
178
|
+
print("\n" + "="*60)
|
|
179
|
+
print("🎉 Publishing process complete!")
|
|
180
|
+
print("="*60)
|
|
181
|
+
print("\nNext steps:")
|
|
182
|
+
print(" 1. Verify on PyPI: https://pypi.org/project/pyservx/")
|
|
183
|
+
print(" 2. Test installation: pip install pyservx")
|
|
184
|
+
print(" 3. Tag release in Git: git tag -a v1.2.0 -m 'Version 1.2.0'")
|
|
185
|
+
print(" 4. Push to GitHub: git push origin main --tags")
|
|
186
|
+
print("\n✨ Great job! Your package is now available to the world! ✨\n")
|
|
187
|
+
|
|
188
|
+
if __name__ == "__main__":
|
|
189
|
+
try:
|
|
190
|
+
main()
|
|
191
|
+
except KeyboardInterrupt:
|
|
192
|
+
print("\n\n❌ Publishing cancelled by user.")
|
|
193
|
+
sys.exit(1)
|
|
194
|
+
except Exception as e:
|
|
195
|
+
print(f"\n\n❌ An error occurred: {e}")
|
|
196
|
+
sys.exit(1)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "pyservx"
|
|
3
|
+
version = "2.0.0"
|
|
4
|
+
description = "A feature-rich Python HTTP server for file sharing with retro UI, dark/light themes, notepad, analytics, thumbnails, and QR code access."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.6"
|
|
7
|
+
license = {text = "MIT"}
|
|
8
|
+
keywords = ["file server", "http server", "file sharing", "retro ui", "qrcode", "pyservx", "dark mode", "light mode", "notepad", "text editor", "file preview", "analytics", "thumbnails"]
|
|
9
|
+
authors = [
|
|
10
|
+
{ name = "Subz3r0x01", email = "subz3r0x01@protonmail.com" }
|
|
11
|
+
]
|
|
12
|
+
dependencies = [
|
|
13
|
+
"qrcode",
|
|
14
|
+
"Pillow"
|
|
15
|
+
]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Intended Audience :: End Users/Desktop",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.6",
|
|
22
|
+
"Programming Language :: Python :: 3.7",
|
|
23
|
+
"Programming Language :: Python :: 3.8",
|
|
24
|
+
"Programming Language :: Python :: 3.9",
|
|
25
|
+
"Programming Language :: Python :: 3.10",
|
|
26
|
+
"Programming Language :: Python :: 3.11",
|
|
27
|
+
"Programming Language :: Python :: 3.12",
|
|
28
|
+
"Operating System :: OS Independent",
|
|
29
|
+
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
|
|
30
|
+
"Topic :: System :: Filesystems",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[build-system]
|
|
34
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
35
|
+
build-backend = "setuptools.build_meta"
|
|
36
|
+
|
|
37
|
+
[tool.setuptools.packages]
|
|
38
|
+
find = { include = ["pyservx*"] }
|
|
39
|
+
|
|
40
|
+
[project.urls]
|
|
41
|
+
Homepage = "https://github.com/SubZ3r0-0x01/pyservx"
|
|
42
|
+
Repository = "https://github.com/SubZ3r0-0x01/pyservx"
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
pyservx = "pyservx.server:main"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.0.0" # Unified version with all features: dark/light mode, notepad, analytics, thumbnails, and file operations
|