Permalink
Browse files

Better docs (fixes #4).

  • Loading branch information...
1 parent 48e830e commit 643720174361009e71b935575e600aa1e26cc921 @whitequark committed Jun 25, 2013
Showing with 65 additions and 11 deletions.
  1. +1 −1 LICENSE → MIT-LICENSE
  2. +47 −0 README.md
  3. +16 −0 config/nginx.conf.example
  4. +1 −0 config/schema.sql
  5. +0 −10 config/upgrade1.sql
@@ -1,4 +1,4 @@
-Copyright (C) 2011-2012 Peter Zotov <whitequark@whitequark.org>
+Copyright (C) 2011-2013 Peter Zotov <whitequark@whitequark.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
@@ -0,0 +1,47 @@
+irclogger
+=========
+
+irclogger is a simple irc logger with a fluid web interface, search function, and a live streaming mode where new messages automatically appear in today's log.
+
+Requirements
+------------
+
+ * A Linux server. Non-Linux setups will probably work, but have never been tested.
+ * Ruby >= 1.9.3
+ * MySQL >= 5
+ * Redis >= 2.7
+ * Nginx
+
+The default launch scripts assume that Ruby is managed with RVM, but you can remove the two lines mentioning RVM if you are using some other solution or just system Ruby.
+
+Installation
+------------
+
+ 1. Make sure all dependencies are installed and configured.
+ 2. Create a MySQL database and import the schema from `config/schema.sql`.
+ 3. Copy `config/application.yml.example` to `config/application.yml`.
+ 4. Edit `config/application.yml`. The fields should be self-documenting.
+ 5. Edit `config/thin.yml` if you want to place the socket somewhere else than `/tmp/irclogger.sock`.
+ 6. Copy `config/nginx.conf.example` to `/etc/nginx/sites-enabled/irclogger`. Edit the `server_name` and `root` directives to match your setup. Edit the `upstream` directive if you have changed socket location.
+ 7. Add the following lines to your crontab:
+
+ @reboot (cd /var/www/irclogger && ./launch-viewer.sh)
+ @reboot (cd /var/www/irclogger && ./launch-logger.sh)
+
+ Replace /var/www/irclogger with the appropriate installation path.
+
+ 8. Reload nginx confguration.
+ 9. Reboot. (Joking.) `cd /var/www/ircloggger; bundle && ./launch-viewer.sh && ./launch-logger.sh`.
+
+Updating configuration
+----------------------
+
+ 1. Edit `config/application.yml`.
+ 2. `./deploy-logger.sh`
+
+Upgrading
+---------
+
+ 1. `git pull`
+ 2. Read the git log. I will mention if the updates change the schema, include breaking changes, etc.
+ 3. `./deploy-logger.sh && ./deploy-viewer.sh`
@@ -0,0 +1,16 @@
+upstream irclogger {
+ server unix:/tmp/irclogger.sock;
+}
+
+server {
+ listen [::];
+ server_name irclog.foobar.org;
+
+ root /var/www/irclog/public;
+
+ location / {
+ if (!-f $request_filename) {
+ proxy_pass http://irclogger;
+ }
+ }
+}
View
@@ -10,4 +10,5 @@ CREATE TABLE `irclog` (
) CHARSET=utf8 ENGINE=MyISAM;
CREATE INDEX `irclog_channel_timestamp_index` ON `irclog` (channel, timestamp);
+CREATE INDEX `irclog_channel_opcode_index` ON `irclog` (channel, opcode);
CREATE FULLTEXT INDEX `irclog_fulltext_index` ON `irclog` (nick, line);
View
@@ -1,10 +0,0 @@
-ALTER TABLE irclog ADD COLUMN opcode VARCHAR(20);
-CREATE INDEX `irclog_channel_opcode_index` ON `irclog` (channel, opcode);
-
-UPDATE irclog SET opcode='topic', nick=left(line, instr(line, ' ')) WHERE nick IS NULL AND opcode IS NULL AND line LIKE '% changed the topic of #%';
-UPDATE irclog SET opcode='join', nick=left(line, instr(line, ' ')) WHERE nick IS NULL AND opcode IS NULL AND line LIKE '% has joined #%';
-UPDATE irclog SET opcode='leave', nick=left(line, instr(line, ' ')) WHERE nick IS NULL AND opcode IS NULL AND line LIKE '% has left #%';
-UPDATE irclog SET opcode='kick', nick=left(line, instr(line, ' ')) WHERE nick IS NULL AND opcode IS NULL AND line LIKE '% was kicked from #%';
-UPDATE irclog SET opcode='nick', nick=left(line, instr(line, ' ')) WHERE nick IS NULL AND opcode IS NULL AND line LIKE '% is now known as %';
-UPDATE irclog SET opcode='quit', nick=left(line, instr(line, ' ')) WHERE nick IS NULL AND opcode IS NULL AND line LIKE '% has quit%';
-UPDATE irclog SET nick=TRIM(nick) WHERE nick IS NOT NULL;

0 comments on commit 6437201

Please sign in to comment.