Files
sumoc-backend/entrypoint.sh
T
neuhauss cd07bf16cf
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good
add entrypoint script to decrypt secrets on application startup with key provided as env
2026-01-23 12:32:53 +01:00

16 lines
457 B
Bash

#!/bin/bash
# Decrypt secrets if key is provided
if [ -z "$FCM_DECRYPTION_KEY" ]; then
echo "No decryption key provided, skipping decryption."
else
echo "Decryption key provided, decrypting secrets..."
openssl enc -d -aes-256-cbc -pbkdf2 -in ./secrets/fcm-key.json.enc -out ./secrets/fcm-key.json -k "$FCM_DECRYPTION_KEY"
if [ $? -ne 0 ]; then
echo "Decryption failed!"
exit 1
fi
echo "Decryption successful."
fi
exec java -jar app.jar