pywebexec 1.1.7__tar.gz → 1.1.9__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-1.1.7/pywebexec.egg-info → pywebexec-1.1.9}/PKG-INFO +7 -5
- {pywebexec-1.1.7 → pywebexec-1.1.9}/README.md +6 -4
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/pywebexec.py +2 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/static/css/style.css +2 -2
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/static/js/script.js +6 -5
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/version.py +2 -2
- {pywebexec-1.1.7 → pywebexec-1.1.9/pywebexec.egg-info}/PKG-INFO +7 -5
- {pywebexec-1.1.7 → pywebexec-1.1.9}/.github/workflows/python-publish.yml +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/.gitignore +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/LICENSE +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pyproject.toml +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/__init__.py +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/static/images/aborted.svg +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/static/images/copy.svg +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/static/images/copy_ok.svg +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/static/images/failed.svg +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/static/images/favicon.svg +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/static/images/running.gif +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/static/images/success.svg +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/templates/__init__.py +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec/templates/index.html +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec.egg-info/SOURCES.txt +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec.egg-info/dependency_links.txt +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec.egg-info/entry_points.txt +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec.egg-info/requires.txt +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/pywebexec.egg-info/top_level.txt +0 -0
- {pywebexec-1.1.7 → pywebexec-1.1.9}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: pywebexec
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.9
|
|
4
4
|
Summary: Simple Python HTTP Exec Server
|
|
5
5
|
Home-page: https://github.com/joknarf/pywebexec
|
|
6
6
|
Author: Franck Jouvanceau
|
|
@@ -99,8 +99,8 @@ all commands output / statuses are available in the executables directory in sub
|
|
|
99
99
|
* Basic Auth
|
|
100
100
|
* LDAP(S)
|
|
101
101
|
* Can be started as a daemon (POSIX)
|
|
102
|
-
*
|
|
103
|
-
*
|
|
102
|
+
* Uses gunicorn to serve http/https
|
|
103
|
+
* Linux/MacOS compatible
|
|
104
104
|
|
|
105
105
|
## Customize server
|
|
106
106
|
```shell
|
|
@@ -148,12 +148,14 @@ $ pywebexec start
|
|
|
148
148
|
$ pywebexec status
|
|
149
149
|
$ pywebexec stop
|
|
150
150
|
```
|
|
151
|
-
* log of server are stored in directory
|
|
151
|
+
* log of server are stored in directory `~/[.config/].pywebexec/pywebexec_<listen>:<port>.log`
|
|
152
152
|
|
|
153
153
|
## Launch command through API
|
|
154
154
|
|
|
155
155
|
```shell
|
|
156
|
-
$ curl http://myhost:8080/run_script -H 'Content-Type: application/json' -X POST -d '{ "script_name":"myscript", "
|
|
156
|
+
$ curl http://myhost:8080/run_script -H 'Content-Type: application/json' -X POST -d '{ "script_name":"myscript", "params":["param1", ...]}
|
|
157
|
+
$ curl http://myhost:8080/command_status/<command_id>
|
|
158
|
+
$ curl http://myhost:8080/command_output/<command_id> -H "Accept: text/plain"
|
|
157
159
|
```
|
|
158
160
|
|
|
159
161
|
## API reference
|
|
@@ -37,8 +37,8 @@ all commands output / statuses are available in the executables directory in sub
|
|
|
37
37
|
* Basic Auth
|
|
38
38
|
* LDAP(S)
|
|
39
39
|
* Can be started as a daemon (POSIX)
|
|
40
|
-
*
|
|
41
|
-
*
|
|
40
|
+
* Uses gunicorn to serve http/https
|
|
41
|
+
* Linux/MacOS compatible
|
|
42
42
|
|
|
43
43
|
## Customize server
|
|
44
44
|
```shell
|
|
@@ -86,12 +86,14 @@ $ pywebexec start
|
|
|
86
86
|
$ pywebexec status
|
|
87
87
|
$ pywebexec stop
|
|
88
88
|
```
|
|
89
|
-
* log of server are stored in directory
|
|
89
|
+
* log of server are stored in directory `~/[.config/].pywebexec/pywebexec_<listen>:<port>.log`
|
|
90
90
|
|
|
91
91
|
## Launch command through API
|
|
92
92
|
|
|
93
93
|
```shell
|
|
94
|
-
$ curl http://myhost:8080/run_script -H 'Content-Type: application/json' -X POST -d '{ "script_name":"myscript", "
|
|
94
|
+
$ curl http://myhost:8080/run_script -H 'Content-Type: application/json' -X POST -d '{ "script_name":"myscript", "params":["param1", ...]}
|
|
95
|
+
$ curl http://myhost:8080/command_status/<command_id>
|
|
96
|
+
$ curl http://myhost:8080/command_output/<command_id> -H "Accept: text/plain"
|
|
95
97
|
```
|
|
96
98
|
|
|
97
99
|
## API reference
|
|
@@ -541,6 +541,8 @@ def get_command_output(command_id):
|
|
|
541
541
|
with open(output_file_path, 'r') as output_file:
|
|
542
542
|
output = output_file.read()
|
|
543
543
|
status_data = read_command_status(command_id) or {}
|
|
544
|
+
if request.headers.get('Accept') == 'text/plain':
|
|
545
|
+
return f"{output}\nstatus: {status_data.get('status')}", 200, {'Content-Type': 'text/plain'}
|
|
544
546
|
return jsonify({'output': output, 'status': status_data.get("status")})
|
|
545
547
|
return jsonify({'error': 'Invalid command_id'}), 404
|
|
546
548
|
|
|
@@ -89,10 +89,10 @@ form {
|
|
|
89
89
|
background-image: url("/static/images/aborted.svg")
|
|
90
90
|
}
|
|
91
91
|
.copy_clip {
|
|
92
|
-
padding-right:
|
|
92
|
+
padding-right: 20px;
|
|
93
93
|
background-repeat: no-repeat;
|
|
94
94
|
background-position: right top;
|
|
95
|
-
background-size:
|
|
95
|
+
background-size: 20px 12px;
|
|
96
96
|
white-space: nowrap;
|
|
97
97
|
}
|
|
98
98
|
.copy_clip:hover {
|
|
@@ -33,7 +33,7 @@ async function fetchCommands() {
|
|
|
33
33
|
commandRow.onclick = () => viewOutput(command.command_id);
|
|
34
34
|
commandRow.innerHTML = `
|
|
35
35
|
<td class="monospace">
|
|
36
|
-
<span class="copy_clip" onclick="copyToClipboard('${command.command_id}', this)">${command.command_id.slice(0, 8)}</span>
|
|
36
|
+
<span class="copy_clip" onclick="copyToClipboard('${command.command_id}', this, event)">${command.command_id.slice(0, 8)}</span>
|
|
37
37
|
</td>
|
|
38
38
|
<td><span class="status-icon status-${command.status}"></span>${command.status}</td>
|
|
39
39
|
<td>${formatTime(command.start_time)}</td>
|
|
@@ -41,8 +41,7 @@ async function fetchCommands() {
|
|
|
41
41
|
<td>${command.exit_code}</td>
|
|
42
42
|
<td>${command.command.replace(/^\.\//, '')}</td>
|
|
43
43
|
<td>
|
|
44
|
-
${command.status === 'running' ? `<button onclick="stopCommand('${command.command_id}')">Stop</button>` :
|
|
45
|
-
`}
|
|
44
|
+
${command.status === 'running' ? `<button onclick="stopCommand('${command.command_id}')">Stop</button>` : `<button onclick="relaunchCommand('${command.command_id}')">Run</button>`}
|
|
46
45
|
</td>
|
|
47
46
|
<td class="monospace outcol">${command.last_output_line || ''}</td>
|
|
48
47
|
`;
|
|
@@ -146,12 +145,14 @@ function formatDuration(startTime, endTime) {
|
|
|
146
145
|
return `${hours}h ${minutes}m ${seconds}s`;
|
|
147
146
|
}
|
|
148
147
|
|
|
149
|
-
function copyToClipboard(text, element) {
|
|
148
|
+
function copyToClipboard(text, element, event) {
|
|
149
|
+
event.stopPropagation();
|
|
150
|
+
event.stopImmediatePropagation();
|
|
150
151
|
navigator.clipboard.writeText(text).then(() => {
|
|
151
152
|
element.classList.add('copy_clip_ok');
|
|
152
153
|
setTimeout(() => {
|
|
153
154
|
element.classList.remove('copy_clip_ok');
|
|
154
|
-
},
|
|
155
|
+
}, 1000);
|
|
155
156
|
});
|
|
156
157
|
}
|
|
157
158
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: pywebexec
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.9
|
|
4
4
|
Summary: Simple Python HTTP Exec Server
|
|
5
5
|
Home-page: https://github.com/joknarf/pywebexec
|
|
6
6
|
Author: Franck Jouvanceau
|
|
@@ -99,8 +99,8 @@ all commands output / statuses are available in the executables directory in sub
|
|
|
99
99
|
* Basic Auth
|
|
100
100
|
* LDAP(S)
|
|
101
101
|
* Can be started as a daemon (POSIX)
|
|
102
|
-
*
|
|
103
|
-
*
|
|
102
|
+
* Uses gunicorn to serve http/https
|
|
103
|
+
* Linux/MacOS compatible
|
|
104
104
|
|
|
105
105
|
## Customize server
|
|
106
106
|
```shell
|
|
@@ -148,12 +148,14 @@ $ pywebexec start
|
|
|
148
148
|
$ pywebexec status
|
|
149
149
|
$ pywebexec stop
|
|
150
150
|
```
|
|
151
|
-
* log of server are stored in directory
|
|
151
|
+
* log of server are stored in directory `~/[.config/].pywebexec/pywebexec_<listen>:<port>.log`
|
|
152
152
|
|
|
153
153
|
## Launch command through API
|
|
154
154
|
|
|
155
155
|
```shell
|
|
156
|
-
$ curl http://myhost:8080/run_script -H 'Content-Type: application/json' -X POST -d '{ "script_name":"myscript", "
|
|
156
|
+
$ curl http://myhost:8080/run_script -H 'Content-Type: application/json' -X POST -d '{ "script_name":"myscript", "params":["param1", ...]}
|
|
157
|
+
$ curl http://myhost:8080/command_status/<command_id>
|
|
158
|
+
$ curl http://myhost:8080/command_output/<command_id> -H "Accept: text/plain"
|
|
157
159
|
```
|
|
158
160
|
|
|
159
161
|
## API reference
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|