-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Store avatars outside of the home #26124
Conversation
@PVince81, thanks for your PR! By analyzing the annotation information on this pull request, we identified @rullzer, @icewind1991 and @schiessle to be potential reviewers |
|
Hmm, works for me when upgrading from stable9.1 to this branch. |
tested - works 👍 |
We still need to decide whether the name of the folder "metadata-avatars" is acceptable or need something better. |
since we want #18029 anyway I'd go with |
how about "_metadata/avatars" ? This way there is only a single folder |
@PVince81 I wrote down my thougts in #18029 (comment). I'd go for |
@butonic but in this case the avatar is back again in the user's home which we don't want. I don't want to introduce the "a/d" letters at this point, it seems too early. We don't even have a PR ready yet for the user migration which is a big topic. |
We can do whatever we want for the avatar path, because it is not related to anything our virtual fs does. So '/path/to/data/users/a/d/admin/avatar.jpg Currently a file scan would pick up the avatars if a user |
Id place the avatars there because I'd move the users files to |
No it won't. |
yes - we need to keep avatars out side the users home. I don't care much how we name the avatars folder - move it out is the most important thing as of now. |
what is the difference between Neither is inside the users home? I'd just already put the users in subdirs to be future proof ... |
As discussed yesterday I thought that |
Bringing back the user account table and the need to store various additional information with the user - what about storing the avatar in the vcard of the user account table - see #23558 |
|
|
||
private function buildAvatarPath($userId) { | ||
$prefix = $userId; | ||
if (strlen($userId) < 2 || !ctype_alnum($userId[0]) || !ctype_alnum($userId[1])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
KISS: just always md5 the uid ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: every time we use md5 we make it very difficult to reverse-lookup to an actual user (for example when an admin wants to find out to which user this folder belongs).
Remember the oc_storages problem with md5 entries.
I guess if it's only a md5 for the user id alone, then one might be able to generate a table of user ids to md5 to do a manual reverse lookup.
@@ -96,6 +96,9 @@ public function __construct( | |||
$this->config = $config; | |||
|
|||
$this->excludedPaths[] = 'files_encryption'; | |||
$this->excludedPaths[] = 'metadata-avatars'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DeepDiver1975 @butonic we also need to adjust the path here else encryption is likely to cause trouble like it did on my first test
Not sure where 21 and 23 come from. |
Never mind the LDAP issue, I forgot to check out user_ldap app when switching branch.
|
acfd7ef
to
c5d0dc7
Compare
rebased for the weird CI failures. Still need to look at the encryption issues. |
I have retested with encryption twice with local and LDAP users and it all worked fine. Maybe last time I did something wrong. |
Okay, so with a setup LDAP server and going to the users page, it will query the avatar of all users displayed on the page which will create empty avatar folders. Let's see if we can prevent this by checking the last login flag and avoid creating folders for users who never logged in before. |
Looks like this won't be easily possible. The problem is that even when no avatar exists, we need to return a valid instance of @butonic @DeepDiver1975 re-review ? also see text above |
some really weird failures:
maybe the executor is is a broken state and needs cleanup? |
Inside a hidden "metadata-avatars" folder. Doesn't require home FS setup
…ters and refactor tests
c5d0dc7
to
cba3193
Compare
Rebased, hoping for passing CI now |
SMB and swift again - atleast smb works locally for me ... let me kick jenkins |
I see this in the logs - maybe related?
|
Green now. Merge ? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Resend of #25790 to master
Store avatars outside of the home
Inside a hidden "metadata-avatars" folder.
Doesn't require home FS setup
@DeepDiver1975 @butonic