Add netblock examples and documantion
[python-rwhoisd.git] / README
1 WHAT IS THIS?
2
3 As a programming exercise for learning Python, I wrote a simple rwhois
4 server (described in RFC 2167).  It uses in-memory data structures,
5 and it intuits the schema based on the data it sees.  The server takes
6 as input a schema file, which for now just describes which attributes
7 should be indexed (and how), and data files which look much like the C
8 rwhoisd's data files.
9
10 This version supports a sort of extended query syntax: IP or CIDR
11 queries ending in "**" will result in a "subnet" search, where all of
12 the found subnets at or below the specified network will be returned.
13 Ending a IP or CIDR query with a single "*" will result in a
14 "supernet" search.
15
16 It supports (as of v0.4) IPv6 CIDR networks and network blocks, and
17 supports indexing network-block type values.  That is, you can index
18 values like "10.131.10.0 - 10.131.11.255" and "3ffe:4:5::0 -
19 3ffe:4:6::ffff".
20
21 REQUIREMENTS
22
23 python 2.2 or later.
24
25 INSTALL
26
27 This can be run from it's source directory, which is a fine way to do
28 it.
29
30 However, if you wish to install it, as root:
31
32 % python setup.py install
33
34 This is just using the standard Python distutils, so there is actually
35 a great deal of flexibility here.  Try
36
37 % python setup.py install --help
38
39 to see some of the options available.
40
41 RUNNING IT
42
43 This is assuming that you are running it from the distribution
44 directory.
45
46 % tar zxvf python-rwhoisd-0.4.tar.gz
47
48 % cd python-rwhoisd-0.4
49
50 % ./bin/pyrwhoisd sample_data/example_schema \
51                   sample_data/example_data &
52
53 Voila!  You should now have some sort of rwhois server running on port
54 4321
55
56 CONFIGURING IT
57
58 Edit rwhoisd/config.py.
59
60 This file has comments describing options that you can change.
61
62 DATA
63
64 See the example_schema and example_data files in the sample_data
65 directory.
66
67 The format of the data files is very similar to the format used by the
68 C rwhois server (rwhoisd-1.5.x from www.rwhois.net).  It has the
69 following differences, however:
70
71 * These files may have records separated by blank lines instead of
72   dashes.
73
74 * They are not sensitive to trailing separators (whitespace or
75   dashes)
76
77 * They do not have to be arranged in any special manner.  That is, the
78   C rwhoisd forces (or at least encourages) you to arrange your data
79   files into different directories per authority-area.  These can be
80   wherever.
81
82 * This server does not support attribute "aliases".
83
84 It should be noted that this server in small ways violates the
85 description put forth by RFC 2167.  In particular, it does not
86 establish independent schemas for each authority area.  There may be
87 other violations as well.