webhaak


Namewebhaak JSON
Version 0.5.4 PyPI version JSON
download
home_page
SummarySimple webhook service to update and deploy sites and do other maintenance and automatic tasks
upload_time2023-07-28 11:47:15
maintainer
docs_urlNone
author
requires_python>=3.7
licenseApache
keywords webhook api automation ci/cd
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            webhaak
=======

|PyPI version| |PyPI downloads| |PyPI license| |Code quality| |Known vulnerabilities|

`webhaak`_ is a simple `webhook`_ service to update and deploy sites and do
other maintenance without having to ssh to a node.

`webhaak is on ReadTheDocs <https://webhaak.readthedocs.io/en/latest/>`_

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:

.. code-block:: bash

    pip install webhaak

From Git
~~~~~~~~

Create a new virtualenv (if you are not already in one) and install the
necessary packages:

.. code-block:: bash

    git clone https://github.com/aquatix/webhaak.git
    cd webhaak
    mkvirtualenv webhaak # or whatever project you are working on
    pip install -r requirements.txt


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 <https://www.slingacademy.com/article/deploying-fastapi-on-ubuntu-with-nginx-and-lets-encrypt/>`_ with configuration for nginx, uvicorn, systemd, security and such.

The RQ background worker can be run from the command line: ``rq worker --with-scheduler``

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 ``repoparent`` 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 ``repoparent``, so
<repoparent>/reponame (e.g., /srv/customparent/myproject).


Server configuration
~~~~~~~~~~~~~~~~~~~~

* `supervisord RQ worker`_ which uses the `RQ config`_
* `systemd for webhaak API`_ which uses the `gunicorn config`_
* `nginx for webhaak API`_
* `more config`_


What's new?
-----------

See the `Changelog`_.


Developing
----------

Running in PyCharm: tbd :)


.. _webhaak: https://github.com/aquatix/webhaak
.. _webhook: https://en.wikipedia.org/wiki/Webhook
.. |PyPI version| image:: https://img.shields.io/pypi/v/webhaak.svg
   :target: https://pypi.python.org/pypi/webhaak/
.. |PyPI downloads| image:: https://img.shields.io/pypi/dm/webhaak.svg
   :target: https://pypi.python.org/pypi/webhaak/
.. |PyPI license| image:: https://img.shields.io/github/license/aquatix/webhaak.svg
   :target: https://pypi.python.org/pypi/webhaak/
.. |Code quality| image:: https://api.codacy.com/project/badge/Grade/e18e62698761411482716d0fceb65bfe
   :target: https://www.codacy.com/app/aquatix/webhaak?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=aquatix/webhaak&amp;utm_campaign=Badge_Grade
   :alt: Code Quality
.. |Known vulnerabilities| image:: https://snyk.io/test/github/aquatix/webhaak/badge.svg?targetFile=requirements.txt
   :target: https://snyk.io/test/github/aquatix/webhaak
   :alt: Known vulnerabilities
