Gas Station Feature

This commit is contained in:
Eric Gullickson
2025-11-04 18:46:46 -06:00
parent d8d0ada83f
commit 5dc58d73b9
61 changed files with 12952 additions and 52 deletions

29
frontend/scripts/load-config.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/sh
# Load runtime configuration from secrets and generate config.js
# This script is called at container startup before nginx starts
set -e
SECRETS_DIR="${SECRETS_DIR:-/run/secrets}"
CONFIG_FILE="/usr/share/nginx/html/config.js"
GOOGLE_MAPS_API_KEY=""
# Try to read Google Maps API key from secret file
if [ -f "$SECRETS_DIR/google-maps-api-key" ]; then
GOOGLE_MAPS_API_KEY=$(cat "$SECRETS_DIR/google-maps-api-key")
echo "[Config] Loaded Google Maps API key from $SECRETS_DIR/google-maps-api-key"
else
echo "[Config] Warning: Google Maps API key not found at $SECRETS_DIR/google-maps-api-key"
GOOGLE_MAPS_API_KEY=""
fi
# Generate config.js
cat > "$CONFIG_FILE" <<EOF
window.CONFIG = {
googleMapsApiKey: '$GOOGLE_MAPS_API_KEY'
};
EOF
echo "[Config] Generated $CONFIG_FILE"
echo "[Config] Config contents:"
cat "$CONFIG_FILE"