pages tagged kgbDon Armstronghttps://www.donarmstrong.com/tags/kgb/Don Armstrongikiwiki2012-10-29T02:17:35ZSwitching to KGB from CIAhttps://www.donarmstrong.com/posts/switching_to_kgb/2012-10-29T02:17:35Z2012-09-28T23:27:59Z
<p><a href="http://cia.vc">CIA.vc</a> has unfortunately
<a href="http://shadowm.rewound.net/blog/archives/245-CIA.vc-is-dead.html">disappeared</a>,
and is <a href="http://pastebin.com/9RBBniM1">unlikely to return</a> any time
soon. I personally have decided to switch to
<a href="http://kgb.alioth.debian.org/">KGB</a>, but other alternatives such as
<a href="http://fbi.github.com">FBI</a> and
<a href="http://www.catb.org/esr/irker/">irker</a> exist.</p>
<p>To switch, you first need to find or set up a kgb bot. If this is a
Debian associated FOSS project, feel free to contact me or join
#kgb-devel on irc.oftc.net and ask for someone to allow your project
to talk to their bot. Once you've found a bot, we need to set up the
client. [I'll talk about bot set up at the end.]</p>
<h2 id="kgb-clientconfiguration">kgb-client configuration</h2>
<p>Install the <code>kgb-client</code> and <code>kgb-client-git</code> packages. Currently, kgb
only supports subversion, git, and cvs, but support for additional
VCSes continue to be added as kgb gains popularity.</p>
<p>For git repositories, add a post-receive hook like the following:</p>
<pre><code>#!/bin/sh
tee hooks/reflog | kgb-client --conf /path/to/kgbclient.conf --repository git --git-reflog -
</code></pre>
<p>For subversion repositories, add a post-commit hook like the following:</p>
<pre><code>#!/bin/sh
kgb-client --conf /path/to/kgbclient.conf --repository svn "$1" "$2"
</code></pre>
<p>Then update the configuration file <code>/path/to/kgbclient.conf</code>:</p>
<pre><code>---
repo-id: my-repository
servers:
- uri: http://servername:9999/
password: verysecret
# optional link to a website where the commits are;
# needs newish kgb-client and server
web-link: http://example.com/?p=my-repository;a=commitdiff;h=${commit}
</code></pre>
<p>Then, send the bot owner the password, repo-id, channel, and network
you'd like the changes to be reported to.</p>
<h2 id="configuringkgb-bot">Configuring kgb-bot</h2>
<p>The bots just listen to soap requests and if the password matches,
sends the commit to the appropriate IRC channel. To set one up,
install <code>kgb-bot</code>.</p>
<p>Then, enable the bot (set <code>BOT_ENBALED=1</code> in <code>/etc/default/kgb-bot</code>),
and configure the bot's configuration file <code>/etc/kgb-bot/kgb.conf</code>:</p>
<pre><code>---
soap:
server_addr: 0.0.0.0
server_port: 9999
service_name: KGB
queue_limit: 150
log_file: "/var/log/kgb-bot.log"
repositories:
# just a name to identify it
my-repository:
# needs to be the same on the client
password: verysecret
networks:
oftc:
nick: KGB-you
ircname: KGB bot
username: kgb
password: ~
nickserv_password: yournickservpassword
server: irc.oftc.net
port: 6667
freenode:
nick: KGB-you
ircname: KGB bot
username: kgb
password: ~
nickserv_password: yournickservpassword
server: irc.freenode.net
port: 6667
channels:
- name: '#your-channel'
network: oftc
repos:
- your-repo
- name: '#commits'
network: freenode
repos:
- your-repo
</code></pre>
<p>Then start the bot (<code>/etc/init.d/kgb-bot start</code>), and watch as it
joins channels and reports your changes!</p>
<p>You'll probably actually want to register whatever nick you are using
on the networks, etc... but you can figure that out yourself!</p>