Skip to content

Conversation

@markbrown87
Copy link

Under Admin/Configuration/Settings housed Disable Gravatar and Enable Federated Avatars

image

This PR aligns with enable convention

image

In an attempt to aid future changes from DISABLE_xxx config.Value class was extended to invert booleans and allow for SelectFrom option. The SelectFrom build option allows for the underlying database entry to remain the same and thus not have the need to migrate the database to a new entry.

To aid in this, a config::setter class was created which mirrors the config::getter abstraction which can be used to set the value in the database. This consolidates the getting and setting from one source config and allows for any manipulation that is required during getting and setting of the configuration database value.

for completeness, installation has a minor change as well. Here is the before change

image

And after

image

Finally, this PR modifies the access values for all the locale but only changes the English locale. Once this PR has progressed to that level, I will submit for a translation to Enable Gravatar in other languages.

Closes #35627

Frontend still interacts directly with the database entry name
`picture.disable_gravatar` so logic needs flipped when writing, but
logic to read automatically flips based on config.Invert() being called
during init or INI read.
Install now submits the proper database name and is properly set using
the config.Value class. This extends the getter functionality so now
config.Value can be used to both get and set values.
@GiteaBot
Copy link
Collaborator

@markbrown87 I noticed you've updated the locales for non-English languages. These will be overwritten during the sync from our translation tool Crowdin. If you'd like to contribute your translations, please visit https://crowdin.com/project/gitea. Please revert the changes done on these files. 🍵

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 17, 2025
@github-actions github-actions bot added modifies/translation modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/frontend labels Oct 17, 2025
Accidental swap of enable_federated_avatar to disable in avatars.tmpl
@markbrown87 markbrown87 force-pushed the feature/35627/align-enable-gravatar-and-removal-of-libravatar branch from 9efa6e1 to 524dd74 Compare October 17, 2025 01:31
@wxiaoguang
Copy link
Contributor

Thank you for the PR.

It seems much more complex than I thought (and than it should be ....), and I really worry about the maintainability of this approach.

Maybe the "database configuration system" needs a whole re-design to make it flawlessly work with the "ini config".

@markbrown87
Copy link
Author

Thank you wxiaoguang for reviewing this. I agree with you on all points. The best I could hope for would be this approach might set the groundwork for that database configuration system redesign.

I would like to do things the right way over temporary patches, but I don't know how pressing such a redesign is compared to other more important features.

That said, should I close this and wait for the redesign? Or do you have an idea for another approach, or something I can do to this MR to make it more maintainable?

@wxiaoguang
Copy link
Contributor

Let's keep it open. I think it provides very valuable input for the config system redesign.

And maybe it will be the groundwork in the future. 🙏

@wxiaoguang wxiaoguang marked this pull request as draft October 21, 2025 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Align Gavatar and Federated Avatars options to be Enable

3 participants