Git Product home page Git Product logo

minixed's Introduction

Minixed is a minimal but nice-looking PHP directory indexer.
You can see it as a replacement for the Apache mod_autoindex.

«How does it look?» Like this.
«I don't like it.» You are a CSS master, right? Good, you know what to do.

How to use

Just drop the index.php script in the same directory that contains files you want to index.

wget https://raw.githubusercontent.com/lorenzos/Minixed/master/index.php

«Really? One single file?» Yes, really. Glad you asked.
«If so, where are icon files?» They are hard coded into the source, thanks Base-64.
«Was it really necessary?» I don't know, I just loved the idea you need only one file.

If you want Minixed to work also in subfolders, edit index.php setting:

$browseDirectories = true; // Navigate into sub-folders

Configuration

The script works well out-of-the-box, and generally you want to leave it as it is. However if you have some particular needs, there are some PHP variables placed in the first lines of index.php you can edit.

You can enable navigation into subfolders using:

$browseDirectories = true; // Navigate into sub-folders

You can change the page title (and subtitle) providing strings that can contains some placeholders that will be parsed at runtime:

$title = 'Index of {{path}}';
$subtitle = '{{files}} objects in this folder, {{size}} total'; // Empty to disable

You can make breadcrumb links if titles contain {{path}}, useful when navigating into subfolders:

$breadcrumbs = true; // Make links in {{path}}

You can tell the script how to build the files list using:

$showParent = false; // Display a (parent directory) link
$showDirectories = true;
$showDirectoriesFirst = true; // Lists directories first when sorting by name
$showHiddenFiles = false; // Display files starting with "." too

And how that list should look:

$alignment = 'left'; // You can use 'left' or 'center'
$showIcons = true;
$dateFormat = 'dd/mm/yyyy HH:ii'; // Used in date() function
$sizeDecimals = 1;

Finally, you can customize the content of the meta-tag "robots" if you want to give some search engine hints:

$robots = 'noindex, nofollow'; // Avoid robots by default

Of course, if PHP is a friend of yours you can easily understand the whole script source code, so the only limit to customization is your imagination.

Bug tracking and developing

If you find bugs, if you have suggestions, if you modified the script adding features or improvements, feel free to contribute by opening Issues or Pull Requests.

minixed's People

Contributors

lorenzos avatar tim-elmer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minixed's Issues

Breadcrumbs

I would love to see the title work like breadcrumbs where you could click one item in the title and go to that folder directly.

Undefined index

If in config show Folders and after URL and enter (without "d" parameter) show:
Notice: Undefined index: b in D:\Data\Servers\Web\UniServerZ\www\2019\test\index.php on line 36

How fix?

Using the Ignore array

Hi, I love this little dynamo of a product! The last line of Configuration reads like this:

$ignore = array(); // Names of files and folders to not list (case-sensitive)

I presume it is a filter of sorts, so that I could instruct it to not show certain files. What is the syntax for using this, and can I use wildcards to, for example, filter out all JPG and PNG files?

Pretty URL's

Stubbled across this gem in my travels - Works perfectly, thank you! Just one thing I cannot get working is "Pretty URL's".

I am using Nginx and have added the following and although it works on the root, it doesn't when navigating through folders etc. Am I doing something wrong?

location ~ \.php$ { include fastcgi_params; fastcgi_intercept_errors on; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_read_timeout 3600; fastcgi_send_timeout 3600; fastcgi_param HTTPS "on"; fastcgi_param SERVER_PORT 443; fastcgi_pass 127.0.0.1:{{php_fpm_port}}; fastcgi_param PHP_VALUE "{{php_settings}}"; }

Not an issue the program works great More of a request

This is an excellent tool that I had a real need for. My only problem is regarding sorting and i hope the issue has an easy solution
I need to display the contents of the folder listed in order by their first character regardless of their file-type so I can Intersperse doc, pdf, and other file types in the same display order as the subdirectories.
Each folder item is numbered 1. 2. 3. 4. etc. so they appear in the order they need to be seen in. But I can't find a way to keep them in order based on those numbers regardless of their type.

