Name | pywebexec JSON |
Version |
1.3.2
JSON |
| download |
home_page | https://github.com/joknarf/pywebexec |
Summary | Simple Python HTTP Exec Server |
upload_time | 2025-01-18 17:28:11 |
maintainer | Franck Jouvanceau |
docs_url | None |
author | Franck Jouvanceau |
requires_python | >=3.6 |
license | MIT License Copyright (c) 2025 joknarf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
http
server
remote commands
api
website
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![Pypi version](https://img.shields.io/pypi/v/pywebexec.svg)](https://pypi.org/project/pywebexec/)
![example](https://github.com/joknarf/pywebexec/actions/workflows/python-publish.yml/badge.svg)
[![Licence](https://img.shields.io/badge/licence-MIT-blue.svg)](https://shields.io/)
[![PyPI Downloads](https://static.pepy.tech/badge/pywebexec)](https://pepy.tech/projects/pywebexec)
[![Python versions](https://img.shields.io/badge/python-3.6+-blue.svg)](https://shields.io/)
# pywebexec
Simple Python HTTP(S) API/Web Command Launcher and Terminal sharing
## Install
```
$ pip install pywebexec
```
## Quick start
* put in a directory the scripts/commands/links to commands you want to expose
* start http server serving current directory executables listening on 0.0.0.0 port 8080
```shell
$ pywebexec -d <dir>
```
* Launch commands with params/view live output/Status using browser
* Share your terminal output using `pywebexec -d <dir> term`
all commands output / statuses are available in the executables directory in subdirectory `.web_status`
![pywebexecnew8](https://github.com/user-attachments/assets/b36c98e7-8209-46f9-a320-57f460255bc7)
## features
* Serve executables in a directory
* Launch commands with params from web browser or API call
* multiple share terminal output
* Follow live output
* Stop command
* Relaunch command
* HTTPS support
* HTTPS self-signed certificate generator
* Basic Auth
* LDAP(S) password check/group member
* Safe url token generation
* Can be started as a daemon (POSIX)
* Uses gunicorn to serve http/https
* Linux/MacOS compatible
## Customize server
```shell
$ pywebexec --dir ~/myscripts --listen 0.0.0.0 --port 8080 --title myscripts
$ pywebexec -d ~/myscripts -l 0.0.0.0 -p 8080 -t myscripts
```
## Safe url token
* generate safe url, use the url to access the server
```shell
$ pywebexec -T
$ pywebexec --tokenurl
Starting server:
http://<host>:8080?token=jSTWiNgEVkddeEJ7I97x2ekOeaiXs2mErRSKNxm3DP0
http://x.x.x.x:8080?token=jSTWiNgEVkddeEJ7I97x2ekOeaiXs2mErRSKNxm3DP0
```
## Basic auth
* single user/password
```shell
$ pywebexec --user myuser [--password mypass]
$ pywebexec -u myuser [-P mypass]
```
Generated password is given if no `--pasword` option
* ldap(s) password check / group member
```shell
$ export PYWEBEXEC_LDAP_SERVER=ldap://ldap.forumsys.com:389
$ export PYWEBEXEC_LDAP_BIND_DN="cn=read-only-admin,dc=example,dc=com"
$ export PYWEBEXEC_LDAP_BIND_PASSWORD="password"
$ export PYWEBEXEC_LDAP_GROUPS="ou=mathematicians,ou=scientists"
$ export PYWEBEXEC_LDAP_USER_ID="uid"
$ export PYWEBEXEC_LDAP_BASE_DN="dc=example,dc=com"
$ pywebexec
```
## HTTPS server
* Generate auto-signed certificate and start https server
```shell
$ pywebexec --gencert
$ pywebexec --g
```
* Start https server using existing certificate
```shell
$ pywebexec --cert /pathto/host.cert --key /pathto/host.key
$ pywebexec -c /pathto/host.cert -k /pathto/host.key
```
## Launch server as a daemon
```shell
$ pywebexec start
$ pywebexec status
$ pywebexec stop
```
* log of server are stored in directory `~/[.config/].pywebexec/pywebexec_<listen>:<port>.log`
## Launch command through API
```shell
$ curl http://myhost:8080/run_command -H 'Content-Type: application/json' -X POST -d '{ "command":"myscript", "params":["param1", ...]}'
$ curl http://myhost:8080/command_status/<command_id>
$ curl http://myhost:8080/command_output/<command_id> -H "Accept: text/plain"
```
## API reference
| method | route | params/payload | returns
|-----------|-----------------------------|--------------------|---------------------|
| POST | /run_command | command: str<br>params: array[str] | command_id: uuid<br>message: str |
| POST | /stop_command/command_id | | message: str |
| 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<br>last_output_line: str |
| GET | /command_output/command_id | offset: int | output: str<br>status: str<br>links: { next: str } |
| 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<br>last_output_line: str |
| GET | /executables | | array of str |
Raw data
{
"_id": null,
"home_page": "https://github.com/joknarf/pywebexec",
"name": "pywebexec",
"maintainer": "Franck Jouvanceau",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "http, server, remote commands, api, website",
"author": "Franck Jouvanceau",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/e8/97/ce3cb2c38044e00a3d6fa894ef14538f843710cba5fdee8ba964632b7a11/pywebexec-1.3.2.tar.gz",
"platform": null,
"description": "[![Pypi version](https://img.shields.io/pypi/v/pywebexec.svg)](https://pypi.org/project/pywebexec/)\n![example](https://github.com/joknarf/pywebexec/actions/workflows/python-publish.yml/badge.svg)\n[![Licence](https://img.shields.io/badge/licence-MIT-blue.svg)](https://shields.io/)\n[![PyPI Downloads](https://static.pepy.tech/badge/pywebexec)](https://pepy.tech/projects/pywebexec)\n[![Python versions](https://img.shields.io/badge/python-3.6+-blue.svg)](https://shields.io/)\n\n# pywebexec\nSimple Python HTTP(S) API/Web Command Launcher and Terminal sharing\n\n## Install\n```\n$ pip install pywebexec\n```\n\n## Quick start\n\n* put in a directory the scripts/commands/links to commands you want to expose\n* start http server serving current directory executables listening on 0.0.0.0 port 8080\n```shell\n$ pywebexec -d <dir>\n```\n\n* Launch commands with params/view live output/Status using browser\n* Share your terminal output using `pywebexec -d <dir> term`\n\n\nall commands output / statuses are available in the executables directory in subdirectory `.web_status`\n![pywebexecnew8](https://github.com/user-attachments/assets/b36c98e7-8209-46f9-a320-57f460255bc7)\n\n## features\n\n* Serve executables in a directory\n* Launch commands with params from web browser or API call\n* multiple share terminal output\n* Follow live output\n* Stop command\n* Relaunch command\n* HTTPS support\n* HTTPS self-signed certificate generator\n* Basic Auth\n* LDAP(S) password check/group member\n* Safe url token generation\n* Can be started as a daemon (POSIX)\n* Uses gunicorn to serve http/https\n* Linux/MacOS compatible\n\n## Customize server\n```shell\n$ pywebexec --dir ~/myscripts --listen 0.0.0.0 --port 8080 --title myscripts\n$ pywebexec -d ~/myscripts -l 0.0.0.0 -p 8080 -t myscripts\n```\n\n## Safe url token\n\n* generate safe url, use the url to access the server\n```shell\n$ pywebexec -T\n$ pywebexec --tokenurl\nStarting server:\nhttp://<host>:8080?token=jSTWiNgEVkddeEJ7I97x2ekOeaiXs2mErRSKNxm3DP0\nhttp://x.x.x.x:8080?token=jSTWiNgEVkddeEJ7I97x2ekOeaiXs2mErRSKNxm3DP0\n```\n\n## Basic auth\n\n* single user/password\n```shell\n$ pywebexec --user myuser [--password mypass]\n$ pywebexec -u myuser [-P mypass]\n```\nGenerated password is given if no `--pasword` option\n\n* ldap(s) password check / group member\n```shell\n$ export PYWEBEXEC_LDAP_SERVER=ldap://ldap.forumsys.com:389\n$ export PYWEBEXEC_LDAP_BIND_DN=\"cn=read-only-admin,dc=example,dc=com\"\n$ export PYWEBEXEC_LDAP_BIND_PASSWORD=\"password\"\n$ export PYWEBEXEC_LDAP_GROUPS=\"ou=mathematicians,ou=scientists\"\n$ export PYWEBEXEC_LDAP_USER_ID=\"uid\"\n$ export PYWEBEXEC_LDAP_BASE_DN=\"dc=example,dc=com\"\n$ pywebexec\n```\n## HTTPS server\n\n* Generate auto-signed certificate and start https server\n```shell\n$ pywebexec --gencert\n$ pywebexec --g\n```\n\n* Start https server using existing certificate\n```shell\n$ pywebexec --cert /pathto/host.cert --key /pathto/host.key\n$ pywebexec -c /pathto/host.cert -k /pathto/host.key\n```\n\n## Launch server as a daemon\n\n```shell\n$ pywebexec start\n$ pywebexec status\n$ pywebexec stop\n```\n* log of server are stored in directory `~/[.config/].pywebexec/pywebexec_<listen>:<port>.log`\n\n## Launch command through API\n\n```shell\n$ curl http://myhost:8080/run_command -H 'Content-Type: application/json' -X POST -d '{ \"command\":\"myscript\", \"params\":[\"param1\", ...]}'\n$ curl http://myhost:8080/command_status/<command_id>\n$ curl http://myhost:8080/command_output/<command_id> -H \"Accept: text/plain\"\n```\n\n## API reference\n\n\n| method | route | params/payload | returns\n|-----------|-----------------------------|--------------------|---------------------|\n| POST | /run_command | command: str<br>params: array[str] | command_id: uuid<br>message: str |\n| POST | /stop_command/command_id | | message: str |\n| 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<br>last_output_line: str |\n| GET | /command_output/command_id | offset: int | output: str<br>status: str<br>links: { next: str } |\n| 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<br>last_output_line: str |\n| GET | /executables | | array of str |\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2025 joknarf Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Simple Python HTTP Exec Server",
"version": "1.3.2",
"project_urls": {
"Documentation": "https://github.com/joknarf/pywebexec/blob/main/README.md",
"Homepage": "https://github.com/joknarf/pywebexec",
"Repository": "https://github.com/joknarf/pywebexec.git"
},
"split_keywords": [
"http",
" server",
" remote commands",
" api",
" website"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6428c72012066e12d111fcecb0645f2defb7cecd416d58f6b9cb50fa75dfba19",
"md5": "2b629cf37771ea4510d09271bc29b28b",
"sha256": "0732d5b1a1a5ecc3209566917738a140ff1c998aa1836d443ec24d0aece457a5"
},
"downloads": -1,
"filename": "pywebexec-1.3.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2b629cf37771ea4510d09271bc29b28b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 114658,
"upload_time": "2025-01-18T17:28:10",
"upload_time_iso_8601": "2025-01-18T17:28:10.268900Z",
"url": "https://files.pythonhosted.org/packages/64/28/c72012066e12d111fcecb0645f2defb7cecd416d58f6b9cb50fa75dfba19/pywebexec-1.3.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e897ce3cb2c38044e00a3d6fa894ef14538f843710cba5fdee8ba964632b7a11",
"md5": "86f7af81f57ba54d76b7602e1c07887b",
"sha256": "b0b9eb6db670b53634b83be6bc5ec44dd76c8086ccad43fd827403adf03f12ab"
},
"downloads": -1,
"filename": "pywebexec-1.3.2.tar.gz",
"has_sig": false,
"md5_digest": "86f7af81f57ba54d76b7602e1c07887b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 115743,
"upload_time": "2025-01-18T17:28:11",
"upload_time_iso_8601": "2025-01-18T17:28:11.537779Z",
"url": "https://files.pythonhosted.org/packages/e8/97/ce3cb2c38044e00a3d6fa894ef14538f843710cba5fdee8ba964632b7a11/pywebexec-1.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-18 17:28:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "joknarf",
"github_project": "pywebexec",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pywebexec"
}