diff --git a/README.md b/README.md index 6e92127..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,12 +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`. - -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`. 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:-}"