Skip to content

Commit b16c312

Browse files
committed
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix spelling mistake in ProcReceive (go-gitea#19853) Ensure responses are context.ResponseWriters (go-gitea#19843) Fix inconsistency in doctor output (go-gitea#19836) docs: recommendations to ensure backup consistency and reliability (go-gitea#19845) feat: Add support for extra sshd_config parameters via 'Include' file (go-gitea#19842) [skip ci] Updated translations via Crowdin docs: update the ROOT documentation and error messages (go-gitea#19832)
2 parents e6177c2 + d002e3d commit b16c312

File tree

15 files changed

+52
-14
lines changed

15 files changed

+52
-14
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.

docker/root/etc/s6/openssh/setup

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ if [ -d /etc/ssh ]; then
4949
SSH_DSA_CERT="${SSH_DSA_CERT:+"HostCertificate "}${SSH_DSA_CERT}" \
5050
SSH_MAX_STARTUPS="${SSH_MAX_STARTUPS:+"MaxStartups "}${SSH_MAX_STARTUPS}" \
5151
SSH_MAX_SESSIONS="${SSH_MAX_SESSIONS:+"MaxSessions "}${SSH_MAX_SESSIONS}" \
52+
SSH_INCLUDE_FILE="${SSH_INCLUDE_FILE:+"Include "}${SSH_INCLUDE_FILE}" \
5253
SSH_LOG_LEVEL=${SSH_LOG_LEVEL:-"INFO"} \
5354
envsubst < /etc/templates/sshd_config > /etc/ssh/sshd_config
5455

docker/root/etc/templates/sshd_config

+2
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ Banner none
4141
Subsystem sftp /usr/lib/ssh/sftp-server
4242

4343
AcceptEnv GIT_PROTOCOL
44+
45+
${SSH_INCLUDE_FILE}

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`

docs/content/doc/usage/backup-and-restore.en-us.md

+17
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ file can be unpacked and used to restore an instance.
2222

2323
{{< toc >}}
2424

25+
## Backup Consistency
26+
27+
To ensure the consistency of the Gitea instance, it must be shutdown during backup.
28+
29+
Gitea consists of a database, files and git repositories, all of which change when it is used. For instance, when a migration is in progress, a transaction is created in the database while the git repository is being copied over. If the backup happens in the middle of the migration, the git repository may be incomplete although the database claims otherwise because it was dumped afterwards. The only way to avoid such race conditions is by stopping the Gitea instance during the backups.
30+
2531
## Backup Command (`dump`)
2632

2733
Switch to the user running Gitea: `su git`. Run `./gitea dump -c /path/to/app.ini` in the Gitea installation
@@ -48,6 +54,17 @@ Inside the `gitea-dump-1482906742.zip` file, will be the following:
4854
Intermediate backup files are created in a temporary directory specified either with the
4955
`--tempdir` command-line parameter or the `TMPDIR` environment variable.
5056

57+
## Backup the database
58+
59+
The SQL dump created by `gitea dump` uses XORM and Gitea admins may prefer to use the native the MySQL and PostgreSQL dump tools instead. There are still open issues when using XORM for dumping the database that may cause problems when attempting to restore it.
60+
61+
```sh
62+
# mysql
63+
mysqldump -u$USER -p$PASS --database $DATABASE > gitea-db.sql
64+
# postgres
65+
pgdump -U $USER $DATABASE > gitea-db.sql
66+
```
67+
5168
### Using Docker (`dump`)
5269

5370
There are a few caveats for using the `dump` command with Docker.

modules/doctor/fix16961.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,11 @@ func fixBrokenRepoUnits16961(ctx context.Context, logger log.Logger, autofix boo
302302
}
303303

304304
if !autofix {
305-
logger.Warn("Found %d broken repo_units", count)
305+
if count == 0 {
306+
logger.Info("Found no broken repo_units")
307+
} else {
308+
logger.Warn("Found %d broken repo_units", count)
309+
}
306310
return nil
307311
}
308312
logger.Info("Fixed %d broken repo_units", count)

modules/doctor/mergebase.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ func checkPRMergeBase(ctx context.Context, logger log.Logger, autofix bool) erro
9292
if autofix {
9393
logger.Info("%d PR mergebases updated of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
9494
} else {
95-
if numPRsUpdated > 0 && err == nil {
95+
if numPRsUpdated == 0 {
96+
logger.Info("All %d PRs in %d repos have a correct mergebase", numPRs, numRepos)
97+
} else if err == nil {
9698
logger.Critical("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
9799
return fmt.Errorf("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
100+
} else {
101+
logger.Warn("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
98102
}
99-
100-
logger.Warn("%d PRs with incorrect mergebases of %d PRs total in %d repos", numPRsUpdated, numPRs, numRepos)
101103
}
102104

103105
return err

modules/web/wrap_convert.go

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ func convertHandler(handler interface{}) wrappedHandlerFunc {
2121
case http.HandlerFunc:
2222
return func(resp http.ResponseWriter, req *http.Request, others ...wrappedHandlerFunc) (done bool, deferrable func()) {
2323
routing.UpdateFuncInfo(req.Context(), funcInfo)
24+
if _, ok := resp.(context.ResponseWriter); !ok {
25+
resp = context.NewResponse(resp)
26+
}
2427
t(resp, req)
2528
if r, ok := resp.(context.ResponseWriter); ok && r.Status() > 0 {
2629
done = true
@@ -92,6 +95,9 @@ func convertHandler(handler interface{}) wrappedHandlerFunc {
9295
next = wrapInternal(others)
9396
}
9497
routing.UpdateFuncInfo(req.Context(), funcInfo)
98+
if _, ok := resp.(context.ResponseWriter); !ok {
99+
resp = context.NewResponse(resp)
100+
}
95101
t(next).ServeHTTP(resp, req)
96102
if r, ok := resp.(context.ResponseWriter); ok && r.Status() > 0 {
97103
done = true

options/locale/locale_el-GR.ini

+1
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ webauthn_delete_key_desc=Αν αφαιρέσετε ένα κλειδί ασφα
778778
manage_account_links=Διαχείριση Συνδεδεμένων Λογαριασμών
779779
manage_account_links_desc=Αυτοί οι εξωτερικοί λογαριασμοί είναι συνδεδεμένοι στον Gitea λογαριασμό σας.
780780
account_links_not_available=Προς το παρόν δεν υπάρχουν εξωτερικοί λογαριασμοί συνδεδεμένοι με τον λογαριασμό σας στο Gitea.
781+
link_account=Σύνδεση Λογαριασμού
781782
remove_account_link=Αφαίρεση Συνδεδεμένου Λογαριασμού
782783
remove_account_link_desc=Η κατάργηση ενός συνδεδεμένου λογαριασμού θα ανακαλέσει την πρόσβασή του στο λογαριασμό σας στο Gitea. Συνέχεια;
783784
remove_account_link_success=Ο συνδεδεμένος λογαριασμός έχει αφαιρεθεί.

options/locale/locale_ja-JP.ini

+2
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ webauthn_delete_key_desc=セキュリティキーの登録を解除すると、
778778
manage_account_links=連携アカウントの管理
779779
manage_account_links_desc=これらの外部アカウントがGiteaアカウントと連携されています。
780780
account_links_not_available=現在このGiteaアカウントが連携している外部アカウントはありません。
781+
link_account=アカウントをリンク
781782
remove_account_link=連携アカウントの削除
782783
remove_account_link_desc=連携アカウントを削除し、Giteaアカウントへのアクセス権を取り消します。 続行しますか?
783784
remove_account_link_success=連携アカウントを削除しました。
@@ -2423,6 +2424,7 @@ dashboard.new_version_hint=Gitea %s が入手可能になりました。 現在
24232424
dashboard.statistic=サマリー
24242425
dashboard.operations=メンテナンス操作
24252426
dashboard.system_status=システム状況
2427+
dashboard.statistic_info=Giteaデータベースは <b>%d</b> ユーザー, <b>%d</b> 組織, <b>%d</b> 公開鍵, <b>%d</b> リポジトリ, <b>%d</b> ウォッチ, <b>%d</b> スター, ~<b>%d</b> アクション, <b>%d</b> アクセス, <b>%d</b> イシュー, <b>%d</b> コメント, <b>%d</b> ソーシャルアカウント, <b>%d</b> フォロー, <b>%d</b> ミラー, <b>%d</b> リリース, <b>%d</b> 認証ソース, <b>%d</b> Webhook, <b>%d</b> マイルストーン, <b>%d</b> ラベル, <b>%d</b> フックタスク, <b>%d</b> チーム, <b>%d</b> 更新タスク, <b>%d</b> 添付ファイル の情報を持っています。
24262428
dashboard.operation_name=操作の名称
24272429
dashboard.operation_switch=切り替え
24282430
dashboard.operation_run=実行

options/locale/locale_zh-CN.ini

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sign_in=登录
66
sign_in_with=登录方式
77
sign_out=退出
88
sign_up=注册
9-
link_account=链接帐户
9+
link_account=链接账户
1010
register=注册
1111
website=官方网站
1212
version=当前版本
@@ -778,6 +778,7 @@ webauthn_delete_key_desc=如果删除了安全密钥,则不能再使用它登
778778
manage_account_links=管理绑定过的账号
779779
manage_account_links_desc=这些外部帐户已经绑定到您的 Gitea 帐户。
780780
account_links_not_available=当前没有与您的 Gitea 帐户绑定的外部帐户。
781+
link_account=链接账户
781782
remove_account_link=删除已绑定的账号
782783
remove_account_link_desc=删除已绑定帐户将吊销其对您的 Gitea 帐户的访问权限。继续?
783784
remove_account_link_success=已取消绑定帐户。

routers/private/hook_proc_receive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func HookProcReceive(ctx *gitea_context.PrivateContext) {
2323
return
2424
}
2525

26-
results := agit.ProcRecive(ctx, opts)
26+
results := agit.ProcReceive(ctx, opts)
2727
if ctx.Written() {
2828
return
2929
}

services/agit/agit.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020
pull_service "code.gitea.io/gitea/services/pull"
2121
)
2222

23-
// ProcRecive handle proc receive work
24-
func ProcRecive(ctx *context.PrivateContext, opts *private.HookOptions) []private.HookProcReceiveRefResult {
23+
// ProcReceive handle proc receive work
24+
func ProcReceive(ctx *context.PrivateContext, opts *private.HookOptions) []private.HookProcReceiveRefResult {
2525
// TODO: Add more options?
2626
var (
2727
topicBranch string

0 commit comments

Comments
 (0)