Skip to content

Commit f15e03d

Browse files
authored
Merge branch 'main' into refactor-packages
2 parents 400b4a8 + e20952a commit f15e03d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cmd/serv.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,15 @@ func runServ(c *cli.Context) error {
296296
gitcmd = exec.CommandContext(ctx, verb, repoPath)
297297
}
298298

299+
// Check if setting.RepoRootPath exists. It could be the case that it doesn't exist, this can happen when
300+
// `[repository]` `ROOT` is a relative path and $GITEA_WORK_DIR isn't passed to the SSH connection.
301+
if _, err := os.Stat(setting.RepoRootPath); err != nil {
302+
if os.IsNotExist(err) {
303+
return fail("Incorrect configuration.",
304+
"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+
}
306+
}
307+
299308
gitcmd.Dir = setting.RepoRootPath
300309
gitcmd.Stdout = os.Stdout
301310
gitcmd.Stdin = os.Stdin

docs/content/doc/advanced/logging-documentation.en-us.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ MODE = console
287287
LEVEL = debug ; please set the level to debug when we are debugging a problem
288288
ROUTER = console
289289
COLORIZE = false ; this can be true if you can strip out the ansi coloring
290+
ENABLE_SSH_LOG = true ; shows logs related to git over SSH.
290291
```
291292

292293
Sometimes it will be helpful get some specific `TRACE` level logging restricted
@@ -445,7 +446,7 @@ Gitea includes built-in log rotation, which should be enough for most deployment
445446
- Disable built-in log rotation by setting `LOG_ROTATE` to `false` in your `app.ini`.
446447
- Install `logrotate`.
447448
- Configure `logrotate` to match your deployment requirements, see `man 8 logrotate` for configuration syntax details. In the `postrotate/endscript` block send Gitea a `USR1` signal via `kill -USR1` or `kill -10` to the `gitea` process itself, or run `gitea manager logging release-and-reopen` (with the appropriate environment). Ensure that your configurations apply to all files emitted by Gitea loggers as described in the above sections.
448-
- Always do `logrotate /etc/logrotate.conf --debug` to test your configurations.
449+
- Always do `logrotate /etc/logrotate.conf --debug` to test your configurations.
449450
- If you are using docker and are running from outside of the container you can use `docker exec -u $OS_USER $CONTAINER_NAME sh -c 'gitea manager logging release-and-reopen'` or `docker exec $CONTAINER_NAME sh -c '/bin/s6-svc -1 /etc/s6/gitea/'` or send `USR1` directly to the Gitea process itself.
450451

451452
The next `logrotate` jobs will include your configurations, so no restart is needed. You can also immediately reload `logrotate` with `logrotate /etc/logrotate.conf --force`.

0 commit comments

Comments
 (0)