All Projects â†’ mavam â†’ gitdub

mavam / gitdub

Licence: BSD-3-Clause license
ðŸ“Ī A github WebHook that emails detailed diffs of your commits.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to gitdub

wp-trigger-netlify-build
A WordPress plugin to automatically rebuild a Netlify site when content is updated.
Stars: ✭ 80 (+220%)
Mutual labels:  webhook
YappyGitLab
A GitLab monitor bot for Discord
Stars: ✭ 51 (+104%)
Mutual labels:  webhook
diffhtml
Tools for generating diff output in HTML.
Stars: ✭ 23 (-8%)
Mutual labels:  diff
dify
A fast pixel-by-pixel image comparison tool in Rust
Stars: ✭ 41 (+64%)
Mutual labels:  diff
webhook-tunnel
A little HTTP proxy suitable to create tunnels for webhook endpoints protected behind a firewall or a VPN
Stars: ✭ 63 (+152%)
Mutual labels:  webhook
Diff.Net
A differencing utility for Window desktop written in C#.
Stars: ✭ 34 (+36%)
Mutual labels:  diff
langx-java
Java tools, helper, common utilities. A replacement of guava, apache-commons, hutool
Stars: ✭ 50 (+100%)
Mutual labels:  diff
tqsdk-js
期čī§čĄŒæƒ…/历åē数æŪ/äšĪ易 垀发包
Stars: ✭ 52 (+108%)
Mutual labels:  diff
diff-text
Just get the diff of a simple inline text, simple mode.
Stars: ✭ 13 (-48%)
Mutual labels:  diff
rocketchat-uptimerobot
Uptime Robot integration for Rocket.Chat
Stars: ✭ 34 (+36%)
Mutual labels:  webhook
chathooks
Service to convert webhook messages to your favorite chat / team messaging format. Run transparently as a formatting webhook proxy.
Stars: ✭ 39 (+56%)
Mutual labels:  webhook
dipa
dipa makes it easy to efficiently delta encode large Rust data structures.
Stars: ✭ 243 (+872%)
Mutual labels:  diff
fast diff match patch
Python package for Google's diff-match-patch native C++ implementation.
Stars: ✭ 55 (+120%)
Mutual labels:  diff
diffviewer
HTML widget to visually compare files
Stars: ✭ 52 (+108%)
Mutual labels:  diff
discord
GitHub webhook that analyzes pull requests and adds comments about incompatible CSS
Stars: ✭ 29 (+16%)
Mutual labels:  webhook
intellij-diff-plugin
Syntax highlighting for .diff files and .patch files in IntelliJ IDEs
Stars: ✭ 17 (-32%)
Mutual labels:  diff
MailHookBundle
A bundle to catch API webhook from different mail service
Stars: ✭ 36 (+44%)
Mutual labels:  webhook
PSDiscord
Simple PowerShell module allowing to send messages to Discord Channel over webhooks
Stars: ✭ 34 (+36%)
Mutual labels:  webhook
fdiff
An OpenType table diff tool for fonts. Based on the fontTools TTX format.
Stars: ✭ 33 (+32%)
Mutual labels:  diff
MsftTeams
Module for Posting messages to MSTeams via Webhook
Stars: ✭ 35 (+40%)
Mutual labels:  webhook

gitdub

gitdub is a github web-hook that converts a changeset pushed into one email per change via git-notifier. Unlike the existing github email hook, gitdub sends out detailed diffs for each change.

Setup

Dependencies

  • git (>= 1.7.12)
  • Ruby (>= v1.9)
  • gem install sinatra
  • git-notifier (master branch required)

Installation

  1. cp gitdub /path/to/dir/in/$PATH
  2. cp config.yml.example config.yml
  3. gitdub config.yml

Integration with github

  1. Navigate to a repository you own, e.g., https://github.com/user/repo
  2. Click on Settings in the right sidebar
  3. Click on Webhooks & Services in the left sidebar
  4. Click on Add Webhook
  5. Enter the URL to reach gitdub, e.g., http://gitdub.mydomain.com:8888/
  6. Set the content type to application/x-www-from-urlencoded
  7. Select the radio button Just the push event
  8. Click on the green Add Webhook button

Customizing

The YAML configuration file contains the list of repositories that gitdub tracks. The first section (gitdub:) specifies global options, such as the interfaces gitdub should bind to and ports to listen on. Moreover, you can control the behavior of the first chunk of data. When setting silent_init: to true, gitdub will only fast-forward to the current commit and begin mailing diffs after the next push (or after hitting the Test Hook button). Otherwise gitdub sends exactly one email per commit since the first commit in the repository.

The second section (notifier:) describes the behavior of git-notifier. Here you can the configure a global sender of the emails (from:), the receivers (to:), and the prefix of the email subject (subject:).

The third section (github:) contains a list of github repository entries, where each entry must at least contain an id field. If an item does not contain any further options, the globals from the notifier section apply. However, in most cases it makes sense to override the globals with repository-specific information, e.g.:

notifier:
  # The email sender. (Can be overriden for each repository.)
  from: 'Sam Sender <[email protected]>'

  # The email subject prefix. (Can be overriden for each repository.)
  subject: '[git]'

github:
  - id: mavam/gitdub
    subject: '[git/gitdub]'    # Overrides global '[git]' subject prefix.
    from: [email protected]   # Overrides global sender.
    to: [[email protected]]   # Overrides global receivers.

  - id: mavam/.*
    from: mavam                # Overrides global sender.

Note the regular expression in the second entry. This enables the configuration of entire sets of repositories. Since gitdub processes the list sequentially in order of definition, only settings from the first match apply. For example, appending an entry for mavam/foo would never match.

Restricting Access

To prevent unauthorized access to the service, you can restrict the set of allowed source IP addresses to github addresses, e.g., via iptables:

iptables -A INPUT -m state --state NEW -m tcp -p tcp \
    -s 192.30.252.0/22,185.199.108.0/22,140.82.112.0/20 --dport 42042 -j ACCEPT

If that's not an option on your machine, you can also perform application-layer filtering in gitdub by setting the following configuration option:

allowed_sources: [192.30.252.0/22, 185.199.108.0/22, 140.82.112.0/20]

For an up-to-date listing of the github ip ranges, check the hooks section under https://api.github.com/meta.

Installation as a service on Linux

Once you have gitdub working, you probably will want to make it into a service, so that it'll automatically start on reboot.

You can either write your own script or you can use a pre-made script from this repository. You just need to make a few minor tweaks to make it workable. Here is the instructions page with general details for this repository.

If you are on a Ubuntu or a similar system that supports the rc.d system you can use debian rc.d template:

wget https://raw.github.com/frdmn/service-daemons/master/debian -O /etc/init.d/gitdub

Edit /etc/init.d/gitdub and change the example settings to:

# The following assumes gitdub is setup under /var/gitdub/
NAME="gitdub"
PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/var/gitdub"
APPDIR="/var/gitdub"
APPBIN="/var/gitdub/gitdub"
APPARGS="config.yml"
USER="nobody"
GROUP="nobody"

Depending on the user/group you are going to run it under, you may have to change USER and GROUP settings as well.

Make sure the script is executable:

chmod +x /etc/init.d/gitdub

Enable the daemon with:

update-rc.d gitdub defaults

Start the service with:

service gitdub start

Stop the service with:

service gitdub stop

If your system doesn't support the rc.d approach, check the service-daemons repository for other methods.

Licence

Gitdub comes with a BSD license, please see COPYING for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].