From a380aeb3b60435892c152c475e5955902e3b9f4e Mon Sep 17 00:00:00 2001
From: Ben Grande <ben.grande.b@gmail.com>
Date: Fri, 12 Jan 2024 17:30:29 +0100
Subject: [PATCH] fix: sys-cacher tag compliance with default tags

The default tags start with the capability than the qube name, such as
audiovm-dom0 and guivm-dom0.
---
 salt/sys-cacher/README.md                   | 6 +++---
 salt/sys-cacher/files/server/conf/acng.conf | 2 ++
 salt/sys-cacher/tag.sls                     | 2 +-
 salt/sys-cacher/untag.sls                   | 2 +-
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/salt/sys-cacher/README.md b/salt/sys-cacher/README.md
index b41b296..92efc49 100644
--- a/salt/sys-cacher/README.md
+++ b/salt/sys-cacher/README.md
@@ -20,7 +20,7 @@ packages, so that you need only download a package once for it to be used when
 updating many  The proxy is preconfigured to work out of the box
 for Debian, Ubuntu, Arch, and Fedora
 
-When you install this package, qubes will be tagged with "sys-cacher-updatevm"
+When you install this package, qubes will be tagged with "updatevm-sys-cacher"
 and they will be altered to use the proxy by default. When there is "https://"
 in your repository definitions, the entries will be changed in the templates
 from to "http://HTTPS///". This is so that the request to the proxy is plain
@@ -99,7 +99,7 @@ Non-TemplateVMs updates or simply make them functional again, the qube will
 need the `service.updates-proxy-setup` feature set:
 ```sh
 qubesctl --skip-dom0 --targets=QUBE state.apply sys-cacher.install-client
-qvm-tags add QUBE sys-cacher-updatevm
+qvm-tags add QUBE updatevm-sys-cacher
 qvm-features QUBE service.updates-proxy-setup 1
 ```
 Don't forget to restart the qube.
@@ -132,7 +132,7 @@ qubesctl --skip-dom0 --templates state.apply sys-cacher.uninstall-client
 If you want to use the standard proxy for a few templates:
 ```sh
 qubesctl --skip-dom0 --targets=TEMPLATE state.apply sys-cacher.uninstall-client
-qvm-tags del TEMPLATE sys-cacher-updatevm
+qvm-tags del TEMPLATE updatevm-sys-cacher
 ```
 
 ## Credits
diff --git a/salt/sys-cacher/files/server/conf/acng.conf b/salt/sys-cacher/files/server/conf/acng.conf
index 6078a0f..cec44ac 100644
--- a/salt/sys-cacher/files/server/conf/acng.conf
+++ b/salt/sys-cacher/files/server/conf/acng.conf
@@ -95,6 +95,8 @@ Remap-hashicorprep: https://apt.releases.hashicorp.com http://apt.releases.hashi
 Remap-launchpadrep: https://ppa.launchpad.net http://ppa.launchpad.net
 Remap-signalrep: https://updates.signal.org http://updates.signal.org
 Remap-syncthingrep: https://apt.syncthing.net
+Remap-whonixdebrep: https://deb.whonix.org http://deb.whonix.org
+Remap-kicksecuredebrep: https://deb.kicksecure.com http://deb.kicksecure.com
 
 # Virtual page accessible in a web browser to see statistics and status
 # information, i.e. under http://localhost:3142/acng-report.html
diff --git a/salt/sys-cacher/tag.sls b/salt/sys-cacher/tag.sls
index c60afcb..65e09fe 100644
--- a/salt/sys-cacher/tag.sls
+++ b/salt/sys-cacher/tag.sls
@@ -10,5 +10,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later
   qvm.tags:
     - name: {{ tpl }}
     - add:
-      - sys-cacher-updatevm
+      - updatevm-sys-cacher
 {% endfor -%}
diff --git a/salt/sys-cacher/untag.sls b/salt/sys-cacher/untag.sls
index ab93716..a0b576d 100644
--- a/salt/sys-cacher/untag.sls
+++ b/salt/sys-cacher/untag.sls
@@ -11,5 +11,5 @@ SPDX-License-Identifier: AGPL-3.0-or-later
   qvm.tags:
     - name: {{ tpl }}
     - del:
-      - sys-cacher-updatevm
+      - updatevm-sys-cacher
 {% endfor -%}