File: README.rst

package info (click to toggle)
irclog2html 2.17.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 1,144 kB
  • sloc: python: 2,577; perl: 216; makefile: 65
file content (151 lines) | stat: -rw-r--r-- 4,928 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
===========
irclog2html
===========

Converts IRC log files to HTML with pretty colours.


Quick start
===========

Installation::

  pip install irclog2html

Quick usage for a single log file::

  irclog2html --help
  irclog2html filename.log                  (produces filename.log.html)

Mass-conversion of logs (one file per day, with YYYY-MM-DD in the filename)
with next/prev links, with mtime checks, usable from cron::

  logs2html directory/     (looks for *.log and *.log.gz, produces *.log.html)


Configuration files
===================

Since you probably don't want to keep specifying the same options on the
command line every time you run logs2html, you can create a config file.
For example::

  -t 'IRC logs for #mychannel'
  -p 'IRC logs for #mychannel for '
  # the following needs some extra Apache setup to enable the CGI/WSGI script
  --searchbox
  # where we keep the logs
  /full/path/to/directory/

Use it like this::

  logs2html -c /path/to/mychannel.conf

Lines starting with a ``#`` are ignored.  Other lines are interpreted as 
command-line options.

The order matters: options on the command line before the ``-c FILE`` will
be overriden by option in the config file.  Options specified after ``-c FILE``
will override the options in the config file.

You can include more than one config file by repeating ``-c FILE``.  You
can include config files from other config files.  You can even create loops of
config files and then watch and laugh manically as logs2html sits there burning
your CPU.


CGI script for log searching
============================

.. warning::
   The script can be easily abused to cause a denial of service attack; it
   parses *all* log files every time you perform a search.

You can generate search boxes on IRC log pages by passing the ``--searchbox``
option to ``logs2html``.  Here's an example Apache config snippet that makes
it work::

  RewriteRule ^/my-irclog/search/$ /my-irclog/search [R,L]
  ScriptAlias /my-irclog/search /usr/local/bin/irclogsearch
  <Location /my-irclog/search>
    SetEnv IRCLOG_LOCATION "/var/www/my-irclog/"
    # Uncomment the following if your log files use a different format
    #SetEnv IRCLOG_GLOB "*.log.????-??-??"
    # (this will also automatically handle *.log.????-??-??.gz)
  </Location>


WSGI script for log serving
===========================

.. warning::
   The script can be easily abused to cause a denial of service attack; it
   parses *all* log files every time you perform a search.

There's now an experimental WSGI script that can generate HTML for the
logs on the fly.  You can use it if you don't like cron scripts and CGI.

Here's an example Apache config snippet::

  WSGIScriptAlias /irclogs /usr/local/bin/irclogserver
  <Location /irclogs>
    SetEnv IRCLOG_LOCATION "/var/www/my-irclog/"
    # Uncomment the following if your log files use a different format
    #SetEnv IRCLOG_GLOB "*.log.????-??-??"
    # (this will also automatically handle *.log.????-??-??.gz)
  </Location>

Currently it has certain downsides:

- configuration is very limited, e.g you cannot specify titles or styles
  or enable dircproxy mode
- HTML files in the irc log directory will take precedence over
  dynamically-generated logs even if they're older than the corresponding
  log file (but on the plus side you can use that to have dynamic search
  via WSGI, but keep statically-generated HTML files with your own config
  tweaks)


WSGI script for multi-channel log serving
=========================================

.. warning::
   The script can be easily abused to cause a denial of service attack; it
   parses *all* log files every time you perform a search.

The experimental WSGI script can serve logs for multiple channels::

  WSGIScriptAlias /irclogs /usr/local/bin/irclogserver
  <Location /irclogs>
    SetEnv IRCLOG_CHAN_DIR "/var/www/my-irclog/"
    # Uncomment the following if your log files use a different format
    #SetEnv IRCLOG_GLOB "*.log.????-??-??"
    # (this will also automatically handle *.log.????-??-??.gz)
  </Location>

Now ``/irclogs`` will show a list of channels (subdirectories under
``/var/www/my-irclog/``), and ``/irclogs/channel/`` will show the
date index for that channel.


Misc
====

Website: https://mg.pov.lt/irclog2html/

Bug tracker:
https://github.com/mgedmin/irclog2html/issues

Licence: GPL v2 or later (https://www.gnu.org/copyleft/gpl.html)

|buildstatus|_ |appveyor|_ |coverage|_

.. |buildstatus| image:: https://api.travis-ci.org/mgedmin/irclog2html.svg?branch=master
.. _buildstatus: https://travis-ci.org/mgedmin/irclog2html

.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/mgedmin/irclog2html?branch=master&svg=true
.. _appveyor: https://ci.appveyor.com/project/mgedmin/irclog2html

.. |coverage| image:: https://coveralls.io/repos/mgedmin/irclog2html/badge.svg?branch=master
.. _coverage: https://coveralls.io/r/mgedmin/irclog2html