From a7487dadd7b5da794d0f5858ebde66fb76e5fbd4 Mon Sep 17 00:00:00 2001 From: Andrew Cassidy Date: Thu, 16 Oct 2025 07:42:36 +0000 Subject: [PATCH] fix: use automatic IP detection instead of cache proxy host config value for internal cache server (#1088) The description for the `cache.host` config value is ``` # The IP or hostname (195.84.20.30 or example.com) to use when constructing # ACTIONS_CACHE_URL which is the URL of the cache proxy. ``` however the internal cache *server* was being started using that value, despite it clearly stating its for the *proxy*. While the address used to contact the cache proxy from the job is *usually* the same as the address for the cache proxy to contact the server, that is not the case with custom /etc/hosts entries, like what is used for the `host.containers.internal` address, which is needed for contacting the cache proxy on rootless podman (see #1075). Since the cache proxy and internal cache server are always running on the same host (or container), it's safe to use localhost for the server address instead. - bug fixes - [PR](https://code.forgejo.org/forgejo/runner/pulls/1088): fix: use automatic IP detection instead of cache proxy host config value for internal cache server Reviewed-on: https://code.forgejo.org/forgejo/runner/pulls/1088 Reviewed-by: Mathieu Fenniak Reviewed-by: Kwonunn Reviewed-by: Michael Kriese Co-authored-by: Andrew Cassidy Co-committed-by: Andrew Cassidy --- internal/app/run/runner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/app/run/runner.go b/internal/app/run/runner.go index 31a1b320..c709b462 100644 --- a/internal/app/run/runner.go +++ b/internal/app/run/runner.go @@ -117,7 +117,7 @@ func setupCache(cfg *config.Config, envs map[string]string) *cacheproxy.Handler cacheServer, err := artifactcache.StartHandler( cfg.Cache.Dir, - cfg.Cache.Host, + "", // automatically detect cfg.Cache.Port, cacheSecret, log.StandardLogger().WithField("module", "cache_request"),