import: Support env var to override gpg keyring

By default there is a fixed keyring in /usr or /etc. But when running
systemd-pull unprivileged in the user context or with a custom transfer
definition as in systemd-sysupdate --definitions=./... (e.g., for local
ParticleOS updates) it is limiting to require that all keys have to be
part of the OS keyring or otherwise no verification can be used. Also,
for testing it is valuable to point it at a different keyring.
Add a SYSTEMD_OPENPGP_KEYRING env var where the omission or empty
assignment sticks to the current behavior of the global OS keyrings but
a keyring path given will take precedence. While an env var can leak
down the process tree and is more difficult to secure for being the
trust anchor the advantage is that one can directly specify it in the
service unit as drop-in instead of having to patch the command
invocation. Anyway it's a niche use case and thus not part of the man
page.
This commit is contained in:
Kai Lüke
2026-07-01 22:00:48 +09:00
parent 8b8d819944
commit e50f4b7387
2 changed files with 23 additions and 3 deletions
+10
View File
@@ -508,6 +508,16 @@ is suppressed by default.
operation. If not set, defaults to true. If disabled installation of images
will be quicker, but not as safe.
`systemd-importd`/`systemd-pull` and `systemd-sysupdate`:
* `$SYSTEMD_OPENPGP_KEYRING` — takes an absolute path to an OpenPGP keyring
file. If set and non-empty, signature verification on download uses this
keyring instead of the default `/etc/systemd/import-pubring.pgp` and
`/usr/lib/systemd/import-pubring.pgp` keyrings.
Useful when running unprivileged in the user context, with custom transfer
definitions (e.g. `systemd-sysupdate --definitions=…`), or for testing.
Has no effect when signature verification is disabled.
`systemd-dissect`, `systemd-nspawn` and all other tools that may operate on
disk images with `--image=` or similar: