Skip to content
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

Add DISABLE_ORGANIZATIONS_PAGE and DISABLE_CODE_PAGE settings for explore pages and fix an issue related to user search #32288

Merged
merged 17 commits into from
Oct 22, 2024

Conversation

Zettat123
Copy link
Contributor

@Zettat123 Zettat123 commented Oct 18, 2024

These settings can allow users to only display the repositories explore page

image

This PR also fixes an issue related to user search: #32288 (comment)
Thanks to @yp05327 and @wxiaoguang !

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 18, 2024
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 18, 2024
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files docs-update-needed The document needs to be updated synchronously labels Oct 18, 2024
@Zettat123
Copy link
Contributor Author

PR for docs: https://gitea.com/gitea/docs/pulls/82

@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label Oct 18, 2024
@wxiaoguang
Copy link
Contributor

Why not use database based config system but adding more app.ini items?

@Zettat123
Copy link
Contributor Author

Zettat123 commented Oct 18, 2024

Why not use database based config system but adding more app.ini items?

I followed the implementation of DISABLE_USERS_PAGE. But I think it's a good idea to use the database based config. I will update my code.

@Zettat123 Zettat123 marked this pull request as draft October 18, 2024 09:41
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 20, 2024
routers/api/v1/api.go Outdated Show resolved Hide resolved
@Zettat123 Zettat123 marked this pull request as ready for review October 21, 2024 04:20
@wolfogre
Copy link
Member

Why not use database based config system but adding more app.ini items?

I don't think it's a good idea to add those options to the databased config.

  • [service.explore]
    • REQUIRE_SIGNIN_VIEW
    • DISABLE_USERS_PAGE
    • DISABLE_ORGANIZATIONS_PAGE
    • DISABLE_CODE_PAGE

Those options are not related to user experience, like DisableGravatar or OpenWithEditorApps; it's about permission control.

I believe that currently, most Gitea users are not familiar with databased config. Such important options are not suitable to be placed in databased config and operated through the UI. Users might accidentally modify the options on the UI and then panic when they find that the originally hidden explore for anonymous users has suddenly become public. In a rush, they may try to modify the configuration file only to find that it does not take effect (because it is overridden by databased config).

Moreover, the importance of those options implies that restarting Gitea after modifying it is not something users cannot understand.

I do not oppose moving more configurations into databased config in the future, but I believe a better approach is to do it gradually. After users become more familiar with databased config and it has more options, then more important options, even those related to permission control, can be moved in.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Oct 21, 2024

The "database system config" is from Add system setting table with cache and also add cache supports for user setting #18058 , 2 years ago.

Since then, no one really uses it. Then, why it was introduced before?

  • If the "database system config" is the future, polish it and actively migrate existing file config to it.
  • If the "database system config" is wrong and wont' be used any more, totally drop it and roll back to the file config.

Otherwise, I do not see any reason to keep 2 config systems but only use file config.

@wxiaoguang
Copy link
Contributor

Actually, I do not mean "no" to file config either ..... I just found that it is a chance to "gradually use the database config" by these new options.

If there are other concerns, feel free to use the old mechanism. Thank you.

@yp05327
Copy link
Contributor

yp05327 commented Oct 21, 2024

I also wonder what is the difference.... But maybe this is off topic.

This reverts commit b793c6b.
This reverts commit efe0df8.
This reverts commit c3a3bab.
@pull-request-size pull-request-size bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 21, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Oct 21, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 21, 2024
@lunny lunny added this to the 1.23.0 milestone Oct 21, 2024
@pull-request-size pull-request-size bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 22, 2024
@Zettat123 Zettat123 changed the title Add DISABLE_ORGANIZATIONS_PAGE and DISABLE_CODE_PAGE settings for explore pages Add DISABLE_ORGANIZATIONS_PAGE and DISABLE_CODE_PAGE settings for explore pages and fix the incorrect usage of DISABLE_USERS_PAGE Oct 22, 2024
@Zettat123 Zettat123 changed the title Add DISABLE_ORGANIZATIONS_PAGE and DISABLE_CODE_PAGE settings for explore pages and fix the incorrect usage of DISABLE_USERS_PAGE Add DISABLE_ORGANIZATIONS_PAGE and DISABLE_CODE_PAGE settings for explore pages and fix an issue related to user search Oct 22, 2024
@wxiaoguang wxiaoguang merged commit 9206fbb into go-gitea:main Oct 22, 2024
26 checks passed
@wxiaoguang wxiaoguang deleted the more-explore-page-settings branch October 22, 2024 05:09
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 22, 2024
lunny pushed a commit that referenced this pull request Oct 23, 2024
…returned users for `/user/search` (#32310)

Partially backport #32288

---------

Co-authored-by: wxiaoguang <[email protected]>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 24, 2024
* giteaofficial/main:
  Fix broken image when editing comment with non-image attachments (go-gitea#32319)
  Fix disable 2fa bug (go-gitea#32320)
  Upgrade rollup to 4.24.0 (go-gitea#32312)
  Upgrade vue to 3.5.12 (go-gitea#32311)
  Make admins adhere to branch protection rules (go-gitea#32248)
  Prevent from submitting issue/comment on uploading (go-gitea#32263)
  Add warn log when deleting inactive users (go-gitea#32318)
  Add `DISABLE_ORGANIZATIONS_PAGE` and `DISABLE_CODE_PAGE` settings for explore pages and fix an issue related to user search (go-gitea#32288)
  chore: fix some function names in comment (go-gitea#32300)
silverwind added a commit to silverwind/gitea that referenced this pull request Oct 30, 2024
* origin/main: (21 commits)
  Fix toAbsoluteLocaleDate and add more tests (go-gitea#32387)
  Respect UI.ExploreDefaultSort setting again (go-gitea#32357)
  Fix absolute-date (go-gitea#32375)
  Fix undefined errors on Activity page (go-gitea#32378)
  Add new [lfs_client].BATCH_SIZE and [server].LFS_MAX_BATCH_SIZE config settings. (go-gitea#32307)
  remove unused call to $.HeadRepo in view_title template (go-gitea#32317)
  Fix clean tmp dir (go-gitea#32360)
  Optimize branch protection rule loading (go-gitea#32280)
  Suggestions for issues (go-gitea#32327)
  Migrate vue components to setup (go-gitea#32329)
  Fix db engine (go-gitea#32351)
  Refactor the DB migration system slightly (go-gitea#32344)
  Fix broken image when editing comment with non-image attachments (go-gitea#32319)
  Fix disable 2fa bug (go-gitea#32320)
  Upgrade rollup to 4.24.0 (go-gitea#32312)
  Upgrade vue to 3.5.12 (go-gitea#32311)
  Make admins adhere to branch protection rules (go-gitea#32248)
  Prevent from submitting issue/comment on uploading (go-gitea#32263)
  Add warn log when deleting inactive users (go-gitea#32318)
  Add `DISABLE_ORGANIZATIONS_PAGE` and `DISABLE_CODE_PAGE` settings for explore pages and fix an issue related to user search (go-gitea#32288)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-update-needed The document needs to be updated synchronously lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants