Simple tool for running shell scripts on webhook events. A simple sample use case is Github Actions: send request from a deploy action to a server with WSI (this project) running to easily run a deploy script
To set up a requests acceptor on a server, follow these steps:
-
Create scripts inside
scripts/directory and make them runnable (chmod +x) -
Create
config.pywith the following variables defined:-
secret_tokenA string token to verify that a trusted service is sending the request -
projects_to_scriptsA dictionary from (strings) projects names to (strings) names of script files insidescripts/directory
Example is in
example_config.py -
-
Run
python3 main.py
Default port is 2010. Post HTTP requests to / with header Authorization set to the authorization secret key from
config.py and json body with key project_name set to name of a project (key of projects_to_scripts
from config.py) are accepted. You can send it in any way. Example with curl:
curl --fail http://localhost:2010 -H "Content-Type: application/json" \
-H "Authorization: password12345" \
--data '{"project_name": "project_name_1"}'