A simple and small webserver to react to webhook-calls by running commands.For simplicity, webhook-urls and scripts are configured in a configfile.
Project description
Webhook command runner
This module provides a simple method for automatically execution calling scripts when a webhook-call is received.
In the configuration file you define, which script will be called on wich request. e.g.:
[webserver-settings]
listen_ip: 127.0.0.1
listen_port: 8080
[/print/hello]
method: GET, POST
command: echo "Hello!"
[/wall/hello]
method: GET, POST
command: wall "Hello!"
[/sleep]
method: GET
command: sleep 5 && wall "Hello!"
[/git/pull/webhook_script_execution]
method: GET
path: /data/scripts/webhook_script_execution
command: git pull
To start the webhook command runner simply install it with pip and call webhook-command-runner
:
$ pip3 install webhook-command-runner
$ webhook-command-runner config.ini
The configuration has following sections:
webserver-settings
:
In this section, the IP-Adress and Port configuration can be done.
/request/paths
:
In these sections, it is defined, wich script will be called: You can define:
method
: Which HTTP-Method can be used to trigger the script-execution. Today,GET
andPOST
are implemented.path
: Optionally, you can define a Filesystem-Path, where the script shall be executed.command
: The command to be executed.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for webhook_command_runner-1.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9178be09437eaa2d6341eff776b4d49cdad550beac9f56849b5c4c124e88dd0 |
|
MD5 | 7c13e21f7196e18c8d874923bb2b546a |
|
BLAKE2b-256 | c15e73adc7862a1008d61fde6da746e31225e60945b472022e74d3c7d23c5899 |
Close
Hashes for webhook_command_runner-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b929d8fee73fd9c7fbbbae88be7784aff4dbc121d58feb4f345c6b588754dd79 |
|
MD5 | 8b66fc035c15d5c212c8209deff879f3 |
|
BLAKE2b-256 | 8b28db82a154bf5b80fcecdee02a87078ba6732eb91689a27c1529b507bc670b |