Automatic GPG creation on aptly deployment.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user