Documentation
¶
Overview ¶
Package hookd is the unix-socket bridge between git hooks and the daemon. The hook process (gitbayd in hook mode) computes git facts — it inherits git's quarantine environment, which the daemon does not see — and sends them here; the daemon answers with a policy decision.
pre-receive is two-phase when the repo requires signed commits: the first response sets NeedCommits, and the hook answers with the raw commit objects (only the hook can read them out of quarantine) for verification.
Index ¶
Constants ¶
const ( EnvSocket = "GITBAY_HOOK_SOCKET" EnvRepoID = "GITBAY_REPO_ID" EnvUserID = "GITBAY_USER_ID" )
Env variable names passed to git transport subprocesses and inherited by hooks.
Variables ¶
This section is empty.
Functions ¶
func Serve ¶
Serve listens on the unix socket until the listener is closed.
func SocketPath ¶
SocketPath returns the hook socket location. It prefers the server root, but unix socket paths are capped (~104 bytes on macOS, 108 on Linux), so deep roots fall back to a hashed name under the system temp directory. Hooks receive the chosen path via GITBAY_HOOK_SOCKET, so both sides always agree.
Types ¶
type CommitsPayload ¶
type CommitsPayload struct {
Commits []RawCommit `json:"commits"`
}
CommitsPayload is the hook's second message when NeedCommits was set.
type Request ¶
type Response ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Source Files
¶
- hookd.go