diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-01-11 22:24:57 +0800 |
---|---|---|
committer | Antoine GIRARD <sapk@users.noreply.github.com> | 2020-01-11 15:24:57 +0100 |
commit | f69f5a9f105f655c931b29a57f9ffb257b7edf7c (patch) | |
tree | 35f16feba0d18fcaaa10de86623e307289348aa2 /docs | |
parent | f2e6c4538e83f267a1b1f2abaaf38cd99c6dd0a5 (diff) | |
download | gitea-f69f5a9f105f655c931b29a57f9ffb257b7edf7c.tar.gz gitea-f69f5a9f105f655c931b29a57f9ffb257b7edf7c.zip |
Add a new command doctor to check if some wrong configurations on gitea instance (#9095)
* add doctor
* Add a new command doctor to check if some wrong configurations on gitea instance
* fix import
* use regex match authorized_keys on doctor
* Add documentation
Diffstat (limited to 'docs')
-rw-r--r-- | docs/content/doc/usage/command-line.en-us.md | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/content/doc/usage/command-line.en-us.md b/docs/content/doc/usage/command-line.en-us.md index 0f7b4f61a2..60c2e26a7b 100644 --- a/docs/content/doc/usage/command-line.en-us.md +++ b/docs/content/doc/usage/command-line.en-us.md @@ -289,3 +289,28 @@ This command is idempotent. #### convert Converts an existing MySQL database from utf8 to utf8mb4. + +#### doctor +Diagnose the problems of current gitea instance according the given configuration. +Currently there are a check list below: + +- Check if OpenSSH authorized_keys file id correct +When your gitea instance support OpenSSH, your gitea instance binary path will be written to `authorized_keys` +when there is any public key added or changed on your gitea instance. +Sometimes if you moved or renamed your gitea binary when upgrade and you haven't run `Update the '.ssh/authorized_keys' file with Gitea SSH keys. (Not needed for the built-in SSH server.)` on your Admin Panel. Then all pull/push via SSH will not be work. +This check will help you to check if it works well. + +For contributors, if you want to add more checks, you can wrie ad new function like `func(ctx *cli.Context) ([]string, error)` and +append it to `doctor.go`. + +```go +var checklist = []check{ + { + title: "Check if OpenSSH authorized_keys file id correct", + f: runDoctorLocationMoved, + }, + // more checks please append here +} +``` + +This function will receive a command line context and return a list of details about the problems or error.
\ No newline at end of file |