From cbf61e674e28aad49fa2a0063c035f554812285c Mon Sep 17 00:00:00 2001 From: Ben Grande Date: Fri, 24 May 2024 13:53:17 +0200 Subject: [PATCH] feat: add Firefox browser from Mozilla repository --- salt/browser/README.md | 11 ++++++++++- salt/browser/create.sls | 9 ++++++--- salt/browser/files/repo/mozilla.asc | 19 +++++++++++++++++++ salt/browser/files/repo/mozilla.list | 2 ++ salt/browser/files/repo/mozilla.sources | 6 ++++++ salt/browser/install-firefox-esr.sls | 21 +++++++++++++++++++++ salt/browser/install-firefox-esr.top | 9 +++++++++ salt/browser/install-firefox-repo.sls | 12 ++++++++++++ salt/browser/install-firefox-repo.top | 9 +++++++++ salt/browser/install-firefox.sls | 5 ++--- salt/browser/install-firefox.top | 2 +- salt/utils/macros/install-repo.sls | 2 +- 12 files changed, 98 insertions(+), 9 deletions(-) create mode 100644 salt/browser/files/repo/mozilla.asc create mode 100644 salt/browser/files/repo/mozilla.list create mode 100644 salt/browser/files/repo/mozilla.sources create mode 100644 salt/browser/install-firefox-esr.sls create mode 100644 salt/browser/install-firefox-esr.top create mode 100644 salt/browser/install-firefox-repo.sls create mode 100644 salt/browser/install-firefox-repo.top diff --git a/salt/browser/README.md b/salt/browser/README.md index 3bf806c..f01877f 100644 --- a/salt/browser/README.md +++ b/salt/browser/README.md @@ -48,18 +48,27 @@ to install: ```sh sudo qubesctl --skip-dom0 --targets=tpl-browser state.apply browser.install-chromium ``` + - Chrome: ```sh sudo qubesctl --skip-dom0 --targets=tpl-browser state.apply browser.install-chrome ``` -- Firefox-ESR: + +- Firefox: ```sh sudo qubesctl --skip-dom0 --targets=tpl-browser state.apply browser.install-firefox ``` + +- Firefox-ESR: +```sh +sudo qubesctl --skip-dom0 --targets=tpl-browser state.apply browser.install-firefox-esr +``` + - W3M: ```sh sudo qubesctl --skip-dom0 --targets=tpl-browser state.apply browser.install-w3m ``` + - Lynx: ```sh sudo qubesctl --skip-dom0 --targets=tpl-browser state.apply browser.install-lynx diff --git a/salt/browser/create.sls b/salt/browser/create.sls index 31ce4f0..4f49117 100644 --- a/salt/browser/create.sls +++ b/salt/browser/create.sls @@ -20,8 +20,11 @@ prefs: - maxmem: 2000 features: - set: - - default-menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop" - - menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop" + - default-menu-items: "firefox.desktop firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop qubes-start.desktop" # noqa: 204 + - menu-items: "firefox.desktop firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop hqubes-start.desktop" # noqa: 204 +- disable: + - service.tracker + - service.evolution-data-server {%- endload %} {{ load(defaults) }} @@ -49,6 +52,6 @@ features: - service.tracker - service.evolution-data-server - set: - - menu-items: "firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-start.desktop" + - menu-items: "firefox.desktop firefox-esr.desktop chromium.desktop google-chrome.desktop qubes-run-terminal.desktop qubes-open-file-manager.desktop qubes-start.desktop" # noqa: 204 {%- endload %} {{ load(defaults) }} diff --git a/salt/browser/files/repo/mozilla.asc b/salt/browser/files/repo/mozilla.asc new file mode 100644 index 0000000..a8236db --- /dev/null +++ b/salt/browser/files/repo/mozilla.asc @@ -0,0 +1,19 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +xsBNBGCRt7MBCADkYJHHQQoL6tKrW/LbmfR9ljz7ib2aWno4JO3VKQvLwjyUMPpq +/SXXMOnx8jXwgWizpPxQYDRJ0SQXS9ULJ1hXRL/OgMnZAYvYDeV2jBnKsAIEdiG/ +e1qm8P4W9qpWJc+hNq7FOT13RzGWRx57SdLWSXo0KeY38r9lvjjOmT/cuOcmjwlD +T9XYf/RSO+yJ/AsyMdAr+ZbDeQUd9HYJiPdI04lGaGM02MjDMnx+monc+y54t+Z+ +ry1WtQdzoQt9dHlIPlV1tR+xV5DHHsejCZxu9TWzzSlL5wfBBeEz7R/OIzivGJpW +QdJzd+2QDXSRg9q2XYWP5ZVtSgjVVJjNlb6ZABEBAAHNVEFydGlmYWN0IFJlZ2lz +dHJ5IFJlcG9zaXRvcnkgU2lnbmVyIDxhcnRpZmFjdC1yZWdpc3RyeS1yZXBvc2l0 +b3J5LXNpZ25lckBnb29nbGUuY29tPsLAjgQTAQoAOBYhBDW6oLM+nrOW9ZyoOMC6 +XObcYxWjBQJgkbezAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEMC6XObc +YxWj+igIAMFh6DrAYMeq9sbZ1ZG6oAMrinUheGQbEqe76nIDQNsZnhDwZ2wWqgVC +7DgOMqlhQmOmzm7M6Nzmq2dvPwq3xC2OeI9fQyzjT72deBTzLP7PJok9PJFOMdLf +ILSsUnmMsheQt4DUO0jYAX2KUuWOIXXJaZ319QyoRNBPYa5qz7qXS7wHLOY89IDq +fHt6Aud8ER5zhyOyhytcYMeaGC1g1IKWmgewnhEq02FantMJGlmmFi2eA0EPD02G +C3742QGqRxLwjWsm5/TpyuU24EYKRGCRm7QdVIo3ugFSetKrn0byOxWGBvtu4fH8 +XWvZkRT+u+yzH1s5yFYBqc2JTrrJvRU= +=QnvN +-----END PGP PUBLIC KEY BLOCK----- \ No newline at end of file diff --git a/salt/browser/files/repo/mozilla.list b/salt/browser/files/repo/mozilla.list new file mode 100644 index 0000000..c97050b --- /dev/null +++ b/salt/browser/files/repo/mozilla.list @@ -0,0 +1,2 @@ +deb [signed-by=/usr/share/keyrings/mozilla.asc] https://packages.mozilla.org/apt mozilla main +# vim:ft=debsources diff --git a/salt/browser/files/repo/mozilla.sources b/salt/browser/files/repo/mozilla.sources new file mode 100644 index 0000000..593a7ee --- /dev/null +++ b/salt/browser/files/repo/mozilla.sources @@ -0,0 +1,6 @@ +Types: deb +URIs: https://packages.mozilla.org/apt +Suites: mozilla +Components: main +Signed-by: /usr/share/keyrings/mozilla.asc +# vim:ft=debsources diff --git a/salt/browser/install-firefox-esr.sls b/salt/browser/install-firefox-esr.sls new file mode 100644 index 0000000..8f81c10 --- /dev/null +++ b/salt/browser/install-firefox-esr.sls @@ -0,0 +1,21 @@ +{# +SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{% if grains['nodename'] != 'dom0' -%} + +include: + - .install-common + +"{{ slsdotpath }}-installed-firefox-esr": + pkg.installed: + - require: + - sls: {{ slsdotpath }}.install-common + - install_recommends: False + - skip_suggestions: True + - pkgs: + - firefox-esr + +{% endif -%} diff --git a/salt/browser/install-firefox-esr.top b/salt/browser/install-firefox-esr.top new file mode 100644 index 0000000..4c2accc --- /dev/null +++ b/salt/browser/install-firefox-esr.top @@ -0,0 +1,9 @@ +{# +SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'tpl-browser': + - browser.install-firefox-esr diff --git a/salt/browser/install-firefox-repo.sls b/salt/browser/install-firefox-repo.sls new file mode 100644 index 0000000..2af7b29 --- /dev/null +++ b/salt/browser/install-firefox-repo.sls @@ -0,0 +1,12 @@ +{# +SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +{% if grains['nodename'] != 'dom0' -%} + +{% from 'utils/macros/install-repo.sls' import install_repo -%} +{{ install_repo(sls_path, 'mozilla') }} + +{% endif -%} diff --git a/salt/browser/install-firefox-repo.top b/salt/browser/install-firefox-repo.top new file mode 100644 index 0000000..6919505 --- /dev/null +++ b/salt/browser/install-firefox-repo.top @@ -0,0 +1,9 @@ +{# +SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. + +SPDX-License-Identifier: AGPL-3.0-or-later +#} + +base: + 'tpl-browser': + - browser.install-firefox-repo diff --git a/salt/browser/install-firefox.sls b/salt/browser/install-firefox.sls index 37182a7..80b25f9 100644 --- a/salt/browser/install-firefox.sls +++ b/salt/browser/install-firefox.sls @@ -7,15 +7,14 @@ SPDX-License-Identifier: AGPL-3.0-or-later {% if grains['nodename'] != 'dom0' -%} include: + - .install-firefox-repo - .install-common "{{ slsdotpath }}-installed-firefox": pkg.installed: - - require: - - sls: {{ slsdotpath }}.install-common - install_recommends: False - skip_suggestions: True - pkgs: - - firefox-esr + - firefox {% endif -%} diff --git a/salt/browser/install-firefox.top b/salt/browser/install-firefox.top index 4aa5167..fa01450 100644 --- a/salt/browser/install-firefox.top +++ b/salt/browser/install-firefox.top @@ -1,5 +1,5 @@ {# -SPDX-FileCopyrightText: 2023 Benjamin Grande M. S. +SPDX-FileCopyrightText: 2023 - 2024 Benjamin Grande M. S. SPDX-License-Identifier: AGPL-3.0-or-later #} diff --git a/salt/utils/macros/install-repo.sls b/salt/utils/macros/install-repo.sls index 379ed77..271379b 100644 --- a/salt/utils/macros/install-repo.sls +++ b/salt/utils/macros/install-repo.sls @@ -81,7 +81,7 @@ If sls_path is 'browser', then this would install the repo from: {% endif -%} -{% if salt['cmd.shell']('command -v apt-cacher-ng-repo >/dev/null') -%} +{% if salt['cmd.retcode']('command -v apt-cacher-ng-repo >/dev/null') == 0 -%} "{{ name }}-run-apt-cacher-ng-repo": cmd.run: - name: apt-cacher-ng-repo