raw
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).
frontend_updates.kv 10 (5) A WWW server that can serve WSGI applications (e.g. Apache with mod_wsgi installed).
frontend_updates.kv 11 - If installing mod_wsgi for the first time be sure to set your target
frontend_updates.kv 12 python version to 2.7 (/etc/portage/make.conf in gentoo/dulap systems)
frontend_updates.kv 13
frontend_updates.kv 14
frontend_updates.kv 15 ####################
frontend_updates.kv 16 DB Setup
frontend_updates.kv 17 ####################
logotron_genesis.kv 18
logotron_genesis.kv 19 To use the kit, you will first need to create a user and DB, e.g.:
logotron_genesis.kv 20
logotron_genesis.kv 21 su - postgres
logotron_genesis.kv 22 psql
logotron_genesis.kv 23
logotron_genesis.kv 24 create user nsabot createdb;
logotron_genesis.kv 25 alter role nsabot superuser;
uptimefix_bye_cac... 26 create database nsalog;
frontend_updates.kv 27 grant all privileges on database nsalog to nsabot;
logotron_genesis.kv 28
logotron_genesis.kv 29 ... you can take 'super' away from this user after 1st run,
logotron_genesis.kv 30 it is needed in order to let him load the pg_trgm indexer
logotron_genesis.kv 31 plugin.
logotron_genesis.kv 32
logotron_genesis.kv 33 Next, run 'init_db.sh' (alter the constants to match the
logotron_genesis.kv 34 names of your postgres user and the DB), this creates the schema.
logotron_genesis.kv 35
frontend_updates.kv 36
frontend_updates.kv 37 ####################
frontend_updates.kv 38 Importing Logs
frontend_updates.kv 39 ####################
frontend_updates.kv 40
logotron_genesis.kv 41 Then see 'eat.sh' and the 'eat_dump.py' it uses, re how to
logotron_genesis.kv 42 fill your log archive DB. 'eat_dump.py' eats in Phf's classical
logotron_genesis.kv 43 format, e.g.:
logotron_genesis.kv 44
logotron_genesis.kv 45 1926177;1564727032;mp_en_viaje;in the meantime, everyone's invited on trilema & other blogs.
logotron_genesis.kv 46
logotron_genesis.kv 47 where 1926177 is absolute line index (in given chan), 1564727032
logotron_genesis.kv 48 is unix epochal timestamp, mp_en_viaje is speaker (if he is
logotron_genesis.kv 49 'actioning', there will be a * behind his name), and the remainder
logotron_genesis.kv 50 of the line is the payload.
logotron_genesis.kv 51
logotron_genesis.kv 52 You WILL need to adjust the constants in 'eat_dump.py', it is not
logotron_genesis.kv 53 currently capable of eating config file. Set these to your DB
logotron_genesis.kv 54 and PG user.
logotron_genesis.kv 55
frontend_updates.kv 56 See subdir 'logconverters' for scripts to convert ZNC and irssi log formats to Phf's format
uniturds_etc.kv 57
uniturds_etc.kv 58
frontend_updates.kv 59 ####################
frontend_updates.kv 60 Configuration
frontend_updates.kv 61 ####################
detect_disconnect.kv 62
frontend_updates.kv 63 Now, adjust the constants in 'nsabot.conf' (rename per taste)
frontend_updates.kv 64 to specify your IRC params, name of bot, host at which www
frontend_updates.kv 65 logger will reside, and other knob values.
detect_disconnect.kv 66
frontend_updates.kv 67 Set css_file in the conf file to point to your desired CSS file in 'static' subdir.
frontend_updates.kv 68 Adjust the 'jinja' templates in 'templates' subdir to give the desired look
frontend_updates.kv 69 and feel for the www end IF your CSS changes alone are not sufficient.
frontend_updates.kv 70 Currently we are using Phf's classic style sheet, with minor modifications.
detect_disconnect.kv 71
hide_inactive.kv 72
search_all_chans.kv 73 ####################
frontend_updates.kv 74 Running the WWW
search_all_chans.kv 75 ####################
hide_inactive.kv 76
frontend_updates.kv 77 'reader.py' takes one mandatory argument: full path to the config above.
frontend_updates.kv 78 - When running as a WSGI module this argument needs to be hardcoded in 'reader.py'
frontend_updates.kv 79 - When running locally pass in as a single command-line argument,
frontend_updates.kv 80 e.g. `./reader.py path/to/config`
frontend_updates.kv 81 - Optionally, when running locally, set FLASK_ENV=development to allow for
frontend_updates.kv 82 auto-reloading on file changes (see Flask documentation for more info).
search_all_chans.kv 83
navbar_date_auto.kv 84
navbar_date_auto.kv 85 ####################
frontend_updates.kv 86 Running the Bot
navbar_date_auto.kv 87 ####################
navbar_date_auto.kv 88
frontend_updates.kv 89 Run bot.by and pass in the path to the same config file as a single command-line
frontend_updates.kv 90 argument, e.g. `nohup ./bot.py path/to/config &`
navbar_date_auto.kv 91
frontend_updates.kv 92 For bot.py you will need a registered nick on fleanode (or wherever
frontend_updates.kv 93 it is used.) There are no fleanode-specific hacks in the bot, ergo
frontend_updates.kv 94 it can be stood up behind ZNC (although this has not been tested.)
aug2020_errata.kv 95
aug2020_errata.kv 96
frontend_updates.kv 97 ####################
frontend_updates.kv 98 Not Yet Implemented
frontend_updates.kv 99 ####################
aug2020_errata.kv 100
frontend_updates.kv 101 Certain important features are presently unimplemented, in no order:
frontend_updates.kv 102 (1) Backlinkage.
frontend_updates.kv 103 (3) Double-quoted search terms.
frontend_updates.kv 104 (4) Paste archiving.
frontend_updates.kv 105 (5) Multi-headed IRC bot for weather resistance.
frontend_updates.kv 106 (6) Informative eggogology for bot commands.
frontend_updates.kv 107 (7) Automatic synchronization with mirrors