2023-11-13 09:33:28 -05:00
|
|
|
# qubes-builder
|
|
|
|
|
|
|
|
Setup Qubes OS Builder V2 in Qubes OS itself.
|
|
|
|
|
|
|
|
## Table of Contents
|
|
|
|
|
|
|
|
* [Description](#description)
|
|
|
|
* [Installation](#installation)
|
|
|
|
* [Access Control](#access-control)
|
|
|
|
* [Usage](#usage)
|
2024-01-08 14:08:54 -05:00
|
|
|
* [Builder configuration](#builder-configuration)
|
|
|
|
* [Update repository safely](#update-repository-safely)
|
2023-11-13 09:33:28 -05:00
|
|
|
|
|
|
|
## Description
|
|
|
|
|
|
|
|
Setup a Builder qube named "qubes-builder" and a disposable template for Qubes
|
|
|
|
Executor named "dvm-qubes-builder". It is possible to use any of the available
|
|
|
|
executors: docker, podman, qubes-executor.
|
|
|
|
|
|
|
|
During installation, after cloning the qubes-builderv2 repository, signatures
|
|
|
|
will be verified and the installation will fail if the signatures couldn't be
|
|
|
|
verified. Packages necessary for split operations such as split-gpg2, spit-git
|
|
|
|
and split-ssh-agent will also be installed.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
The template is based on Fedora Minimal and not Debian Minimal due to the
|
|
|
|
Qubes Executor lacking some dependencies on Debian such as
|
|
|
|
[mock](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1025460). Even if the
|
|
|
|
builder qube was Debian based, the executor qube still needs to be a Fedora
|
|
|
|
template.
|
|
|
|
|
|
|
|
- Top
|
|
|
|
```sh
|
|
|
|
qubesctl top.enable qubes-builder
|
|
|
|
qubesctl --targets=tpl-qubes-builder,dvm-qubes-builder,qubes-builder state.apply
|
|
|
|
qubesctl top.disable qubes-builder
|
|
|
|
```
|
|
|
|
|
|
|
|
- State
|
|
|
|
<!-- pkg:begin:post-install -->
|
|
|
|
```sh
|
|
|
|
qubesctl state.apply qubes-builder.create
|
|
|
|
qubesctl --skip-dom0 --targets=tpl-qubes-builder state.apply qubes-builder.install
|
|
|
|
qubesctl --skip-dom0 --targets=dvm-qubes-builder state.apply qubes-builder.configure-qubes-executor
|
|
|
|
qubesctl --skip-dom0 --targets=qubes-builder state.apply qubes-builder.configure
|
|
|
|
```
|
|
|
|
<!-- pkg:end:post-install -->
|
|
|
|
|
|
|
|
## Access Control
|
|
|
|
|
|
|
|
The policy is based on `qubes-builderv2/rpc/50-qubesbuilder.policy`.
|
2023-12-28 05:47:41 -05:00
|
|
|
Extra services added are `qubes.Gpg2`, `qusal.GitInit`, `qusal.GitFetch`,
|
2024-01-05 11:24:14 -05:00
|
|
|
`qusal.GitPush`, `qusal.SshAgent`. Necessary services are allowed to have an
|
|
|
|
unattended build.
|
2023-11-13 09:33:28 -05:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2024-01-08 14:08:54 -05:00
|
|
|
### Builder configuration
|
2023-11-13 09:33:28 -05:00
|
|
|
|
2023-12-28 06:26:37 -05:00
|
|
|
When using the Qubes Executor, configure the `builder.yml` `dispvm` option to
|
2023-11-13 09:33:28 -05:00
|
|
|
either `dom0` or `dvm-qubes-builder`:
|
|
|
|
```yaml
|
2024-01-08 14:08:54 -05:00
|
|
|
include:
|
|
|
|
- example-configs/desired-config.yml
|
|
|
|
|
2023-11-13 09:33:28 -05:00
|
|
|
executor:
|
|
|
|
type: qubes
|
|
|
|
options:
|
|
|
|
dispvm: "dom0"
|
|
|
|
#dispvm: "dvm-qubes-builder"
|
|
|
|
```
|
|
|
|
Setting the Disposable VM to Dom0 works because it will use the
|
|
|
|
`default_dispvm` preference of `qubes-builder`, which is `dvm-qubes-builder`.
|
|
|
|
|
2024-01-08 14:08:54 -05:00
|
|
|
### Update repository safely
|
|
|
|
|
|
|
|
If you need to pull new commits, set `GNUPGHOME` to
|
|
|
|
`/home/user/.gnupg/qubes-builder`, the provided gitconfig enforces signature
|
|
|
|
verification on git merges:
|
2023-12-28 06:26:37 -05:00
|
|
|
```sh
|
2024-01-07 14:20:54 -05:00
|
|
|
GNUPGHOME="$HOME/.gnupg/qubes-builder" git pull
|
2024-01-18 09:23:52 -05:00
|
|
|
Commit 7c37bb7 has a good GPG signature by Frederic Pierret (fepitre)
|
2024-01-07 14:20:54 -05:00
|
|
|
<frederic.pierret@qubes-os.org>
|
|
|
|
...
|
2023-12-28 06:26:37 -05:00
|
|
|
```
|