Skip to content

Commit

Permalink
Merge pull request #14 from danut13/PAN-1887-fix-signer-file-generation
Browse files Browse the repository at this point in the history
[PAN-1887] fix: check and generate the signare key correctly
  • Loading branch information
danut13 authored Jun 5, 2024
2 parents 8a4225d + e053152 commit 64e4497
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ services:
image: postgres:latest
restart: on-failure
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres"]
test: [ "CMD", "pg_isready", "-U", "postgres" ]
interval: 10s
timeout: 5s
retries: 5
Expand All @@ -113,7 +113,7 @@ services:
networks:
pantos-service-node:
healthcheck:
test: ["CMD", "rabbitmqctl", "status"]
test: [ "CMD", "rabbitmqctl", "status" ]
interval: 10s
timeout: 5s
retries: 5
Expand Down
22 changes: 12 additions & 10 deletions linux/debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,20 @@ else
fi

# Signer key
if [ ! -e "${signer_key_file}" || -z "$SIGNER_KEY_PASSWORD" ]; then
if [ ! command -v ssh-keygen ]; then
echo "ssh-keygen is not installed, please install the package with the recommended dependencies to generate the key"
exit 1
fi
echo "Signer key does not exist, generating new one"
read -s -p "Please enter your password for your pem file: " passwd
ssh-keygen -t ed25519 -f "$signer_key_file" -N "$passwd" >/dev/null 2>&1
echo "SIGNER_KEY_PASSWORD='$passwd'" >> ${env_file}
if [ ! -e ${signer_key_file} ] || [ -z ${SIGNER_KEY_PASSWORD} ]; then
# Check if ssh-keygen is installed
if command -v ssh-keygen &>/dev/null; then
echo "Signer key does not exist; generating a new one"
read -s -p "Please enter your password for your PEM file: " passwd
ssh-keygen -t ed25519 -f "$signer_key_file" -N "$passwd" >/dev/null 2>&1
echo "SIGNER_KEY_PASSWORD='$passwd'" >> "${env_file}"
else
echo -e "\033[1;32mssh-keygen is not installed, please reinstall the"\
"package with the recommended dependencies or make sure that the signer"\
"key is provided as an environment variable at run time\033[0m"
fi
fi


# Offchain bids
if [ ! -e "${offchain_bids_default_file}" ]; then
# if offchain bids default file does not exists, we add it, otherwise do nothing
Expand Down

0 comments on commit 64e4497

Please sign in to comment.