aboutsummaryrefslogtreecommitdiff
path: root/ssh_handle_receive_pack.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 20:21:32 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 20:21:32 +0800
commit71ab9b7f14118f02dd18cd733bd4e0ad19ece590 (patch)
tree0303cbee651a4e1cee62a348d25066b9543f4425 /ssh_handle_receive_pack.go
parentgit2d: Remove UTF-8 checks (diff)
downloadforge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.gz
forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.tar.zst
forge-71ab9b7f14118f02dd18cd733bd4e0ad19ece590.zip
config shall no longer be a global variable
Diffstat (limited to 'ssh_handle_receive_pack.go')
-rw-r--r--ssh_handle_receive_pack.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/ssh_handle_receive_pack.go b/ssh_handle_receive_pack.go
index f8777fa..ed7ef40 100644
--- a/ssh_handle_receive_pack.go
+++ b/ssh_handle_receive_pack.go
@@ -34,8 +34,8 @@ type packPass struct {
var packPasses = cmap.Map[string, packPass]{}
// sshHandleRecvPack handles attempts to push to repos.
-func sshHandleRecvPack(session gliderSSH.Session, pubkey, repoIdentifier string) (err error) {
- groupPath, repoName, repoID, repoPath, directAccess, contribReq, userType, userID, err := getRepoInfo2(session.Context(), repoIdentifier, pubkey)
+func (s *server) sshHandleRecvPack(session gliderSSH.Session, pubkey, repoIdentifier string) (err error) {
+ groupPath, repoName, repoID, repoPath, directAccess, contribReq, userType, userID, err := s.getRepoInfo2(session.Context(), repoIdentifier, pubkey)
if err != nil {
return err
}
@@ -55,7 +55,7 @@ func sshHandleRecvPack(session gliderSSH.Session, pubkey, repoIdentifier string)
}
hooksPath := repoConfCore.OptionAll("hooksPath")
- if len(hooksPath) != 1 || hooksPath[0] != config.Hooks.Execs {
+ if len(hooksPath) != 1 || hooksPath[0] != s.config.Hooks.Execs {
return errors.New("repository has hooksPath set to an unexpected value")
}
@@ -114,7 +114,7 @@ func sshHandleRecvPack(session gliderSSH.Session, pubkey, repoIdentifier string)
proc := exec.CommandContext(session.Context(), "git-receive-pack", repoPath)
proc.Env = append(os.Environ(),
- "LINDENII_FORGE_HOOKS_SOCKET_PATH="+config.Hooks.Socket,
+ "LINDENII_FORGE_HOOKS_SOCKET_PATH="+s.config.Hooks.Socket,
"LINDENII_FORGE_HOOKS_COOKIE="+cookie,
)
proc.Stdin = session