uploadserver 6.0.0__tar.gz → 6.0.1__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.
- {uploadserver-6.0.0/uploadserver.egg-info → uploadserver-6.0.1}/PKG-INFO +21 -12
- {uploadserver-6.0.0 → uploadserver-6.0.1}/README.md +10 -10
- {uploadserver-6.0.0 → uploadserver-6.0.1}/setup.py +1 -1
- {uploadserver-6.0.0 → uploadserver-6.0.1}/uploadserver/__init__.py +10 -0
- {uploadserver-6.0.0 → uploadserver-6.0.1/uploadserver.egg-info}/PKG-INFO +21 -12
- {uploadserver-6.0.0 → uploadserver-6.0.1}/LICENSE +0 -0
- {uploadserver-6.0.0 → uploadserver-6.0.1}/setup.cfg +0 -0
- {uploadserver-6.0.0 → uploadserver-6.0.1}/uploadserver/__main__.py +0 -0
- {uploadserver-6.0.0 → uploadserver-6.0.1}/uploadserver/cgi.py +0 -0
- {uploadserver-6.0.0 → uploadserver-6.0.1}/uploadserver.egg-info/SOURCES.txt +0 -0
- {uploadserver-6.0.0 → uploadserver-6.0.1}/uploadserver.egg-info/dependency_links.txt +0 -0
- {uploadserver-6.0.0 → uploadserver-6.0.1}/uploadserver.egg-info/entry_points.txt +0 -0
- {uploadserver-6.0.0 → uploadserver-6.0.1}/uploadserver.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: uploadserver
|
|
3
|
-
Version: 6.0.
|
|
3
|
+
Version: 6.0.1
|
|
4
4
|
Summary: Python's http.server extended to include a file upload page
|
|
5
5
|
Home-page: https://github.com/Densaugeo/uploadserver
|
|
6
6
|
Author: Densaugeo
|
|
@@ -11,6 +11,15 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.9
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: classifier
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: home-page
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
14
23
|
|
|
15
24
|
# uploadserver
|
|
16
25
|
|
|
@@ -32,13 +41,13 @@ Python's http.server extended to include a file upload page
|
|
|
32
41
|
|
|
33
42
|
## Installation
|
|
34
43
|
|
|
35
|
-
~~~
|
|
44
|
+
~~~bash
|
|
36
45
|
python3 -m pip install --user uploadserver
|
|
37
46
|
~~~
|
|
38
47
|
|
|
39
48
|
## Usage
|
|
40
49
|
|
|
41
|
-
~~~
|
|
50
|
+
~~~bash
|
|
42
51
|
python3 -m uploadserver
|
|
43
52
|
~~~
|
|
44
53
|
|
|
@@ -49,18 +58,18 @@ After the server starts, the upload page is at /upload. For example, if the serv
|
|
|
49
58
|
Warning: This is an upload server, and running it will allow uploads.
|
|
50
59
|
|
|
51
60
|
Now supports uploading multiple files at once! Select multiple files in the web page's file selector, or upload with cURL:
|
|
52
|
-
~~~
|
|
61
|
+
~~~bash
|
|
53
62
|
curl -X POST http://127.0.0.1:8000/upload -F 'files=@multiple-example-1.txt' -F 'files=@multiple-example-2.txt'
|
|
54
63
|
~~~
|
|
55
64
|
|
|
56
65
|
## Basic Authentication (downloads and uploads)
|
|
57
66
|
|
|
58
|
-
~~~
|
|
67
|
+
~~~bash
|
|
59
68
|
python3 -m uploadserver --basic-auth hello:world
|
|
60
69
|
~~~
|
|
61
70
|
|
|
62
71
|
Now you can upload with basic authentication. For example:
|
|
63
|
-
~~~
|
|
72
|
+
~~~bash
|
|
64
73
|
curl -X POST http://127.0.0.1:8000/upload -F 'files=@basicauth-example.txt' -u hello:world
|
|
65
74
|
~~~
|
|
66
75
|
|
|
@@ -68,7 +77,7 @@ All requests without authentication will be rejected. Note that basic authentica
|
|
|
68
77
|
|
|
69
78
|
## Basic Authentication (uploads only)
|
|
70
79
|
|
|
71
|
-
~~~
|
|
80
|
+
~~~bash
|
|
72
81
|
python3 -m uploadserver --basic-auth-upload hello:world
|
|
73
82
|
~~~
|
|
74
83
|
|
|
@@ -79,18 +88,18 @@ If both `--basic-auth` and `--basic-auth-upload` are specified, all requests wil
|
|
|
79
88
|
## Theme Option
|
|
80
89
|
|
|
81
90
|
The upload page supports a dark mode for showing white text on black background. If no option is specified, the color scheme is chosen from the client’s browser’s preference (which typically matches their operating system’s setting, if light or dark mode is supported by the OS). To enforce the light or dark theme, the CLI parameter `--theme` can be used:
|
|
82
|
-
~~~
|
|
91
|
+
~~~bash
|
|
83
92
|
python3 -m uploadserver --theme light
|
|
84
93
|
~~~
|
|
85
94
|
or
|
|
86
|
-
~~~
|
|
95
|
+
~~~bash
|
|
87
96
|
python3 -m uploadserver --theme dark
|
|
88
97
|
~~~
|
|
89
98
|
|
|
90
99
|
## HTTPS Option
|
|
91
100
|
|
|
92
101
|
Run with HTTPS and without client authentication:
|
|
93
|
-
~~~
|
|
102
|
+
~~~bash
|
|
94
103
|
# Generate self-signed server certificate
|
|
95
104
|
openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server'
|
|
96
105
|
|
|
@@ -103,7 +112,7 @@ curl -X POST https://localhost:8000/upload --insecure -F files=@simple-example.t
|
|
|
103
112
|
~~~
|
|
104
113
|
|
|
105
114
|
Run with HTTPS and with client authentication:
|
|
106
|
-
~~~
|
|
115
|
+
~~~bash
|
|
107
116
|
# Generate self-signed server certificate
|
|
108
117
|
openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server'
|
|
109
118
|
|
|
@@ -18,13 +18,13 @@ Python's http.server extended to include a file upload page
|
|
|
18
18
|
|
|
19
19
|
## Installation
|
|
20
20
|
|
|
21
|
-
~~~
|
|
21
|
+
~~~bash
|
|
22
22
|
python3 -m pip install --user uploadserver
|
|
23
23
|
~~~
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
26
26
|
|
|
27
|
-
~~~
|
|
27
|
+
~~~bash
|
|
28
28
|
python3 -m uploadserver
|
|
29
29
|
~~~
|
|
30
30
|
|
|
@@ -35,18 +35,18 @@ After the server starts, the upload page is at /upload. For example, if the serv
|
|
|
35
35
|
Warning: This is an upload server, and running it will allow uploads.
|
|
36
36
|
|
|
37
37
|
Now supports uploading multiple files at once! Select multiple files in the web page's file selector, or upload with cURL:
|
|
38
|
-
~~~
|
|
38
|
+
~~~bash
|
|
39
39
|
curl -X POST http://127.0.0.1:8000/upload -F 'files=@multiple-example-1.txt' -F 'files=@multiple-example-2.txt'
|
|
40
40
|
~~~
|
|
41
41
|
|
|
42
42
|
## Basic Authentication (downloads and uploads)
|
|
43
43
|
|
|
44
|
-
~~~
|
|
44
|
+
~~~bash
|
|
45
45
|
python3 -m uploadserver --basic-auth hello:world
|
|
46
46
|
~~~
|
|
47
47
|
|
|
48
48
|
Now you can upload with basic authentication. For example:
|
|
49
|
-
~~~
|
|
49
|
+
~~~bash
|
|
50
50
|
curl -X POST http://127.0.0.1:8000/upload -F 'files=@basicauth-example.txt' -u hello:world
|
|
51
51
|
~~~
|
|
52
52
|
|
|
@@ -54,7 +54,7 @@ All requests without authentication will be rejected. Note that basic authentica
|
|
|
54
54
|
|
|
55
55
|
## Basic Authentication (uploads only)
|
|
56
56
|
|
|
57
|
-
~~~
|
|
57
|
+
~~~bash
|
|
58
58
|
python3 -m uploadserver --basic-auth-upload hello:world
|
|
59
59
|
~~~
|
|
60
60
|
|
|
@@ -65,18 +65,18 @@ If both `--basic-auth` and `--basic-auth-upload` are specified, all requests wil
|
|
|
65
65
|
## Theme Option
|
|
66
66
|
|
|
67
67
|
The upload page supports a dark mode for showing white text on black background. If no option is specified, the color scheme is chosen from the client’s browser’s preference (which typically matches their operating system’s setting, if light or dark mode is supported by the OS). To enforce the light or dark theme, the CLI parameter `--theme` can be used:
|
|
68
|
-
~~~
|
|
68
|
+
~~~bash
|
|
69
69
|
python3 -m uploadserver --theme light
|
|
70
70
|
~~~
|
|
71
71
|
or
|
|
72
|
-
~~~
|
|
72
|
+
~~~bash
|
|
73
73
|
python3 -m uploadserver --theme dark
|
|
74
74
|
~~~
|
|
75
75
|
|
|
76
76
|
## HTTPS Option
|
|
77
77
|
|
|
78
78
|
Run with HTTPS and without client authentication:
|
|
79
|
-
~~~
|
|
79
|
+
~~~bash
|
|
80
80
|
# Generate self-signed server certificate
|
|
81
81
|
openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server'
|
|
82
82
|
|
|
@@ -89,7 +89,7 @@ curl -X POST https://localhost:8000/upload --insecure -F files=@simple-example.t
|
|
|
89
89
|
~~~
|
|
90
90
|
|
|
91
91
|
Run with HTTPS and with client authentication:
|
|
92
|
-
~~~
|
|
92
|
+
~~~bash
|
|
93
93
|
# Generate self-signed server certificate
|
|
94
94
|
openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server'
|
|
95
95
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import http.server, http, pathlib, sys, argparse, ssl, os, builtins, tempfile
|
|
2
|
+
import ipaddress
|
|
2
3
|
import base64, binascii, functools, contextlib
|
|
3
4
|
|
|
4
5
|
# Does not seem to do be used, but leaving this import out causes uploadserver
|
|
@@ -452,5 +453,14 @@ def main():
|
|
|
452
453
|
|
|
453
454
|
args = parser.parse_args()
|
|
454
455
|
if not hasattr(args, 'directory'): args.directory = os.getcwd()
|
|
456
|
+
if args.bind:
|
|
457
|
+
try:
|
|
458
|
+
ipaddress.ip_address(args.bind)
|
|
459
|
+
except ValueError:
|
|
460
|
+
parser.error(
|
|
461
|
+
'Invalid -b/--bind address. Expected an IP address (no port). '
|
|
462
|
+
'Example: -b 192.168.1.10 and pass the port as a separate '
|
|
463
|
+
'argument.'
|
|
464
|
+
)
|
|
455
465
|
|
|
456
466
|
serve_forever()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: uploadserver
|
|
3
|
-
Version: 6.0.
|
|
3
|
+
Version: 6.0.1
|
|
4
4
|
Summary: Python's http.server extended to include a file upload page
|
|
5
5
|
Home-page: https://github.com/Densaugeo/uploadserver
|
|
6
6
|
Author: Densaugeo
|
|
@@ -11,6 +11,15 @@ Classifier: Operating System :: OS Independent
|
|
|
11
11
|
Requires-Python: >=3.9
|
|
12
12
|
Description-Content-Type: text/markdown
|
|
13
13
|
License-File: LICENSE
|
|
14
|
+
Dynamic: author
|
|
15
|
+
Dynamic: author-email
|
|
16
|
+
Dynamic: classifier
|
|
17
|
+
Dynamic: description
|
|
18
|
+
Dynamic: description-content-type
|
|
19
|
+
Dynamic: home-page
|
|
20
|
+
Dynamic: license-file
|
|
21
|
+
Dynamic: requires-python
|
|
22
|
+
Dynamic: summary
|
|
14
23
|
|
|
15
24
|
# uploadserver
|
|
16
25
|
|
|
@@ -32,13 +41,13 @@ Python's http.server extended to include a file upload page
|
|
|
32
41
|
|
|
33
42
|
## Installation
|
|
34
43
|
|
|
35
|
-
~~~
|
|
44
|
+
~~~bash
|
|
36
45
|
python3 -m pip install --user uploadserver
|
|
37
46
|
~~~
|
|
38
47
|
|
|
39
48
|
## Usage
|
|
40
49
|
|
|
41
|
-
~~~
|
|
50
|
+
~~~bash
|
|
42
51
|
python3 -m uploadserver
|
|
43
52
|
~~~
|
|
44
53
|
|
|
@@ -49,18 +58,18 @@ After the server starts, the upload page is at /upload. For example, if the serv
|
|
|
49
58
|
Warning: This is an upload server, and running it will allow uploads.
|
|
50
59
|
|
|
51
60
|
Now supports uploading multiple files at once! Select multiple files in the web page's file selector, or upload with cURL:
|
|
52
|
-
~~~
|
|
61
|
+
~~~bash
|
|
53
62
|
curl -X POST http://127.0.0.1:8000/upload -F 'files=@multiple-example-1.txt' -F 'files=@multiple-example-2.txt'
|
|
54
63
|
~~~
|
|
55
64
|
|
|
56
65
|
## Basic Authentication (downloads and uploads)
|
|
57
66
|
|
|
58
|
-
~~~
|
|
67
|
+
~~~bash
|
|
59
68
|
python3 -m uploadserver --basic-auth hello:world
|
|
60
69
|
~~~
|
|
61
70
|
|
|
62
71
|
Now you can upload with basic authentication. For example:
|
|
63
|
-
~~~
|
|
72
|
+
~~~bash
|
|
64
73
|
curl -X POST http://127.0.0.1:8000/upload -F 'files=@basicauth-example.txt' -u hello:world
|
|
65
74
|
~~~
|
|
66
75
|
|
|
@@ -68,7 +77,7 @@ All requests without authentication will be rejected. Note that basic authentica
|
|
|
68
77
|
|
|
69
78
|
## Basic Authentication (uploads only)
|
|
70
79
|
|
|
71
|
-
~~~
|
|
80
|
+
~~~bash
|
|
72
81
|
python3 -m uploadserver --basic-auth-upload hello:world
|
|
73
82
|
~~~
|
|
74
83
|
|
|
@@ -79,18 +88,18 @@ If both `--basic-auth` and `--basic-auth-upload` are specified, all requests wil
|
|
|
79
88
|
## Theme Option
|
|
80
89
|
|
|
81
90
|
The upload page supports a dark mode for showing white text on black background. If no option is specified, the color scheme is chosen from the client’s browser’s preference (which typically matches their operating system’s setting, if light or dark mode is supported by the OS). To enforce the light or dark theme, the CLI parameter `--theme` can be used:
|
|
82
|
-
~~~
|
|
91
|
+
~~~bash
|
|
83
92
|
python3 -m uploadserver --theme light
|
|
84
93
|
~~~
|
|
85
94
|
or
|
|
86
|
-
~~~
|
|
95
|
+
~~~bash
|
|
87
96
|
python3 -m uploadserver --theme dark
|
|
88
97
|
~~~
|
|
89
98
|
|
|
90
99
|
## HTTPS Option
|
|
91
100
|
|
|
92
101
|
Run with HTTPS and without client authentication:
|
|
93
|
-
~~~
|
|
102
|
+
~~~bash
|
|
94
103
|
# Generate self-signed server certificate
|
|
95
104
|
openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server'
|
|
96
105
|
|
|
@@ -103,7 +112,7 @@ curl -X POST https://localhost:8000/upload --insecure -F files=@simple-example.t
|
|
|
103
112
|
~~~
|
|
104
113
|
|
|
105
114
|
Run with HTTPS and with client authentication:
|
|
106
|
-
~~~
|
|
115
|
+
~~~bash
|
|
107
116
|
# Generate self-signed server certificate
|
|
108
117
|
openssl req -x509 -out server.pem -keyout server.pem -newkey rsa:2048 -nodes -sha256 -subj '/CN=server'
|
|
109
118
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|