Skip to content

Commit

Permalink
Builder - standardise install.
Browse files Browse the repository at this point in the history
Use default netvm. Use sys-gpg for split gpg.
Set up rpmmacros for split-gpg
  • Loading branch information
NAME authored and NAME committed Aug 17, 2022
1 parent 5497693 commit 147c07e
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 26 deletions.
2 changes: 1 addition & 1 deletion builder/builder-split-gpg-config
Original file line number Diff line number Diff line change
@@ -1 +1 @@
gpg
sys-gpg
2 changes: 1 addition & 1 deletion builder/clone.top
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
base:
dom0:
- match: nodegroup
- build.clone
- builder.clone
6 changes: 3 additions & 3 deletions builder/config.sls
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/home/user/.gitconfig:
file.managed:
- source:
- salt://build/builder-gitconfig
- salt://builder/builder-gitconfig
- user: user
- group: user

/rw/config/gpg-split-domain:
file.managed:
- source:
- salt://build/builder-split-gpg-config
- salt://builder/builder-split-gpg-config
- user: root
- group: root

/home/user/.rpmmacros:
file.managed:
- source:
- salt://build/builder-rpmmacros
- salt://builder/rpmmacros
- user: user
- group: user

Expand Down
2 changes: 1 addition & 1 deletion builder/config.top
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
base:
builder:
- build.config
- builder.config
8 changes: 4 additions & 4 deletions builder/create.sls
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include:
- build.clone
- builder.clone

qvm-present-id:
qvm.present:
Expand All @@ -10,7 +10,6 @@ qvm-present-id:
qvm-prefs-id:
qvm.prefs:
- name: builder
- netvm: tor
- memory: 800
- maxmem: 8000
- vcpus: 4
Expand All @@ -26,5 +25,6 @@ qvm-features-id:

update_file:
file.prepend:
- name: /etc/qubes-rpc/policy/qubes.Gpg
- text: builder gpg allow
- name: /etc/qubes/policy.d/30-user.policy
- text: qubes.Gpg * builder sys-gpg allow
- makedirs: True
2 changes: 1 addition & 1 deletion builder/create.top
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
base:
dom0:
- match: nodegroup
- build.create
- builder.create
27 changes: 13 additions & 14 deletions builder/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@

{% if salt['qvm.exists']('cacher') %}

/etc/yum.repos.d/:
file.replace:
- names:
- /etc/yum.repos.d/fedora.repo
- /etc/yum.repos.d/fedora-updates.repo
- /etc/yum.repos.d/fedora-updates-testing.repo
- /etc/yum.repos.d/fedora-cisco-openh264.repo
- pattern: 'metalink=https://(.*)basearch'
- repl: 'metalink=http://HTTPS///\1basearch&protocol=http'
- flags: [ 'IGNORECASE', 'MULTILINE' ]

/etc/yum.repos.d/qubes-r4.repo:
{% for repo in salt['file.find']('/etc/yum.repos.d/', name='*repo*') %}
{{ repo }}_baseurl:
file.replace:
- name: {{ repo }}
- pattern: 'baseurl=https://'
- repl: 'baseurl=http://HTTPS///'
- flags: [ 'IGNORECASE', 'MULTILINE' ]
{{ repo }}_metalink:
file.replace:
- pattern: 'https://'
- repl: 'http://HTTPS///'
- name: {{ repo }}
- pattern: 'metalink=https://(.*)basearch'
- repl: 'metalink=http://HTTPS///\1basearch&protocol=http'
- flags: [ 'IGNORECASE', 'MULTILINE' ]

{% endfor %}
{% endif %}

install:
Expand Down Expand Up @@ -56,4 +54,5 @@ install:
- systemd-container
- texinfo
- wget
- vi
- zlib-devel
2 changes: 1 addition & 1 deletion builder/install.top
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

base:
template-builder:
- build.install
- builder.install
9 changes: 9 additions & 0 deletions builder/rpmmacros
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
%__gpg /usr/bin/qubes-gpg-client-wrapper

%__gpg_check_password_cmd %{__gpg} \
gpg --batch --no-verbose -u "%{_gpg_name}" -s

%__gpg_sign_cmd /bin/sh sh -c '/usr/bin/qubes-gpg-client-wrapper \\\
--batch --no-verbose \\\
%{?_gpg_digest_algo:--digest-algo %{_gpg_digest_algo}} \\\
-u "%{_gpg_name}" -sb %{__plaintext_filename} >%{__signature_filename}'

0 comments on commit 147c07e

Please sign in to comment.