Skip to content

Commit a764866

Browse files
iavclaude
andcommitted
ccache-remote: address CodeRabbit review feedback
- Update outdated Redis security documentation URL - Add language specifier to DNS record code blocks (MD040) - Add nginx module requirement comment (http_dav_module) - Clarify kernel_make_config vs custom_kernel_make_params hook ordering - Move doc comment to correct function (ccache_format_host_port) - Clarify loopback URL rewrite safety in Docker hook comment Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b775779 commit a764866

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

extensions/ccache-remote/README.server-setup.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
```
3838

3939
For advanced security (TLS, ACL, rename-command), see:
40-
https://redis.io/docs/management/security/
40+
https://redis.io/docs/latest/operate/oss_and_stack/management/security/
4141

4242
3. Publish DNS-SD service — copy `misc/avahi/ccache-redis.service` to `/etc/avahi/services/`:
4343
```bash
@@ -113,13 +113,13 @@
113113
Set `CCACHE_REMOTE_DOMAIN` on the client, then create DNS records.
114114

115115
Redis backend:
116-
```
116+
```text
117117
_ccache._tcp.example.com. SRV 0 0 6379 ccache.example.com.
118118
_ccache._tcp.example.com. TXT "type=redis"
119119
```
120120

121121
HTTP/WebDAV backend:
122-
```
122+
```text
123123
_ccache._tcp.example.com. SRV 0 0 8088 ccache.example.com.
124124
_ccache._tcp.example.com. TXT "type=http" "path=/ccache/"
125125
```

extensions/ccache-remote/ccache-remote.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,20 @@ declare -g -a CCACHE_PASSTHROUGH_VARS=(
123123
CCACHE_PCH_EXTSUM
124124
)
125125

126-
# Discover ccache remote storage via DNS-SD (mDNS/Avahi) or DNS SRV records.
127-
# Looks for _ccache._tcp services with TXT records: type=http|redis, path=/...
128-
# Prefers Redis over HTTP when multiple services are found.
129-
# Sets CCACHE_REMOTE_STORAGE on success, returns 1 if nothing found.
126+
# Format host:port, wrapping IPv6 addresses in brackets for URL compatibility (RFC 2732)
130127
function ccache_format_host_port() {
131128
local host="$1" port="$2"
132-
# Wrap IPv6 addresses in brackets for URL compatibility (RFC 2732)
133129
if [[ "${host}" == *:* ]]; then
134130
echo "[${host}]:${port}"
135131
else
136132
echo "${host}:${port}"
137133
fi
138134
}
139135

136+
# Discover ccache remote storage via DNS-SD (mDNS/Avahi) or DNS SRV records.
137+
# Looks for _ccache._tcp services with TXT records: type=http|redis, path=/...
138+
# Prefers Redis over HTTP when multiple services are found.
139+
# Sets CCACHE_REMOTE_STORAGE on success, returns 1 if nothing found.
140140
function ccache_discover_remote_storage() {
141141
# Method 1: DNS-SD browse on local network (requires avahi-browse)
142142
if command -v avahi-browse &>/dev/null; then
@@ -342,7 +342,9 @@ function host_pre_docker_launch__setup_remote_ccache() {
342342
fi
343343
fi
344344

345-
# Replace loopback addresses with host.docker.internal so the container can reach the host
345+
# Replace loopback addresses with host.docker.internal so the container can reach the host.
346+
# The regex above matches loopback only in the host position (after ://), so the global
347+
# string substitution below is safe — loopback strings in password/path are not matched.
346348
if [[ -n "${CCACHE_REMOTE_STORAGE}" ]]; then
347349
if [[ "${CCACHE_REMOTE_STORAGE}" =~ ://localhost[:/\|] || \
348350
"${CCACHE_REMOTE_STORAGE}" =~ ://127\.0\.0\.1[:/\|] || \

extensions/ccache-remote/misc/nginx/ccache-webdav.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Use ONLY in a fully trusted private network.
1111
# For auth, add auth_basic directives. See nginx WebDAV documentation.
1212
# Note: ccache does not support HTTPS directly. Use a reverse proxy for TLS.
13+
# Requires: nginx with http_dav_module (e.g. nginx-full or nginx-extras on Debian/Ubuntu)
1314

1415
server {
1516
listen 8088;

lib/functions/compilation/kernel-make.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ function run_kernel_make_internal() {
7474
common_make_params_quoted+=("${llvm_flag}")
7575
fi
7676

77+
# Hook order: kernel_make_config runs first (generic extension config),
78+
# then custom_kernel_make_params (user/board overrides can take precedence).
7779
call_extension_method "kernel_make_config" <<- 'KERNEL_MAKE_CONFIG'
7880
*Hook to customize kernel make environment and parameters*
7981
Called right before invoking make for kernel compilation.
@@ -84,7 +86,7 @@ function run_kernel_make_internal() {
8486
- KERNEL_COMPILER, ARCHITECTURE, BRANCH, LINUXFAMILY, toolchain
8587
KERNEL_MAKE_CONFIG
8688

87-
# Allow extensions to modify make parameters and environment variables
89+
# Runs after kernel_make_config — allows user/board overrides to take precedence
8890
call_extension_method "custom_kernel_make_params" <<- 'CUSTOM_KERNEL_MAKE_PARAMS'
8991
*Customize kernel make parameters before compilation*
9092
Called after all standard make parameters are set but before invoking make.

0 commit comments

Comments
 (0)