[Directory Lister] Web File Browser

Overview

Directory Lister is the easiest way to expose the contents of any web-accessible folder for browsing and sharing. With a zero configuration, drag-and-drop installation you’ll be up and running in less than a minute.

Features

  • Light and dark themes
  • Custom sort ordering
  • File search
  • File hashes
  • Readme rendering
  • Zip downloads

Shipped version: 3.12.3~ynh1

Demo: https://demo.directorylister.com/

Screenshots

Documentation and resources

6 Likes

What’s the right way to enable sftp for the app?

1 Like

Hello!

It seems that default configuration is not ideal, as data is located at /var/www/directorylister/ with permissions only given to the directorylister user.

As root a ls -alh gives :

drwxr-x---   3 directorylister www-data        4.0K Jan  6 11:38 .
drwxr-xr-x+ 14 root            root            4.0K Jan  6 10:43 ..
drwxr-x---   9 directorylister www-data        4.0K Nov 27 19:04 app
-rw-r-----   1 directorylister www-data        5.9K Nov 27 19:04 directory-lister.svg
-rw-------   1 directorylister directorylister  411 Jan  6 10:43 .env
-rw-r-----   1 directorylister www-data         330 Nov 27 19:04 .env.example
-rw-r-----   1 directorylister www-data         528 Nov 27 19:04 index.php
-rw-r-----   1 directorylister www-data        1.1K Nov 27 19:04 LICENSE
-rw-r-----   1 directorylister www-data        4.0K Nov 27 19:04 README.md

I’m a bit annoyed by the Simple installation allows you to be up and running in less than a minute. as it’s clearly not the case for the YNH integration. :slight_smile:

So here’s what you can do :
1 - not recommended : alter the permissions of your /var/www/directorylister/ so it can connect with your SFTP user
2 - Wait for this github PR to land : Add SFTP access to the app by DeMiro5001 · Pull Request #13 · YunoHost-Apps/directorylister_ynh · GitHub, I have great hopes in this one as it seems the “correct YNH way” to create a SFTP access. It comes from the demo webapp install code and seems more solid, pretty close to landing as it seems.

I’m still trying to figure out other solutions that would not induce halo effects (security, update risks, …)

If someone more at ease with YNH configuration could help us it’d be a great help.

3 - We could also remove the bold statement Simple installation allows you to be up and running in less than a minute. :sweat_smile:

Did you test it? I forgot about it. The app I itself doesn’t allow data dir to be outside the install dir as stated by the dev.

Sadly, I haven’t been able to hack anything outside the app directory : symlinks don’t seem to work in either way. (It’s either access denied or breaking the listing)

Currently, the way to go seems to add your user to www-data group, then altering the permissions of this group on files for this app. I’m still hacking around a bit before giving up :confused: , or not. I’ll keep you posted if I find a more suitable workflow.

@ericg , I was a bit (bitterly) kidding about this one :slight_smile:

Still have great hopes on the PR landing, though.

Finally got a working workflow, using samba !

sudo apt update && sudo apt upgrade -y

sudo apt install samba -y

sudo systemctl enable smbd

edited /var/samba/smb.conf and added the following at the end (warning, this is a public, passwordless, share, need to ensure ports are NOT open in your NAT

[DirectoryLister]   

   comment = Directory Lister
   path = /var/www/directorylister
   browseable = yes
   read only = no
   guest ok = yes
   create mask = 666
   directory mask = 777
   force user = directorylister
   force group = www-data

then a bit of reload/restart :
sudo systemctl reload smbd
sudo systemctl restart smbd

After that, going to firewall settings to open SMB ports (TCP : 137,138,139,445)

It worked for me without too much hassle:

Hope this helps.

Beware, the samba solution broke after migrating to Yunohost 12.

For some reason Samba does not work anymore :frowning:

$ sudo systemctl restart smbd
Failed to restart smbd.service: Unit smbd.service is masked.

Edit : Somehow it got masked during migration, tried to re-enable but still broken. No logs, no output

$ sudo systemctl unmask smbd.service
$ sudo systemctl enable smbd
$ sudo systemctl start smbd

Edit 2 : Due to “unforeseen consequences” while in migration, samba was uninstalled. Got it reinstalled and it finally worked.

$ sudo apt install samba
$ sudo systemctl enable smbd
$ sudo systemctl start smbd

Quick update on that topic : It seems that updating the app also clears and resets the /var/www/directorylister directory.

Please be cautious to backup contents before upgrading. I will open a ticket on the github repo

Can you identify the files to preserve before updating?

I think this was introduced in Update upgrade · YunoHost-Apps/directorylister_ynh@6d9558a · GitHub
--full_replace
The data uploaded is in fact in $install_dir

Now the app allows to define a location for files folder outside the app location..
I am working on making the files upload easy here : GitHub - DeMiro5001/directorylister_ynh at datadir

Testers and feedback are welcome.

What has been added :

  • the app will now have a data_dir (on /home/yunohost.app/$app)
  • on install, you will be asked to choose an admin for the app
  • data_dir will be symlinked to a folder with the same name of the app located on the “Multimedia” folder of the admin you chose on app install
  • you can use nextcloud or any filemanager that has access to the Multimedia folder to upload your files
  • UPGRADE WILL NOT WORK (sorry. Until I add a config panel that allows to change the admin user and the symlink)

I still didn’t add symlink deletion in the remove script, as the data_dir can be kept on remove. So, should I keep it or not?
Those who have multiple users, can you test it with multiple instances for every user?

1 Like