mirror of
https://codeberg.org/forgejo-aneksajo/forgejo-aneksajo.git
synced 2025-04-21 05:36:43 +02:00
fix: set git identity for p2phttp processes
In some situations it could happen that `git annex p2phttp` needs some kind of maintenance work resulting in a commit, but without a configured git identity p2phttp would refuse to run. This could break p2phttp support. Setting `GIT_AUTHOR_{NAME,EMAIL}` should remedy this issue.
This commit is contained in:
parent
6c61f80d21
commit
7a62ee693f
1 changed files with 5 additions and 0 deletions
|
@ -19,6 +19,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/annex"
|
||||
"code.gitea.io/gitea/modules/graceful"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
services_context "code.gitea.io/gitea/services/context"
|
||||
)
|
||||
|
||||
|
@ -93,6 +94,10 @@ func AnnexP2PHTTP(ctx *services_context.Context) {
|
|||
Pdeathsig: syscall.SIGINT,
|
||||
}
|
||||
cmd.Cancel = func() error { return cmd.Process.Signal(os.Interrupt) }
|
||||
cmd.Env = append(os.Environ(),
|
||||
"GIT_AUTHOR_NAME="+setting.AppName,
|
||||
"GIT_AUTHOR_EMAIL="+setting.RunUser+"@"+setting.Domain,
|
||||
)
|
||||
_ = cmd.Run()
|
||||
}(p2phttpCtx)
|
||||
graceful.GetManager().RunAtTerminate(p2phttpCtxCancel)
|
||||
|
|
Loading…
Add table
Reference in a new issue