• Stars
    star
    118
  • Rank 299,923 (Top 6 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created almost 16 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Git post-receive web hook notifier in Python.

notify-webhook

notify-webhook is a git post-receive hook script that posts JSON data to a webhook capable server.

This implements the GitHub Web hooks API as closely as possible. It allows arbitrary git repositories to use webhook capable services.

As an example, this script works very well with commitbot which sends commit notifications to XMPP group chat rooms.

Dependencies

Usage

Installation & Configuration (manual)

To use notify-webhook, just copy notify-webhook.py to your repository's .git/hooks dir and call it post-receive. Be sure to set it executable with chmod 755 post-receive as well.

Configuration is handled through git config. We use sensible defaults where possible.

Configuration example:

git config meta.url "http://example.com"
git config hooks.webhookurl "http://example.net"

Installation & Configuration (Gitolite)

Please see the installation details at Gitolite repo-specific hooks.

Configuration example:

repo some-repo-in-gitolite
  option hook.post-receive = notify-webhook
  config meta.url = "http://example.com"
  config hooks.webhookurl = "http://example.net"

Configuration Parameters

hooks.webhookurl

The URL to the webhook consumer - the commit details will be POSTed here.

Defaults to None which will echo the JSON data instead of sending it (unless the hooks.webhookurls configuration is set).

hooks.webhookurls

A list of URLs to different webhook consumers - the commit details will be POSTed to each of them in the order they arrive (if hooks.webhookurl is set, the commit details will be POSTed to that URL first).

The value is parsed like a csv file so each URL is separated by a comma or a newline (or a combination of the two). URLs with a comma in them can be wrapped in quotation marks.

An example of value with two URLS:

git config hooks.webhookurls 'http://example.com/hook,"http://other.example.com/hook,with,comma"'

Defaults to None which will echo the JSON data instead of sending it (unless the hooks.webhookurl configuration is set).

meta.ownername / meta.owneremail

Details about the repository owner.

Defaults the gitweb.owner variable, and falls back to author details on the initial commit to the repository.

meta.reponame

The name of the repository.

Defaults to the repository name as determined by its path.

meta.description

Description of the repo.

Defaults to the gitweb.description config variable, and falls back to the contents of the description file. This behavior is intended to be compatible with GitWeb.

meta.url

The URL of your repository browser

Defaults to None

meta.commiturl

The URL of a commit in your repository browser. %s is replaced with the SHA1 hash of the commit. Defaults to meta.url+'/commit/%s' or None

meta.compareurl

The URL of a diff in your repository browser. Must contain two %s elements. Defaults to meta.url+'/compare/%s..%s' or None

hooks.authuser

Username to use for basic and digest authentication.

Defaults to None

hooks.authpass

Password to use for basic and digest authentication. Note that it is stored in plaintext in git's config file!

Defaults to None

hooks.authrealm

Realm to use for digest authentication.

Defaults to None

hooks.secrettoken

Secret token to use for GitHub-compatible X-Hub-Signature header.

Defaults to None

hooks.webhook-contenttype

Payload Content Type to use for the body of the data. Supported values are:

  • application/x-www-form-urlencoded (default).
  • application/json

License

This code is copyright (c) 2008-2015 by Jack Moffitt [email protected] and others; and is available under the GPLv3. See LICENSE.txt for details. See CONTRIBUTORS.markdown for all authors.

More Repositories

1

strophejs

The Strophe.js repository has moved to https://github.com/strophe/strophejs
JavaScript
812
star
2

profxmpp

Source code for example applications of "Professional XMPP Programming with JavaScript and jQuery"
JavaScript
234
star
3

strophejs-plugins

The Strophe.js plugins repo has moved to https://github.com/strophe/strophejs-plugins
JavaScript
165
star
4

libstrophe

The libstrophe repository has moved to https://github.com/strophe/libstrophe
C
135
star
5

tape

A simple, reverse proxy capable Web server for local JavaScript application development.
Python
86
star
6

cgit

a fast web interface for git
C
69
star
7

commitbot

XMPP bot that posts commit summaries to MUCs.
Python
46
star
8

metajack.im

The source for the metajack.im blog.
CSS
28
star
9

limerick

A mocking XMPP BOSH server
Erlang
12
star
10

cserialize

This is a fast, native C module replacement for Twisted Python's twisted.words.xish.Domish serializer.
C
11
star
11

stenotype

Conference call transcription to XMPP MUC
Python
7
star
12

xmpp-websocket

XMPP over WebSocket specification
6
star
13

surveycouch

A simple CouchDB application example that works with surveys
JavaScript
6
star
14

ejabberd-package

Debian and Ubuntu packaging for ejabberd snapshots.
5
star
15

notify-mublog

Git post-receive hook notifier for microblogs like Identi.ca and Twitter
4
star
16

strophe.im

strophe.im web site
JavaScript
4
star
17

multihook

Git hook multiplexer.
Python
4
star
18

bookrank

Collect and analyze Amazon SalesRank data for books
4
star
19

mt2jekyll

MovableType to jekyll convertor.
Python
3
star
20

daala

Daala video codec
C
3
star
21

gpeg

JPEG implementation using GPU
Yacc
3
star
22

eventcal

training app
Ruby
2
star
23

testing

testing
2
star
24

clango

Django-style templates for Clojure.
Clojure
2
star
25

rebar_lfe_ct_plugin

Rebar plugin for writing Common Test suites using LFE
Erlang
1
star
26

metajack.github.com

My GitHub Pages
1
star
27

hslic

example git repository
Ruby
1
star
28

diem-sqlize

Convert the chain to SQL
Rust
1
star
29

miniservo-gtk

MiniServo for Gtk+
C
1
star
30

servo-android-glue

android application for operating servo on android platform
C
1
star
31

workspace-unification

minimal test for feature unification in cargo in a workspace
Rust
1
star
32

thor

Thor Video Codec
C
1
star