pywebexec 0.1.1__tar.gz → 1.1.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.
- {pywebexec-0.1.1/pywebexec.egg-info → pywebexec-1.1.0}/PKG-INFO +49 -14
- pywebexec-1.1.0/README.md +106 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pyproject.toml +1 -0
- pywebexec-1.1.0/pywebexec/pywebexec.py +563 -0
- pywebexec-1.1.0/pywebexec/static/css/style.css +112 -0
- pywebexec-1.1.0/pywebexec/static/images/favicon.svg +1 -0
- pywebexec-1.1.0/pywebexec/static/js/script.js +197 -0
- pywebexec-1.1.0/pywebexec/templates/index.html +41 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec/version.py +2 -2
- {pywebexec-0.1.1 → pywebexec-1.1.0/pywebexec.egg-info}/PKG-INFO +49 -14
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec.egg-info/SOURCES.txt +3 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec.egg-info/requires.txt +1 -0
- pywebexec-0.1.1/README.md +0 -72
- pywebexec-0.1.1/pywebexec/pywebexec.py +0 -364
- pywebexec-0.1.1/pywebexec/templates/index.html +0 -330
- {pywebexec-0.1.1 → pywebexec-1.1.0}/.github/workflows/python-publish.yml +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/.gitignore +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/LICENSE +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec/__init__.py +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec/static/images/aborted.svg +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec/static/images/copy.svg +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec/static/images/copy_ok.svg +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec/static/images/failed.svg +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec/static/images/running.svg +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec/static/images/success.svg +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec/templates/__init__.py +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec.egg-info/dependency_links.txt +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec.egg-info/entry_points.txt +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/pywebexec.egg-info/top_level.txt +0 -0
- {pywebexec-0.1.1 → pywebexec-1.1.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: pywebexec
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Simple Python HTTP Exec Server
|
|
5
5
|
Home-page: https://github.com/joknarf/pywebexec
|
|
6
6
|
Author: Franck Jouvanceau
|
|
@@ -58,6 +58,7 @@ Requires-Dist: cryptography>=40.0.2
|
|
|
58
58
|
Requires-Dist: Flask>=2.0.3
|
|
59
59
|
Requires-Dist: Flask-HTTPAuth>=4.8.0
|
|
60
60
|
Requires-Dist: gunicorn>=21.2.0
|
|
61
|
+
Requires-Dist: ldap3>=2.9.1
|
|
61
62
|
|
|
62
63
|
[](https://pypi.org/project/pywebexec/)
|
|
63
64
|

|
|
@@ -75,59 +76,93 @@ $ pip install pywebexec
|
|
|
75
76
|
|
|
76
77
|
## Quick start
|
|
77
78
|
|
|
79
|
+
* put in a directory the scripts/commands/links to commands you want to expose
|
|
78
80
|
* start http server serving current directory executables listening on 0.0.0.0 port 8080
|
|
79
|
-
```
|
|
81
|
+
```shell
|
|
80
82
|
$ pywebexec
|
|
81
83
|
```
|
|
82
84
|
|
|
83
85
|
* Launch commands with params/view live output/Status using browser
|
|
84
|
-

|
|
85
87
|
|
|
86
88
|
## features
|
|
87
89
|
|
|
88
|
-
* Serve executables in
|
|
90
|
+
* Serve executables in a directory
|
|
89
91
|
* Launch commands with params from web browser or API call
|
|
90
92
|
* Follow live output
|
|
91
93
|
* Stop command
|
|
92
94
|
* Relaunch command
|
|
93
95
|
* HTTPS support
|
|
94
96
|
* HTTPS self-signed certificate generator
|
|
97
|
+
* Basic Auth
|
|
98
|
+
* LDAP(S)
|
|
95
99
|
* Can be started as a daemon (POSIX)
|
|
96
100
|
* uses gunicorn to serve http/https
|
|
101
|
+
* compatible Linux/MacOS
|
|
97
102
|
|
|
98
103
|
## Customize server
|
|
99
|
-
```
|
|
100
|
-
$ pywebexec --listen 0.0.0.0 --port 8080
|
|
101
|
-
$ pywebexec -l 0.0.0.0 -p 8080
|
|
104
|
+
```shell
|
|
105
|
+
$ pywebexec --dir ~/myscripts --listen 0.0.0.0 --port 8080
|
|
106
|
+
$ pywebexec -d ~/myscripts -l 0.0.0.0 -p 8080
|
|
102
107
|
```
|
|
103
108
|
|
|
104
|
-
## Basic auth
|
|
105
|
-
|
|
109
|
+
## Basic auth
|
|
110
|
+
|
|
111
|
+
* single user/password
|
|
112
|
+
```shell
|
|
106
113
|
$ pywebexec --user myuser [--password mypass]
|
|
107
|
-
$
|
|
114
|
+
$ pywebexec -u myuser [-P mypass]
|
|
108
115
|
```
|
|
109
116
|
Generated password is given if no `--pasword` option
|
|
110
117
|
|
|
118
|
+
* ldap(s) password check / group member
|
|
119
|
+
```shell
|
|
120
|
+
$ export PYWEBEXEC_LDAP_SERVER=ldap.forumsys.com
|
|
121
|
+
$ export PYWEBEXEC_LDAP_USE_SSL=0
|
|
122
|
+
$ export PYWEBEXEC_LDAP_BIND_DN="cn=read-only-admin,dc=example,dc=com"
|
|
123
|
+
$ export PYWEBEXEC_LDAP_BIND_PASSWORD="password"
|
|
124
|
+
$ export PYWEBEXEC_LDAP_GROUPS=mathematicians,scientists
|
|
125
|
+
$ export PYWEBEXEC_LDAP_USER_ID="uid"
|
|
126
|
+
$ export PYWEBEXEC_LDAP_BASE_DN="dc=example,dc=com"
|
|
127
|
+
$ pywebexec
|
|
128
|
+
```
|
|
111
129
|
## HTTPS server
|
|
112
130
|
|
|
113
131
|
* Generate auto-signed certificate and start https server
|
|
114
|
-
```
|
|
132
|
+
```shell
|
|
115
133
|
$ pywebfs --gencert
|
|
116
134
|
$ pywebfs --g
|
|
117
135
|
```
|
|
118
136
|
|
|
119
137
|
* Start https server using existing certificate
|
|
120
|
-
```
|
|
138
|
+
```shell
|
|
121
139
|
$ pywebfs --cert /pathto/host.cert --key /pathto/host.key
|
|
122
140
|
$ pywebfs -c /pathto/host.cert -k /pathto/host.key
|
|
123
141
|
```
|
|
124
142
|
|
|
125
|
-
## Launch server as a daemon
|
|
143
|
+
## Launch server as a daemon
|
|
126
144
|
|
|
127
|
-
```
|
|
145
|
+
```shell
|
|
128
146
|
$ pywebexec start
|
|
129
147
|
$ pywebexec status
|
|
130
148
|
$ pywebexec stop
|
|
131
149
|
```
|
|
132
150
|
* log of server are stored in directory `[.config/].pywebexec/pywebexec_<listen>:<port>.log`
|
|
133
151
|
|
|
152
|
+
## Launch command through API
|
|
153
|
+
|
|
154
|
+
```shell
|
|
155
|
+
$ curl http://myhost:8080/run_script -H 'Content-Type: application/json' -X POST -d '{ "script_name":"myscript", "param":["param1", ...]}
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## API reference
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
| method | route | params/payload | returns
|
|
162
|
+
|-----------|-----------------------------|--------------------|---------------------|
|
|
163
|
+
| POST | /run_command | command: str<br>params: array[str] | command_id: uuid<br>message: str |
|
|
164
|
+
| POST | /stop_command/command_id | | message: str |
|
|
165
|
+
| GET | /command_status/command_id | | command_id: uuid<br>command: str<br>params: array[str]<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int |
|
|
166
|
+
| GET | /command_output/command_id | | output: str<br>status: str |
|
|
167
|
+
| GET | /commands | | array of<br>command_id: uuid<br>command: str<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int |
|
|
168
|
+
| GET | /executables | | array of str |
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
[](https://pypi.org/project/pywebexec/)
|
|
2
|
+

|
|
3
|
+
[](https://shields.io/)
|
|
4
|
+
[](https://pepy.tech/project/pywebexec)
|
|
5
|
+
[](https://shields.io/)
|
|
6
|
+
|
|
7
|
+
# pywebexec
|
|
8
|
+
Simple Python HTTP(S) API/Web Command Launcher
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
```
|
|
12
|
+
$ pip install pywebexec
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
* put in a directory the scripts/commands/links to commands you want to expose
|
|
18
|
+
* start http server serving current directory executables listening on 0.0.0.0 port 8080
|
|
19
|
+
```shell
|
|
20
|
+
$ pywebexec
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
* Launch commands with params/view live output/Status using browser
|
|
24
|
+

|
|
25
|
+
|
|
26
|
+
## features
|
|
27
|
+
|
|
28
|
+
* Serve executables in a directory
|
|
29
|
+
* Launch commands with params from web browser or API call
|
|
30
|
+
* Follow live output
|
|
31
|
+
* Stop command
|
|
32
|
+
* Relaunch command
|
|
33
|
+
* HTTPS support
|
|
34
|
+
* HTTPS self-signed certificate generator
|
|
35
|
+
* Basic Auth
|
|
36
|
+
* LDAP(S)
|
|
37
|
+
* Can be started as a daemon (POSIX)
|
|
38
|
+
* uses gunicorn to serve http/https
|
|
39
|
+
* compatible Linux/MacOS
|
|
40
|
+
|
|
41
|
+
## Customize server
|
|
42
|
+
```shell
|
|
43
|
+
$ pywebexec --dir ~/myscripts --listen 0.0.0.0 --port 8080
|
|
44
|
+
$ pywebexec -d ~/myscripts -l 0.0.0.0 -p 8080
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Basic auth
|
|
48
|
+
|
|
49
|
+
* single user/password
|
|
50
|
+
```shell
|
|
51
|
+
$ pywebexec --user myuser [--password mypass]
|
|
52
|
+
$ pywebexec -u myuser [-P mypass]
|
|
53
|
+
```
|
|
54
|
+
Generated password is given if no `--pasword` option
|
|
55
|
+
|
|
56
|
+
* ldap(s) password check / group member
|
|
57
|
+
```shell
|
|
58
|
+
$ export PYWEBEXEC_LDAP_SERVER=ldap.forumsys.com
|
|
59
|
+
$ export PYWEBEXEC_LDAP_USE_SSL=0
|
|
60
|
+
$ export PYWEBEXEC_LDAP_BIND_DN="cn=read-only-admin,dc=example,dc=com"
|
|
61
|
+
$ export PYWEBEXEC_LDAP_BIND_PASSWORD="password"
|
|
62
|
+
$ export PYWEBEXEC_LDAP_GROUPS=mathematicians,scientists
|
|
63
|
+
$ export PYWEBEXEC_LDAP_USER_ID="uid"
|
|
64
|
+
$ export PYWEBEXEC_LDAP_BASE_DN="dc=example,dc=com"
|
|
65
|
+
$ pywebexec
|
|
66
|
+
```
|
|
67
|
+
## HTTPS server
|
|
68
|
+
|
|
69
|
+
* Generate auto-signed certificate and start https server
|
|
70
|
+
```shell
|
|
71
|
+
$ pywebfs --gencert
|
|
72
|
+
$ pywebfs --g
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
* Start https server using existing certificate
|
|
76
|
+
```shell
|
|
77
|
+
$ pywebfs --cert /pathto/host.cert --key /pathto/host.key
|
|
78
|
+
$ pywebfs -c /pathto/host.cert -k /pathto/host.key
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Launch server as a daemon
|
|
82
|
+
|
|
83
|
+
```shell
|
|
84
|
+
$ pywebexec start
|
|
85
|
+
$ pywebexec status
|
|
86
|
+
$ pywebexec stop
|
|
87
|
+
```
|
|
88
|
+
* log of server are stored in directory `[.config/].pywebexec/pywebexec_<listen>:<port>.log`
|
|
89
|
+
|
|
90
|
+
## Launch command through API
|
|
91
|
+
|
|
92
|
+
```shell
|
|
93
|
+
$ curl http://myhost:8080/run_script -H 'Content-Type: application/json' -X POST -d '{ "script_name":"myscript", "param":["param1", ...]}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## API reference
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
| method | route | params/payload | returns
|
|
100
|
+
|-----------|-----------------------------|--------------------|---------------------|
|
|
101
|
+
| POST | /run_command | command: str<br>params: array[str] | command_id: uuid<br>message: str |
|
|
102
|
+
| POST | /stop_command/command_id | | message: str |
|
|
103
|
+
| GET | /command_status/command_id | | command_id: uuid<br>command: str<br>params: array[str]<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int |
|
|
104
|
+
| GET | /command_output/command_id | | output: str<br>status: str |
|
|
105
|
+
| GET | /commands | | array of<br>command_id: uuid<br>command: str<br>start_time: isotime<br>end_time: isotime<br>status: str<br>exit_code: int |
|
|
106
|
+
| GET | /executables | | array of str |
|