From 4927fd8dd636635c990eab9f29cde40be264dc05 Mon Sep 17 00:00:00 2001 From: Ro Date: Tue, 14 Feb 2023 12:55:48 -0800 Subject: [PATCH 1/3] Support multiple git url formats in common.sh --- scripts/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/common.sh b/scripts/common.sh index a305346..b2bbc5c 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -1,6 +1,6 @@ TOPLEVEL=$(git rev-parse --show-toplevel) export TOPLEVEL -PROJECT=$(git remote get-url origin | sed -e 's,.*/\(.*\)\.git,\1,') +PROJECT=$(git remote get-url origin | xargs basename -s .git) export PROJECT OCI_RUN_ARGUMENTS="${OCI_RUN_ARGUMENTS:-}" From e36831f4c902e26d2ff6dd5902c5d7e7857f2aeb Mon Sep 17 00:00:00 2001 From: Ro Date: Tue, 14 Feb 2023 12:56:08 -0800 Subject: [PATCH 2/3] Add Docker/Podman note to README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 6e92127..0709e8a 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ To run the notifier that pops up if `/proc/uptime` (how long the system has been ## Developer environment Install the following packages in Debian Bullseye: `make`, `python3-venv`, `xvfb` and `python3-pyqt5`. +For non-Fedora-based systems, ensure Docker or Podman is installed. The updater build process will default to Podman if both are installed. To run the preflight updater outside of `dom0`: From 65e4a23668e097de499e62856bf0db3113833129 Mon Sep 17 00:00:00 2001 From: Michael Z Date: Wed, 15 Feb 2023 17:55:51 +0100 Subject: [PATCH 3/3] Adding more detail to the development environment instructions --- README.md | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 0709e8a..d268121 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ The Updater ensures that the [SecureDrop Workstation](https://github.com/freedom Qubes 4.1.1 uses an end-of-life Fedora template in dom0 (fedora-32). See rationale here: https://www.qubes-os.org/doc/supported-releases/#note-on-dom0-and-eol. -To run the preflight updater: +If you installed SecureDrop Updater on your Qubes machine's `dom0`, you can run the updater like this: 1. Open a `dom0` terminal 2. Run `sdw-updater --skip-delta 0` @@ -16,13 +16,26 @@ To run the notifier that pops up if `/proc/uptime` (how long the system has been ## Developer environment -Install the following packages in Debian Bullseye: `make`, `python3-venv`, `xvfb` and `python3-pyqt5`. -For non-Fedora-based systems, ensure Docker or Podman is installed. The updater build process will default to Podman if both are installed. - -To run the preflight updater outside of `dom0`: - -1. `sudo apt install make python3-venv python3-pyqt5` -2. Set up your virtual environment by running `make venv && source .venv/bin/activate` -3. Now you can run the updater: `./files/sdw-updater` (it won't actually update VMs unless you are in `dom0`) -4. You can also run the notifier: `./files/sdw-notify` -5. And, finally, tests and linters by running: `sudo apt install xvfb`, then `make check` +Because `securedrop-updater` is used exclusively with Fedora 32 (see above), it follows that we target Python 3.8. To make development for this target more accessible, we use a containerized build and test environment. Here are the instructions to set it up: + +- Install dependencies for building and testing: + - `make` + - Podman (default) or Docker (or Docker compatible drop-in) +- Install dependencies for development: + - `Python 3.8` (default) or any other version of Python 3 + - (If you're on Debian/Ubuntu) `apt install python3-venv` +- Set up the virtual environment: + - Run `make venv && source .venv/bin/activate` - it will automatically create a virtual environment with `python3.8` if it is available on your machine. Otherwise, it will use your systems default Python interpreter. + - If used your systems default Python interpreter, install PyQt5: + - (On Debian/Ubuntu) `apt install python3-pyqt5` + - (On Fedora) `dnf install python3-qt5` + - If you used an alternative Python interpreter to create your virtual environment, install PyQt5 from PyPi: + - `pip install PyQt5==5.14.2` + +After installing the development dependencies: + +1. You can run the updater: `./files/sdw-updater` (it won't actually update VMs unless you are in `dom0`) +2. You can also run the notifier: `./files/sdw-notify` +3. And, finally, tests and linters by running: `make check`. + +For more `make` targets, please refer to `make help`.