Skip to content

Commit

Permalink
Create templates for Google Cloud credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
0x326 committed Nov 16, 2020
1 parent 9499064 commit 994eee8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions env.example
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ JIGASI_PORT_MAX=20050
# section "Before you begin" paragraph 1 to 5
# Copy the values from the json to the related env vars
#GC_PROJECT_ID=
#GC_PRIVATE_KEY_ID=
#GC_PRIVATE_KEY=
# (See .secrets/GC_PRIVATE_KEY_ID.env for GC_PRIVATE_KEY_ID)
# (See .secrets/GC_PRIVATE_KEY.env for GC_PRIVATE_KEY)
#GC_CLIENT_EMAIL=
#GC_CLIENT_ID=
#GC_CLIENT_CERT_URL=
Expand Down
12 changes: 12 additions & 0 deletions gen-passwords.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,21 @@ GENERATED_ENV_VARIABLES=(
JWT_APP_SECRET
)

MANUAL_ENV_VARIABLES=(
GC_PRIVATE_KEY_ID
GC_PRIVATE_KEY
)

for ENV_VARIABLE in "${GENERATED_ENV_VARIABLES[@]}"; do
if [[ -e ".secrets/${ENV_VARIABLE}.env" ]]; then
mv ".secrets/${ENV_VARIABLE}.env" ".secrets/${ENV_VARIABLE}.env.bak"
fi
echo "${ENV_VARIABLE}=$(generatePassword)" > ".secrets/${ENV_VARIABLE}.env"
done

for ENV_VARIABLE in "${MANUAL_ENV_VARIABLES[@]}"; do
if [[ -e ".secrets/${ENV_VARIABLE}.env" ]]; then
mv ".secrets/${ENV_VARIABLE}.env" ".secrets/${ENV_VARIABLE}.env.bak"
fi
echo "${ENV_VARIABLE}=" > ".secrets/${ENV_VARIABLE}.env"
done

0 comments on commit 994eee8

Please sign in to comment.