Skip to content

Commit fdc784d

Browse files
singulieredelvh
andauthored
docs: update the ROOT documentation and error messages (#19832)
* 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. Co-authored-by: delvh <[email protected]>
1 parent fe4c846 commit fdc784d

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

cmd/serv.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func runServ(c *cli.Context) error {
302302
if _, err := os.Stat(setting.RepoRootPath); err != nil {
303303
if os.IsNotExist(err) {
304304
return fail("Incorrect configuration.",
305-
"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.")
305+
"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)
306306
}
307307
}
308308

custom/conf/app.example.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,8 @@ PATH =
813813
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
814814
;[repository]
815815
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
816-
;; 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`.
816+
;; Root path for storing all repository data. By default, it is set to %(APP_DATA_PATH)/gitea-repositories.
817+
;; A relative path is interpreted as %(GITEA_WORK_DIR)/%(ROOT)
817818
;ROOT =
818819
;;
819820
;; The script type this server supports. Usually this is `bash`, but some users report that only `sh` is available.

docs/content/doc/advanced/config-cheat-sheet.en-us.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
4242

4343
## Repository (`repository`)
4444

45-
- `ROOT`: **data/gitea-repositories/**: Root path for storing all repository data. It must be
46-
an absolute path. By default it is stored in a sub-directory of `APP_DATA_PATH`.
45+
- `ROOT`: **%(APP_DATA_PATH)/gitea-repositories**: Root path for storing all repository data.
46+
A relative path is interpreted as **%(GITEA_WORK_DIR)/%(ROOT)**.
4747
- `SCRIPT_TYPE`: **bash**: The script type this server supports. Usually this is `bash`,
4848
but some users report that only `sh` is available.
4949
- `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.

docs/content/doc/help/faq.en-us.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ https://github.com/loganinak/MigrateGitlabToGogs
6464
- Unix: Environment variable `HOME`
6565
- Windows: Environment variable `USERPROFILE`, else environment variables `HOMEDRIVE`+`HOMEPATH`
6666
- RepoRootPath
67-
- `ROOT` in `app.ini`
68-
- Else `%(AppDataPath)/gitea-repositories`
67+
- `ROOT` in the \[repository] section of `app.ini` if absolute
68+
- Else `%(AppWorkPath)/ROOT` if `ROOT` in the \[repository] section of `app.ini` if relative
69+
- Default `%(AppDataPath)/gitea-repositories`
6970
- INI (config file)
7071
- `-c` flag
7172
- Else `%(CustomPath)/conf/app.ini`

0 commit comments

Comments
 (0)