pywebexec 1.9.7__py3-none-any.whl → 1.9.9__py3-none-any.whl
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/pywebexec.py +6 -4
- pywebexec/static/css/style.css +19 -12
- pywebexec/static/js/executables.js +2 -2
- pywebexec/swagger.yaml +6 -6
- pywebexec/version.py +2 -2
- {pywebexec-1.9.7.dist-info → pywebexec-1.9.9.dist-info}/METADATA +12 -10
- {pywebexec-1.9.7.dist-info → pywebexec-1.9.9.dist-info}/RECORD +11 -11
- {pywebexec-1.9.7.dist-info → pywebexec-1.9.9.dist-info}/LICENSE +0 -0
- {pywebexec-1.9.7.dist-info → pywebexec-1.9.9.dist-info}/WHEEL +0 -0
- {pywebexec-1.9.7.dist-info → pywebexec-1.9.9.dist-info}/entry_points.txt +0 -0
- {pywebexec-1.9.7.dist-info → pywebexec-1.9.9.dist-info}/top_level.txt +0 -0
pywebexec/pywebexec.py
CHANGED
@@ -766,6 +766,12 @@ def run_command_endpoint():
|
|
766
766
|
|
767
767
|
return jsonify({'message': 'Command is running', 'command_id': command_id})
|
768
768
|
|
769
|
+
@app.route('/commands/exposed', methods=['GET'])
|
770
|
+
def list_executables():
|
771
|
+
executables_list = get_executables()
|
772
|
+
return jsonify({"commands": executables_list})
|
773
|
+
|
774
|
+
|
769
775
|
@app.route('/commands/<cmd>', methods=['POST'])
|
770
776
|
def run_dynamic_command(cmd):
|
771
777
|
# Validate that 'cmd' is an executable in the current directory
|
@@ -871,10 +877,6 @@ def get_command_output_raw(command_id):
|
|
871
877
|
return
|
872
878
|
return Response(generate(offset), content_type='text/plain')
|
873
879
|
|
874
|
-
@app.route('/executables', methods=['GET'])
|
875
|
-
def list_executables():
|
876
|
-
executables_list = get_executables()
|
877
|
-
return jsonify({"executables": executables_list})
|
878
880
|
|
879
881
|
@app.route('/commands/<command_id>/popup')
|
880
882
|
def popup(command_id):
|
pywebexec/static/css/style.css
CHANGED
@@ -99,6 +99,9 @@ form {
|
|
99
99
|
vertical-align: bottom;
|
100
100
|
padding-left: 35px;
|
101
101
|
}
|
102
|
+
code {
|
103
|
+
font-family: "CommitMono Nerd Font Mono", Consolas, "Courier New", monospace;
|
104
|
+
}
|
102
105
|
#paramsHelp {
|
103
106
|
position: absolute;
|
104
107
|
background-color: #e0e0ff;
|
@@ -126,9 +129,16 @@ form {
|
|
126
129
|
td, th{
|
127
130
|
margin: 0;
|
128
131
|
padding: 4px 6px;
|
129
|
-
border-bottom: 1px solid #
|
132
|
+
border-bottom: 1px solid #ccc;
|
133
|
+
}
|
134
|
+
ul, ol{
|
135
|
+
margin: 0;
|
136
|
+
padding: 0;
|
137
|
+
padding-left: 30px;
|
138
|
+
}
|
139
|
+
p {
|
140
|
+
margin-bottom: 4px;
|
130
141
|
}
|
131
|
-
|
132
142
|
th:last-child {
|
133
143
|
border-top-right-radius: 10px;
|
134
144
|
}
|
@@ -147,9 +157,14 @@ form {
|
|
147
157
|
tr > td:last-child {
|
148
158
|
border-right: 1px solid #aaa;
|
149
159
|
}
|
150
|
-
code {
|
151
|
-
font-family: "CommitMono Nerd Font Mono", Consolas, "Courier New", monospace;
|
160
|
+
code, pre {
|
152
161
|
font-size: 14px;
|
162
|
+
background-color: #d5d5fe;
|
163
|
+
}
|
164
|
+
pre {
|
165
|
+
padding: 5px 10px;
|
166
|
+
border-radius: 10px;
|
167
|
+
overflow-x: auto;
|
153
168
|
}
|
154
169
|
}
|
155
170
|
#thStatus {
|
@@ -320,14 +335,6 @@ body.dimmed * {
|
|
320
335
|
left: 50%;
|
321
336
|
transform: translate(-50%, -50%);
|
322
337
|
}
|
323
|
-
/* allow wide chars in terminal */
|
324
|
-
/*
|
325
|
-
span {
|
326
|
-
letter-spacing: 0px !important;
|
327
|
-
margin-right: -0.17px;
|
328
|
-
margin-left: -0.09px
|
329
|
-
}
|
330
|
-
*/
|
331
338
|
.slider-container {
|
332
339
|
display: flex;
|
333
340
|
align-items: center;
|
@@ -225,7 +225,7 @@ window.addEventListener('load', () => {
|
|
225
225
|
|
226
226
|
async function fetchExecutables() {
|
227
227
|
try {
|
228
|
-
const response = await fetch(`/
|
228
|
+
const response = await fetch(`/commands/exposed`);
|
229
229
|
if (!response.ok) {
|
230
230
|
throw new Error('Failed to fetch executables');
|
231
231
|
}
|
@@ -233,7 +233,7 @@ async function fetchExecutables() {
|
|
233
233
|
// Build mapping from executable name to its object
|
234
234
|
gExecutables = {};
|
235
235
|
commandListDiv.innerHTML = '';
|
236
|
-
data.
|
236
|
+
data.commands.forEach(exeObj => {
|
237
237
|
gExecutables[exeObj.command] = exeObj;
|
238
238
|
const div = document.createElement('div');
|
239
239
|
div.className = 'command-item';
|
pywebexec/swagger.yaml
CHANGED
@@ -190,7 +190,7 @@ paths:
|
|
190
190
|
properties:
|
191
191
|
message:
|
192
192
|
type: string
|
193
|
-
/
|
193
|
+
/commands/exposed:
|
194
194
|
get:
|
195
195
|
summary: "List available executable commands"
|
196
196
|
tags:
|
@@ -199,11 +199,11 @@ paths:
|
|
199
199
|
- application/json
|
200
200
|
responses:
|
201
201
|
"200":
|
202
|
-
description: "List of
|
202
|
+
description: "List of commands with markdown help"
|
203
203
|
schema:
|
204
204
|
type: object
|
205
205
|
properties:
|
206
|
-
|
206
|
+
commands:
|
207
207
|
type: array
|
208
208
|
items:
|
209
209
|
type: object
|
@@ -214,8 +214,8 @@ paths:
|
|
214
214
|
type: string
|
215
215
|
examples:
|
216
216
|
application/json:
|
217
|
-
|
217
|
+
commands:
|
218
218
|
- command: ls
|
219
|
-
help: "List directory contents\
|
219
|
+
help: "List directory contents \n**params**:\n* `<ls_params>`"
|
220
220
|
- command: cat
|
221
|
-
help: "Concatenate and display files\
|
221
|
+
help: "Concatenate and display files \n**params**:\n* `<cat_params>`"
|
pywebexec/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: pywebexec
|
3
|
-
Version: 1.9.
|
3
|
+
Version: 1.9.9
|
4
4
|
Summary: Simple Python HTTP Exec Server
|
5
5
|
Home-page: https://github.com/joknarf/pywebexec
|
6
6
|
Author: Franck Jouvanceau
|
@@ -207,24 +207,26 @@ The help message is displayed:
|
|
207
207
|
* in the response when calling the API `/executables`
|
208
208
|
* in the swagger-ui in the `/commands/<command>` route.
|
209
209
|
|
210
|
-
<img src="https://github.com/user-attachments/assets/
|
210
|
+
<img src="https://github.com/user-attachments/assets/ecdeb890-5018-498f-872a-57dd4bf542cf" width="400"/>
|
211
211
|
|
212
212
|
## Swagger UI
|
213
213
|
|
214
214
|
A swagger UI is available at `http[s]://<srv>/v0/documentation`
|
215
215
|
|
216
|
-
<img src="https://github.com/user-attachments/assets/
|
216
|
+
<img src="https://github.com/user-attachments/assets/c80a341e-c04c-4606-9510-a57b473a74e5" width="400"/>
|
217
217
|
|
218
218
|
## API reference
|
219
219
|
|
220
220
|
|
221
221
|
| method | route | params/payload | returns
|
222
222
|
|-----------|-----------------------------|--------------------|---------------------|
|
223
|
-
| GET | /
|
223
|
+
| GET | /commands/exposed | | commands: [<br> {<br> command: str,<br> help: str<br> },<br>] |
|
224
224
|
| GET | /commands | | commands: [<br> {<br> command_id: uuid<br> command: str<br> start_time: isotime<br> end_time: isotime<br> status: str<br> exit_code: int<br> last_output_line: str<br> },<br>] |
|
225
|
-
| GET | /commands/{id}
|
226
|
-
| GET | /commands/{id}/output
|
227
|
-
| GET | /commands/{id}/output_raw
|
228
|
-
| POST | /commands
|
229
|
-
| POST | /commands/{cmd}
|
230
|
-
| PATCH
|
225
|
+
| GET | /commands/{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<br>last_output_line: str |
|
226
|
+
| GET | /commands/{id}/output | offset: int | output: str<br>status: str<br>links: { next: str } |
|
227
|
+
| GET | /commands/{id}/output_raw | offset: int | output: stream raw output until end of command<br>curl -Ns http://srv/commands/{id}/output_raw|
|
228
|
+
| POST | /commands | command: str<br>params: array[str]<br>rows: int<br>cols: int | command_id: uuid<br>message: str |
|
229
|
+
| POST | /commands/{cmd} | params: array[str]<br>rows: int<br>cols: int | command_id: uuid<br>message: str |
|
230
|
+
| PATCH | /commands/{id}/stop | | message: str |
|
231
|
+
|
232
|
+
* to get command output as text (without ANSI codes/Control characters) use: `/commands/{id}/output` with header `"Accept: text/plain"`
|
@@ -1,9 +1,9 @@
|
|
1
1
|
pywebexec/__init__.py,sha256=197fHJy0UDBwTTpGCGortZRr-w2kTaD7MxqdbVmTEi0,61
|
2
2
|
pywebexec/host_ip.py,sha256=Ud_HTflWVQ8789aoQ2RZdT1wGI-ccvrwSWGz_c7T3TI,1241
|
3
|
-
pywebexec/pywebexec.py,sha256=
|
4
|
-
pywebexec/swagger.yaml,sha256=
|
5
|
-
pywebexec/version.py,sha256=
|
6
|
-
pywebexec/static/css/style.css,sha256=
|
3
|
+
pywebexec/pywebexec.py,sha256=SU-iD3FQIyWsw0-iGjM2P8INpBW9JhzZ1lI3Y50Fwqk,37983
|
4
|
+
pywebexec/swagger.yaml,sha256=pGG4ikpASgBnzoZ44jJJ8l5JrNz7GOBpCakSJta-30c,5676
|
5
|
+
pywebexec/version.py,sha256=qOm1uilBcYzlcy6ghcmqbDb5vPaWJKJYDFCEytaVpSE,511
|
6
|
+
pywebexec/static/css/style.css,sha256=Le69gWTGbSh7TOERegKvKnqYUy1LC-XLifrPPxoXeCs,9661
|
7
7
|
pywebexec/static/css/xterm.css,sha256=uo5phWaUiJgcz0DAzv46uoByLLbJLeetYosL1xf68rY,5559
|
8
8
|
pywebexec/static/fonts/CommitMonoNerdFontMono-Regular.ttf,sha256=v6nZdSx5cs_TIic8Fujrjzg9u9glWjorDIr7RlwNceM,2370228
|
9
9
|
pywebexec/static/fonts/LICENSE,sha256=gsBdbFPfoMkCWYXBnjcYEAILdO0sYdUdNw8qirJQbVI,4395
|
@@ -23,7 +23,7 @@ pywebexec/static/images/popup.svg,sha256=0Bl9A_v5cBsMPn6FnOlVWlAQKgd2zqiWQbhjcL9
|
|
23
23
|
pywebexec/static/images/resume.svg,sha256=99LP1Ya2JXakRCO9kW8JMuT_4a_CannF65EiuwtvK4A,607
|
24
24
|
pywebexec/static/images/running.svg,sha256=fBCYwYb2O9K4N3waC2nURP25NRwZlqR4PbDZy6JQMww,610
|
25
25
|
pywebexec/static/images/success.svg,sha256=NVwezvVMplt46ElW798vqGfrL21Mw_DWHUp_qiD_FU8,489
|
26
|
-
pywebexec/static/js/executables.js,sha256=
|
26
|
+
pywebexec/static/js/executables.js,sha256=ISRtkAlpjv3agIbTc3MIKV62g22h6NQW8stxA43ZD9Y,9473
|
27
27
|
pywebexec/static/js/popup.js,sha256=0fr3pp4j9D2fXEVnHyQrx2bPWFHfgbb336dbewgH1d8,9023
|
28
28
|
pywebexec/static/js/script.js,sha256=EpDwM1CyvHgsfkMSAkYmS9nU0sKOEXpQ6L3xhDIabEY,17933
|
29
29
|
pywebexec/static/js/marked/LICENSE.md,sha256=jjo_gvWaYJWPVsoI9EVkfDKkcz3HymwsRvbriYRxq5w,2942
|
@@ -42,9 +42,9 @@ pywebexec/static/js/xterm/xterm.js.map,sha256=Y7O2Pb-fIS7Z8AC1D5s04_aiW_Jf1f4mCf
|
|
42
42
|
pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
43
43
|
pywebexec/templates/index.html,sha256=66Oevi5umxCK81IoGoudx3vWp0ltdFMFsymXsnLQw-c,3209
|
44
44
|
pywebexec/templates/popup.html,sha256=3kpMccKD_OLLhJ4Y9KRw6Ny8wQWjVaRrUfV9y5-bDiQ,1580
|
45
|
-
pywebexec-1.9.
|
46
|
-
pywebexec-1.9.
|
47
|
-
pywebexec-1.9.
|
48
|
-
pywebexec-1.9.
|
49
|
-
pywebexec-1.9.
|
50
|
-
pywebexec-1.9.
|
45
|
+
pywebexec-1.9.9.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
|
46
|
+
pywebexec-1.9.9.dist-info/METADATA,sha256=unYofKfmomCtcJjzH0DX3v6IAzOqNujP7BN1Rmt-anc,9684
|
47
|
+
pywebexec-1.9.9.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
48
|
+
pywebexec-1.9.9.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
|
49
|
+
pywebexec-1.9.9.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
|
50
|
+
pywebexec-1.9.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|