feat: configure HTTP and FastCGI UNIX socket attributes - #284
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #284 +/- ##
==========================================
+ Coverage 88.34% 88.52% +0.17%
==========================================
Files 29 30 +1
Lines 1347 1359 +12
==========================================
+ Hits 1190 1203 +13
+ Misses 157 156 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The new raw UID/GID validation uses architecture-dependent string parsing (strconv.IntSize), which can incorrectly reject otherwise valid IDs on 32-bit builds.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds independent UNIX socket attribute configuration (mode/uid/gid) for both the plain HTTP and FastCGI listeners, upgrades to tcplisten v1.6.0 (and its shared schema), and improves FastCGI shutdown semantics to reliably close the underlying listener (including during concurrent start/stop).
Changes:
- Introduce
http.unix_socketandhttp.fcgi.unix_socketconfig blocks, with early raw UID/GID validation to avoid weak-decoding surprises. - Pass UNIX socket options into listener creation (
tcplisten.CreateListenerWithOptions) for HTTP/1.1 and FastCGI, and ensure FastCGI closes the real listener on shutdown. - Update JSON schema and add extensive tests for decode/validation, ownership handling, and UNIX-socket serving.
File summaries
| File | Description |
|---|---|
| tests/unix_socket_test.go | New integration-style tests covering config decode, ownership validation, FastCGI UNIX socket serving, and plugin serving over UNIX sockets. |
| tests/go.mod | Bumps tcplisten dependency to v1.6.0 for the tests module. |
| tests/go.sum | Updates sums for tcplisten v1.6.0 in the tests module. |
| servers/unix_socket_test.go | New server-level tests validating UNIX socket ownership/mode behavior across HTTP/1.1, h2c, and FastCGI. |
| servers/https/https_test.go | Aligns expected error text casing (“invalid protocol”). |
| servers/http11/http.go | Threads UNIX socket options into listener creation via CreateListenerWithOptions. |
| servers/fcgi/fcgi.go | Adds synchronized listener lifecycle tracking and closes the actual listener during shutdown (including concurrent start/stop). |
| servers/fcgi/fcgi_test.go | Adds concurrency and shutdown behavior tests for FastCGI server stop/serve interactions and unexpected listener close. |
| servers/fcgi/config.go | Adds unix_socket options to FastCGI config plus validation wrapper. |
| schema.json | References tcplisten v1.6.0 schema for unix_socket and updates address descriptions/examples. |
| plugin_test.go | Updates stub configurer Has behavior and extends per-section unmarshal error coverage to new unix_socket sections. |
| init.go | Adds early raw UID/GID validation and explicit per-subsection unmarshalling for http.unix_socket and http.fcgi.unix_socket. |
| go.mod | Bumps tcplisten dependency to v1.6.0. |
| go.sum | Updates sums for tcplisten v1.6.0. |
| config/unix_socket_test.go | New config-level tests for UNIX socket validation rules and independent HTTP vs FCGI unix_socket options. |
| config/config.go | Adds UnixSocket field to HTTP config and validates both HTTP and FCGI UNIX socket options. |
Review details
- Files reviewed: 14/16 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Part of roadrunner-server/roadrunner#1789.
http.unix_socketandhttp.fcgi.unix_socketsettings for mode, UID, and GID.tcplisten v1.6.0and its shared schema. Omitted settings keep the current defaults.These settings apply only to filesystem UNIX listeners. HTTPS, HTTP/3, ACME, and worker credentials remain unchanged.