2021-02-10 01:53:23 -05:00
|
|
|
This is a caching proxy, based on apt-cacher-ng.
|
2019-08-05 07:18:03 -04:00
|
|
|
|
2022-07-28 12:21:06 -04:00
|
|
|
Config files are included, which will work out of the box for Debian,Ubuntu,Arch, and Fedora.
|
2019-08-05 07:18:03 -04:00
|
|
|
The cache and log directories are bind-mounted in /rw in the cacher qube.
|
|
|
|
|
2021-02-10 01:53:23 -05:00
|
|
|
Copy directory to /srv/salt, then run:
|
2022-05-15 10:36:33 -04:00
|
|
|
qubesctl state.apply cacher.create
|
2021-02-10 01:53:23 -05:00
|
|
|
qubesctl --skip-dom0 --targets=template-cacher state.apply cacher.install
|
2019-08-05 07:18:03 -04:00
|
|
|
qubesctl --skip-dom0 --targets=cacher state.apply cacher.configure
|
|
|
|
|
2021-02-10 01:53:23 -05:00
|
|
|
To automatically use the proxy run:
|
|
|
|
qubesctl state.apply cacher.use
|
2022-08-19 06:47:13 -04:00
|
|
|
This will configure /etc/qubes/policy.d/30-user.policy to use the caching proxy by default.
|
2021-02-10 01:53:23 -05:00
|
|
|
|
|
|
|
apt-cacher-ng will cache HTTPS requests if you change https:// to http://HTTPS/// in repo source lists.
|
2022-08-19 06:47:13 -04:00
|
|
|
To configure all templates to use the proxy in this way, run:
|
|
|
|
qubesctl --skip-dom0 --templates state.apply cacher.change_templates
|
|
|
|
Or target individual templates, as you wish:
|
|
|
|
qubesctl --skip-dom0 --targets=TEMPLATE1,TEMPLATE2 state.apply cacher.change_templates
|
|
|
|
|
2019-08-05 07:18:03 -04:00
|
|
|
|
2021-02-10 01:53:23 -05:00
|
|
|
N.B
|
|
|
|
apt-cacher-ng works well for Debian,Ubuntu,and Arch.
|
2022-08-19 06:47:13 -04:00
|
|
|
It works reasonably well for Fedora, but may require further tweaking of the apt-cacher-ng control file, and the fedora_mirrors lists.
|
2022-07-28 12:21:06 -04:00
|
|
|
|
2022-08-19 06:47:13 -04:00
|
|
|
To restore a template to the default state, a state is provided, restore_templates.sls.
|
|
|
|
Apply it like this:
|
|
|
|
qubesctl --skip-dom0 --targets=TEMPLATE1,TEMPLATE2 state.apply cacher.restore_templates
|
2022-07-28 12:21:06 -04:00
|
|
|
|
2022-08-19 06:47:13 -04:00
|
|
|
The qrexec policy file at /etc/qubes/policy.d/30-user.policy should be edited so that these templates use the default system proxy.
|
2022-07-28 12:21:06 -04:00
|
|
|
|
|
|
|
|