raspberry pi - Serving irssi log files over local network with Lighttpd

07
2014-07
  • Jack

    I wish to use Lighttpd to serve some Irssi log files over a local network - [for my own private use].

    Irssi can't write to /var/www/, and I don't think changing permissions is the 'right' way to do things.

    Is there a 'typical' way around this?

    I tried softlinking the irclogs folder to /var/www/ but Lighttpd wouldn't serve them.

    I have set

    server.document-root = /home/user/irclogs/ 
    

    but that just serves up the generic welcome page. Typing in an individual log filename results in a not found error, as does a test.txt filename.

    Copying the directory with a cron job seems like a waste ...

    I am looking for advice on how to do this, or on how to debug the attempts I made.

  • Answers
  • MKzero

    Why not change the permissions? Permissions are there to use them. And this is a fine example of where group permissions are useful.

    Try using a log directory with read+write permissions for your irssi user and read permissions for your web server user.

    You could of course add an additional group for that purpose and put the web servers user into that group.

    Example:

    Folder /var/www/irclogs

    Permissions:

    User: [irssi-user]
    
    Group: [web server group]
    
    Mode (Folder): 0750
    
    Mode (Files): 0640
    

    That way your web server can read the files, irssi can read+write the files and no one else can access them(unless you set the mode to something else).


  • Related Question

    irc - Irssi: /LASTLOG match -file /tmp/irssi_discussion
  • Masi

    I have tried to save the match "/lastlog match" to a file /tmp/irssi_discussion. I can get it work like "/lastlog /tmp/irssi_discussion" that saves the whole buffer, noted in the documentation. However, it fails on its variant.

    How can I get the command "/LASTLOG match -file /tmp/irssi_discussion" working in Irssi?


  • Related Answers
  • mark

    You should put the pattern to match after the file, so:

    /LASTLOG -file /tmp/irssi_discussion match
    

    To get the full help information do:

    /HELP lastlog
    

    That includes the specific syntax details:

    LASTLOG [-] [-file <filename>] [-window <ref#|name>] [-new | -away] [-<level>-<level...>] [-clear] [-count] [-case] [-regexp | -word] [-before[<#>]] [-after [<#>]] [-<# before+after>] [<pattern>] [<count>[<start>]]