Skip to content

Commit

Permalink
doc: uninstall cacher client based on tag
Browse files Browse the repository at this point in the history
For: #41
  • Loading branch information
ben-grande committed Mar 25, 2024
1 parent fb7db5d commit 084d08f
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions salt/sys-cacher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sudo qubesctl --skip-dom0 --targets=tpl-sys-cacher state.apply sys-cacher.instal
sudo qubesctl --skip-dom0 --targets=sys-cacher state.apply sys-cacher.configure
sudo qubesctl --skip-dom0 --targets=sys-cacher-browser state.apply sys-cacher.configure-browser
sudo qubesctl state.apply sys-cacher.appmenus,sys-cacher.tag
sudo qubesctl --skip-dom0 --templates state.apply sys-cacher.install-client
sudo qubesctl --skip-dom0 --targets="$(qvm-ls --no-spinner --raw-list --tags updatevm-sys-cacher | tr "\n" ",")" state.apply sys-cacher.install-client

This comment has been minimized.

Copy link
@gonzalo-bulnes

gonzalo-bulnes Mar 25, 2024

You know I like to avoid issuing qubesctl commands with targets defined explicitly, but as manual (semi-automatic) targetting goes, this is a neat way to make things less error-prone than manually listing qube names! Nice trade-off! 👍

This comment has been minimized.

Copy link
@ben-grande

ben-grande via email Mar 25, 2024

Author Owner

This comment has been minimized.

Copy link
@tlaurion

tlaurion Mar 28, 2024

@ben-grande Had to come back to history to make sure I used
sudo qubesctl --skip-dom0 --templates state.apply sys-cacher.uninstall-client to make my templates updatable again since I have still no success deploying sys-cacher correctly. Seems to be linked to 75 policy file which puts sy-whonix first which is the one being used unless I comment lines.

Not sure this change in doc helps, since state application sometimes fail for templates and tag is unset, resulting in tag not being present.

```
<!-- pkg:end:post-install -->

Expand Down Expand Up @@ -99,19 +99,22 @@ By default, only templates will use the proxy to update, if you want to cache
Non-TemplateVMs updates or simply make them functional again, the qube will
need the `service.updates-proxy-setup` feature set:
```sh
sudo qubesctl --skip-dom0 --targets=QUBE state.apply sys-cacher.install-client
qvm-tags add QUBE updatevm-sys-cacher
qvm-features QUBE service.updates-proxy-setup 1
sudo qubesctl --skip-dom0 --targets=QUBE state.apply sys-cacher.install-client
```
Don't forget to restart the qube.

If you don't want or can't restart the qube, such as DispVMs, where you would
lose the current session, run the above commands plus the following inside the
qube:
lose the current session:
```sh
sudo touch /var/run/qubes-service/updates-proxy-setup
sudo /usr/lib/qubes/update-proxy-configs
sudo systemctl restart qubes-updates-proxy-forwarder.socket
qvm-tags add QUBE updatevm-sys-cacher
qvm-features QUBE service.updates-proxy-setup 1
qvm-run --user=root QUBE -- "
touch /var/run/qubes-service/updates-proxy-setup
/usr/lib/qubes/update-proxy-configs
systemctl restart qubes-updates-proxy-forwarder.socket"
sudo qubesctl --skip-dom0 --targets=QUBE state.apply sys-cacher.install-client
```

### Rewrite URIs inside the qube
Expand All @@ -131,21 +134,22 @@ sudo apt-cacher-ng-repo uninstal
- Top:
```sh
sudo qubesctl top.enable sys-cacher.deinit
sudo qubesctl --templates state.apply
sudo qubesctl --targets="$(qvm-ls --no-spinner --raw-list --tags updatevm-sys-cacher | tr "\n" ",")" state.apply
sudo qubesctl top.disable sys-cacher.deinit
```

- State:
```sh
sudo qubesctl state.apply sys-cacher.remove-policy
sudo qubesctl --skip-dom0 --targets="$(qvm-ls --no-spinner --raw-list --tags updatevm-sys-cacher | tr "\n" ",")" state.apply sys-cacher.uninstall-client
sudo qubesctl state.apply sys-cacher.untag
sudo qubesctl --skip-dom0 --templates state.apply sys-cacher.uninstall-client
```

If you want to use the standard proxy for a few templates:
If you want to use the standard proxy for a few qubes, only uninstall it
from the templates that you don't want to cache packages:
```sh
sudo qubesctl --skip-dom0 --targets=TEMPLATE state.apply sys-cacher.uninstall-client
qvm-tags del TEMPLATE updatevm-sys-cacher
sudo qubesctl --skip-dom0 --targets=QUBE state.apply sys-cacher.uninstall-client
qvm-tags del QUBE updatevm-sys-cacher
```

## Credits
Expand Down

0 comments on commit 084d08f

Please sign in to comment.