Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | hooks: Remove debug printf | Runxi Yu | 6 days | 1 | -2/+0 |
| | |||||
* | hooks: Send/process environment variables starting with GIT_ | Runxi Yu | 6 days | 1 | -0/+29 |
| | |||||
* | *: Support subgroups via SQL recursion | Runxi Yu | 7 days | 1 | -1/+1 |
| | |||||
* | *: Typing fixes | Runxi Yu | 8 days | 1 | -1/+1 |
| | |||||
* | *: Replace some := with var | Runxi Yu | 8 days | 1 | -34/+49 |
| | |||||
* | Add SPDX license headers to all Go files | Runxi Yu | 10 days | 1 | -0/+3 |
| | |||||
* | ssh/recv: Check hooksPath before receiving packs | Runxi Yu | 2025-02-20 | 1 | -20/+13 |
| | |||||
* | hooks, ssh: Indicate URL of newly-created MRs | Runxi Yu | 2025-02-20 | 1 | -3/+6 |
| | |||||
* | hooks: Clarify the last ACK/NAK being overall | Runxi Yu | 2025-02-20 | 1 | -4/+3 |
| | |||||
* | hooks: Use colorful SSH messages | Runxi Yu | 2025-02-20 | 1 | -23/+32 |
| | |||||
* | hooks: Don't trim contrib/ when inserting MRs | Runxi Yu | 2025-02-19 | 1 | -2/+2 |
| | |||||
* | all: Use COALESCE to handle some nullable database fields | Runxi Yu | 2025-02-19 | 1 | -1/+6 |
| | |||||
* | ssh/recv, hooks: Create MRs on push, reject pushes to others' MRs | Runxi Yu | 2025-02-19 | 1 | -5/+32 |
| | |||||
* | hooks: Ignore error value of the last conn.Write() | Runxi Yu | 2025-02-19 | 1 | -1/+1 |
| | |||||
* | hooks: Use ssh stderr directly instead of going through hook | Runxi Yu | 2025-02-19 | 1 | -132/+99 |
| | |||||
* | hooks: Reject non-FF contrib pushes for now | Runxi Yu | 2025-02-19 | 1 | -36/+68 |
| | | | | We actually intend to create special refs for this in the future. | ||||
* | hooks: Add TODOs on where to create MRs and MR history points | Runxi Yu | 2025-02-19 | 1 | -0/+8 |
| | |||||
* | *.go: Use lowercase error values | Runxi Yu | 2025-02-19 | 1 | -2/+2 |
| | |||||
* | hooks: Check error on conn.Write | Runxi Yu | 2025-02-18 | 1 | -12/+36 |
| | |||||
* | *.go: Add some comments for docs | Runxi Yu | 2025-02-18 | 1 | -0/+4 |
| | |||||
* | git_hooks_handle: Allow anonymous pushes to contrib/ | Runxi Yu | 2025-02-18 | 1 | -2/+74 |
| | |||||
* | hooks: Fix the race condition that causes EPIPE | Runxi Yu | 2025-02-18 | 1 | -0/+7 |
| | | | | | | | | | | | | The hooks handler in the main daemon didn't wait for the hook client to write fully, and sometimes prematurely closes the connection, causing the hook client's splice to return EPIPE (or SIGPIPE if the signal handler wasn't installed). To remedy this, we call shutdown(sock, SHUT_WR) in the client, so that attempts to read on the server side return EOF. Then we can simply use io.Copy(&buf, conn) on the server side to fetch all of the data into a buffer. | ||||
* | hooks, etc.: Restructure concurrency and data flow | Runxi Yu | 2025-02-17 | 1 | -11/+16 |
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously we accepted handler connections at hooks_handle and used a mess of channels and concurrent maps to let receive_pack handle the session. This doesn't work well because there are conditions where a push occurs but the hook is not called, e.g. when the destination branch is up to date. There is no reliable way of checking whether the subprocess is going to call the hook or not; it's technically possible to parse stderr but that interface is not guaranteed to be stable and IIRC has changed in the past). So receive_pack would be waiting on the channel to receive a hooks connection to handle but it'll never receive one, causing a deadlock. This entire thing was overengineered and was very prone to error. Here we let receive_pack put the cookie into the map, then start and wait for the subprocess to finish. When the hook actually runs and connects to its UNIX domain socket, the handler would check its cookie within the map. If the hook doesn't run, then nothing happens. The git-receive-pack subprocess blocks the execution of the SSH handler, and when git-receive-pack exists, the SSH handler (using a defer) deletes the cookie from the map. There may be caveats in signal handling or other cases that cause the cookie to be deleted from the map prematurely. | ||||
* | git_hooks_handle.go: Remove err_not_unixconn | Runxi Yu | 2025-02-17 | 1 | -1/+0 |
| | | | | | As this always suggests a programming mistake, we do not check the type assertion, causing it to panic if the types don't match. | ||||
* | hooks, etc.: Authenticate hooks, and handle them in the spawning thread | Runxi Yu | 2025-02-17 | 1 | -1/+23 |
| | |||||
* | git_hooks_handle.go: Read argv from hook | Runxi Yu | 2025-02-17 | 1 | -7/+33 |
| | |||||
* | git_hooks_handle.go: Refactor for clarity | Runxi Yu | 2025-02-17 | 1 | -14/+13 |
| | |||||
* | git_hooks_handle.go: Exit on UID mismatch, handle >1 connections | Runxi Yu | 2025-02-17 | 1 | -15/+21 |
| | |||||
* | git_hooks_handle.go, etc.: Listen for connections from hooks | Runxi Yu | 2025-02-17 | 1 | -1/+11 |
| | |||||
* | git_hooks_handle.go: Move from git_hooks.go | Runxi Yu | 2025-02-17 | 1 | -0/+45 |