Skip to content

Commit

Permalink
Add more Strapi-specific environment variables
Browse files Browse the repository at this point in the history
Fix #178
  • Loading branch information
akalipetis committed Oct 26, 2023
1 parent a8f19f1 commit 28fb60d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
12 changes: 10 additions & 2 deletions platformifier/templates/generic/.environment
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,22 @@ export CACHE_PASSWORD="$(echo $RELATIONSHIPS_JSON | jq -r '.{{ .Cache }}[0].pass
export CACHE_SCHEME="$(echo $RELATIONSHIPS_JSON | jq -r '.{{ .Cache }}[0].scheme')"
export CACHE_URL="${CACHE_SCHEME}://${CACHE_PASSWORD}@${CACHE_HOST}:${CACHE_PORT}"
{{- end -}}
{{- if eq .Cache "redis" }}
{{- if or (eq .Cache "redis") (eq .Cache "redis_persistent") }}

# Set Redis environment variables
export REDIS_URL="$CACHE_URL"
{{- end -}}
{{- if eq .Stack.Name "strapi" }}

# Strapi-specific environment variables
# Set Strapi-specific environment variables
export DATABASE_HOST="$DB_HOST"
export DATABASE_PORT="$DB_PORT"
export DATABASE_NAME="$DB_PATH"
export DATABASE_USERNAME="$DB_USERNAME"
export DATABASE_PASSWORD="$DB_PASSWORD"
export DATABASE_SCHEME="$DB_SCHEME"

export ADMIN_JWT_SECRET="${{ .Assets.EnvPrefix }}_PROJECT_ENTROPY"
export JWT_SECRET="${{ .Assets.EnvPrefix }}_PROJECT_ENTROPY"
export API_TOKEN_SALT="${{ .Assets.EnvPrefix }}_PROJECT_ENTROPY"
{{- end -}}
10 changes: 9 additions & 1 deletion platformifier/templates/upsun/.environment
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ export REDIS_URL="$CACHE_URL"
{{- end -}}
{{- if eq .Stack.Name "strapi" }}

# Strapi-specific environment variables
# Set Strapi-specific environment variables
export DATABASE_HOST="$DB_HOST"
export DATABASE_PORT="$DB_PORT"
export DATABASE_NAME="$DB_PATH"
export DATABASE_USERNAME="$DB_USERNAME"
export DATABASE_PASSWORD="$DB_PASSWORD"
export DATABASE_SCHEME="$DB_SCHEME"

export ADMIN_JWT_SECRET="${{ .Assets.EnvPrefix }}_PROJECT_ENTROPY"
export JWT_SECRET="${{ .Assets.EnvPrefix }}_PROJECT_ENTROPY"
export API_TOKEN_SALT="${{ .Assets.EnvPrefix }}_PROJECT_ENTROPY"
{{- end -}}

0 comments on commit 28fb60d

Please sign in to comment.