go-http-file-server icon indicating copy to clipboard operation
go-http-file-server copied to clipboard

Suggestion: UNauthenticated dirs

Open fimmspin opened this issue 1 year ago • 2 comments

I have enabled global authentication on / for security. But I need to add some UNauthenticated dirs like for /public dir How is it possible? A setting like --unauth dir1#dir2#dir3 could be nice to override auth requirement :)

fimmspin avatar May 06 '24 05:05 fimmspin

Then that will be too many negative options like --no-mkdir, --no-upload, etc. I thought about this problem before, but to keep the program simple, I didn't implement all the negative control features.

Is the possible to create 2 alias? One for authenticated user and one for guests?

ghfs --empty-root \
  --alias :/confidential:/fs/path/that/require/auth-access \
  --alias :/public:/fs/path/to/public-access \
  --auth /confidential \
  --user username:password

marjune163 avatar May 06 '24 13:05 marjune163

It may be a solution using aliases. thanks!

Another possibility could be (without requiring negative rules you want to avoid): to define an hardcoded 'noauthusr' (noauth, - or the symbol you prefer, so like a 'user' not needing for any auth and not asking for auth in that folder) and then permit it in a rule like this:

--auth-user #/#user1#user2 #/pub#noauthusr #/user3#user3

fimmspin avatar May 06 '24 15:05 fimmspin