Automatic GPG creation on aptly deployment.

This commit is contained in:
2026-06-20 07:22:19 +00:00
parent 5c6f8f3a2b
commit 6e77c1ada5
4 changed files with 46 additions and 63 deletions

View File

@@ -18,6 +18,28 @@ spec:
seccompProfile:
type: RuntimeDefault
initContainers:
- name: init-gpg
image: urpylka/aptly:1.6.2
command:
- sh
- -c
- |
export GNUPGHOME=/opt/aptly/gpg
mkdir -p "$GNUPGHOME" /opt/aptly/public
chmod 700 "$GNUPGHOME"
if gpg --list-secret-keys 2>/dev/null | grep -q '^sec'; then
echo "GPG key already exists, skipping"
else
echo "Generating GPG signing key..."
printf '%%no-protection\nKey-Type: RSA\nKey-Length: 4096\nName-Real: Wild Cloud APT Repository\nName-Email: {{ .operatorEmail }}\nExpire-Date: 0\n%%commit\n' | gpg --batch --gen-key
echo "GPG key generated"
fi
gpg --export --armor > /opt/aptly/public/public.key
securityContext:
allowPrivilegeEscalation: false
volumeMounts:
- name: data
mountPath: /opt/aptly
- name: init-htpasswd
image: httpd:alpine
command: