packages/utils/cache-domains
Josef Schlehofer 52df6b74dc cache-domains: fix CI test with apk
The runtime test fails for all three variants on master:

  /ci/utils/cache-domains/pre-test.sh: line 21: opkg: not found

apk downloads through uclient-fetch too, so the libustream swap is still
needed. If the variant's libustream only comes in as a dependency,
removing the tested package purges it with /lib/libustream-ssl.so and
the next download fails. So add the variant with apk, which keeps it in
world, and run apk fix to put its file back if another variant
overwrote it. The opkg part is unchanged.

The generic test then fails on the version check, because
/usr/bin/cache-domains is a shell script that prints only its usage.
test-version.sh skips it.

Tested in the CI test container (aarch64_generic, main) with the
snapshot packages. All three variants pass, each with its own libustream
in place.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2026-11-04 15:24:51 +01:00
..
files
…
Makefile
…
README.md
…
pre-test.sh
…
test-version.sh
…

README.md

cache-domains

hotplug script to dynamically configure the local DNS (dnsmasq) to redirect game content servers to a LAN cache. Definitive list dynamically obtained from https://github.com/uklans/cache-domains.

Configuration

The configuration file (/etc/cache-domains.json) follows the same syntax as the upsteam file. The key for each cache_domains member matches the name of one of the .txt files in the upstream root directory, except for the default key which matches the all the unreferenced .txt files. The value of each cache_domains member maps to one of the keys of the ips members, Thus mapping a cached domain to a list of IP addresses/LAN cache server.

{
	"ips": {
		"server1":	["10.10.3.10", "10.10.3.11"],
		"server2":	"10.10.3.12",
		"server3":	"10.10.3.13"
	},
	"cache_domains": {
		"default":	"server1",
		"blizzard":	"server1",
		"origin":	"server1",
		"steam":	"server2",
		"wsus":		"server3",
		"xboxlive":	"server3"
	}
}

Configure/Cleanup

/usr/bin/cache-domains configure will configure the local DNS (dnsmasq) to redirect the configured cache domains. /usr/bin/cache-domains cleanup will cleanup redirection. The hotplug script calls /usr/bin/cache-domains configure when the WAN interface is brought up.

Testing

After configuring with the above example configuration, running nslookup lancache.steamcontent.com would return 10.10.3.12