[GH-ISSUE #416] Do not list root directory #228

Closed
opened 2026-04-08 16:51:18 +03:00 by zhus · 5 comments
Owner

Originally created by @ign0tus on GitHub (Jul 15, 2024).
Original GitHub issue: https://github.com/sigoden/dufs/issues/416

Specific Demand

Is there a way to exclude the root directory from the directory listing? I want to share different directories with different groups of people without setting a password, but prevent them from accessing the files in another directory if they don't know the directory name.

My idea was that / is only listed by providing password. The other two directories are accessible to anyone who knows the link.

dufs \
  --auth admin:admin@/:rw \
  --auth @/10d4e03e-7a20-4953-a9c5-ddb2993817dc:rw \
  --auth @/95bd2770-0576-410e-adf5-fddd98d2590b:rw \
  /var/lib/dufs

With this configuration, however, both directories are still listed when unregistered users access /.

Exclusion via --hidden does not seem to be possible either, as I cannot apply this to individual directories. --hidden /*/ does not work, and --hidden */ no longer shows any directories at all.

Is there a way to get the behavior I want or is it simply not possible?

Implement Suggestion

Originally created by @ign0tus on GitHub (Jul 15, 2024). Original GitHub issue: https://github.com/sigoden/dufs/issues/416 ## Specific Demand Is there a way to exclude the root directory from the directory listing? I want to share different directories with different groups of people without setting a password, but prevent them from accessing the files in another directory if they don't know the directory name. My idea was that `/` is only listed by providing password. The other two directories are accessible to anyone who knows the link. ```sh dufs \ --auth admin:admin@/:rw \ --auth @/10d4e03e-7a20-4953-a9c5-ddb2993817dc:rw \ --auth @/95bd2770-0576-410e-adf5-fddd98d2590b:rw \ /var/lib/dufs ``` With this configuration, however, both directories are still listed when unregistered users access `/`. Exclusion via `--hidden` does not seem to be possible either, as I cannot apply this to individual directories. `--hidden /*/` does not work, and `--hidden */` no longer shows any directories at all. Is there a way to get the behavior I want or is it simply not possible? ## ~~Implement Suggestion~~ <!-- If you have any suggestion for complete this feature, you can tell us. -->
zhus closed this issue 2026-04-08 16:51:18 +03:00
Author
Owner

@sigoden commented on GitHub (Jul 15, 2024):

We will not support this feature. see https://github.com/sigoden/dufs/issues/263#issuecomment-1708516517

<!-- gh-comment-id:2228013605 --> @sigoden commented on GitHub (Jul 15, 2024): We will not support this feature. see https://github.com/sigoden/dufs/issues/263#issuecomment-1708516517
Author
Owner

@sigoden commented on GitHub (Jul 15, 2024):

Maybe You should run two instances of dufs with different --path-prefix options.

<!-- gh-comment-id:2228018468 --> @sigoden commented on GitHub (Jul 15, 2024): Maybe You should run two instances of `dufs` with different `--path-prefix` options.
Author
Owner

@ign0tus commented on GitHub (Jul 15, 2024):

Alright, thanks for the explanation in the linked issue. BTW, I appreciate that the application is kept simple and not all the desired functions are implemented in order to keep the application lean and clear.

Maybe You should run two instances of dufs with different --path-prefix options.

Mh, I'll have to think about it. This requires one instance per directory that I want to share independently, right?

<!-- gh-comment-id:2228045581 --> @ign0tus commented on GitHub (Jul 15, 2024): Alright, thanks for the explanation in the linked issue. BTW, I appreciate that the application is kept simple and not all the desired functions are implemented in order to keep the application lean and clear. > Maybe You should run two instances of `dufs` with different `--path-prefix` options. Mh, I'll have to think about it. This requires one instance per directory that I want to share independently, right?
Author
Owner

@sigoden commented on GitHub (Jul 15, 2024):

Dufs path-prefix requires one instance per directory.

If there are many directories, You can also put a reverse-proxy (nginx, trafik) in front of dufs. If the path is / and there is no authentication, block it; otherwise, pass it to dufs.

<!-- gh-comment-id:2228056508 --> @sigoden commented on GitHub (Jul 15, 2024): Dufs path-prefix requires one instance per directory. If there are many directories, You can also put a reverse-proxy (nginx, trafik) in front of dufs. If the path is `/` and there is no authentication, block it; otherwise, pass it to dufs.
Author
Owner

@ign0tus commented on GitHub (Jul 15, 2024):

If there are many directories, You can also put a reverse-proxy (nginx, trafik) in front of dufs. If the path is / and there is no authentication, block it; otherwise, pass it to dufs.

That's an excellent idea, thanks for the suggestion.

<!-- gh-comment-id:2228061363 --> @ign0tus commented on GitHub (Jul 15, 2024): > If there are many directories, You can also put a reverse-proxy (nginx, trafik) in front of dufs. If the path is / and there is no authentication, block it; otherwise, pass it to dufs. That's an excellent idea, thanks for the suggestion.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#228