Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: per-user auto directory creation #676

Merged

Conversation

ttys3
Copy link
Contributor

@ttys3 ttys3 commented Feb 15, 2019

Per-user auto directory creation

Description
as #657 mentioned
auto create user directory while creating new user.

Limitation

  1. this logic DOES NOT work when edit an exists user.
  2. this logic DOES NOT work when public user register on frontend page.
  3. this logic ONLY WORK when admin is creating a new user on the user management page.

there are 2 conditions we need to consider
when creating a new user (with auto dir creation enabled):

  1. user scope == global default user scope
  2. user scope != global default user scope

condition 1.1

for example:
add new user foo and leave the scope dir to the default user scope . ,
and auto directory creation option was enabled,

suggest if we have the following startup command:

/path-to/filebrowser_amd64 -r /media

then the user's default scope dir will be:

./users/foo

and the real path on the system will be:

/media/users/foo

condition 1.2

another condition is the default user scope != server root path, but user scope = default user scope
for example:
we set the default user scope to ./bar under Global settings
when we add a user foo and auto directory creation option was enabled,
the user's default scope dir will be:

./bar/users/foo

and the real path on the system will be:

/media/bar/users/foo

condition 2

for example:
add new user foo and set the scope dir to ./special , and leave global settings default user scope still .
we do create the dir this time , but do not follow the default path creation logic.
the user's default scope dir will be:

./special

and the real path on the system will be:

/media/special

image

frontend assets PR is at filebrowser/frontend#102

@hacdias hacdias changed the title PR for #657 Per-user auto directory creation feat: per-user auto directory creation Feb 15, 2019
@hacdias
Copy link
Member

hacdias commented Feb 15, 2019

Please also add support for this option on config related commands and users new.

@ttys3 ttys3 force-pushed the feature-per-user-auto-dir-creation branch from 7809b51 to 13de65a Compare February 18, 2019 19:21
@ttys3
Copy link
Contributor Author

ttys3 commented Feb 18, 2019

config related commands and users new support has been added.

@ttys3 ttys3 force-pushed the feature-per-user-auto-dir-creation branch 5 times, most recently from f2f0f31 to 03b3170 Compare February 19, 2019 03:26
@ttys3 ttys3 force-pushed the feature-per-user-auto-dir-creation branch from 03b3170 to e8570e4 Compare February 19, 2019 03:55
Copy link
Member

@hacdias hacdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@hacdias hacdias merged commit f72addc into filebrowser:master Apr 20, 2019
hacdias added a commit that referenced this pull request May 11, 2019
Former-commit-id: 4356d3e09da55e5f64acd9c476ba536635d4b2c0 [formerly d888715b1e26e822af92f1fbfd5090003104d6b7] [formerly 91adee94700e7ae1c08fc00679b74e67948ac2f3 [formerly f72addc]]
Former-commit-id: e40b20d11bf17bb0704680c3c41a4f8219248c03 [formerly 9886a9ec0fe230506b346eed1d82b105fca537eb]
Former-commit-id: bba8644c9c61dd04853cac9748d27a453b9607d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants