From 176edd5441bc41a0cd5c1dd9b550fc14668f3cd6 Mon Sep 17 00:00:00 2001 From: singuliere Date: Sat, 28 May 2022 22:49:54 +0200 Subject: [PATCH 1/4] docs: update the ROOT documentation and error messages * The documentation now reflects what happens in the setting/repository.go::newRepository function: filepath.Join(AppWorkPath, RepoRootPath) was missing. * The error message displayed when RepoRootPath is not found now displays the value of RepoRootPath. Given the complexity of the construction of this value, only referring to it in the abstract is likely to be misleading to the Gitea admin trying to interpret the message. --- cmd/serv.go | 2 +- custom/conf/app.example.ini | 3 ++- docs/content/doc/advanced/config-cheat-sheet.en-us.md | 4 ++-- docs/content/doc/help/faq.en-us.md | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/serv.go b/cmd/serv.go index 340f591dce0b3..adfbc6024ca7c 100644 --- a/cmd/serv.go +++ b/cmd/serv.go @@ -302,7 +302,7 @@ func runServ(c *cli.Context) error { if _, err := os.Stat(setting.RepoRootPath); err != nil { if os.IsNotExist(err) { return fail("Incorrect configuration.", - "Directory `[repository]` `ROOT` was not found, please check if $GITEA_WORK_DIR is passed to the SSH connection or make `[repository]` `ROOT` an absolute value.") + "Directory `[repository]` `ROOT` %s was not found, please check if $GITEA_WORK_DIR is passed to the SSH connection or make `[repository]` `ROOT` an absolute value.", setting.RepoRootPath) } } diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index 8362f228123da..03bdf4535040f 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -813,7 +813,8 @@ PATH = ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;[repository] ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Root path for storing all repository data. It must be an absolute path. By default, it is stored in a sub-directory of `APP_DATA_PATH`. +;; Root path for storing all repository data. By default, it is set to %(APP_DATA_PATH)/gitea-repositories. +;; A relative path is interpreted as %(GITEA_WORK_DIR)/%(ROOT) ;ROOT = ;; ;; The script type this server supports. Usually this is `bash`, but some users report that only `sh` is available. diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md index 785fd3d6c25e3..f224a1c0ecba5 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md +++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md @@ -42,8 +42,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. ## Repository (`repository`) -- `ROOT`: **data/gitea-repositories/**: Root path for storing all repository data. It must be - an absolute path. By default it is stored in a sub-directory of `APP_DATA_PATH`. +- `ROOT`: Root path for storing all repository data. By default, it is set to %(APP_DATA_PATH)/gitea-repositories. + A relative path is interpreted as %(GITEA_WORK_DIR)/%(ROOT). - `SCRIPT_TYPE`: **bash**: The script type this server supports. Usually this is `bash`, but some users report that only `sh` is available. - `DETECTED_CHARSETS_ORDER`: **UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, ISO-8859, windows-1252, ISO-8859, windows-1250, ISO-8859, ISO-8859, ISO-8859, windows-1253, ISO-8859, windows-1255, ISO-8859, windows-1251, windows-1256, KOI8-R, ISO-8859, windows-1254, Shift_JIS, GB18030, EUC-JP, EUC-KR, Big5, ISO-2022, ISO-2022, ISO-2022, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr**: Tie-break order of detected charsets - if the detected charsets have equal confidence, charsets earlier in the list will be chosen in preference to those later. Adding `defaults` will place the unnamed charsets at that point. diff --git a/docs/content/doc/help/faq.en-us.md b/docs/content/doc/help/faq.en-us.md index ee5a37c948ec4..f05bae6bd913c 100644 --- a/docs/content/doc/help/faq.en-us.md +++ b/docs/content/doc/help/faq.en-us.md @@ -64,7 +64,8 @@ https://github.com/loganinak/MigrateGitlabToGogs - Unix: Environment variable `HOME` - Windows: Environment variable `USERPROFILE`, else environment variables `HOMEDRIVE`+`HOMEPATH` - RepoRootPath - - `ROOT` in `app.ini` + - `ROOT` in the \[repository] section of `app.ini` if absolute + - Else `%(AppWorkPath)/ROOT` if `ROOT` in the \[repository] section of `app.ini` if relative - Else `%(AppDataPath)/gitea-repositories` - INI (config file) - `-c` flag From e30920441dfb59850ca75f94bd27858ced58c566 Mon Sep 17 00:00:00 2001 From: singuliere <35190819+singuliere@users.noreply.github.com> Date: Mon, 30 May 2022 07:30:42 +0200 Subject: [PATCH 2/4] Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-authored-by: delvh --- docs/content/doc/advanced/config-cheat-sheet.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md index f224a1c0ecba5..055439d4ed427 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md +++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md @@ -42,7 +42,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. ## Repository (`repository`) -- `ROOT`: Root path for storing all repository data. By default, it is set to %(APP_DATA_PATH)/gitea-repositories. +- `ROOT`: **%(APP_DATA_PATH)/gitea-repositories**: Root path for storing all repository data. A relative path is interpreted as %(GITEA_WORK_DIR)/%(ROOT). - `SCRIPT_TYPE`: **bash**: The script type this server supports. Usually this is `bash`, but some users report that only `sh` is available. From aa7ebeecf3a85e1b4198b102accc7d49a3e19530 Mon Sep 17 00:00:00 2001 From: singuliere <35190819+singuliere@users.noreply.github.com> Date: Mon, 30 May 2022 07:30:59 +0200 Subject: [PATCH 3/4] Update docs/content/doc/advanced/config-cheat-sheet.en-us.md Co-authored-by: delvh --- docs/content/doc/advanced/config-cheat-sheet.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/doc/advanced/config-cheat-sheet.en-us.md b/docs/content/doc/advanced/config-cheat-sheet.en-us.md index 055439d4ed427..9d7f6c126cc66 100644 --- a/docs/content/doc/advanced/config-cheat-sheet.en-us.md +++ b/docs/content/doc/advanced/config-cheat-sheet.en-us.md @@ -43,7 +43,7 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`. ## Repository (`repository`) - `ROOT`: **%(APP_DATA_PATH)/gitea-repositories**: Root path for storing all repository data. - A relative path is interpreted as %(GITEA_WORK_DIR)/%(ROOT). + A relative path is interpreted as **%(GITEA_WORK_DIR)/%(ROOT)**. - `SCRIPT_TYPE`: **bash**: The script type this server supports. Usually this is `bash`, but some users report that only `sh` is available. - `DETECTED_CHARSETS_ORDER`: **UTF-8, UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, ISO-8859, windows-1252, ISO-8859, windows-1250, ISO-8859, ISO-8859, ISO-8859, windows-1253, ISO-8859, windows-1255, ISO-8859, windows-1251, windows-1256, KOI8-R, ISO-8859, windows-1254, Shift_JIS, GB18030, EUC-JP, EUC-KR, Big5, ISO-2022, ISO-2022, ISO-2022, IBM424_rtl, IBM424_ltr, IBM420_rtl, IBM420_ltr**: Tie-break order of detected charsets - if the detected charsets have equal confidence, charsets earlier in the list will be chosen in preference to those later. Adding `defaults` will place the unnamed charsets at that point. From 1079740eb85261f3ec03591a03c499e9f077c4ee Mon Sep 17 00:00:00 2001 From: singuliere <35190819+singuliere@users.noreply.github.com> Date: Mon, 30 May 2022 07:32:17 +0200 Subject: [PATCH 4/4] Update docs/content/doc/help/faq.en-us.md Co-authored-by: delvh --- docs/content/doc/help/faq.en-us.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/doc/help/faq.en-us.md b/docs/content/doc/help/faq.en-us.md index f05bae6bd913c..a64cccfa66f4c 100644 --- a/docs/content/doc/help/faq.en-us.md +++ b/docs/content/doc/help/faq.en-us.md @@ -66,7 +66,7 @@ https://github.com/loganinak/MigrateGitlabToGogs - RepoRootPath - `ROOT` in the \[repository] section of `app.ini` if absolute - Else `%(AppWorkPath)/ROOT` if `ROOT` in the \[repository] section of `app.ini` if relative - - Else `%(AppDataPath)/gitea-repositories` + - Default `%(AppDataPath)/gitea-repositories` - INI (config file) - `-c` flag - Else `%(CustomPath)/conf/app.ini`