.. _hook settings: https://github.com/aquatix/webhaak/blob/master/example_config/examples.yaml
.. _vhost for Apache2.4: https://github.com/aquatix/webhaak/blob/master/example_config/apache_vhost.conf
.. _uwsgi.ini: https://github.com/aquatix/webhaak/blob/master/example_config/uwsgi.ini
.. _supervisord RQ worker: https://github.com/aquatix/webhaak/blob/master/example_config/supervisord/webhaak_rq_worker.conf
.. _RQ config: https://github.com/aquatix/webhaak/blob/master/example_config/rq_settings.example.py
.. _systemd for webhaak API: https://github.com/aquatix/webhaak/blob/master/example_config/systemd/webhaak.service
.. _gunicorn config: https://github.com/aquatix/webhaak/blob/master/example_config/gunicorn_webhaak_conf.py
.. _more config: https://github.com/aquatix/webhaak/tree/master/example_config
.. _nginx for webhaak API: https://github.com/aquatix/webhaak/blob/master/example_config/nginx/hook.example.com.conf
.. _Changelog: https://github.com/aquatix/webhaak/blob/master/CHANGELOG.md

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "webhaak",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "webhook,api,automation,CI/CD",
    "author": "",
    "author_email": "Michiel Scholten <michiel@diginaut.net>",
    "download_url": "https://files.pythonhosted.org/packages/4b/4b/550143350e77ac469130e5bf110bb894000a9cfc05cc5cb52444b7f5d792/webhaak-0.5.4.tar.gz",
    "platform": null,
    "description": "webhaak\n=======\n\n|PyPI version| |PyPI downloads| |PyPI license| |Code quality| |Known vulnerabilities|\n\n`webhaak`_ is a simple `webhook`_ service to update and deploy sites and do\nother maintenance without having to ssh to a node.\n\n`webhaak is on ReadTheDocs <https://webhaak.readthedocs.io/en/latest/>`_\n\nwebhaak 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.\n\n\nInstallation\n------------\n\nFrom PyPI\n~~~~~~~~~\n\nAssuming you already are inside a virtualenv:\n\n.. code-block:: bash\n\n    pip install webhaak\n\nFrom Git\n~~~~~~~~\n\nCreate a new virtualenv (if you are not already in one) and install the\nnecessary packages:\n\n.. code-block:: bash\n\n    git clone https://github.com/aquatix/webhaak.git\n    cd webhaak\n    mkvirtualenv webhaak # or whatever project you are working on\n    pip install -r requirements.txt\n\n\nUsage\n-----\n\nCopy ``example.yaml`` from example_config to a directory you will use for configuration and\nconfigure to your needs. This is a yaml file with the projects to serve (see next section).\n\nRun webhaak as a service under nginx or apache and call the appropriate\nurl's when wanted (e.g., on push to repository).\n\nwebhaak can also be run from the command line: ``uvicorn webhaak:app --reload``\n\nBe sure to export/set the ``SECRETKEY`` environment variable before running, it's needed for some management URI's.\n\nRun ``gunicorn -k uvicorn.workers.UvicornWorker`` for production. For an example of how to set up a server `see this article <https://www.slingacademy.com/article/deploying-fastapi-on-ubuntu-with-nginx-and-lets-encrypt/>`_ with configuration for nginx, uvicorn, systemd, security and such.\n\nThe RQ background worker can be run from the command line: ``rq worker --with-scheduler``\n\nUrl's are of the form https://hook.example.com/app/<appkey>/<triggerkey>\n\nAPI documentation is auto-generated, and can be browsed at https://hook.example.com/docs\n\n\nExample configuration\n---------------------\n\nSee the example `hook settings`_ for syntax of how to configure\nrepositories, commands and directories.\n\nCall webhaak on its endpoint ``/admin/SECRETKEY/get_app_key`` to generate a random new key for\nusage in the projects yaml file (so, for example https://hook.example.com/admin/abc123/get_app_key)\n\nBy default, webhaak clones projects in a directory under its\n``REPOS_CACHE_DIR`` directory, but there is support for a per-repo parent dir\nsettings with ``repoparent`` in the yaml.\n\nThis means that webhaak then doesn't clone this repo into its default cache\ndir, but in a subdirectory of the directory configured in ``repoparent``, so\n<repoparent>/reponame (e.g., /srv/customparent/myproject).\n\n\nServer configuration\n~~~~~~~~~~~~~~~~~~~~\n\n* `supervisord RQ worker`_ which uses the `RQ config`_\n* `systemd for webhaak API`_ which uses the `gunicorn config`_\n* `nginx for webhaak API`_\n* `more config`_\n\n\nWhat's new?\n-----------\n\nSee the `Changelog`_.\n\n\nDeveloping\n----------\n\nRunning in PyCharm: tbd :)\n\n\n.. _webhaak: https://github.com/aquatix/webhaak\n.. _webhook: https://en.wikipedia.org/wiki/Webhook\n.. |PyPI version| image:: https://img.shields.io/pypi/v/webhaak.svg\n   :target: https://pypi.python.org/pypi/webhaak/\n.. |PyPI downloads| image:: https://img.shields.io/pypi/dm/webhaak.svg\n   :target: https://pypi.python.org/pypi/webhaak/\n.. |PyPI license| image:: https://img.shields.io/github/license/aquatix/webhaak.svg\n   :target: https://pypi.python.org/pypi/webhaak/\n.. |Code quality| image:: https://api.codacy.com/project/badge/Grade/e18e62698761411482716d0fceb65bfe\n   :target: https://www.codacy.com/app/aquatix/webhaak?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=aquatix/webhaak&amp;utm_campaign=Badge_Grade\n   :alt: Code Quality\n.. |Known vulnerabilities| image:: https://snyk.io/test/github/aquatix/webhaak/badge.svg?targetFile=requirements.txt\n   :target: https://snyk.io/test/github/aquatix/webhaak\n   :alt: Known vulnerabilities\n.. _hook settings: https://github.com/aquatix/webhaak/blob/master/example_config/examples.yaml\n.. _vhost for Apache2.4: https://github.com/aquatix/webhaak/blob/master/example_config/apache_vhost.conf\n.. _uwsgi.ini: https://github.com/aquatix/webhaak/blob/master/example_config/uwsgi.ini\n.. _supervisord RQ worker: https://github.com/aquatix/webhaak/blob/master/example_config/supervisord/webhaak_rq_worker.conf\n.. _RQ config: https://github.com/aquatix/webhaak/blob/master/example_config/rq_settings.example.py\n.. _systemd for webhaak API: https://github.com/aquatix/webhaak/blob/master/example_config/systemd/webhaak.service\n.. _gunicorn config: https://github.com/aquatix/webhaak/blob/master/example_config/gunicorn_webhaak_conf.py\n.. _more config: https://github.com/aquatix/webhaak/tree/master/example_config\n.. _nginx for webhaak API: https://github.com/aquatix/webhaak/blob/master/example_config/nginx/hook.example.com.conf\n.. _Changelog: https://github.com/aquatix/webhaak/blob/master/CHANGELOG.md\n",
    "bugtrack_url": null,
    "license": "Apache",
    "summary": "Simple webhook service to update and deploy sites and do other maintenance and automatic tasks",
    "version": "0.5.4",
    "project_urls": {
        "Bug Tracker": "https://github.com/aquatix/webhaak/issues",
        "Homepage": "https://github.com/aquatix/webhaak"
    },
    "split_keywords": [
        "webhook",
        "api",
        "automation",
        "ci/cd"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "503f9fc3314f149ed4d35f3e765c549cb96423ac7f9144dcf16d1177d27547ea",
                "md5": "aee5fbdb3e630543ab0c39df74b0be57",
                "sha256": "62e9475bb6954bf854c15b72efb0349d4fc512705e2d93d68e75b8b21b9c83a6"
            },
            "downloads": -1,
            "filename": "webhaak-0.5.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "aee5fbdb3e630543ab0c39df74b0be57",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 18518,
            "upload_time": "2023-07-28T11:47:14",
            "upload_time_iso_8601": "2023-07-28T11:47:14.211459Z",
            "url": "https://files.pythonhosted.org/packages/50/3f/9fc3314f149ed4d35f3e765c549cb96423ac7f9144dcf16d1177d27547ea/webhaak-0.5.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4b4b550143350e77ac469130e5bf110bb894000a9cfc05cc5cb52444b7f5d792",
                "md5": "f83205229b5024d293508d492ddccc2c",
                "sha256": "ea67ebaf06292194a627c2457d56d89115ae5b7eb72f0d0edcc7763b7245d264"
            },
            "downloads": -1,
            "filename": "webhaak-0.5.4.tar.gz",
            "has_sig": false,
            "md5_digest": "f83205229b5024d293508d492ddccc2c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 19561,
            "upload_time": "2023-07-28T11:47:15",
            "upload_time_iso_8601": "2023-07-28T11:47:15.591460Z",
            "url": "https://files.pythonhosted.org/packages/4b/4b/550143350e77ac469130e5bf110bb894000a9cfc05cc5cb52444b7f5d792/webhaak-0.5.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-28 11:47:15",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aquatix",
    "github_project": "webhaak",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "webhaak"
}
        
Elapsed time: 0.09907s