mirror of
https://github.com/get-drexa/drive.git
synced 2026-02-02 12:01:17 +00:00
dev: configure GPG for non-interactive signing
Co-authored-by: Ona <no-reply@ona.com>
This commit is contained in:
@@ -108,18 +108,25 @@ if [ -n "$GPG_PRIVATE_KEY" ]; then
|
|||||||
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key "$KEY_ID" trust quit 2>/dev/null
|
echo -e "5\ny\n" | gpg --batch --command-fd 0 --expert --edit-key "$KEY_ID" trust quit 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure GPG agent for passphrase caching if passphrase is provided
|
# Configure GPG for non-interactive use
|
||||||
if [ -n "$GPG_PRIVATE_KEY_PASSPHRASE" ]; then
|
echo "Configuring GPG for non-interactive signing..."
|
||||||
echo "Configuring GPG agent for passphrase caching..."
|
|
||||||
mkdir -p ~/.gnupg
|
mkdir -p ~/.gnupg
|
||||||
|
chmod 700 ~/.gnupg
|
||||||
|
|
||||||
|
# Configure gpg.conf for loopback pinentry
|
||||||
|
cat > ~/.gnupg/gpg.conf << EOF
|
||||||
|
use-agent
|
||||||
|
pinentry-mode loopback
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Configure gpg-agent for passphrase caching
|
||||||
cat > ~/.gnupg/gpg-agent.conf << EOF
|
cat > ~/.gnupg/gpg-agent.conf << EOF
|
||||||
default-cache-ttl 28800
|
default-cache-ttl 28800
|
||||||
max-cache-ttl 28800
|
max-cache-ttl 28800
|
||||||
pinentry-program /usr/bin/pinentry-curses
|
allow-loopback-pinentry
|
||||||
EOF
|
EOF
|
||||||
# Restart GPG agent
|
# Restart GPG agent
|
||||||
gpg-connect-agent reloadagent /bye 2>/dev/null || true
|
gpg-connect-agent reloadagent /bye 2>/dev/null || true
|
||||||
fi
|
|
||||||
|
|
||||||
echo "GPG key setup complete!"
|
echo "GPG key setup complete!"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user