automatically set signing keys to first available cert sha256 fingerprint if they aren't set when the script runs, warn user if this happens

This commit is contained in:
idk
2023-02-01 23:08:16 +00:00
parent 15dfb338b5
commit df31d1e67a
2 changed files with 24 additions and 21 deletions

View File

@ -26,24 +26,31 @@ if [ "$JAVA" -lt "16" ]; then
exit 1
fi
if [ -z "${I2P_SIGNER}" ]; then
echo "I2P_SIGNER variable not set, can't sign. Script will terminate after unsigned app-image generation"
fi
if [ -z ${I2P_VERSION} ]; then
echo "I2P_VERSION not set, aborting"
exit 1
fi
if [ -z ${I2P_BUILD_NUMBER} ]; then
echo "please set the I2P_BUILD_NUMBER variable to some integer >= 1"
exit 1
fi
if [ -z ${JAVA_HOME} ]; then
JAVA_HOME=$(/usr/libexec/java_home)
fi
if [ -z "$I2P_SIGNER" ]; then
I2P_SIGNER=$(security find-identity -v -p codesigning | cut -d ' ' -f 3)
echo "Warning: using automatically configured signer ID, make sure this is the one you want: $I2P_SIGNER"
echo "continuing in 10 seconds"
sleep 10s
fi
if [ -z "$I2P_CODE_SIGNER" ]; then
I2P_CODE_SIGNER=$(security find-identity -v -p codesigning | cut -d ' ' -f 3)
echo "Warning: using automatically configured signer ID, make sure this is the one you want: $I2P_CODE_SIGNER"
echo "continuing in 10 seconds"
sleep 10s
fi
if [ -z "$I2P_SIGNER_USERPHRASE" ]; then
I2P_SIGNER_USERPHRASE=$(security find-identity -v -p codesigning | cut -d ' ' -f 3)
echo "Warning: using automatically configured signer ID, make sure this is the one you want: $I2P_SIGNER_USERPHRASE"
echo "continuing in 10 seconds"
sleep 10s
fi
echo "JAVA_HOME is $JAVA_HOME"
echo "cleaning"

View File

@ -13,19 +13,13 @@
# Uncomment/Edit this line to include the build number in the config file
# I2P_BUILD_NUMBER=1
if [ -z $I2P_VERSION ]; then
I2P_VERSION=2.1.0
fi
if [ -z $I2P_BUILD_NUMBER ]; then
I2P_BUILD_NUMBER=1
fi
if [ -z $I2P_SIGNER ]; then
# This is the team ID of the Apple account associated with the app. It is used to sign the DMG.
# it is a unique ID which is a short, random-looking string.
# OR
# the sha256 fingerprint of the cert(recommended)
echo "I2P_SIGNER not set, signing will not work"
I2P_SIGNER=$(security find-identity -v -p codesigning | cut -d ' ' -f 3)
fi
if [ -z $I2P_CODE_SIGNER ]; then
# This is the code signing ID of the team associated with the Apple Account. it is used to sign the libraries.
@ -33,6 +27,7 @@ if [ -z $I2P_CODE_SIGNER ]; then
# OR
# the sha256 fingerprint of the cert(recommended)
echo "I2P_CODE_SIGNER not set, signing will not work"
I2P_CODE_SIGNER_USERPHRASE=$(security find-identity -v -p codesigning | cut -d ' ' -f 3)
fi
if [ -z "$I2P_SIGNER_USERPHRASE" ]; then
# This is an the phrase identifying the third party developer(I2P) in the following form:
@ -40,5 +35,6 @@ if [ -z "$I2P_SIGNER_USERPHRASE" ]; then
# OR
# the sha256 fingerprint of the cert(recommended)
echo "I2P_SIGNER_USERPHRASE not set, signing will not work"
I2P_SIGNER_USERPHRASE=$(security find-identity -v -p codesigning | cut -d ' ' -f 3)
fi