Skip to content

Commit 898169e

Browse files
authored
Merge branch 'main' into custom-regexp-external-issues
2 parents 94361df + d002e3d commit 898169e

File tree

19 files changed

+86
-48
lines changed

19 files changed

+86
-48
lines changed

cmd/serv.go

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 2 deletions
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/developers/hacking-on-gitea.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Start local ElasticSearch instance using docker:
192192
```sh
193193
mkdir -p $(pwd)/data/elasticsearch
194194
sudo chown -R 1000:1000 $(pwd)/data/elasticsearch
195-
docker run --rm -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" -v "$(pwd)/data/elasticsearch:/usr/share/elasticsearch/data" docker.elastic.co/elasticsearch/elasticsearch:7.16.3
195+
docker run --rm --memory="4g" -p 127.0.0.1:9200:9200 -p 127.0.0.1:9300:9300 -e "discovery.type=single-node" -v "$(pwd)/data/elasticsearch:/usr/share/elasticsearch/data" docker.elastic.co/elasticsearch/elasticsearch:7.16.3
196196
```
197197

198198
Configure `app.ini`:

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

Lines changed: 3 additions & 2 deletions
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/packages/overview.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ menu:
1414

1515
# Package Registry
1616

17-
The Package Registry can be used as a public or private registry for common package managers.
17+
Starting with Gitea **1.17**, the Package Registry can be used as a public or private registry for common package managers.
1818

1919
**Table of Contents**
2020

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

Lines changed: 17 additions & 0 deletions
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

Lines changed: 5 additions & 1 deletion
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

Lines changed: 5 additions & 3 deletions
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

Lines changed: 6 additions & 0 deletions
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

0 commit comments

Comments
 (0)