diff -uNr a/logotron/MANIFEST.TXT b/logotron/MANIFEST.TXT --- a/logotron/MANIFEST.TXT 2e4d375892db18ce0f42b30381993c7a70f119542a581b3b20211a3a7f373512c23b832a545a730f86b86143d562e3c383bbe2dd960de617127cc9220437dc1c +++ b/logotron/MANIFEST.TXT d842b46bd643a09c4561676285ec2cd921368026994849f0e771b040a090a144a2749fb3dfad53942aa7d55d3d92037b60e771bf95358a07aff7ad7cfb775afc @@ -14,3 +14,4 @@ 597688 sept_errata asciilifeform "Fixed coarse mistake in reader.py" 597858 detect_disconnect asciilifeform "Adjustable detector of bot disconnection." 598372 shlex_removal asciilifeform "Reverted defective attempt at double-quoted search." +640165 hide_inactive asciilifeform "Configurable default-hide of idle chans" diff -uNr a/logotron/README.txt b/logotron/README.txt --- a/logotron/README.txt 706c15fc1eb5be1fdad3d80321da88590cdc33518d0ea2c004de17f948b7ad07c190374a3e118c5d254c2731a280b52b4030ad2998808104410a35eab05cd825 +++ b/logotron/README.txt 41b2d77f5049bcf7c65dba41e46dc5464b27da3f947cecba3f3bd1ed451b2d469bf550155ec6efb49e52bea0a6467f9d5eee7b5298e2396c39a64390711b6ace @@ -119,9 +119,6 @@ Still needs a variant of 'eater' that will eat these. -############### -Oct. 4 Update: -############### (1) WWW: Removed ill-conceived 'Tape' knob. (2) Bot: Added silent-disconnection detector. @@ -136,3 +133,11 @@ a disconnection is forced. The normal reconnection routine will execute. To disable forced disconnects, set disc_t to zero. + +################# +Jul. 2020 Update: +################# + +(1) Hide by default chans where no activity in days_hide day (set in config.) +(2) Added 'join as guest' link (via 'kiwi' wwwtronic IRC client) +(3) Example Apache-WSGI configs. diff -uNr a/logotron/apacheism/example.vhost b/logotron/apacheism/example.vhost --- a/logotron/apacheism/example.vhost false +++ b/logotron/apacheism/example.vhost 14d7ac73f3c61335c9bb7ae63f70401b2342e82091d600a40653c4a86cbae5d6bdf8619a377a85d48d02ebb6b3f0bd1563751319bd02d4786c7ec6d4844de27a @@ -0,0 +1,30 @@ +Listen 80 + +WSGIPythonPath /home/yourbotuser/logger/ + + + + ServerName logs.yourwww.com + + ErrorLog /var/log/apache2/error.log + CustomLog /var/log/apache2/access.log combined + + WSGIDaemonProcess yourbotuser user=yourbotuser group=apache threads=16 + + WSGIProcessGroup %{GLOBAL} + + WSGIScriptAlias / /home/yourbotuser/logger/yourbotuser.wsgi + + Alias /static/ /home/yourbotuser/logger/static/ + + + Require all granted + + + + + Require all granted + + + + diff -uNr a/logotron/nsabot.conf b/logotron/nsabot.conf --- a/logotron/nsabot.conf b94d71536f35de90b931ffc0d485ff22d643576548e60a3b4bacb3e6a8e9f463ae4a219d7d71067dd780b83e41d35a9493b18213d3d6c5dca96538e3995ecfbd +++ b/logotron/nsabot.conf 3fb19192427a44dcb19df8673eabef04a84355b0a7bec3a411adfef6b7199969eaf2c02f8536ca89ff5c0332110574c47ff804b323543bedd21353d0ff855d7d @@ -58,6 +58,9 @@ # Other people's bots (for colouration strictly) bots = a111, deedbot, feedbot, auctionbot, lobbesbot +# Days of inactivity after which chan is hidden by default +days_hide = 14 + # On what port will sit the www logtron www_port = 5002 diff -uNr a/logotron/nsabot.wsgi b/logotron/nsabot.wsgi --- a/logotron/nsabot.wsgi false +++ b/logotron/nsabot.wsgi af929e1979fef048e21e5537350907b21c3df71497a2cf592d90707943d3c38d41603f359713fbc37d964f1c4c33e6db9e732b3b724c48a98cbeac6551f4efe2 @@ -0,0 +1,5 @@ +#!/usr/bin/python + +import sys + +from reader import app as application diff -uNr a/logotron/reader.py b/logotron/reader.py --- a/logotron/reader.py c9a1cb11f1bca0d8ee8f1351f0e2ad9aea8d6e33d5915372854df0352563fff72d867002d17e0fd5a1a9475066eec9078c20c3bdb5b81009456ac44290bf2660 +++ b/logotron/reader.py 8ac522f24e0add9ba37c81161edbb0ba5fe70df54c03e73fc8a6a60bac3bf993d1530088c5a3a8a7caa90db67ee6b3cdae75a15b4c6d698ed3d95aff12e54626 @@ -25,13 +25,15 @@ ############################################################################## # Single mandatory arg: config file path + if len(sys.argv[1:]) != 1: - # If no args, print usage and exit: - print sys.argv[0] + " CONFIG" - exit(0) + # Default path for WSGI use (change to yours) : + config_path = "/home/nsabot/logger/nsabot.conf" +else: + # Read Config from given conf file + config_path = sys.argv[1] -# Read Config from given conf file -config_path = os.path.abspath(sys.argv[1]) +#config_path = os.path.abspath(config_path) cfg = ConfigParser.ConfigParser() cfg.readfp(open(config_path)) @@ -50,6 +52,7 @@ Era = int(cfg.get("logotron", "era")) DEBUG = int(cfg.get("logotron", "www_dbg")) Max_Raw_Ln = int(cfg.get("logotron", "max_raw")) + Days_Hide = int(cfg.get("logotron", "days_hide")) # WWW: WWW_Port = int(cfg.get("logotron", "www_port")) @@ -150,27 +153,29 @@ l['t'].strftime(Date_Short_Format), l['idx']) -def gen_chanlist(selected_chan): +def gen_chanlist(selected_chan, show_all_chans=False): # Get current time now = datetime.now() - - s = """""" + # Data for channel display : + chan_tbl = {} for chan in Channels: + chan_tbl[chan] = {} + chan_tbl[chan]['show'] = False + chan_formed = chan if chan == selected_chan: chan_formed = "" + chan + "" - s += """""".format( + + chan_tbl[chan]['link'] = """{2}""".format( get_base(), chan, chan_formed) - s += "" - - for chan in Channels: - + last_time = query_db( '''select t, idx from loglines where chan=%s and idx = (select max(idx) from loglines where chan=%s) ;''', [chan, chan], one=True) last_time_txt = "" + time_field = "" if last_time != None: span = (now - last_time['t']) days = span.days @@ -183,19 +188,31 @@ last_time_txt += '%dh ' % hours if minutes != 0: last_time_txt += '%dm' % minutes - - s += """""".format( + + time_field = """{4}""".format( get_base(), chan, last_time['t'].strftime(Date_Short_Format), last_time['idx'], last_time_txt) - else: - last_time_txt = "" - s += "" + if (days <= Days_Hide) or (chan == selected_chan) or show_all_chans: + chan_tbl[chan]['show'] = True - s += "
{2}
{4}
" + chan_tbl[chan]['time'] = time_field + + ## Generate channel selector bar : + s = """""" + for chan in Channels: + if chan_tbl[chan]['show']: + s += """""".format(chan_tbl[chan]['link']) + s += "" + ## Generate last-activ. links for above : + for chan in Channels: + if chan_tbl[chan]['show']: + s += """""".format(chan_tbl[chan]['time']) + # wrap up: + s += "" return s @@ -356,6 +373,9 @@ # Get possible 'reverse gear' rev = request.args.get('rev', default = 0, type = int) + + # Get possible 'show all' + show_all = request.args.get('all', default = 0, type = int) # Get current time now = datetime.now() @@ -398,7 +418,9 @@ sel = (sel_start, sel_end), date = date, tail = tail, - rev = not rev) + rev = not rev, + show_all = show_all, + idle_day = Days_Hide) @app.route('/log-raw/') diff -uNr a/logotron/templates/layout.html b/logotron/templates/layout.html --- a/logotron/templates/layout.html 96ec2c4262fdc5a0707910cc69ccf6c522e6d4b7c0597b61672afcfe1f17bcabe94629c97517328d1f02bc8bb8b2f96bb69d1f39027f55a671b0b290e83c6248 +++ b/logotron/templates/layout.html 7260e8531eee1e629d3bd793931237b759ccd829f1d5f5a929ef3375897ee7a5d21562e870142c24d5f3bafb44f7d7b83b1952c8fdd8554a2e8f55633f10d54c @@ -104,32 +104,30 @@

-

{0}
{0}
+
- - - -
- - No Such lAbs - - - {{ gen_chanlist( chan ) | safe }} - - - Pizarro - + {{ gen_chanlist( chan, show_all ) | safe }}

- + +
+ + {% if not show_all %} + + Show Idle (>{{ idle_day }} d.) Chans + + {% else %} + + Hide Idle (>{{ idle_day }} d.) Chans + + {% endif %} + +
+