From f69f5a9f105f655c931b29a57f9ffb257b7edf7c Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 11 Jan 2020 22:24:57 +0800 Subject: 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 --- docs/content/doc/usage/command-line.en-us.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'docs/content/doc/usage') 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 -- cgit v1.2.3