-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into MERX-794-fix-broken-avatar
- Loading branch information
Showing
5 changed files
with
72 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"saleor-dashboard": patch | ||
--- | ||
|
||
You can now replace all environment variables instead of only API_URL in Docker and nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
|
||
# Replaces environment variables in the bundle's index.html file with their respective values. | ||
# This script is automatically picked up by the nginx entrypoint on startup. | ||
|
||
set -e | ||
|
||
INDEX_BUNDLE_PATH="/app/dashboard/index.html" | ||
|
||
# Function to replace environment variables | ||
replace_env_var() { | ||
var_name=$1 | ||
var_value=$(eval echo \$"$var_name") | ||
if [ -n "$var_value" ]; then | ||
echo "Setting $var_name to: $var_value" | ||
sed -i "s#$var_name: \".*\"#$var_name: \"$var_value\"#" "$INDEX_BUNDLE_PATH" | ||
else | ||
echo "No $var_name provided, using defaults." | ||
fi | ||
} | ||
|
||
# Replace each environment variable | ||
replace_env_var "API_URL" | ||
replace_env_var "APP_MOUNT_URI" | ||
replace_env_var "APPS_MARKETPLACE_API_URL" | ||
replace_env_var "APPS_TUNNEL_URL_KEYWORDS" | ||
replace_env_var "IS_CLOUD_INSTANCE" | ||
replace_env_var "LOCALE_CODE" | ||
|
||
echo "Environment variable replacement complete." |