irc.apertus.org listing error
Open, Needs TriagePublic

Description

Empty log listing at http://irc.apertus.org/ and file not found error for individual pages, e.g.:
http://irc.apertus.org/index.php?day=01&month=05&year=2015

intracube created this task.May 1 2015, 1:54 AM
intracube updated the task description. (Show Details)
intracube raised the priority of this task from to Needs Triage.
intracube added a subscriber: intracube.
intracube added a comment.EditedMay 3 2015, 2:23 AM

More info about the error on 30th April:

  • at 23:45 UTC, the logs overview (month listing) wasn't visible
  • the issue fixed itself at midnight

cause:

  • in index.php lines 213, 218: is_dir($logdir) would return false as the $logdir var is constructed from $year and $month which are set to:

$month = date('m');
$year = date('Y');
(lines 76-96)

The web server clock is CET, so it'd would be looking for a future, non-existant log dir as the IRC logger writes files according to UTC.

EDIT: A similar issue stops the [Today] button working for a couple of hours each night as CET is a couple of hours ahead of UTC during summer.

Very well observed!

If you have a fix I can push it live and to github immediately.

I'm not that proficient in PHP, maybe:

  • the server base time could be changed to UTC or
  • set date.timezone in php.ini to UTC or
  • set date_default_timezone_set('UTC') at the top of index.php

+ some sort of offset for line 193 'Current Server Time (Central Europe)' ?

line numbers correspond to this version/hash of index.php:
https://github.com/apertus-open-source-cinema/irc-log-viewer/blob/41cbb55bada854d45e4320b4468998396d5abce6/index.php

Created a fork for testing;
https://github.com/intracube-paul/irc-log-viewer

changes:

  • add utcDatTime() function where server time can be offset to return UTC (substitute for date() )
  • add logLink() which returns <a class="loglink" ...> for each logfile in the overview mode
  • add PHP_EOL in places for cleaner HTML
  • ($showoverview) section now reads the actual log dir names rather than trying to construct from the current date. regex tests on dirs and files to exclude any non log files
  • changed some var names for readability
intracube added a project: Restricted Project.May 13 2015, 6:38 PM

URLs are now clickable links as long as they start with http:// or https://

any feedback welcome.

sebastian claimed this task.Jun 3 2015, 4:53 PM

Thanks for the fix/patch!

Sorry I had been so busy that I could not test/deploy it yet. I hope to do that soon. (claiming task)

About the clickable URLs:
We on purpose decided against clickable links in the logs to reduce spam/phishing/exploits severity.
Cleaning those malicious URLs from the logs would be extremely time consuming in case a bot or whoever decided to attack us/our channel.

Would it be any help if I do a patch with the minimum changes to fix the original bug?

yes that would be great!

I can push it live and we can just see if the problem is gone, yes I know very sophisticated code review but better than nothing at all happening....

sebastian edited projects, added Web Content & Documentation; removed Restricted Project.Mar 10 2016, 9:27 PM