Allow users to upload avatars, resized to 512px square and stored as jpegPhoto in LDAP, where it can be used from Gitea, ejabberd, etc..
I started implementing this using ActiveStorage, but then realized it's much nicer to not require any separate file storage in addition to LDAP for this, because everything will be fast enough to just retrieve the avatar from there and re-process it if necessary. However, I left in the ActiveStorage configs (all local disk for now), so we can use it for other things, like e.g. the app icons in #142.
The avatar is also shown on the admin user page, but no fancy layout there as of now.
Allow users to upload avatars, resized to 512px square and stored as `jpegPhoto` in LDAP, where it can be used from Gitea, ejabberd, etc..
I started implementing this using ActiveStorage, but then realized it's much nicer to not require any separate file storage in addition to LDAP for this, because everything will be fast enough to just retrieve the avatar from there and re-process it if necessary. However, I left in the ActiveStorage configs (all local disk for now), so we can use it for other things, like e.g. the app icons in #142.
The avatar is also shown on the admin user page, but no fancy layout there as of now.
closes #123
We'll need to create a custom Docker image on top of guildeducation/rails, in order to install the libvips package. Out of time just now, but will look at it later. We can host it directly on this Gitea's Docker registry.
We'll need to create a custom Docker image on top of `guildeducation/rails`, in order to install the `libvips` package. Out of time just now, but will look at it later. We can host it directly on this Gitea's Docker registry.
> I find the name `jpegPhoto` a bit odd. Did you choose that deliberately or is that something LDAP specific?
Yes, it's a standardized property name: https://www.rfc-editor.org/rfc/rfc2798#section-2.6
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Allow users to upload avatars, resized to 512px square and stored as
jpegPhotoin LDAP, where it can be used from Gitea, ejabberd, etc..I started implementing this using ActiveStorage, but then realized it's much nicer to not require any separate file storage in addition to LDAP for this, because everything will be fast enough to just retrieve the avatar from there and re-process it if necessary. However, I left in the ActiveStorage configs (all local disk for now), so we can use it for other things, like e.g. the app icons in #142.
The avatar is also shown on the admin user page, but no fancy layout there as of now.
closes #123
We'll need to create a custom Docker image on top of
guildeducation/rails, in order to install thelibvipspackage. Out of time just now, but will look at it later. We can host it directly on this Gitea's Docker registry.Overall the changes look good to me. I find the name
jpegPhotoa bit odd. Did you choose that deliberately or is that something LDAP specific?@@ -0,0 +7,4 @@def calltreebase = @ou ? "ou=#{@ou},cn=users,#{suffix}" : ldap_config["base"]puts treebase.inspect✂️
@@ -65,1 +65,4 @@<section class="sm:flex-1 sm:pt-0"><h3>LDAP<h3><p><img src="data:image/png;base64,<%= @avatar %>" class="h-48 w-48" />Shouldn't this be
image/jpeg?Yes! Thanks.
Yes, it's a standardized property name: https://www.rfc-editor.org/rfc/rfc2798#section-2.6