Minixed icon indicating copy to clipboard operation
Minixed copied to clipboard

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

Open yusufcardinal opened this issue 3 years ago • 4 comments

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.

yusufcardinal avatar Oct 13 '21 20:10 yusufcardinal

It'd be helpful to know what you've changed and what the permissions to /medias/foo/bar look like.

tim-elmer avatar Oct 13 '21 21:10 tim-elmer

Sorry, I pressed post way too early.

I've forked the version of lorenzos and replaced it with my version. The relevant changes are in the latest commit, line 45 onward. The permissions of /medias/foo/bar are okay because I am able to get the directory listing and open files that are at the root of /medias/foo/bar , I only find myself unable to open subdirectories.

yusufcardinal avatar Oct 13 '21 21:10 yusufcardinal

@yusufcardinal I don't know if it's the only cause, but take a look at line 60 in your modified script. There's a check (the last condition) that makes sure the b URL parameter is in fact a directory name, using is_dir(). That check fails because b is relative to the script location, and so the $_browse is never set. You should prefix both the check and $_browse with your starting path.

lorenzos avatar Oct 15 '21 08:10 lorenzos

Also, why not using a symlink instead of modifying the script?

cd /www/html/foo/bar
wget https://raw.githubusercontent.com/lorenzos/Minixed/master/index.php
ln -s /medias/foo/bar/ ./baz

And configure the script like:

$browseDirectories = true;
$browseDefault = 'baz'

lorenzos avatar Oct 15 '21 08:10 lorenzos