pywebexec 0.1.1__py3-none-any.whl → 1.1.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: pywebexec
3
- Version: 0.1.1
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
  [![Pypi version](https://img.shields.io/pypi/v/pywebexec.svg)](https://pypi.org/project/pywebexec/)
63
64
  ![example](https://github.com/joknarf/pywebexec/actions/workflows/python-publish.yml/badge.svg)
@@ -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
- ![image](https://github.com/user-attachments/assets/921da56f-6d4b-46e3-b16c-e01a2dc9accf)
86
+ ![pywebexec](https://github.com/user-attachments/assets/1bfec34f-8e3b-4ad0-b6c4-c03c957c070a)
85
87
 
86
88
  ## features
87
89
 
88
- * Serve executables in current directory
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 user/password
105
- ```
109
+ ## Basic auth
110
+
111
+ * single user/password
112
+ ```shell
106
113
  $ pywebexec --user myuser [--password mypass]
107
- $ pywebfs -u myuser [-P mypass]
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 (Linux)
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,20 @@
1
+ pywebexec/__init__.py,sha256=4spIsVaF8RJt8S58AG_wWoORRNkws9Iwqprj27C3ljM,99
2
+ pywebexec/pywebexec.py,sha256=KyKJcadzuXWh1Im0bkbu0ScEBMwsWTPQg5xPN2jDMdQ,21174
3
+ pywebexec/version.py,sha256=CqDGE4B1ZqZ-56mxeOFcXRTmlxrdOh4ayrjbcPjziE4,411
4
+ pywebexec/static/css/style.css,sha256=NiBoOzZ35eBM1ZP2HFNda-dzOsAv4xRPh3vsvVgLL9c,2513
5
+ pywebexec/static/images/aborted.svg,sha256=_mP43hU5QdRLFZIknBgjx-dIXrHgQG23-QV27ApXK2A,381
6
+ pywebexec/static/images/copy.svg,sha256=d9OwtGh5GzzZHzYcDrLfNxZYLth1Q64x7bRyYxu4Px0,622
7
+ pywebexec/static/images/copy_ok.svg,sha256=mEqUVUhSq8xaJK2msQkxRawnz_KwlCZ-tok8QS6hJ3g,451
8
+ pywebexec/static/images/failed.svg,sha256=ADZ7IKrUyOXtqpivnz3VcH0-Wru-I5MOi3OJAkI3hxk,1439
9
+ pywebexec/static/images/favicon.svg,sha256=ti80IfuDZwIvQcmJxkOeUaB1iMsiyOPmQmVO-h0y1IU,1126
10
+ pywebexec/static/images/running.svg,sha256=vBpiG6ClNUNCArkwsyqK7O-qhIKJX1NI7MSjclNSp_8,1537
11
+ pywebexec/static/images/success.svg,sha256=PJDcCSTevJh7rkfSFLtc7P0pbeh8PVQBS8DaOLQemmc,489
12
+ pywebexec/static/js/script.js,sha256=d16MohpBSvw5evamC4o3_MWayQ1B8Cj9TePNclroUvo,7093
13
+ pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ pywebexec/templates/index.html,sha256=70yLF1zTrNG4cVFsi9gvy9WYurLXvvMdeR5EFIDafBA,1306
15
+ pywebexec-1.1.0.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
16
+ pywebexec-1.1.0.dist-info/METADATA,sha256=yeelN08_hUHw_GyZIb9oGFmfqr8KhSNJS1zEEnDOWGk,6567
17
+ pywebexec-1.1.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
18
+ pywebexec-1.1.0.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
19
+ pywebexec-1.1.0.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
20
+ pywebexec-1.1.0.dist-info/RECORD,,
@@ -1,17 +0,0 @@
1
- pywebexec/__init__.py,sha256=4spIsVaF8RJt8S58AG_wWoORRNkws9Iwqprj27C3ljM,99
2
- pywebexec/pywebexec.py,sha256=IyNVTDepd5UPfKBHqctIyNez9McNb7z9xN01rXGIK44,12928
3
- pywebexec/version.py,sha256=PKIMyjdUACH4-ONvtunQCnYE2UhlMfp9su83e3HXl5E,411
4
- pywebexec/static/images/aborted.svg,sha256=_mP43hU5QdRLFZIknBgjx-dIXrHgQG23-QV27ApXK2A,381
5
- pywebexec/static/images/copy.svg,sha256=d9OwtGh5GzzZHzYcDrLfNxZYLth1Q64x7bRyYxu4Px0,622
6
- pywebexec/static/images/copy_ok.svg,sha256=mEqUVUhSq8xaJK2msQkxRawnz_KwlCZ-tok8QS6hJ3g,451
7
- pywebexec/static/images/failed.svg,sha256=ADZ7IKrUyOXtqpivnz3VcH0-Wru-I5MOi3OJAkI3hxk,1439
8
- pywebexec/static/images/running.svg,sha256=vBpiG6ClNUNCArkwsyqK7O-qhIKJX1NI7MSjclNSp_8,1537
9
- pywebexec/static/images/success.svg,sha256=PJDcCSTevJh7rkfSFLtc7P0pbeh8PVQBS8DaOLQemmc,489
10
- pywebexec/templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- pywebexec/templates/index.html,sha256=0628YJ1TIH7WPA-UJPfYqEjBo8joYn9685R9Zm5Zz30,12356
12
- pywebexec-0.1.1.dist-info/LICENSE,sha256=gRJf0JPT_wsZJsUGlWPTS8Vypfl9vQ1qjp6sNbKykuA,1064
13
- pywebexec-0.1.1.dist-info/METADATA,sha256=83vtZn2DbTfVaOFejyAiKhef_rYEiE6-ko_LMi8yPhg,4770
14
- pywebexec-0.1.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
15
- pywebexec-0.1.1.dist-info/entry_points.txt,sha256=l52GBkPCXRkmlHfEyoVauyfBdg8o-CAtC8qQpOIjJK0,55
16
- pywebexec-0.1.1.dist-info/top_level.txt,sha256=vHoHyzngrfGdm_nM7Xn_5iLmaCrf10XO1EhldgNLEQ8,10
17
- pywebexec-0.1.1.dist-info/RECORD,,