Files – Single-file photo gallery and file manager
files.gallery
files.gallery
From the forum:
"In terms of license, you don't need an internet connection. However, Files app loads it's own Javascript, CSS and several plugins from CDN (jsdelivr.com), and this requires internet. We already have a request to allow serving all assets locally (as an option), although in your case that might not be practical as this means Files app is essentially no longer a"single file", but multiple files that you need to be included with each installation (although you could assign a global path perhaps). In any case, for now it's not possible to load Files app without internet."
This is a major turn-off IMO. One of the main points of self-hosting is that you don't rely on the outer internet. If a self-hosted service relies on externally hosted resources, does this make it partially self-hosted?
There is a use case for that. Maintainability. Drop one file to start. To delete, delete the file. To upgrade, replace the file.
For example, I really like tiddlywiki because no matter where or what, I only have to deal with and track 1 file.
It’s impressive what they’ve accomplished with just one file full of custom content. Even upgrading is possible.
I just want a glorified `autoindex on`. I don't want to manage an extra container just for that.
(I'm speaking in regards to the file viewer option, looks like there's also a file manager option on the pro version and I have a bit more mixed feeling regarding that)
There are a lot of people still doing this. Some of us have gotten away from it, but I support some people on the side that have multiple projects that still manage it this way and it works for them.
I would not want to be the one to explain to them what docker is, how it works and how to use it.
Afterwards, I just delete and that’s it.
You could use bash and be supported on almost every unix-a-like OS¹, or plain-'ol sh for even wider compatibility. You'd need to configure CGI/FCGI as well as dropping the script(s) in, but you have to do similar work for PHP/python/other if you don't already have them installed and configured for the site/directory in question.
[1] and others: it'll work with IIS if the server has a bash/sh interpreter² available
[2] plus any externals that the script relies upon, of course
First off, its already not a "single file" you need a PHP interpreter.
Secondly, you can cram the JS and CSS into a .phar file, the performance is horrible, but it's probably not noticeable in this scenario.
You can cram the JS and CSS into the PHP file itself, no phar needed. Performance change is unnoticeable on any modern machine.
About Files app not being "single file" because it loads JS/CSS resources from the CDN (internet). That is of course a correct observation, and this is already noted on the website. From an operational perspective, there is only one file to download/move/install, and from a functional perspective for the vast majority, it will be viewed in browser with an active internet connection. Furthermore, it was INTENDED BY DESIGN to load all JS/CSS from CDN, because ultimately it improves the user-experience, and makes it plausible to make an app like this wrapped into a single index.php file.
It's not reasonable to add ALL Javascript/CSS directly into the index.php file. PHP is only 10% of the codebase, and it would bloat the file to insane dimensions and make it difficult to maintain. JS/CSS is loaded from CDN service jsdelivr.com, with multi-level redundancy (Amazon, Cloudfront, Cloudflare), and will load faster and cache more effectively than anything served from within the index.php app on your own server. Furthermore, some plugins are served on-demand, for example when browser needs a "polyfill" or for specific features. For functional reasons, benefiting the vast majority who do not care how/where the JS/CSS is loaded from, JS and CSS files are therefore served from CDN. If this does not suit you, nobody has any problem with that.
Does anyone have any examples of any other single-file app with a comprehensive interface like Files app that is entirely self-contained?
There will be a future release where you can assign all scripts/css to be loaded from local path, but then of course all these files will need to be installed alongside Files app index.php. We will NOT be adding all JS/CSS directly into the index.php file.
About license, as stated on the website, you can use it as a file viewer for free (with the nag). If you want to remove the nag and use it as a file manager, license is required. Those who expect apps like this to be entirely free with updates and support, are living in dream land. It's hardly worthwhile in the first place. There are loads of other free apps, and if you can't see any difference, then your choice is easy.
I have noted comments about license info being unclear, thanks.
phpLiteAdmin (https://github.com/phpLiteAdmin/pla) is developed as separate PHP, JS, and CSS files. A "build" script merges all into a single PHP script, which includes compressed resources inlined after a call to `__halt_compiler()`. The same code can run as separate files, or as a single one.
I wrote the original "build", years ago, as we started extracting classes out of a procedural single file.
[edit] Link to the interesting bit: https://github.com/phpLiteAdmin/pla/blob/master/phpliteadmin...
Furthermore, it was INTENDED BY DESIGN to load all JS/CSS from CDN, because ultimately it improves the user-experience, and makes it plausible to make an app like this wrapped into a single index.php file.
I get the rest of the points you're making but I think the flak you're getting is largely about what you consider the "user" here. You're responding from the point of view of the person I am sharing my photos with, whereas most of the respondents are responding from the point of view of the me, the guy who is gonna actually use this app. There's a mid-sized vocal crowd of self-hosters here on HN and from my own observation a tendency to prefer control over these sorts of things. Does anyone have any examples of any other single-file app with a comprehensive interface like Files app that is entirely self-contained?
Your app is, as you noted, not single-file. Setting that aside though, the density of the interface is kind of irrelevant to where the CSS and JS are hosted. There's loads of on-premise enterprise apps that do not load data from CDNs and have much more convoluted user interfaces. Plus they work on an otherwise disconnected network, do not subject users to potential tracking, etc.I would also warn you, having seen this happen to a friend's project, the absence of any robust license text inside the package and/or spelled out on the website is going to give you some headaches. For example, does "use" of the app include customization? What type of customization is possible and accepted? If you allow some customization, you'd need to be careful to spell out explicitly that people can't just edit the PHP and remove the nag, etc.
One other thing to note: The application is very vulnerable to Cross-Site Scripting.
I guess no one says that's the way you want to maintain the project. The final `index.php` with HTML/CSS/JS can just be built out of parts that can be maintained separately.
> Does anyone have any examples of any other single-file app with a comprehensive interface like Files app that is entirely self-contained?
Adminer comes to mind: https://www.adminer.org/ https://github.com/vrana/adminer/
As far as I can tell, they "compile" everything, including JS, into one PHP file.
[0] https://j11g.com/2021/11/23/corbin-static-responsive-image-a... [1] https://github.com/jan-vandenberg/corbin
Im kind of surprised that as a species we dont have a conclusive ubiquitous solution to the foggy problem of digital photo storage / management. So many of my photos are just in drawers on old hard drives and phones.
Anyway maybe its getting better. Or maybe Im just stupid.
Interfaces got really good and slick at the same time it became profitable/useful to alienate people from their own data for profit.
The only real problem with it is conflicts, where one file is edited simultaneously on two devices. I think Dropbox has solved that (?), but I'd rather keep my data on my own computers.
But it's always been straight up evil to completely remove all meaningful access to them, and yet Apple et al chose to go in this direction.
With it's SSH, SMB, and Wifi-Filetransfer it has so far outclasses most desktop filemanagers that I have tried.
It might not be stock, but it's easy to get from the app store.
Android has good third party file managers though, like Solid Explorer.
Then my family is confused about where photos live, etc.
Might try something like this instead.
(I ended up using PhotoView, which works fine, but this looks like it might have been better.)
But I think it could have been made clearer that (1) you only download one file but it loads more from their CDN, it's not truly "single file" and (2) the free version is heavily limited and gated with a pop-up.
That said, I like the demo - it looks really slick and has a lot of features.
My to-do list is still long, but I'm plugging through it and I believe PhotoStructure already has the most robust tag extraction, inference, and image deduplication heuristics around, and has a novel browsing approach that scales well to very large (100k+ - 1mm+) libraries.
https://photostructure.com/faq/why-photostructure/
(Disclaimers: I'm the solo author, and although I am an open source author, PhotoStructure is commercial software. There are both a free and paid tiers of functionality: details are on the pricing page.)
https://wiki.gnome.org/Apps/Shotwell (it doesn't require Gnome, my desktop is XFCE)
The image viewing interface itself is okay although it might not be as smooth as e.g. Apple Photo (which I feel has its own challenges with how convoluted its image directories are e.g). ImageRanger has also tags and Face Detection and Recognition.
I have only installed the Home edition, and it seems to re-index the images to create thumbnails (relatively fast) if you have stored images on an external disk that is detached/attached between openings of the program. From what I understand, the Professional version does not have this issue as the images are cached (not tested out this myself). I don't think the face Detection and Recognition is on par with e.g. Apple Photo, but haven't tested it extensively enough to say that with 100% certainty.
What I like most about ImageRanger is its import functions and the way it stores the images in common folders and subfolders based on preferences and not in a convoluted DB.
This dev also has others cool tool. Check it out on his Github page [0]
It's less polished, but it's free.
This submission is notable is because it's free and polished.
--- Edit ---
AH, DAMN. It is NOT indeed free, at least not as demoed.The child comment below is 100% correct.
It also pulls piles of stuff from cdn.jsdelivr.net and can't function without it. That's no bueno.
No, it's not free. Every time you load up the page to view your own files with files.gallery, a big honkin' pop-up shows up instructing you to buy a $40 license for additional features:
Purchase a license [$39] to unlock features and support dev! - Remove this popup - Upload - Download folder - Code and text editor - Create new file - Create new folder - Rename - Delete - Duplicate file - Dedicated support - Multi-user, panorama and much more coming soon! [payment button]
The files.gallery website only hints at this restriction at the very bottom of the page in the "License" section, which devs would expect to mean an OSS license: "Files is free to use with basic features. To remove the license-popup and unlock additional features, you may purchase a license [$39] from within the app."
Now if you look at the rest of the landing page you can see it very carefully does not mention the ability to use basic file browsing features so that it's not technically a lie to present a tool that can "browse files and folders without complicated installations" that doesn't allow you to do anything more than download your own files without opening your wallet.
The dev is just another hustler.
> The dev is just another hustler.
But this was really uncalled for even if this does look kinda deceiving and dark-pattern-ish.
But does this mean devaluing their work by calling them "just another hustler"? I believe this isn't necessary.
And sadly it totally devalues your comment for me.
More upfront than under the "License" section on the landing page?
Are you working for free or do you ask for a salary from your employer?
> Files is free to use with basic features. To remove the license-popup and unlock additional features, you may purchase a license [$39] from within the app.
Backend in Go, frontend in Vue, deployed as a single binary.
This solves the problem and it looks elegant. Great work.
Why? Because that allows you to easily click and drag a select area and select multiple pictures, where I can then click a button to tag them all at once. With Files Gallery, you cannot drag to select so this doesn't seem a concern, but then again I would love to be able to _manage_ files easily and not just look at them.
[1] https://www.php.net/manual/en/book.phar.php
Most php cli tools (like Composer) are actually phar archives
I can't quite pinpoint what was the cause but I've never been as productive as with PHP + JQuery. Modern tooling is just plain slow, mandatory and definitely gets in the way. Having extra layers means more bugs you waste time on and bugs that are harder to debug. It seems like there are also less and less tutorials and documentation.
[0] Flickr, for those who haven't used it much, came up with a unique way of displaying photos in a "justified" view so that there are no gaps between photos in a page full of images of various dimensions and orientations and so that all images stretch all the way to both edges and and are organized into neat rows with no vertical gaps. Example: https://www.flickr.com/photos/defender90/albums/721576700986...
https://github.com/flickr/justified-layout
Now to look into porting this to Hugo.
* https://github.com/bpatrik/PiGallery2/
I’m using the first one as personal album and it works very well, including things like infinite scroll and link-based album sharing.
The latter is more sophisticated and has a native accompanying app but I found pigallery easier to work with.
Edit: oh, it's not free... I mean, $40 isn't bad, but then I expect a decent level of support. Also, $40 for... a year, a life?
I’d love to use Rails active storage + S3 to allow users to have a “mini Dropbox” inside my web App; the only one I could find that was nice enough was CKFinder, but it’s not open source and it’s tied to a Java or PHP backend as well.
This page crashed. Cannot read properties of undefined (reading 'destroy')
This is really where PHP shines. I find it really sad to see what PHP has become, just because people keep wanting to use it for complex stuff…
As side effect it even executes faster and uses less resources for it.
> PHP4 spaghetti code
I got fantastic feedback when I recently asked about a personal wiki that would fit my criteria [2], so I figure I'll ask here for a photo library management app.
My use case isn't just personal photos, but also concept art. I would love to replace the scourge that is Pinterest (which I shamefully admit I use). I used Picasa for this use case before it died.
Here are the features I would like in a photo management system:
- Importing photos should be as easy as drag and drop or "add directory".
- Images in the library should be mirrored to an internal store independent of the greater filesystem.
- It needs to support rich tagging. Images should be easily enumerable by tag.
- It needs to store all metadata in a central database or file that I can easily distribute and back up. (As opposed to writing the data into the images directly.) It would be nice if the primary keys to image were signature-based rather than filename (and especially not full file path) as it could live on different systems.
- Group by GPS coordinates would be nice. Even better if it can pull the location name.
- Group by date taken.
- Find or automatically ignore/remove duplicates.
- Support for a NAS or cloud backup would be fantastic. Especially if it also backs up the database.
- It should generate pre-computed thumbnails so scrolling a large library doesn't show blank images, but keep them off to the side so it doesn't impact backup.
- It should have RAW support, but doesn't need editing/adjustment capabilities. (If not available, I suppose I could pre-process the RAWs.)
- Video support would be extremely nice too, but it doesn't need to have any editing or miscellaneous features.
- It would be nice to keep galleries separate, or at least in different namespaces so I can reuse tags. Family, real estate, conceptual/renders, etc.
- Replication across multiple devices would be a nice to have, especially if it can update tags and metadata across machines.
- Open source would be nice, but I'd be happy with paid/commercial software if it did what I wanted.
- Multiplatform support (Linux, Windows, Mac) would be extremely nice. Even nicer if it supports mobile too.
- It should be snappier than a web-based gallery.
- That said, internet web access (like photos.google.com) would be killer.
- Importing photos should be as easy as drag and drop or "add directory".
Check Lomorage web app and import tool.
- Images in the library should be mirrored to an internal store independent of the greater filesystem.
The storage can be on the external hard drive or remote mounted device.
- It needs to support rich tagging. Images should be easily enumerable by tag.
Tag will be added.
- It needs to store all metadata in a central database or file that I can easily distribute and back up. (As opposed to writing the data into the images directly.) It would be nice if the primary keys to image were signature-based rather than filename (and especially not full file path) as it could live on different systems.
All the metadata is stored in sqlitelite database and backup daily.
- Group by GPS coordinates would be nice. Even better if it can pull the location name.
GPS location already processed and stored in DB, currently support search by location, will add map view.
- Group by date taken.
The default view is by date taken, in reverse order, latest first.
- Find or automatically ignore/remove duplicates.
dedup done by file hash, also support similar photo dedup by using perception hash, will add in smart album.
- Support for a NAS or cloud backup would be fantastic. Especially if it also backs up the database.
Support redundancy backup with network mount.
- It should generate pre-computed thumbnails so scrolling a large library doesn't show blank images, but keep them off to the side so it doesn't impact backup.
- It should have RAW support, but doesn't need editing/adjustment capabilities. (If not available, I suppose I could pre-process the RAWs.)
Support iPhone dng raw format, others can be added.
- Video support would be extremely nice too, but it doesn't need to have any editing or miscellaneous features.
Support popular video formats supported on Android and iOS
- It would be nice to keep galleries separate, or at least in different namespaces so I can reuse tags. Family, real estate, conceptual/renders, etc.
Current support album and folders, the same concept with those on iPhone.
- Replication across multiple devices would be a nice to have, especially if it can update tags and metadata across machines.
Backup photos/videos and also metadata database on 2nd storage.
- Open source would be nice, but I'd be happy with paid/commercial software if it did what I wanted.
- Multiplatform support (Linux, Windows, Mac) would be extremely nice. Even nicer if it supports mobile too.
Multiple platform support, and has native mobile apps as well.
- It should be snappier than a web-based gallery.
Mobile first + Web APP
- That said, internet web access (like photos.google.com) would be killer.
Support external access via ngrok or other similar tunnel service, can also open port mapping on home router if having public ip address.
Edit: Yes I know I can access the source code by simply downloading index.php but I'm looking for a place where I can file issues, submit patches, view commit history, etc.
Edit: kinda makes sense reading the license, it is not opensource.
License
Files is free to use with basic features. To remove the license-popup and unlock additional features, you may purchase a license [$39] from within the app.
I’m sure there are still dozens of open source alternatives floating around - some surely even maintained!
Apparently it's a nag-based paid software with an otherwise restricted feature set. This is not clearly explained on the page.
In fact, it looks like the site goes out of its way to try and pass for free software - the Demo is NOT of what you are actually downloading, no pricing info, no mention of Basic vs Full versions anywhere, including the Docs, except for an dull looking blurb at the very bottom on the home page -
License
Files is free to use with basic features. To remove the
license-popup and unlock additional features, you may
purchase a license [$39] from within the app.
The page also pulls a lot of scripts off the Internet on every load, so that too is not explained anywhere clearly and it's absolutely not good for hosting private photo archives.Despite its good looks it kinda leaves bad aftertaste because of all these shady shenanigans.
> Add username and password to protect your Files app by login. You can encrypt your password by using our md5() hash tool if you don't want the password to be exposed in the PHP file.
Now I realize it's probably not using md5, but it does not bode well.
> If your pepper contains 128 bits of entropy, and so long as hmac-sha256 remains secure (even MD5 is technically secure for use in hmac: only its collision resistance is broken, but of course nobody would use MD5 because more and more flaws are found)...
Which means whoever developed this file photo app may have read this clear shot at MD5, and still used it anyways. That's kinda funny.
[0] https://www.php.net/manual/en/function.password-hash.php
It loads 14 resources from https://cdn.jsdelivr.net/npm/
This also makes it completely broken if these dependencies are inaccessible or go missing.
Well to be fair, that can be explained by the whole 'drop this PHP file in and wham' model they are going for. Personally I would not advertise / make something like this as the single-file model becomes more and more of a constraint as the project evolves. It feels needlessly limited just to fit the single-file goal.
In my more noobie days, I had PHP _generate_ JS.
"Files is free to use with basic features. To remove the license-popup and unlock additional features, you may purchase a license [$39] from within the app."
Not clearly visible until you scroll down to the very bottom, no. Most paid projects like this (that I have seen, anyway) have clear pricing info on the front page, or at least a Pricing item in the navigation bar. This site has neither. I feel like this is a bit misleading as you're immediately told to download the file, then perhaps discover that it is paid software later (or once you've already installed it), but I am willing to assume incompetence on the developer's part here.
Thanks, I will stick to my synology.
* Requires a server to run (you don't just 'open from browser' as instructed
* CDN-dependent
This...is not terribly good or useful.
function login_page($is_login_attempt, $sidx, $is_logout, $client_hash){ ?> <!doctype html> <html> <head> <meta charset="utf-8"> … </html> <?php exit; // end form and exit }