-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: cacher: restrict install to supported clients
- Enforce uninstall in Fedora, it has been too problematic due to zchunk checksum mismatch errors; - Skip tagging and installing on unsupported qubes, before it tagged every template that did not have the tag 'whonix-updatevm', this is error prone as it would fail the installation on unsupported clients such as Gentoo, Mirage. Fixes: #54
- Loading branch information
1 parent
9cb7d72
commit bb4dcbb
Showing
11 changed files
with
136 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/sh | ||
|
||
# SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected]> | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
set -eu | ||
|
||
get_os_distro(){ | ||
distro_qube="${1}" | ||
os_distro="$(qvm-features "${distro_qube}" os-distribution || true)" | ||
} | ||
|
||
tagged="$(qvm-ls --no-spinner --raw-list --tags updatevm-sys-cacher | tr "\n" " ")" | ||
|
||
wanted="" | ||
for qube in ${tagged}; do | ||
get_os_distro "${qube}" | ||
case "${os_distro}" in | ||
debian|ubuntu|linuxmint|kali|kicksecure|arch) | ||
continue | ||
;; | ||
"") | ||
## AppVMs and DispVMs do not report the features, discover from | ||
## their templates. | ||
klass="$(qvm-prefs "${qube}" klass)" | ||
case "${klass}" in | ||
TemplateVM|StandaloneVM) | ||
## WARN: creates false positives in case qube never did an update to | ||
## report the OS ID, thus reporting both supported qubes that are | ||
## not updated yet and unsupported that didn't update yet also. | ||
wanted="${wanted:+"${wanted} "}${qube}" | ||
;; | ||
AppVM|DispVM) | ||
case "${klass}" in | ||
AppVM) | ||
template="$(qvm-prefs "${qube}" template)" | ||
;; | ||
DispVM) | ||
app="$(qvm-prefs "${qube}" template)" | ||
template="$(qvm-prefs "${app}" template)" | ||
;; | ||
esac | ||
get_os_distro "${template}" | ||
case "${os_distro}" in | ||
debian|ubuntu|linuxmint|kali|kicksecure|arch) | ||
continue | ||
;; | ||
## Qube is not supported. | ||
*) wanted="${wanted:+"${wanted} "}${qube}";; | ||
esac | ||
;; | ||
esac | ||
;; | ||
## Qube is not supported. | ||
*) wanted="${wanted:+"${wanted} "}${qube}";; | ||
esac | ||
done | ||
|
||
echo "${wanted}" | tr " " "\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. <[email protected]> | ||
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
base: | ||
'I@qubes:type:template and not P@nodename:host and not P@nodename:whonix.*': | ||
'I@qubes:type:template and ( ( G@os_family:Debian and not P@nodename:host and not P@nodename:whonix.* ) or G@os_family:Arch )': | ||
- match: compound | ||
- sys-cacher.install-client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{% set extraneous = salt['cmd.script']('salt://' ~ slsdotpath ~ '/files/admin/list-extra-tag.sh') -%} | ||
"{{ slsdotpath }}-list-extra-tag": | ||
cmd.run: | ||
- name: echo {{ extraneous.stdout.split("\n") }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{# | ||
SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected]> | ||
|
||
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
base: | ||
'dom0': | ||
- match: nodegroup | ||
- sys-cacher.list-extra-tag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,22 @@ SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. <[email protected] | |
SPDX-License-Identifier: AGPL-3.0-or-later | ||
#} | ||
|
||
{% if salt['cmd.shell']('command -v apt-cacher-ng-repo >/dev/null') -%} | ||
"{{ slsdotpath }}-install-client-scripts": | ||
file.recurse: | ||
- name: /usr/bin/ | ||
- source: salt://{{ slsdotpath }}/files/client/bin/ | ||
- file_mode: "0755" | ||
- group: root | ||
- user: root | ||
- makedirs: True | ||
|
||
"{{ slsdotpath }}-uninstall-client-repository-modifications": | ||
cmd.run: | ||
- require: | ||
- file: "{{ slsdotpath }}-install-client-scripts" | ||
- name: apt-cacher-ng-repo uninstall | ||
- stateful: True | ||
- runas: root | ||
{% endif -%} | ||
|
||
"{{ slsdotpath }}-uninstall-client-scripts": | ||
file.absent: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters