Auto create a data folder for new users
Author: derneuereCreated Sep 16, 2026Updated Sep 16, 2026
Labelsenhancementbackend
Summary
Automatically create a folder under DATA_ROOT for a newly created user and set it as their scan directory. Split out of #492.
Current behaviour
A new user has no scan directory until an admin picks one. On a single-server install where each user should simply get their own library, the admin has to create a folder on the host and then assign it in the UI for every account.
Proposed change
- Admin-level setting, off by default, for example
AUTO_CREATE_USER_DIRECTORY. - When on, creating a user (admin UI, signup, or SSO provisioning) creates
DATA_ROOT/<username>if it does not exist and stores it as the scan directory. Validation goes throughnormalize_scan_directory()from #2025. - Do not overwrite a directory that was explicitly given on create.
- Skip silently with a logged warning if
DATA_ROOTis not writable, so a read-only library mount does not break user creation.
Related: creating a folder from the directory picker, tracked separately.
Source: LibrePhotos/librephotos