How to costumize Listing Directory confused smiley

Posted by Elzou 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Now, this forum is in read-only mode. You find details Details hereContinue on /r/PirateBox
How to costumize Listing Directory confused smiley
April 22, 2013 07:32PM
Hello

I would like to know how I can change the directory listing:
- Add a background image
- Change the icons
- Change the title

I searched a lot on the net but I did find a
Tutoriel but that does not work with the latest version 0.5.1.



Thank you
Sorry for my poor English.
Re: How to costumize Listing Directory confused smiley
April 22, 2013 07:44PM
did you checked this page: [redmine.lighttpd.net] ?
it covers a few points
Re: How to costumize Listing Directory confused smiley
April 22, 2013 07:50PM
Thank you for your quick response

Yes I looked this page but I do not understand what changed file ? lighttpd.conf ?

I'm a noob. eye rolling smiley

Basically I want to create a html page including directory list ?
Re: How to costumize Listing Directory confused smiley
April 24, 2013 06:42AM
No, creating a html file won't work if you add new files.

You can only create a custom-css file and modify /opt/piratebox/lighttpd/lighttpd.conf

I can't help more, because I haven't done it for myself yet... sorry.
Re: How to costumize Listing Directory confused smiley
April 25, 2013 09:37AM
Hello,
I found a few things I'd like to share that will perhaps help some people.
For me it works.
This allows to little costum page.

Examples :
---------------
The changes are added to this file with :
vi /opt/piratebox/conf/lighttpd/lighttpd.conf

# It adds a CSS file for layout (light-dir.css is an example )

dir-listing.external-css    ="/opt/pirabox/www/light-dir.css"

# Change the message footer (default : "lighttpd/1.4.18" ) 

dir-listing.set-footer      ="My text"


# The four following commands allow for added HTML code above the directory listing for the use you have to create a 
# file header.txt
# that you put in Shared. It is in this text file you add your HTML code.

# Disables the default generated HTML code allows the neat header or footer with HEADER.txt or README.txt

dir-listing.auto-layout     ="disable"

# Displays the header before the directory listing

dir-listing.show-header     ="enable"

# hide HEADER.txt files to "public" from the directory listing

dir-listing.hide-header-file ="enable"

# Displays the header HTML encoded

dir-listing.encode-header ="disable"

# You can also add HTML footer by creating a README.txt

dir-listing.show-readme ="enable"
dir-listing.hide-readme ="enable"
dir-listing.encode-readme-file ="disable"


I hope so this will help some people and I'm sorry for my bad english ...

Elz



Edited 4 time(s). Last edit at 04/28/2013 07:13PM by Elzou.
Thanks a lot Elzou. Finally my piratebox's directory listing got a beautiful icon beside its file's name.
Re: How to costumize Listing Directory confused smiley
April 27, 2013 11:18PM
To hide the README.txt file,

dir-listing.hide-readme ="enable"

should be

dir-listing.hide-readme-file ="enable"                                                                   
Re: How to costumize Listing Directory confused smiley
April 28, 2013 07:01PM
Sorry !

Okay this has been changed !

Thank !
Re: How to costumize Listing Directory confused smiley
May 13, 2013 11:31PM
If above dir-listing.external-css ="/opt/piratebox/www/light-dir.css" did not work for you
try this one ... place a new file "HEADER.txt" into your Shared-directory and create / edit style.css in /opt/pirabox/css/

FILE: HEADER.txt
Language: HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html> <head> <title>PirateBox - Shared Files</title> <link rel="stylesheet" type="text/css" href="http://piratebox.lan/css/style.css"> </head> <body> <a href="http://piratebox.lan/"><div class="logobox"></div></a><br><br> <div class="list"> <h1>PirateBox - Shared Files</h1>

