forked from rohieb/StratumOpenCloseMonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.