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 an self-check page for site admin #27011

Open
wxiaoguang opened this issue Sep 11, 2023 · 5 comments
Open

Add an self-check page for site admin #27011

wxiaoguang opened this issue Sep 11, 2023 · 5 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Sep 11, 2023

  1. Show deprecated option warnings
  2. Check database: version, charset
  3. Check whehter AppURL/ROOT_URL is right
  4. Check reverse proxy rewriting and sub path (eg: is %2F kept?)
  5. Check whether Cookie Secure is right
  6. Check whether some headers like X-Forwarded-Porto are correctly set
  7. Check if some directories (eg: work path) are right
  8. Check if the server/client time is right (if affects OTP)
  9. Check whether there are some legacy files (eg: /custom/css, /custom/robots.txt, etc)
  10. Check whether there are incorrect config options (need to refactor the INI package first)
  11. Manually version update check
@wxiaoguang wxiaoguang added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Sep 11, 2023
@lunny
Copy link
Member

lunny commented Sep 11, 2023

All gitea doctor could check?

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Sep 11, 2023

Not fully understand what's your meaning.

  1. If you mean "these checks are what 'all gitea doctor could check'":

And how to check these "gitea doctor"?

Check whehter AppURL/ROOT_URL is right
Check reverse proxy rewriting and sub path (eg: is %2F kept?)
Check whether Cookie Secure is right
Check whether some headers like X-Forwarded-Porto are correctly set
Check if the server/client time is right (if affects OTP)
  1. If you mean "move 'all gitea doctor could check' into the self-check page":
  • It needs more refactoring work for the doctor system, because some checks consume a lot of time, which are not suitable to be operated by the web UI.

Update: confirmed, the above comment's meaning is the second one.

@silverwind
Copy link
Member

Maybe gitea doctor could output some parseable JSON format for the UI to consume? So these problems could be shown both on UI and when running it on CLI? I think UI is more important as only few people even know about gitae doctor.

@wxiaoguang
Copy link
Contributor Author

wxiaoguang commented Sep 15, 2023

Maybe gitea doctor could output some parseable JSON format for the UI to consume?

See the answer above:

It needs more refactoring work for the doctor system, because some checks consume a lot of time, which are not suitable to be operated by the web UI.

The block problem is not "output", but the whole design, especially the "time". If a "check" can't finish in 5-10 seconds, then I think it's not suitable to be put in the self-check page directly, it might need extra work to make it work asynchronously with the web UI.

@silverwind
Copy link
Member

silverwind commented Sep 15, 2023

Yeah, it would need to run the check once on app startup in a separate goroutine, and then cache the result in-memory.

That said, I don't require this sharing of doctor features. Fast checks could be done during the request and slow checks be kept in doctor.

Or yes, check via async request. Put a button "check now", show a spinner. Then frontend can poll backend for completion. After check, cache the results in backend in memory and offer a "check again" if necessary.

wxiaoguang added a commit that referenced this issue May 10, 2024
Follow #27011
Follow #30885

---------

Co-authored-by: silverwind <[email protected]>
Co-authored-by: Giteabot <[email protected]>
GiteaBot added a commit to GiteaBot/gitea that referenced this issue May 10, 2024
wxiaoguang added a commit that referenced this issue May 10, 2024
Backport #30890 by wxiaoguang

Follow #27011
Follow #30885

Co-authored-by: wxiaoguang <[email protected]>
Co-authored-by: silverwind <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

3 participants