Add the ability to disable avatar storage #3813

Closed
opened 2026-02-05 07:33:07 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @aStonePenguin on GitHub (May 23, 2023).

Describe the feature you'd like

I would like the ability to disable uploading of avatars completely and set a AVATAR_URL that gets served directly to visitors.

Additionally some new variables such as ${userId}, ${name} etc would be useful.

Describe the benefits this would bring to existing BookStack users

Currently the only way to handle avatars is to upload them to BookStack. In my particular case I'm using my own website as an authentication method meaning I'm storing a users avatar twice and the users avatar will not remain in sync with my main site.

This would this would allow pointing the AVATAR_URL to a custom API endpoint that automatically updates or does whatever one might wish to do.

Can the goal of this request already be achieved via other means?

No.

Have you searched for an existing open/closed issue?

  • I have searched for existing issues and none cover my fundemental request

How long have you been using BookStack?

0 to 6 months

Additional context

No response

Originally created by @aStonePenguin on GitHub (May 23, 2023). ### Describe the feature you'd like I would like the ability to disable uploading of avatars completely and set a `AVATAR_URL` that gets served directly to visitors. Additionally some new variables such as `${userId}`, `${name}` etc would be useful. ### Describe the benefits this would bring to existing BookStack users Currently the only way to handle avatars is to upload them to BookStack. In my particular case I'm using my own website as an authentication method meaning I'm storing a users avatar twice and the users avatar will not remain in sync with my main site. This would this would allow pointing the `AVATAR_URL` to a custom API endpoint that automatically updates or does whatever one might wish to do. ### Can the goal of this request already be achieved via other means? No. ### Have you searched for an existing open/closed issue? - [X] I have searched for existing issues and none cover my fundemental request ### How long have you been using BookStack? 0 to 6 months ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 07:33:07 +03:00
Author
Owner

@ssddanbrown commented on GitHub (May 25, 2023):

Thanks for the request @aStonedPenguin.

To be honest though, I think the use-case is quite specific, to the point if not being worth increasing the scope of the project in this area, and therefore might be better suited to our methods of extension/customization.

Our logical theme system can allow running custom code/actions upon certain events. The user login even is one such exposed event.
Using this you could:

  • Listen to user logins
  • Call out whatever endpoint you desire to get the current user avatar in the external system
  • Fetch the user avatar data
  • Save that in BookStack as the user's avatar

There's this handy method that can allow easy updating of a user's avatar from image data:

295cd01605/app/Uploads/UserAvatars.php (L44-L54)

It's not part of an official API but is accessible for use and that area of code does not change too much.
Just shout if you'd like any guidance/pointers for piecing that together.

@ssddanbrown commented on GitHub (May 25, 2023): Thanks for the request @aStonedPenguin. To be honest though, I think the use-case is quite specific, to the point if not being worth increasing the scope of the project in this area, and therefore might be better suited to our methods of extension/customization. Our [logical theme system](https://github.com/BookStackApp/BookStack/blob/development/dev/docs/logical-theme-system.md) can allow running custom code/actions upon certain events. The user login even is one such exposed event. Using this you could: - Listen to user logins - Call out whatever endpoint you desire to get the current user avatar in the external system - Fetch the user avatar data - Save that in BookStack as the user's avatar There's this handy method that can allow easy updating of a user's avatar from image data: https://github.com/BookStackApp/BookStack/blob/295cd0160525125bbd7756d7ad07392ae7201cb8/app/Uploads/UserAvatars.php#L44-L54 It's not part of an official API but is accessible for use and that area of code does not change too much. Just shout if you'd like any guidance/pointers for piecing that together.
Author
Owner

@ssddanbrown commented on GitHub (Jun 7, 2023):

I'm going to go ahead and close this off for the reasons provided above.
Feel free to still post comments though if you'd want guidance/help in achieving this via a customization as described above.

@ssddanbrown commented on GitHub (Jun 7, 2023): I'm going to go ahead and close this off for the reasons provided above. Feel free to still post comments though if you'd want guidance/help in achieving this via a customization as described above.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3813