webhaak
webhaak is a simple webhook service to update and deploy sites and do other maintenance without having to ssh to a node.
webhaak supports git push hooks from GitHub, BitBucket, gitea, and gogs; for these it can automatically update checkouts. It also recognises Sentry notifications, and of course regular calls.
Installation
From PyPI
Assuming you already are inside a virtualenv:
pip install webhaak
From Git
Create a new virtualenv (if you are not already in one) and install the necessary packages:
git clone https://codeberg.org/diginaut/webhaak.git
cd webhaak
mkvirtualenv webhaak # or whatever project you are working on
# If you just want to run it, no need for development dependencies
uv sync --active --no-dev
# Otherwise, install everything in the active virtualenv
uv sync --active
Usage
Copy example.yaml from example_config to a directory you will use for configuration and configure to your needs. This is a yaml file with the projects to serve (see next section).
Run webhaak as a service under nginx or apache and call the appropriate url’s when wanted (e.g., on push to repository).
webhaak can also be run from the command line: uvicorn webhaak:app --reload
Be sure to export/set the SECRETKEY environment variable before running, it’s needed for some management URI’s.
Run gunicorn -k uvicorn.workers.UvicornWorker for production. For an example of how to set up a server see this article with configuration for nginx, uvicorn, systemd, security and such.
The RQ background worker can be run from the command line: rq worker --with-scheduler webhaak
Url’s are of the form https://hook.example.com/app/<appkey>/<triggerkey>
API documentation is auto-generated, and can be browsed at https://hook.example.com/docs
Example configuration
See the example hook settings for syntax of how to configure repositories, commands and directories.
Call webhaak on its endpoint /admin/SECRETKEY/get_app_key to generate a random new key for usage in the projects yaml file (so, for example https://hook.example.com/admin/abc123/get_app_key)
By default, webhaak clones projects in a directory under its REPOS_CACHE_DIR directory, but there is support for a per-repo parent dir settings with repo_parent in the yaml.
This means that webhaak then doesn’t clone this repo into its default cache dir, but in a subdirectory of the directory configured in repo_parent, so <repo_parent>/repo_name (e.g., /srv/custom_parent/myproject).
Server configuration
supervisord RQ worker which uses the RQ config
systemd for webhaak API which uses the gunicorn config
What’s new?
See the Changelog.
Developing
Running in PyCharm: tbd :)
Metadata
Release files for webhaak 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| webhaak-0.6.1.tar.gz | 40.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| webhaak-0.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 62.2 kB
Release files / webhaak-0.6.1.tar.gz
| Download URL | webhaak-0.6.1.tar.gz |
|---|---|
| Size | 40.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
11d7771cd75ed34204eba0c9ff05ab76a69bc8eebe172e70b92564b619fb9e52
|
|
BLAKE2b-256 checksum How to use checksums |
be1a9c3a4aedf6cb3f240ba1a65d0e0e5a072a7adc88eb8912d1be1f6294e61e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / webhaak-0.6.1-py3-none-any.whl
| Download URL | webhaak-0.6.1-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8589b3265fb8e7e6770911a0f7eaa4fa900a29e4968422f5d530044ff05e2564
|
|
BLAKE2b-256 checksum How to use checksums |
3b5feda47896db7664f604a49164f11af615b870403e3c3871363de171b76f4e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Security for webhaak 0.6.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.