]> git.donarmstrong.com Git - don.git/blob - posts/switching_to_kgb.mdwn
reduce the range slightly
[don.git] / posts / switching_to_kgb.mdwn
1 [[!meta title="Switching to KGB from CIA"]] 
2
3 [CIA.vc](http://cia.vc) has unfortunately
4 [disappeared](http://shadowm.rewound.net/blog/archives/245-CIA.vc-is-dead.html),
5 and is [unlikely to return](http://pastebin.com/9RBBniM1) any time
6 soon. I personally have decided to switch to
7 [KGB](http://kgb.alioth.debian.org/), but other alternatives such as
8 [FBI](http://fbi.github.com) and
9 [irker](http://www.catb.org/esr/irker/) exist.
10
11
12 To switch, you first need to find or set up a kgb bot. If this is a
13 Debian associated FOSS project, feel free to contact me or join
14 \#kgb-devel on irc.oftc.net and ask for someone to allow your project
15 to talk to their bot. Once you've found a bot, we need to set up the
16 client. [I'll talk about bot set up at the end.]
17
18 kgb-client configuration
19 ------------------------
20
21 Install the `kgb-client` and `kgb-client-git` packages. Currently, kgb
22 only supports subversion and git, but I suspect this will be rectified
23 shortly.
24
25 For git repositories, add a post-receive hook like the following:
26
27     #!/bin/sh
28     tee hooks/reflog | kgb-client --conf /path/to/kgbclient.conf --repository git --git-reflog -
29
30 For subversion repositories, add a post-commit hook like the following:
31
32     #!/bin/sh
33     kgb-client --conf /path/to/kgbclient.conf --repository svn "$1" "$2"
34         
35 Then update the configuration file `/path/to/kgbclient.conf`:
36
37     ---
38         repo-id: my-repository
39         servers:
40          - uri: http://servername:9999/
41            password: verysecret
42         # optional link to a website where the commits are;
43         # needs newish kgb-client and server
44         web-link: http://example.com/?p=my-repository;a=commitdiff;h=${commit}
45
46 Then, send the bot owner the password, repo-id, channel, and network
47 you'd like the changes to be reported to.
48
49 Configuring kgb-bot
50 -------------------
51
52 The bots just listen to soap requests and if the password matches,
53 sends the commit to the appropriate IRC channel. To set one up,
54 install `kgb-bot`.
55
56 Then, enable the bot (set `BOT_ENBALED=1` in `/etc/default/kgb-bot`),
57 and configure the bot's configuration file `/etc/kgb-bot/kgb.conf`:
58
59     ---
60     soap:
61       server_addr: 0.0.0.0
62       server_port: 9999
63       service_name: KGB
64     queue_limit: 150
65     log_file: "/var/log/kgb-bot.log"
66     repositories:
67       # just a name to identify it
68       my-repository:
69         # needs to be the same on the client
70         password: verysecret
71         networks:
72       oftc:
73         nick: KGB-you
74         ircname: KGB bot
75         username: kgb
76         password: ~
77         nickserv_password: yournickservpassword
78         server: irc.oftc.net
79         port: 6667
80       freenode:
81         nick: KGB-you
82         ircname: KGB bot
83         username: kgb
84         password: ~
85         nickserv_password: yournickservpassword
86         server: irc.freenode.net
87         port: 6667
88         channels:
89       - name: '#your-channel'
90         network: oftc
91         repos:
92          - your-repo
93           - name: '#commits'
94             network: freenode
95                 repos:
96                  - your-repo
97                 
98
99 Then start the bot (`/etc/init.d/kgb-bot start`), and watch as it
100 joins channels and reports your changes!
101
102 You'll probably actually want to register whatever nick you are using
103 on the networks, etc... but you can figure that out yourself!
104
105
106 [[!tag debian tech kgb]]