rejetto / hfs

HFS is a web file server to run on your computer. Share folders or even a single file thanks to the virtual file system.
GNU General Public License v3.0
2.29k stars 227 forks source link

How to set the hiding of a sub file or folder in a shared virtual folder? #390

Closed dafeifei0218 closed 12 months ago

dafeifei0218 commented 1 year ago

How to set the hiding of a sub file or folder in a shared virtual folder?

Like the old version: image

rejetto commented 1 year ago

now it's the "Who can see" setting

image
dafeifei0218 commented 1 year ago

This way, only the current shared directory can be set. How can I set the subdirectory to be hidden? image D: FTP There are also folders in the directory /Gongxiang /SW-21 /SW-8800 /SW-9000

rejetto commented 1 year ago

it is supposed to hide subdirectories as well. that's the meaning of the "same permission for folder content" underneath.

rejetto commented 1 year ago

i noticed there's a bug in the interface if you change from "same permission" to "different permission", but that's not what you want. I'm telling just to warn you in case you see something strange playing with it. I will publish a fix asap.

rejetto commented 1 year ago

https://github.com/rejetto/hfs/releases/tag/v0.49.1 this should do it

dafeifei0218 commented 1 year ago

Not what I want, I want to set the display or hiding of sub folders separately, just like the old version. If set to anyone, subfolders will not be displayed in myFTP.

rejetto commented 1 year ago

quick solution:

  1. click "MyFTP" image
  2. click "Add"
  3. click "from disk"
  4. select all the folders you are missing using the checkboxes on their left image
  5. click "select" blue button

longer explanation: looking closer at your screenshot, i see that your structure is copied in the virtual file system (i can tell by the color yellow). This happened when you added the first folder. HFS 2 asked if you wanted to copy the structure of files (all virtual), or not (keep it to disk). At the time, you opted for copying. While "copied" made things easier initially, it can a problem if your files are added/renamed on disk, because HFS won't show them. This is ok only if your structure never changes, or change very rarely.

The difference that made confusion is that HFS 3 is not offering you (at the moment) to copy the structure. With my istructions you make the copy, but just the first-level folders, and that's better, because if files inside are added or renamed, your server will stay up-to-date. I have to understand what's the best solution to make this thing easier, yet.

There is also another solution, involing "masks", but in the general case I don't advice you for it.

dafeifei0218 commented 1 year ago

Yes, that's fine. This is only the first level directory, it's troublesome to hide folders in more subdirectories.

rejetto commented 12 months ago

yes, it takes some work to do it like this. I may think of a better way in the future.

There is currently an alternative but tricky way, as I was mentioning, that's using the "masks" field. With masks you can enter all the folders you want just masks: maps a file mask to a set of properties as the one documented in this section. The syntax is a bit tricky, but the result is very powerful. For example you can hide folder2 under folder1, and all mp3 files under folder3/folder4, using this syntax

"folder1/folder2|folder3/folder4/*.mp3": 
  can_see: false

https://github.com/rejetto/hfs/wiki/Masks-field