1; Read me.txt
2, misc image.html
3. Document files (this is a sub-dir)
4. PDF Files (this is a sub-dir)
5. Misc music file.mp4

I had thought that if I changed the option to sort directories ahead of files to false that that would fix the problem ( as below.)
$showDirectoriesFirst = false; // Lists directories first when sorting by name

I would also like to be able to keep the file order locked such that the User cannot re-sort it by clicking on any of the column headers. Turn off sort by User on all fields.

Would it be difficult to impose this setup on the display? Everything else is beautiful and I love the "one file does it all". While it might be nice to have the file icons a little more distinct I am very happy with what you have already done

Any advice appreciated

Square brackets not encoding to %5B and %5D

Hello,
I'm not 100% sure, but it seems like urlencode is not working correctly for the generated index page hyperlinks.

Example some of my folders on disk contain square brackets [ and ] in the path name ie. /videos/Latest.Download.1080p.[foo]/ and while most browsers manage just fine, VLC can't access the directory - unless square brackets are encoded.

I tried to briefly write my own escape function, but it only worked on strings and not buildLink().

If you have time can you have a look?

Much Love!

Inaccurate time on last modified

Why is the last modified time in my index 7 hours longer than the current time? What's the solution?
The current time is 18.50 but the last modified time was 11.50. even though the file was just edited.

Add option for files to ignore

It would be great to have the option of a custom list of items that we don't want to show.
Like index.php, favicon,ico, /scripts /css

Title shows as root when browsing

When browseDirectories is true, the HTML title and page title show "Index of /".

The expected behavior is that the titles show "Index of /$browse/". I can fix this by adding . $_browse . "/" to the titles, but that's a workaround.

Is there any possibility to add a search engine?

The library that I made from your template, which is perfect, works great, but I have more than 14000 titles and it is tedious to search by category, how do I have them arranged ... is there the possibility of adding a search engine?

Source code license

Hi.
I would like to include this nice tool in one of my projects. But as of now I can't use it because you don't provide a license your code it put under.

Can you provide this information?

Thanks, Marcel.

Any way to make the script work with directories outside of its own?

I've been modifying the script so it may be able to list files in a directory other than its own. The website resides at /www/html/ , and the script is placed in folder /www/html/foo/bar/ . It is meant to list files in /medias/foo/bar/ .

I have managed to list the files of the /medias/foo/bar/ directory on the webpage, but I am struggling to get the subdirectory navigation to work.

Filesizes reporting as negative amounts

Currently any file over 2GB in size displays as a negative number. Looking into it myself I believe this is an issue with PHP itself but I think you'd know better than me! I've attached an image of the issue.
capture

Start directory

Could we create a setting variable that would allow the start directory to be other than the same directory as the php file?

Reducing Base-64 icons sizes

Saved as gif got these a bit smaller - although not transparent i.e. white background

case 'asc': exit(base64_decode('R0lGODlhBwAHAIgAAAAAAAAAACH5BAEAAAEALAAAAAAHAAcAAAIIjI8Ju8eaYiwAOw=='));
case 'desc': exit(base64_decode('R0lGODlhBwAHAIgAAAAAAAAAACH5BAEAAAEALAAAAAAHAAcAAAIKjI9pkODnopqmAAA7'));
case 'directory': exit(base64_decode('R0lGODdhCgAKAIgAAP///wAAACwAAAAACgAKAAACFER+oBrb/gxKq6aJTWUtQmp5ITYVADs='));
case 'file': exit(base64_decode('R0lGODdhCgAKAIgAAP///wAAACwAAAAACgAKAAACFUR+oBps+2JzUTI0J8yQ6sV1GYYABQA7'));

Really great lister tho :)

Code issues

Hi, when I copy the code and run it, It doesnt display anything but jumbled code. It just breaks instantly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.