logotron_genesis.kv     1 This is the Aug 2019 draft of S.NSA WWW logotron and IRC bot kit,
logotron_genesis.kv     2 as can be seen presently at http://logs.nosuchlabs.com/log .
logotron_genesis.kv     3 
logotron_genesis.kv     4 To make your own installation, you will need:
logotron_genesis.kv     5 
logotron_genesis.kv     6 (1) Traditional 'python' 2.7.
logotron_genesis.kv     7 (2) 'flask' lib for (1).
logotron_genesis.kv     8 (3) 'psycopg2' lib for (1).
logotron_genesis.kv     9 (4) 'postgres' (9 or 10).
logotron_genesis.kv    10 (5) A WWW server that knows how to proxy.
logotron_genesis.kv    11 
logotron_genesis.kv    12 To use the kit, you will first need to create a user and DB, e.g.:
logotron_genesis.kv    13 
logotron_genesis.kv    14 su - postgres
logotron_genesis.kv    15 psql
logotron_genesis.kv    16 
logotron_genesis.kv    17 create user nsabot createdb;
logotron_genesis.kv    18 alter role nsabot superuser;
logotron_genesis.kv    19 createdb nsalog;
logotron_genesis.kv    20 grant all privileges on database nsalog to nsabot ;
logotron_genesis.kv    21 
logotron_genesis.kv    22 ... you can take 'super' away from this user after 1st run,
logotron_genesis.kv    23 it is needed in order to let him load the pg_trgm indexer
logotron_genesis.kv    24 plugin.
logotron_genesis.kv    25 
logotron_genesis.kv    26 Next, run 'init_db.sh' (alter the constants to match the
logotron_genesis.kv    27 names of your postgres user and the DB), this creates the schema.
logotron_genesis.kv    28 
logotron_genesis.kv    29 Then see 'eat.sh' and the 'eat_dump.py' it uses, re how to
logotron_genesis.kv    30 fill your log archive DB. 'eat_dump.py' eats in Phf's classical
logotron_genesis.kv    31 format, e.g.:
logotron_genesis.kv    32 
logotron_genesis.kv    33 1926177;1564727032;mp_en_viaje;in the meantime, everyone's invited on trilema & other blogs.
logotron_genesis.kv    34 
logotron_genesis.kv    35 where 1926177 is absolute line index (in given chan), 1564727032
logotron_genesis.kv    36 is unix epochal timestamp, mp_en_viaje is speaker (if he is
logotron_genesis.kv    37 'actioning', there will be a * behind his name), and the remainder
logotron_genesis.kv    38 of the line is the payload.
logotron_genesis.kv    39 
logotron_genesis.kv    40 You WILL need to adjust the constants in 'eat_dump.py', it is not
logotron_genesis.kv    41 currently capable of eating config file. Set these to your DB
logotron_genesis.kv    42 and PG user.
logotron_genesis.kv    43 
logotron_genesis.kv    44 Now, adjust the constants in 'nsabot.conf' (rename per taste)
logotron_genesis.kv    45 to specify your IRC params, name of bot, host at which www
logotron_genesis.kv    46 logger will reside, and other knob values.
logotron_genesis.kv    47 
logotron_genesis.kv    48 Adjust the three 'flask' templates in 'templates' subdir to
logotron_genesis.kv    49 give the desired look and feel for the www end. Currently we are using
logotron_genesis.kv    50 Phf's classic style sheet, with minor modifications.
logotron_genesis.kv    51 
logotron_genesis.kv    52 'reader.py' takes one mandatory command-line argument: full path
logotron_genesis.kv    53 to the config above. Same for 'bot.py', which is the IRC bot.
logotron_genesis.kv    54 
logotron_genesis.kv    55 Run these via e.g. nohup ./bot.py & ; nohup ./reader.py &
logotron_genesis.kv    56 and let your proxying WWW server know how to reach the latter's port.
logotron_genesis.kv    57 
logotron_genesis.kv    58 For bot.py you will need a registered nick on fleanode (or wherever
logotron_genesis.kv    59 it is used.) There are no fleanode-specific hacks in the bot, ergo
logotron_genesis.kv    60 it can be stood up behind ZNC (although this has not been tested.)
logotron_genesis.kv    61 
logotron_genesis.kv    62 Certain important features are presently unimplemented, in no order:
logotron_genesis.kv    63 (1) Backlinkage.
logotron_genesis.kv    64 (2) Search result pagination.
logotron_genesis.kv    65 (3) Double-quoted search terms.
logotron_genesis.kv    66 (4) Paste archiving.
logotron_genesis.kv    67 (5) Multi-headed IRC bot for weather resistance.
raw_line_export.kv     68 (6) Informative eggogology for bot commands.
raw_line_export.kv     69 (7) Automatic synchronization with mirrors
logotron_genesis.kv    70 
logotron_genesis.kv    71 A ZNC log eater is also required, to properly fill in the archives.
logotron_genesis.kv    72 This is not yet available at the time of this writing.
raw_line_export.kv     73 
raw_line_export.kv     74 ###############
raw_line_export.kv     75 Aug. 11 Update:
raw_line_export.kv     76 ###############
raw_line_export.kv     77 
raw_line_export.kv     78 (1) Multi-line selection is implemented.
raw_line_export.kv     79 
raw_line_export.kv     80 (2) User may request export of raw log lines in Phf-classical format.
raw_line_export.kv     81     E.g. :
raw_line_export.kv     82     http://logs.nosuchlabs.com/log-raw/trilema?istart=1925000&iend=1925500