Skip to content

Commit

Permalink
documentation for the server part
Browse files Browse the repository at this point in the history
  • Loading branch information
rohieb committed Dec 1, 2012
1 parent 60ea596 commit 97195c0
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
The Stratum 0 Open/Close Monitor shows whether the hackerspace is opened or
closed.
The Stratum 0 Open/Close Monitor shows whether the Stratum 0 hackerspace in
Braunschweig, Germany is currently opened or closed.

Currently the status can only be set by users on IRC. A plugin for the supybot
IRC bot listens for !open and !close commands, and in this case writes an
Expand All @@ -9,5 +9,5 @@ status. The supybot plugin also writes machine-readable information in JSON,
XML and RFC822 format which can be used to build other applications to display
the status (like @wansti's StratumsphereStatusWidget for Android)

See https://stratum0.org/mediawiki/index.php/Open/Close-Monitor for more
information (in German).
This repository includes the server part as well as some simple clients in the
respective subdirectories. See there for more information.
79 changes: 79 additions & 0 deletions server/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
This directory contains the server part of the Stratum 0 Open/Close Monitor.

== Depencendies ==
* Supybot >= 0.83 (http://sourceforge.net/projects/supybot/)
* nginx
* sudo

On a recent Debian system (tested on squeeze/7.0) do the following:
# apt-get install supybot nginx-light sudo

== Installation ==
These steps were tested on a Debian wheezy system. If you are using a different
distribution, you may have to change the paths accordingly to your system, and
also edit the hard-coded paths to the files mentioned at the beginning of
supybot/StratumMonitor/plugin.py.

Here is what I did, on my system, as root:

1. Add a separate user and group to run Supybot:

# groupadd stratummonitor
# useradd -rm -s /bin/false -g stratummonitor ircbot

2. Add a site to the nginx configuration and allow the ircbot user to change it.
The nginx config file will be generated by the Supybot plugin from a template.
If you want to change the generated config, change the template at the
beginning of supybot/StratumMonitor/plugin.py.

# mkdir -p /etc/nginx/sites-enabled/ # unless it already exists...
# rm -f /etc/nginx/sites-enabled/default # default config is not needed
# touch /etc/nginx/sites-enabled/status.stratum0.org
# chgrp stratummonitor /etc/nginx/sites-enabled/status.stratum0.org
# chmod g+rw /etc/nginx/sites-enabled/status.stratum0.org

3. Copy (or link) the contents of www/ to /srv/status.stratum0.org. This will be
the WWW root for the generated nginx configuration. Again, if you want to
change that location, change the template at the beginning of
supybot/StratumMonitor/plugin.py.

# mkdir -p /srv/status.stratum0.org
# cp www/* /srv/status.stratum0.org
-- or, instead of mkdir and cp, just link to your cloned repository --
# ln -s ~/StratumOpenCloseMonitor/server/www/ /srv/status.stratum0.org
-- then, for both cases --
# chgrp stratummonitor /srv/status.stratum0.org
# chmod g+rws /srv/status.stratum0.org

4. Allow the ircbot user to restart nginx. You can use the sudoers.d template
from sudoers.d/nginx-reload and copy it to /etc/sudoers.d/

# cp sudoers.d/nginx-reload /etc/sudoers.d/
# chmod 440 /etc/sudoers.d/nginx-reload
# chown root:root /etc/sudoers.d/nginx-reload

5. Start the Supybot instance from supybot/supybot.conf.example. You can also
use this file as a template. By default, the Supybot instance connects to
irc.freenode.net, takes the nick StratumGuardian and joins the channel
#stratum0. In any case, you probably want to change the NickServ password
(search for the string {{{PASSWORD}}} in the example configuration).
Also note that by default, Supybot uses /home/ircbot for its root folder.

# cp -R supybot/ /home/ircbot/
-- or, instead of cp, just link to your cloned repository --
# ln -s ~/StratumOpenCloseMonitor/server/supybot/ /home/ircbot/supybot
-- then, for both cases --
# chown -R ircbot:stratummonitor /home/ircbot/supybot/
# sudo -u ircbot supybot supybot/supybot.conf.example &

Supybot will write its output to supybot/logs/messages.log.

== Usage ==
The space status can be set with the commands 'offen' and 'zu'. There are also
additional aliases defined: 'auf' and 'open' are aliases for 'offen', and
'close' and 'closed' are aliases for 'zu'.

The default supybot configuration defines two command prefixes, 'sudo' and
'mach', so you can use 'sudo open' or 'mach auf' to set the status to open, and
'sudo close' or 'mach zu' to set the status to closed.

1 change: 0 additions & 1 deletion server/supybot/plugins/StratumMonitor/README

This file was deleted.

3 changes: 0 additions & 3 deletions server/supybot/plugins/StratumMonitor/README.txt

This file was deleted.

0 comments on commit 97195c0

Please sign in to comment.