Skip to content

Commit c5a5e14

Browse files
authored
Merge pull request omacom#8072 from basecamp/require-omarchy-repo-signatures
Require signed packages from the Omarchy repository
2 parents 9d02bb0 + e66c27f commit c5a5e14

4 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎default/pacman/pacman-edge.conf‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Include = /etc/pacman.d/mirrorlist
2626
Include = /etc/pacman.d/mirrorlist
2727

2828
[omarchy]
29-
SigLevel = Optional TrustAll
3029
Server = https://pkgs.omarchy.org/edge/$arch
3130

3231
# Repositories for debug symbol packages.

‎default/pacman/pacman-rc.conf‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ Include = /etc/pacman.d/mirrorlist
2626
Include = /etc/pacman.d/mirrorlist
2727

2828
[omarchy]
29-
SigLevel = Optional TrustAll
3029
Server = https://pkgs.omarchy.org/edge/$arch

‎default/pacman/pacman-stable.conf‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,4 @@ Include = /etc/pacman.d/mirrorlist
2626
Include = /etc/pacman.d/mirrorlist
2727

2828
[omarchy]
29-
SigLevel = Optional TrustAll
3029
Server = https://pkgs.omarchy.org/stable/$arch

‎migrations/1787589206.sh‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
echo "Require signed packages from the Omarchy repository"
2+
3+
# The [omarchy] repo predates the Omarchy packaging key, so existing installs
4+
# carry a SigLevel override that also accepts unsigned packages. Packages are
5+
# signed now, so drop the override and let the repo inherit the global
6+
# SigLevel = Required DatabaseOptional like every other repo. Machine-wide and
7+
# self-detecting, so another user's rerun no-ops.
8+
omarchy_sig_override='SigLevel = Optional TrustAll'
9+
10+
if [[ -f /etc/pacman.conf ]] &&
11+
sed -n '/^\[omarchy\]/,/^\[/p' /etc/pacman.conf | grep -qxF "$omarchy_sig_override"; then
12+
# Requiring signatures with an untrusted packaging key would fail every
13+
# omarchy transaction, including the one that could repair it.
14+
if omarchy-pkg-missing omarchy-keyring ||
15+
! sudo pacman-key --list-keys 40DFB630FF42BCFFB047046CF0134EE680CAC571 &>/dev/null; then
16+
omarchy-update-keyring
17+
fi
18+
19+
sudo sed -i "/^\[omarchy\]/,/^\[/{/^$omarchy_sig_override$/d}" /etc/pacman.conf
20+
fi

0 commit comments

Comments
 (0)