This repository has been archived on 2025-08-03. You can view files and clone it, but cannot push or open issues or pull requests.
snippets/secrets.tgz.aes/decrypt_secrets.sh
2020-10-24 10:58:51 +02:00

15 lines
362 B
Bash
Executable File

#!/bin/sh
if [ -z "${SECRETSKEY+x}" ]; then
echo "ENV[SECRETSKEY] not set! Continue without secrets..."
else
if [ -f /secrets/secrets.tgz.aes ]; then
cd /secrets \
&& openssl aes-256-cbc -in secrets.tgz.aes -out secrets.tgz -d -k "${SECRETSKEY}" \
&& tar xvzf secrets.tgz
else
echo "/secrets/secrets.tgz.aes not found!"
exit 1
fi
fi