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 a new command doctor to check if some wrong configurations on gitea instance #9095

Merged
merged 5 commits into from
Jan 11, 2020

Conversation

lunny
Copy link
Member

@lunny lunny commented Nov 20, 2019

When gitea's path is not changed.

图片

When gitea's path changed.
图片

@lunny lunny added type/feature Completely new functionality. Can only be merged if feature freeze is not active. type/changelog Adds the changelog for a new Gitea version labels Nov 20, 2019
@guillep2k
Copy link
Member

This is about #8781

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 20, 2019
@codecov-io
Copy link

codecov-io commented Nov 20, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@f2e6c45). Click here to learn what that means.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #9095   +/-   ##
=========================================
  Coverage          ?   42.17%           
=========================================
  Files             ?      592           
  Lines             ?    78156           
  Branches          ?        0           
=========================================
  Hits              ?    32963           
  Misses            ?    41146           
  Partials          ?     4047
Impacted Files Coverage Δ
cmd/doctor.go 0% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f2e6c45...bc573b6. Read the comment docs.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Nov 20, 2019
@jolheiser
Copy link
Member

@lunny Is this considered WIP currently, or implement the one check and add more with other PRs?

cmd/doctor.go Outdated Show resolved Hide resolved
cmd/doctor.go Outdated

func runDoctor(ctx *cli.Context) error {
if err := initDB(); err != nil {
return err
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be give the users some hints about this kind of catastrophic failure (e.g. "make sure to use a --config directive", "check if the --config file points to the right file", "make sure you have the right permissions", etc.) even if the problem might not be related to any of the listed hints.

cmd/doctor.go Outdated Show resolved Hide resolved
cmd/doctor.go Show resolved Hide resolved
@lunny
Copy link
Member Author

lunny commented Nov 21, 2019

@jolheiser Not WIP, I just want to add a framework and add more checkes on late PRs.

cmd/doctor.go Outdated Show resolved Hide resolved
@6543
Copy link
Member

6543 commented Dec 2, 2019

because it add a framework we need a litle bit of docu to be usefull

Copy link
Member

@6543 6543 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some docu hints

@lunny lunny added this to the 1.12.0 milestone Dec 14, 2019
cmd/doctor.go Outdated Show resolved Hide resolved
@6543
Copy link
Member

6543 commented Jan 10, 2020

@lunny can you add docs about this feature?

@guillep2k
Copy link
Member

guillep2k commented Jan 10, 2020

@lunny can you add docs about this feature?

I'd suggest not delaying this any longer, so others could start adding functions to it as well. 😉

Docs can wait to another PR, IMHO.

@lunny
Copy link
Member Author

lunny commented Jan 11, 2020

@sapk @guillep2k done.

@6543
Copy link
Member

6543 commented Jan 11, 2020

@lunny thanks

@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 Jan 11, 2020
@sapk sapk merged commit f69f5a9 into go-gitea:master Jan 11, 2020
@lunny lunny deleted the lunny/doctor branch January 12, 2020 01:42
techknowlogick pushed a commit that referenced this pull request Apr 6, 2020
…#10991)

* Mulitple Gitea Doctor improvements (#10943)

Backport #10943

* Add `gitea doctor --list` flag to list the checks that will be run, including those by default
* Add `gitea doctor --run` to run specific checks
* Add `gitea doctor --all` to run all checks
* Add db version checker
* Add non-default recalculate merge bases check/fixer to doctor
* Add hook checker (Fix #9878) and ensure hooks are executable (Fix #6319)
* Fix authorized_keys checker - slight change of functionality here because parsing the command is fragile and we should just check if the authorized_keys file is essentially the same as what gitea would produce. (This is still not perfect as order matters - we should probably just md5sum the two files.)
* Add SCRIPT_TYPE check (Fix #10977)
* Add `gitea doctor --fix` to attempt to fix what is possible to easily fix
* Add `gitea doctor --log-file` to set the log-file, be it a file, stdout or to switch off completely. (Fixes previously undetected bug with certain xorm logging configurations - see @6543 comment.)

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Switch to io.Writer instead of io.StringWriter

Signed-off-by: Andrew Thornton <art27@cantab.net>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@delvh delvh removed the type/changelog Adds the changelog for a new Gitea version label Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants