Debian Codegraph @

README.rst

raw
1 ===========
2 irclog2html
3 ===========
4
5 Converts IRC log files to HTML with pretty colours.
6
7
8 Quick start
9 ===========
10
11 Installation::
12
13 pip install irclog2html
14
15 Quick usage for a single log file::
16
17 irclog2html --help
18 irclog2html filename.log (produces filename.log.html)
19
20 Mass-conversion of logs (one file per day, with YYYY-MM-DD in the filename)
21 with next/prev links, with mtime checks, usable from cron::
22
23 logs2html directory/ (looks for *.log and *.log.gz, produces *.log.html)
24
25
26 Configuration files
27 ===================
28
29 Since you probably don't want to keep specifying the same options on the
30 command line every time you run logs2html, you can create a config file.
31 For example::
32
33 -t 'IRC logs for #mychannel'
34 -p 'IRC logs for #mychannel for '
35 # the following needs some extra Apache setup to enable the CGI/WSGI script
36 --searchbox
37 # where we keep the logs
38 /full/path/to/directory/
39
40 Use it like this::
41
42 logs2html -c /path/to/mychannel.conf
43
44 Lines starting with a ``#`` are ignored. Other lines are interpreted as
45 command-line options.
46
47 The order matters: options on the command line before the ``-c FILE`` will
48 be overriden by option in the config file. Options specified after ``-c FILE``
49 will override the options in the config file.
50
51 You can include more than one config file by repeating ``-c FILE``. You
52 can include config files from other config files. You can even create loops of
53 config files and then watch and laugh manically as logs2html sits there burning
54 your CPU.
55
56
57 CGI script for log searching
58 ============================
59
60 .. warning::
61 The script can be easily abused to cause a denial of service attack; it
62 parses *all* log files every time you perform a search.
63
64 You can generate search boxes on IRC log pages by passing the ``--searchbox``
65 option to ``logs2html``. Here's an example Apache config snippet that makes
66 it work::
67
68 RewriteRule ^/my-irclog/search/$ /my-irclog/search [R,L]
69 ScriptAlias /my-irclog/search /usr/local/bin/irclogsearch
70 <Location /my-irclog/search>
71 SetEnv IRCLOG_LOCATION "/var/www/my-irclog/"
72 # Uncomment the following if your log files use a different format
73 #SetEnv IRCLOG_GLOB "*.log.????-??-??"
74 # (this will also automatically handle *.log.????-??-??.gz)
75 </Location>
76
77
78 WSGI script for log serving
79 ===========================
80
81 .. warning::
82 The script can be easily abused to cause a denial of service attack; it
83 parses *all* log files every time you perform a search.
84
85 There's now an experimental WSGI script that can generate HTML for the
86 logs on the fly. You can use it if you don't like cron scripts and CGI.
87
88 Here's an example Apache config snippet::
89
90 WSGIScriptAlias /irclogs /usr/local/bin/irclogserver
91 <Location /irclogs>
92 SetEnv IRCLOG_LOCATION "/var/www/my-irclog/"
93 # Uncomment the following if your log files use a different format
94 #SetEnv IRCLOG_GLOB "*.log.????-??-??"
95 # (this will also automatically handle *.log.????-??-??.gz)
96 </Location>
97
98 Currently it has certain downsides:
99
100 - configuration is very limited, e.g you cannot specify titles or styles
101 or enable dircproxy mode
102 - HTML files in the irc log directory will take precedence over
103 dynamically-generated logs even if they're older than the corresponding
104 log file (but on the plus side you can use that to have dynamic search
105 via WSGI, but keep statically-generated HTML files with your own config
106 tweaks)
107
108
109 WSGI script for multi-channel log serving
110 =========================================
111
112 .. warning::
113 The script can be easily abused to cause a denial of service attack; it
114 parses *all* log files every time you perform a search.
115
116 The experimental WSGI script can serve logs for multiple channels::
117
118 WSGIScriptAlias /irclogs /usr/local/bin/irclogserver
119 <Location /irclogs>
120 SetEnv IRCLOG_CHAN_DIR "/var/www/my-irclog/"
121 # Uncomment the following if your log files use a different format
122 #SetEnv IRCLOG_GLOB "*.log.????-??-??"
123 # (this will also automatically handle *.log.????-??-??.gz)
124 </Location>
125
126 Now ``/irclogs`` will show a list of channels (subdirectories under
127 ``/var/www/my-irclog/``), and ``/irclogs/channel/`` will show the
128 date index for that channel.
129
130
131 Misc
132 ====
133
134 Website: https://mg.pov.lt/irclog2html/
135
136 Bug tracker:
137 https://github.com/mgedmin/irclog2html/issues
138
139 Licence: GPL v2 or v3 (https://www.gnu.org/copyleft/gpl.html)
140
141 |buildstatus|_ |appveyor|_ |coverage|_
142
143 .. |buildstatus| image:: https://github.com/mgedmin/irclog2html/workflows/build/badge.svg?branch=master
144 .. _buildstatus: https://github.com/mgedmin/irclog2html/actions
145
146 .. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/mgedmin/irclog2html?branch=master&svg=true
147 .. _appveyor: https://ci.appveyor.com/project/mgedmin/irclog2html
148
149 .. |coverage| image:: https://coveralls.io/repos/mgedmin/irclog2html/badge.svg?branch=master
150 .. _coverage: https://coveralls.io/r/mgedmin/irclog2html
151