Skip to content

Commit

Permalink
Make generate-secrets.sh cross platform compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelgbanks committed Nov 6, 2024
1 parent ea9a6e0 commit 1265b09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions generate-secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SALT_FILE="${PROGDIR}/secrets/DRUPAL_DEFAULT_SALT"
readonly SALT_FILE
if [ ! -f "${SALT_FILE}" ]; then
echo "Creating: ${SALT_FILE}" >&2
(grep -ao '[A-Za-z0-9_-]' </dev/urandom || true) | head -74 | tr -d '\n' >"${SALT_FILE}"
docker run --rm -i --entrypoint bash "${BASE_IMAGE}" -c "(grep -ao '[A-Za-z0-9_-]' </dev/urandom || true) | head -74 | tr -d '\n'" >"${SALT_FILE}"
fi

# Use openssl to generate certificates.
Expand Down Expand Up @@ -57,7 +57,7 @@ done < \
for secret in "${SECRETS[@]}"; do
if [ ! -f "${secret}" ]; then
echo "Creating: ${secret}" >&2
(grep -ao "${CHARACTERS}" </dev/urandom || true) | head "-${LENGTH}" | tr -d '\n' >"${secret}"
docker run --rm -i --entrypoint bash "${BASE_IMAGE}" -c "(grep -ao '${CHARACTERS}' </dev/urandom || true) | head '-${LENGTH}' | tr -d '\n'" >"${secret}"
fi
done

Expand Down

0 comments on commit 1265b09

Please sign in to comment.