Skip to content
Lionell Pack edited this page May 13, 2013 · 2 revisions

Jabber / XMPP group room

First of all, you will need a jabber/xmpp group room for the bot to sit in. If you don't have a jabber server, create one - I recommend ejabberd. It's quick and easy to set up.

You will need some dns entries for the jabber server. Your user registration will be something like im.(companyname).com. Your group room server will be something like conference.im.(companyname).com. Run them on the same server, and if you can, use a wildcard entry (*.im.(companyname).com).

Create a jabber handle for your bot. I used gitbot@(our jabber domain).

Next, grab a jabber client which supports MUC (multi-user-conferences). I use Pidgin. Create a room (your client might just auto-create it if you join a room which doesn't exist), and make sure it's set to persistent.

Now hang out in this room (and get the rest of your team to hang out there as well). Your bot will soon join you, and you'll have a great place to keep track of what's going on with your repos and generally chat about what you're doing.

Setting up GitHub-XMPP

First, build it. I'll get a binary distribution going eventually, but for now, it's up to you. It should be clone->build - please let me know (or fix it yourself and send me a pull request) if it isn't.

Set up your app.config. You need the XMPP settings to be filled out. You only need the GitHub settings if you're going to be using the app itself to configure your GitHub webhook - the console app is easier, so just leave those blank.

Configuring GitHub

Sign in to GitHub and go to the repo you want to receive alerts for. Click on settings, then service hooks, then WebHook URLs.

Add a new one pointing to the IP/dns and port of the machine you're going to run GitHub-XMPP on, /GitHubHooks/event. My entry reads (x.x.x.x is my ip address): x.x.x.x:6893/GitHubHooks/event

Unfortunately, GitHub doesn't let you select which events to subscribe to through the web. Run the included GitHubHookConfigurator - it's interactive, should be self-explanatory, and will update the hook to listen for all valid events.

Please note that it looks like the configurator doesn't run under mono. You don't need to run it from your server - if you want to run the server under mono, run the configurator from a windows box somewhere.

Running GitHub-XMPP

I will build windows and mono service projects, but for now it's a console app. Run it, and it will open port 6893 and listen for requests from GitHub. The port will be configurable eventually.

I'm currently running it on a vps linux box under mono. Use screen to keep it running on a detached terminal (if you don't know about screen, you're missing out on one of the best things ever).

Trouble-shooting

Ask me for help. I'm @Rophuine on twitter. If you run into anything that's difficult or not self-explanatory, please let me know and I'll try to make it easier, or fix it yourself and send me a pull request.