Skip to content

Commit

Permalink
Update secrets list (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
asbiin authored Jan 20, 2022
1 parent 0ecf5b8 commit 885b025
Show file tree
Hide file tree
Showing 7 changed files with 79 additions and 55 deletions.
2 changes: 1 addition & 1 deletion apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.21; \
pecl install memcached-3.1.5; \
pecl install redis-5.3.5; \
pecl install redis-5.3.6; \
\
docker-php-ext-enable \
apcu \
Expand Down
32 changes: 19 additions & 13 deletions apache/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,28 @@
set -Eeo pipefail

# set environment variables with docker secrets in /run/secrets/*
supportedSecrets=( "DB_PASSWORD"
"APP_KEY"
"HASH_SALT"
"MAIL_PASSWORD"
"REDIS_PASSWORD"
"AWS_KEY"
"AWS_SECRET"
"PASSPORT_PASSWORD_GRANT_CLIENT_ID"
"PASSPORT_PASSWORD_GRANT_CLIENT_SECRET"
supportedSecrets=( "DB_PASSWORD"
"DATABASE_URL"
"APP_KEY"
"HASH_SALT"
"MAIL_PASSWORD"
"REDIS_PASSWORD"
"AWS_ACCESS_KEY_ID"
"AWS_SECRET_ACCESS_KEY"
"AWS_KEY"
"AWS_SECRET"
"PASSPORT_PASSWORD_GRANT_CLIENT_ID"
"PASSPORT_PASSWORD_GRANT_CLIENT_SECRET"
"SENTRY_AUTH_TOKEN"
"LOCATION_IQ_API_KEY"
"WEATHERAPI_KEY"
"IPDATA_TOKEN"
)
for secret in ${supportedSecrets[@]}; do

for secret in "${supportedSecrets[@]}"; do
envFile="${secret}_FILE"
if [ $(printenv ${envFile}) ]; then envFileName=`printenv ${envFile}`; fi
if [[ ${!envFile} && -f "$envFileName" ]]; then
val=`cat $envFileName`
if [ -n "${!envFile}" ] && [ -f "${!envFile}" ]; then
val="$(< "${!envFile}")"
export "${secret}"="$val"
echo "${secret} environment variable was set by secret ${envFile}"
fi
Expand Down
32 changes: 19 additions & 13 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,28 @@
set -Eeo pipefail

# set environment variables with docker secrets in /run/secrets/*
supportedSecrets=( "DB_PASSWORD"
"APP_KEY"
"HASH_SALT"
"MAIL_PASSWORD"
"REDIS_PASSWORD"
"AWS_KEY"
"AWS_SECRET"
"PASSPORT_PASSWORD_GRANT_CLIENT_ID"
"PASSPORT_PASSWORD_GRANT_CLIENT_SECRET"
supportedSecrets=( "DB_PASSWORD"
"DATABASE_URL"
"APP_KEY"
"HASH_SALT"
"MAIL_PASSWORD"
"REDIS_PASSWORD"
"AWS_ACCESS_KEY_ID"
"AWS_SECRET_ACCESS_KEY"
"AWS_KEY"
"AWS_SECRET"
"PASSPORT_PASSWORD_GRANT_CLIENT_ID"
"PASSPORT_PASSWORD_GRANT_CLIENT_SECRET"
"SENTRY_AUTH_TOKEN"
"LOCATION_IQ_API_KEY"
"WEATHERAPI_KEY"
"IPDATA_TOKEN"
)
for secret in ${supportedSecrets[@]}; do

for secret in "${supportedSecrets[@]}"; do
envFile="${secret}_FILE"
if [ $(printenv ${envFile}) ]; then envFileName=`printenv ${envFile}`; fi
if [[ ${!envFile} && -f "$envFileName" ]]; then
val=`cat $envFileName`
if [ -n "${!envFile}" ] && [ -f "${!envFile}" ]; then
val="$(< "${!envFile}")"
export "${secret}"="$val"
echo "${secret} environment variable was set by secret ${envFile}"
fi
Expand Down
2 changes: 1 addition & 1 deletion fpm-alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.21; \
pecl install memcached-3.1.5; \
pecl install redis-5.3.5; \
pecl install redis-5.3.6; \
\
docker-php-ext-enable \
apcu \
Expand Down
32 changes: 19 additions & 13 deletions fpm-alpine/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,28 @@
set -Eeo pipefail

# set environment variables with docker secrets in /run/secrets/*
supportedSecrets=( "DB_PASSWORD"
"APP_KEY"
"HASH_SALT"
"MAIL_PASSWORD"
"REDIS_PASSWORD"
"AWS_KEY"
"AWS_SECRET"
"PASSPORT_PASSWORD_GRANT_CLIENT_ID"
"PASSPORT_PASSWORD_GRANT_CLIENT_SECRET"
supportedSecrets=( "DB_PASSWORD"
"DATABASE_URL"
"APP_KEY"
"HASH_SALT"
"MAIL_PASSWORD"
"REDIS_PASSWORD"
"AWS_ACCESS_KEY_ID"
"AWS_SECRET_ACCESS_KEY"
"AWS_KEY"
"AWS_SECRET"
"PASSPORT_PASSWORD_GRANT_CLIENT_ID"
"PASSPORT_PASSWORD_GRANT_CLIENT_SECRET"
"SENTRY_AUTH_TOKEN"
"LOCATION_IQ_API_KEY"
"WEATHERAPI_KEY"
"IPDATA_TOKEN"
)
for secret in ${supportedSecrets[@]}; do

for secret in "${supportedSecrets[@]}"; do
envFile="${secret}_FILE"
if [ $(printenv ${envFile}) ]; then envFileName=`printenv ${envFile}`; fi
if [[ ${!envFile} && -f "$envFileName" ]]; then
val=`cat $envFileName`
if [ -n "${!envFile}" ] && [ -f "${!envFile}" ]; then
val="$(< "${!envFile}")"
export "${secret}"="$val"
echo "${secret} environment variable was set by secret ${envFile}"
fi
Expand Down
2 changes: 1 addition & 1 deletion fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ RUN set -ex; \
# pecl will claim success even if one install fails, so we need to perform each install separately
pecl install APCu-5.1.21; \
pecl install memcached-3.1.5; \
pecl install redis-5.3.5; \
pecl install redis-5.3.6; \
\
docker-php-ext-enable \
apcu \
Expand Down
32 changes: 19 additions & 13 deletions fpm/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,28 @@
set -Eeo pipefail

# set environment variables with docker secrets in /run/secrets/*
supportedSecrets=( "DB_PASSWORD"
"APP_KEY"
"HASH_SALT"
"MAIL_PASSWORD"
"REDIS_PASSWORD"
"AWS_KEY"
"AWS_SECRET"
"PASSPORT_PASSWORD_GRANT_CLIENT_ID"
"PASSPORT_PASSWORD_GRANT_CLIENT_SECRET"
supportedSecrets=( "DB_PASSWORD"
"DATABASE_URL"
"APP_KEY"
"HASH_SALT"
"MAIL_PASSWORD"
"REDIS_PASSWORD"
"AWS_ACCESS_KEY_ID"
"AWS_SECRET_ACCESS_KEY"
"AWS_KEY"
"AWS_SECRET"
"PASSPORT_PASSWORD_GRANT_CLIENT_ID"
"PASSPORT_PASSWORD_GRANT_CLIENT_SECRET"
"SENTRY_AUTH_TOKEN"
"LOCATION_IQ_API_KEY"
"WEATHERAPI_KEY"
"IPDATA_TOKEN"
)
for secret in ${supportedSecrets[@]}; do

for secret in "${supportedSecrets[@]}"; do
envFile="${secret}_FILE"
if [ $(printenv ${envFile}) ]; then envFileName=`printenv ${envFile}`; fi
if [[ ${!envFile} && -f "$envFileName" ]]; then
val=`cat $envFileName`
if [ -n "${!envFile}" ] && [ -f "${!envFile}" ]; then
val="$(< "${!envFile}")"
export "${secret}"="$val"
echo "${secret} environment variable was set by secret ${envFile}"
fi
Expand Down

0 comments on commit 885b025

Please sign in to comment.