{"id":17148455,"url":"https://github.com/mavam/gitdub","last_synced_at":"2025-06-12T13:33:33.688Z","repository":{"id":5991537,"uuid":"7214031","full_name":"mavam/gitdub","owner":"mavam","description":":outbox_tray: A github WebHook that emails detailed diffs of your commits.","archived":false,"fork":false,"pushed_at":"2018-10-13T18:36:56.000Z","size":57,"stargazers_count":26,"open_issues_count":1,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-08T02:36:19.510Z","etag":null,"topics":["diff","email","github","webhook"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mavam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-17T23:09:56.000Z","updated_at":"2024-09-13T09:52:17.000Z","dependencies_parsed_at":"2022-08-19T09:01:13.495Z","dependency_job_id":null,"html_url":"https://github.com/mavam/gitdub","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mavam/gitdub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavam%2Fgitdub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavam%2Fgitdub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavam%2Fgitdub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavam%2Fgitdub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mavam","download_url":"https://codeload.github.com/mavam/gitdub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mavam%2Fgitdub/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259473782,"owners_count":22863543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diff","email","github","webhook"],"created_at":"2024-10-14T21:28:43.963Z","updated_at":"2025-06-12T13:33:33.645Z","avatar_url":"https://github.com/mavam.png","language":"Ruby","readme":"gitdub\n======\n\n**gitdub** is a [github web-hook][post-receive-hook] that converts a\nchangeset pushed into one email per change via [git-notifier][git-notifier].\nUnlike the existing github email hook, gitdub sends out detailed diffs for each\nchange.\n\nSetup\n=====\n\nDependencies\n------------\n\n  - git (\u003e= 1.7.12)\n  - Ruby (\u003e= v1.9)\n  - `gem install sinatra`\n  - [git-notifier][git-notifier] (master branch required)\n\nInstallation\n------------\n\n  1. `cp gitdub /path/to/dir/in/$PATH`\n  1. `cp config.yml.example config.yml`\n  1. `gitdub config.yml`\n\nIntegration with github\n-----------------------\n\n  1. Navigate to a repository you own, e.g., `https://github.com/user/repo`\n  1. Click on *Settings* in the right sidebar\n  1. Click on *Webhooks \u0026 Services* in the left sidebar\n  1. Click on *Add Webhook*\n  1. Enter the URL to reach gitdub, e.g., `http://gitdub.mydomain.com:8888/`\n  1. Set the content type to `application/x-www-from-urlencoded`\n  1. Select the radio button *Just the `push` event*\n  1. Click on the green *Add Webhook* button\n\nCustomizing\n===========\n\nThe [YAML](http://www.yaml.org) configuration file contains the list of\nrepositories that gitdub tracks. The first section (`gitdub:`) specifies global\noptions, such as the interfaces gitdub should bind to and ports to listen on. \nMoreover, you can control the behavior of the first chunk of data. When setting\n`silent_init:` to true, gitdub will only fast-forward to the current commit and\nbegin mailing diffs after the next push (or after hitting the *Test Hook*\nbutton). Otherwise gitdub sends exactly one email per commit since the first\ncommit in the repository.\n\nThe second section (`notifier:`) describes the behavior of git-notifier. Here you\ncan the configure a global sender of the emails (`from:`), the receivers\n(`to:`), and the prefix of the email subject (`subject:`).\n\nThe third section (`github:`) contains a list of github repository entries,\nwhere each entry must at least contain an `id` field. If an item does not\ncontain any further options, the globals from the `notifier` section apply.\nHowever, in most cases it makes sense to override the globals with\nrepository-specific information, e.g.:\n\n    notifier:\n      # The email sender. (Can be overriden for each repository.)\n      from: 'Sam Sender \u003cfoo@host.com\u003e'\n\n      # The email subject prefix. (Can be overriden for each repository.)\n      subject: '[git]'\n\n    github:\n      - id: mavam/gitdub\n        subject: '[git/gitdub]'    # Overrides global '[git]' subject prefix.\n        from: vallentin@icir.org   # Overrides global sender.\n        to: [vallentin@icir.org]   # Overrides global receivers.\n\n      - id: mavam/.*\n        from: mavam                # Overrides global sender.\n\nNote the regular expression in the second entry. This enables the configuration\nof entire sets of repositories. Since gitdub processes the list sequentially in\norder of definition, only settings from the first match apply. For example,\nappending an entry for `mavam/foo` would never match.\n\nRestricting Access\n------------------\n\nTo prevent unauthorized access to the service, you can restrict the set of\nallowed source IP addresses to github addresses, e.g., via iptables:\n\n    iptables -A INPUT -m state --state NEW -m tcp -p tcp \\\n        -s 192.30.252.0/22,185.199.108.0/22,140.82.112.0/20 --dport 42042 -j ACCEPT\n\nIf that's not an option on your machine, you can also perform application-layer\nfiltering in gitdub by setting the following configuration option:\n\n    allowed_sources: [192.30.252.0/22, 185.199.108.0/22, 140.82.112.0/20]\n\nFor an up-to-date listing of the github ip ranges, check the hooks section\nunder https://api.github.com/meta.\n\nInstallation as a service on Linux\n==================================\n\nOnce you have gitdub working, you probably will want to make it into a service,\nso that it'll automatically start on reboot.\n\nYou can either write your own script or you can use a pre-made script from this\n[repository](https://github.com/frdmn/service-daemons/). You just need to make\na few minor tweaks to make it workable. Here is the [instructions\npage](https://blog.frd.mn/how-to-set-up-proper-startstop-services-ubuntu-debian-mac-windows/)\nwith general details for this repository.\n\nIf you are on a Ubuntu or a similar system that supports the `rc.d` system you\ncan use [debian rc.d\ntemplate](https://github.com/frdmn/service-daemons/blob/master/debian):\n\n    wget https://raw.github.com/frdmn/service-daemons/master/debian -O /etc/init.d/gitdub\n\nEdit `/etc/init.d/gitdub` and change the example settings to:\n\n    # The following assumes gitdub is setup under /var/gitdub/\n    NAME=\"gitdub\"\n    PATH=\"/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/var/gitdub\"\n    APPDIR=\"/var/gitdub\"\n    APPBIN=\"/var/gitdub/gitdub\"\n    APPARGS=\"config.yml\"\n    USER=\"nobody\"\n    GROUP=\"nobody\"\n\nDepending on the user/group you are going to run it under, you may have to\nchange `USER` and `GROUP` settings as well.\n\nMake sure the script is executable:\n\n    chmod +x /etc/init.d/gitdub\n\nEnable the daemon with:\n\n    update-rc.d gitdub defaults\n\nStart the service with:\n\n    service gitdub start\n\nStop the service with:\n\n    service gitdub stop\n\nIf your system doesn't support the `rc.d` approach, check the\n[service-daemons repository](https://github.com/frdmn/service-daemons/) for\nother methods.\n\nLicence\n=======\n\nGitdub comes with a BSD license, please see COPYING for details.\n\n[git-notifier]: http://www.icir.org/robin/git-notifier\n[sinatra]: http://www.sinatrarb.com\n[post-receive-hook]: https://help.github.com/articles/post-receive-hooks\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmavam%2Fgitdub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmavam%2Fgitdub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmavam%2Fgitdub/lists"}