FILE: style.css (example)
Language: CSS
.readme { font-family: LatoReg, sans-serif; text-align: left; font-size: 30px; }   .n { font-family: arial; margin-right: 10px; padding-right: 20px; padding-bottom:5px; }     .s { font-family: arial; margin-right: 10px; padding-right: 20px; padding-bottom:5px; }     .m { font-family: arial; margin-right: 10px; padding-right: 20px; padding-bottom:5px; }   .t { font-family: arial; margin-right: 10px;   padding-bottom:5px; }       .list { background: none repeat scroll 0 0 #FFFFFF;   margin-left: auto; margin-right: auto; padding: 15px; width: 650px; z-index: 0; } .list > .list { margin-left: auto; margin-right: auto; width: 650px; box-shadow:none; padding:0px; }



Edited 1 time(s). Last edit at 05/13/2013 11:34PM by dataminer.
Re: How to costumize Listing Directory confused smiley
May 14, 2013 04:48AM
Very nice work-around and idea about the directory listing!!
Re: How to costumize Listing Directory confused smiley
June 16, 2013 01:40PM
Hi,

@Elzou, I think you should re-edit your post to hide the readme file.
(mistake with the last line ?)

dir-listing.hide-readme-file ="enable"

Anyway, I would like to thank you, because it works ! >grinning smiley<



I'll post an entry on my weblog for french user.


Sylvain
Re: How to costumize Listing Directory confused smiley
June 16, 2013 02:15PM
One thing I would like to ask why 'last modified date' is 1 Jan 1980?
How to update it?
Re: How to costumize Listing Directory confused smiley
June 16, 2013 02:52PM
@johanrusli It's the date issue of the Piratebox, wich by default not save the date on reboot.

Matthias has a script to save the last date, if you fix manualy the date of your PirateBox, but I don't use it.

I just write my post entry, and realisize the inversion of *-file had desable the interpretation of my footer html, so it is fix now, and everything is good (like javascript for the menu for exemple).



Just yum it !
[sylvain.naud.in]
Communauté francophone BiblioBox : [bibliobox.net]
Re: How to costumize Listing Directory confused smiley
July 06, 2013 12:28AM
Free Php Download script that works great

[forum.daviddarts.com]
customization is fine but dir-listing.encoding = "utf-8" directive doesn't work
Re: How to costumize Listing Directory confused smiley
October 17, 2013 09:05PM
error message?
Re: How to costumize Listing Directory confused smiley
January 08, 2019 04:18PM
Hi,

I use h5ai to list the directories and files of the piratebox.

It works fine, only I would like the HEADER.txt and README.txt files to not appear. In the /opt/piratebox/conf/lighttpd/lighttpd.conf file, I find:

# Enables header section
dir-listing.show-header         = "enable"
dir-listing.encode-header       = "disable"
# Hides HEADER.txt from listing
dir-listing.hide-header-file    = "enable"

# Footer
# Enables footer section
dir-listing.show-readme         = "enable"
dir-listing.encode-readme       = "disable"
# Hides README.txt from listing
dir-listing.hide-readme-file    = "enable"
# Diables default footer text
dir-listing.set-footer          = " "

The files should not appear (?), but it is not the case:



Would you have an idea to make them disappear otherwise?

Best regards,
Rico

٠̩̩̩ЯI☪⚉ ḍḁ ㅒД╰ṽᴬ®Е☡
Re: How to costumize Listing Directory confused smiley
January 11, 2019 06:36AM
The files are re-distributed on each bootup.
You need to disable this function in /opt/piratebox/conf/piratebox.conf

Language: Bash
#Provide files needed for PirateBox custom dirlisting CUSTOM_DIRLIST_COPY="yes"
Switch this to "no"
Re: How to costumize Listing Directory confused smiley
January 11, 2019 07:08AM
Thank you Matthias, it works very well ! thumbs up
@ricodahalvarez

Could you give me tutorial how to install H5ai on piretebox, please?
Hello everybody !!!
Thanks a lot to David, Matthias, Josh and the whole team.
I am sorry I am stuck on a very simple thing...: I don't manage to encode de dir-listing in utf-8....
I already put a <meta charset="utf_8"> in the HEADER.txt I add a rule @charset "utf-8" in the css page, the lighttpd.conf contains the line : dir-listing.encoding = "utf-8" ..... the error.log doesn't show any error....
If anybody have clue i will be very happy !
thx and all the best to everybody
Re: How to costumize Listing Directory confused smiley
August 14, 2019 11:10AM
No, creating a html file won't work if you add new files.

You can only create a custom-css file and modify /opt/piratebox/lighttpd/lighttpd.conf

I can't help more, because I haven't done it for myself yet... sorry.