Search…

X3 Photo Gallery Support Forums

Search…
 
rvine
Topic Author
Posts: 2
Joined: 28 Jun 2020, 09:01

Files apps symlinks and search

28 Jun 2020, 16:59

Hi,

I found the Files Photo Gallery recently and have installed it on a Linux virtual server. First of all, what a fabulous web application! It's trivial to install and configure, and does pretty much exactly what I want to make my photos accessible via the web. It  has a very polished and mature look about it, presumably something to do with the existing X3 app. I'm hoping this can replace an ancient Perl 'Apache:Gallery' application that recent updates to Perl/mod_perl have broken possibly beyond repair! Files seems a perfect replacement and improvement so thank you for your hard work on it.

I noticed a query about protecting the gallery with username/password and how secure that may be. I'm using Apache security with LDAP authentication so don't actually need the Files user authentication option at this time. Apache authentication works for a variety of sites/location so you don't need to keep reinventing solutions for each webapp.


I do have two usage queries:

1. The first is that Files doesn't appear to follow symbolic links to other folders. I've a variety of subfolders that are being displayed normally but also have some that are symlinks. The default 'home'  view shows these folders greyed out and I can't then select any subfolders. Using the tree view on the left shows the folders and all subfolders (hence it is able to follow the links) but accessing any subfolder below the symlink results in 'Invalid directory xxxxxxxx'.

I've looked at the code and it appears there is a section that uses the PHP 'filetype' function to figure what is a file and what is a directory. This  returns 'link' instead of 'dir'. for symlinks to directories. However, 'isdir' is used in other places and this does return 'true' for a symbolic link that resolves to a directory. I'm not fluent with PHP so haven't quite figured out what would be needed to make this work.

2. The other query is regarding the search option; this seems to only search based on folder/filenames. It would be great if this searched on tags within the photos; it does appear this information is pulled into the cache 'json' files so the data does seem to be available to search on without having to open every image, albeit, only if you've visited that folder previously in order to populate the cache!

Can you think of any obvious workarounds for these small issues? The symlink one feels like something that could be made to work, but the search option may be beyond what you're intending for this app.

Look forward to your reply and future developments to this app.

Thanks.

Richard
 
User avatar
mjau-mjau
X3 Wizard
Posts: 12169
Joined: 30 Sep 2006, 03:37

Re: Files apps symlinks and search

29 Jun 2020, 02:43

First of all, thanks for your feedback. I have plans to update Files app well into the future, and all feedback counts. The Files app is in fact more modern than X3 in many ways, and there are many core features in Files app that will be migrated to X3.
rvine wrote:I'm using Apache security with LDAP authentication so don't actually need the Files user authentication option at this time.
Sure. If you have your own server-based authentication and/or security, nothing wrong with using that instead. We will offer PHP-based security native to files app for those who don't/can't control their own server, and also because native Files app users may provide user-specific permissions in future releases.
rvine wrote:1. The first is that Files doesn't appear to follow symbolic links to other folders. I've a variety of subfolders that are being displayed normally but also have some that are symlinks. The default 'home'  view shows these folders greyed out and I can't then select any subfolders. Using the tree view on the left shows the folders and all subfolders (hence it is able to follow the links) but accessing any subfolder below the symlink results in 'Invalid directory xxxxxxxx'.
This has already occurred to me as something that needs to be dealt with. Originally, I planned to simply ignore symlinks ... They might point to locations outside of the applications control (permissions denied for "php" user). Also, if a symlink points to locations outside the applications "root" dir (for example system root), then should this not be a security concern? By default, all "operations" in Files app make sure that the PATH (being read or written to) is within the assigned "root" path. Disabling this security check is of some concern, especially once we add full file-manager capabilities to Files app.

Of course, I see your point and how following symlinks may be useful and in some cases required. Perhaps it might need to be a few options "follow symlinks" and "allow operations on paths outside root".
rvine wrote:I've looked at the code and it appears there is a section that uses the PHP 'filetype' function to figure what is a file and what is a directory. This  returns 'link' instead of 'dir'. for symlinks to directories. However, 'isdir' is used in other places and this does return 'true' for a symbolic link that resolves to a directory. I'm not fluent with PHP so haven't quite figured out what would be needed to make this work.
Let me look into this for next release. I didn't even consider symlinks yet in current release. It should definitely be made to work, although I will need to figure out what happens if the symlink target is outside of the assigned root path.
rvine wrote:2. The other query is regarding the search option; this seems to only search based on folder/filenames. It would be great if this searched on tags within the photos; it does appear this information is pulled into the cache 'json' files so the data does seem to be available to search on without having to open every image, albeit, only if you've visited that folder previously in order to populate the cache!
Indeed. "Global search" will be part of a future release. Current "search" option is really just "filter", but it seems unfitting to use "filter" as placeholder text. Global search might be slower (relatively speaking), since it requires searching all files/dirs on server in real-time, although we might be able to use existing json cache files. In any case, it would only be "too slow" if you have a massive directory structure (entire disk) and/or the server is slow.
rvine wrote:Can you think of any obvious workarounds for these small issues?
I'll look into symlinks for next release, should be no more than 2-4 weeks. Global search may have to wait a little longer ...
 
rvine
Topic Author
Posts: 2
Joined: 28 Jun 2020, 09:01

Re: Files apps symlinks and search

29 Jun 2020, 03:18

Many thanks for your update.

For my usage case, you're correct that "follow symlinks" and "allow operations on paths outside root" would both be needed. Security is a good point though; I'll have a think to see if there's a better way for me to structure my folders. The symlinks are actually pointing to folders which appear as if they're on a remote NAS (it's complicated!) so they might always be 'outside' the local file system.

Regarding the likely performance impact from a search that includes tags, adding a checkbox so that the user indicates that they do want a full search could be one way of differentiating the current filtering from a more in-depth search.

I can imagine keeping this app small and simple would be a priority rather than adding numerous features that few people might use or that would turn this into a monster project, and I've already added two items from my wishlist... :slight_smile: