1 == Iron Blogger Setup Instructions ==
3 Author: Benjamin Mako Hill
5 Thanks to Tony Yet from Iron Blogger Guangzhou who acted as the "guinea
6 pig" and whose experience in the installation helped provide the impetus
7 for writing this documentation.
9 === Things You'll Need ===
11 - Wordpress blog, set up on some server that you have admin rights to.
12 - GNU Ledger (http://ledger-cli.org/)
14 - A mailing list or mailing alias. Each week you will send an email with
15 the results and that email should go to all the participants. Iron
16 Blogger doesn't automatically email everybody but you can create an
17 list on librelist.org, Google Groups, or on your own system with GNU
18 Mailman (for example). I just use a simple Postfix email alias but
19 other folks do different things.
20 - Git (http://git-scm.com/)
22 You can install the dependencies on Debian or Ubuntu with:
24 apt-get install ledger python-yaml git
28 Iron blogger runs in two places:
30 1. The server that hosts your installation of Wordpress and installation
32 2. The administrator's client systems where the administrator will run
33 the scripts from. On my system, this is just my laptop.
35 === 1. Setting up the server ===
37 First, you will need to set up a Wordpress installation. You can
38 download one from: https://wordpress.org/
40 Please follow the instructions there on how to set one up.
42 Once you have installed wordpress, you need to turn on XML-RPC. You can
43 do that by checking the box in the Settings -> Writing -> XML-RPC
44 setting in the Wordpress administrative interface.
46 ==== Installing and setting up planet ====
48 Second, you need to install the Planet software which will show you an
49 aggregator of all of the blogs of people who are participating in a
50 single feed. Planet just sorts of regenerates from a "cronjob"
53 You can put Planet anywhere, but I put it in a subdirectory of my
54 Wordpress directory. My wordpress site is set up to be
55 http://iron-blogger.mako.cc so planet will show up as
56 http://iron-blogger.mako.cc/planet
58 You can download the latest version of the planet code from:
60 http://www.planetplanet.org/
62 The will will be something like "planet-2.0.tar.bz2" and you can upack
63 it with "tar -jxvf FILENAME".
65 The key file in planet is a file called "config.ini". You will see that
66 the Iron Blogger client code will generate this automatically so don't
67 edit this file by hand
69 You will need to create an output directory and a templates directory. I
70 do this just by copying the examples directory with a command like: cp
71 -R examples/output out; cp -R examples templates; cp
72 examples/fancy/index.html.tmpl templates
74 Planet updates automatically. What I did was create a little shell
75 scripts with the following content (I created it in
76 "~/bin/update_planet.sh", but make sure you do "chmod +x" to make it
77 executable). Also make sure that you change the location (e.g.,
78 "/var/www/iron-blogger/planet") to the full path of your planet
79 installation on your server:
82 cd /var/www/iron-blogger/planet
83 python ./planet.py ./config.ini 2>/dev/null
85 I then added a cronjob so that it runs every half hour. Make sure your
86 user is part of the crontab group or add them with "sudo adduser tony23
87 crontab". Once your userhas permission, you can type crontab -e and then
88 add the following line which will cause planet to update on the 14th and
89 44th minute of every hour:
91 14,44 * * * * /home/mako/bin/update_planet.sh
93 Once planet is running, it will be at WORD_PRESSLOCATION/planet/out.
95 If you want it to be at just "/planet" you need to add an Apache alias
96 to your Apache configuration file that is something like this (except
97 with your location in the second part):
99 Alias /planet /var/www/iron-blogger/planet/out/
101 === 2. Setting up the administrators client system ===
103 First, you'll need to clone the repository into some safe place on your system:
105 git clone git://projects.mako.cc/iron-blogger
107 Iron Blogger asssumes you are running bit and will even commit things to
108 your git repository for you in certain situations (e.g., when you run
109 the weekly updates). As you make these changes, it's a good idea to keep
110 committ things to git with "git commit -a" or something similar.
112 ==== Configuration Files ====
114 The following files are configuration files that you will need to blank
115 out and then customize completing for your system:
119 This file contains the list of the bloggers. Find an example of someone
120 and copy and paste. The "start" date should be the Monday of the first
121 week that the person is active.
123 The list can contain multiple blogs and feeds. Every user is introduced
124 with a little nickname which, in our system, is usually that person's
127 As you set it up, this only needs to be a single person.
131 This files doesn't "do" anything. I just use it as a list of the people
132 who are using the system. That said, I like to keep a separate list of
133 who is participating.
137 The ledger file is the file you will end up modifying quite a lot in
138 order to keep up with who owes what, who had paid what, how much you
139 have spent at meetups, etc. The way it works is like a basic ledger
140 program but its data is all stored in a text file.
142 If you have not used GNU Ledger before, figuring out exactly how it
143 works can be a little tricky. In order to modify the file, however, you
144 should only need copy and paste from my material. To start with, move
145 the existing ledger file (from Iron Blogger Boston) to a new file with a
146 commad like "mv ledger ledger.boston.example".
148 Now, create a new file, called "ledger" in that directory that contains
149 a little bit of test data for your installation. Unfortunately, if you
150 just give it an empty file with no debts, the software will not work.
151 So, add a fictional debt and a payment (one of *each*). Once things get
152 up and running, you can remove this, just by removing the basic lines
155 An example of a fictional line would be as follows (although you'd want
156 to replace "mako" with the name of someone who is listed in your
166 In a ledger, money must always come from where and go somewhere. There
167 are two entries in there.
169 The first entry is a debt: money is going from the User:mako account
170 into the Pool:Owed:mako account. As a result, User:mako is now at "$-5"
171 while the Pool:Owed is now positive $5.
173 The second entry is a payment: money is going from the Pool:Owed:mako
174 account into the Pool:Paid account. Think of it this way. In the first
175 bit, Mako owes the pools. After he pays, money is still in the pool, but
176 its in the part of the pool that has been paid up.
178 The person who runs Iron Blogger is basically the bank. Everything in
179 Pool:Paid is money that you have been given. Anything in Pool:Owed is
180 money that people owed the pool but which you have not received yet.
182 Once you have this set up, you can test it by running the ledger command
183 which you hopefully installed earlier. Try running "ledger -f ledger
184 balance Pool:Owed" to find the balance owed. In this command, the first
185 ledger is the program GNU Ledger while the "-f ledger" tell is to read
186 the ledger file in the local directory as its input.
190 The Iron Blogger code was a subdirectory called "out" where it will
191 store intermediary data as it works. Just do "mkdir out" in your main
192 directory on the client.
194 ==== Things you will need to modify ====
198 These two files should be edited so that they contain details about your
199 name/administrator, email address, etc:
206 You must modify this line in the file "config.py" that it points to the
207 Monday that starts the week that your version of Iron Blogger is
210 START = datetime.datetime(2011, 10, 24, 6)
212 Also edit config.py to include details on your wordpress setup. Here are
213 my details that include the PAGE_ID of the participants page:
215 XMLRPC_ENDPOINT = 'http://iron-blogger.mako.cc/xmlrpc.php'
220 The file will automatically keep the page of participants up to date.
221 You can see the page on our system here:
223 http://iron-blogger.mako.cc/participants/
225 The XMLRPC_ENDPOINT should be just your Wordpress URL followed by
226 xmlrpc.php. The USER should be your Wordpress user. The BLOG_ID should
227 be 1 and the PAGE_ID for the Parcipants page should be visible in your
228 Wordpress administrative interface.
232 You'll also want to edit the "update-bloggers" script. You should only
233 need to change this line that copies the planet configuration over to
236 rsync $HERE/../iron-blogger-planet/config.ini epicenter:/var/www/iron-blogger/planet/
238 You will to change it so that the second part ("epicenter:/LOCATION")
239 points to your server in the way that you get to it with SSH (i.e., not
240 the web server location) and the full path to the directory on that
241 server where you have planet code setup. If you do not have rsync set
242 up, you should be able replace rsync with "scp" and have it work just
245 Once you've done this, you should be able to test this by typing
246 "./update-bloggers" in the terminal from your iron-blogger directory on
247 your client. If it's working correctly, it will ask you for a password
248 which will be your Wordpress password. The script will update the
249 participants page in Wordpress, generate a new "config.ini" file for
250 Planet, and copy it to your server.
252 === Adding bloggers and running weekly updates ===
254 To add a new blogger, you need to:
256 1. Edit "bloggers.yml' to add the metadata about the person
257 2. Run: ./scan-feeds.py
258 3. Run: "./update-bloggers" which will update the participants page and
259 the planet configuration.
261 When it's successful, it won't return anything.
263 Each week, you can run a weekly update. The updates don't happen
264 automatically which means the person running the system will need to do
265 it each week. If you miss a week, that's OK. You can run updates at any
266 time so, for example, you could run updates for the previous week, the
267 week before, and the week before that, all at the same time.
269 To run a weekly update, you need to:
271 1. Run ./scan-feeds.py
272 2. Run: ./weekly-update.py -n '2012-01-01'
274 The date, in quotes, should be the Monday that *starts* the week that
275 you are running it on. The "-n" in step 2 will mean to not make changes,
276 will not post to your iron-blogger website, and will not send out an
277 email. It will print out a list on the terminal.
279 If it all looks good, you can send it by running that command again with
282 3. ./weekly-update.py '2012-01-01'
284 That command will ask for your Wordpress password again and will send
285 out an email to which ever address is in templates/email.txt. It will
286 show all the fines and will also commit the latest charges in the ledger
289 === Punting and Unpunting ===
291 By default, the code is set to "punt" people when they have a debt that
292 reaches $30 (or whatever 6 times the fine size (set by FINE_SIZE in
293 config.py). The weekly-update.py file will do this automatically. Their
294 debt dissappears. The idea is that people cannot just keep oweing more
295 and more. When people pay their $30, they are "unpunted" meaning that
296 they are back in the club.
298 Unpunting requires two changes:
300 1. Go to bloggers.yml and remove the line that says "end" associated
301 with the bloggers name.
302 2. Go to the ledger file and restore their debt (essentially, add $30
303 back into the Pool:Owed), and record their payment normally. The
304 following example shows how to do that: