1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-19 23:28:39 +02:00
openwrt-packages/utils/cache-domains
Gerard Ryan 7dd26ee760 cache-domains: added pre-test.sh CI step
Some packages variants have conflicting dependencies with the
base packages and the CI test will fail to install before anything
can be done by the packages to setup the system for install.

This change adds a pre-test.sh that runs before the install so things
like the default libustream variant can be swapped out as shown in the
updated cache-domains.

Signed-off-by: Gerard Ryan <G.M0N3Y.2503@gmail.com>
2023-05-01 13:38:17 +03:00
..
files cache-domains: Fixed hotplug script not running 2022-03-08 21:55:31 -08:00
Makefile cache-domains: added pre-test.sh CI step 2023-05-01 13:38:17 +03:00
pre-test.sh cache-domains: added pre-test.sh CI step 2023-05-01 13:38:17 +03:00
README.md cache-domains: Fixed upstream changes + wolfssl 2020-09-10 22:22:15 +10:00

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