Compare commits

...

2 Commits

Author SHA1 Message Date
Manus AI
d50d3ab98b fix: Update comments to reflect updating existing environment files
The console/environments directory and .env files already exist in the
repository. The install script overwrites these existing files with
the correct configuration values. Updated comments to say 'Update'
instead of 'Write/Create' and removed unnecessary mkdir -p command.
2026-02-23 01:06:44 -05:00
Manus AI
7d3b6ed18f fix: Update install script to create console environment files
This commit updates the docker-install.sh script to create/update the
console environment files (.env.development and .env.production) before
starting Docker containers.

## Changes

- Added section 6b to create console/environments directory
- Create .env.development with HTTP configuration
- Create .env.production with HTTPS configuration
- Both files include API_HOST, SOCKETCLUSTER settings, and OSRM_HOST
- Production file includes API_SECURE=true flag

## Rationale

Production builds no longer use fleetbase.config.json for runtime
configuration. Instead, they rely on .env.production files that are
baked into the build at compile time. This ensures proper configuration
for both development and production environments.

## Files Created

1. console/environments/.env.development
   - HTTP API endpoint (http://<host>:8000)
   - SOCKETCLUSTER_SECURE=false
   - Uses provided host value

2. console/environments/.env.production
   - HTTPS API endpoint (https://<host>:8000)
   - SOCKETCLUSTER_SECURE=true
   - API_SECURE=true
   - Uses provided host value

## Impact

This ensures that when users run `ember build --environment=production`,
the compiled assets have the correct API endpoints and SocketCluster
configuration embedded, rather than relying on runtime configuration
which is only available in development mode.

## Related

This change mirrors the update made to the CLI install-fleetbase command
in fleetbase/fleetbase-cli PR #3.
2026-02-22 21:00:39 -05:00

View File

@@ -96,7 +96,7 @@ else
fi
###############################################################################
# 6. Write console/fleetbase.config.json atomically
# 6. Write console/fleetbase.config.json atomically (for development runtime)
###############################################################################
CONFIG_DIR="console"
CONFIG_PATH="$CONFIG_DIR/fleetbase.config.json"
@@ -113,6 +113,36 @@ JSON
mv -f "${CONFIG_PATH}.tmp" "$CONFIG_PATH"
echo "$CONFIG_PATH updated"
###############################################################################
# 6b. Update console environment files (.env.development and .env.production)
###############################################################################
ENV_DIR="$CONFIG_DIR/environments"
# Update .env.development
cat > "$ENV_DIR/.env.development" <<ENV_DEV
API_HOST=http://$HOST:8000
API_NAMESPACE=int/v1
SOCKETCLUSTER_PATH=/socketcluster/
SOCKETCLUSTER_HOST=$HOST
SOCKETCLUSTER_SECURE=false
SOCKETCLUSTER_PORT=38000
OSRM_HOST=https://router.project-osrm.org
ENV_DEV
# Update .env.production
cat > "$ENV_DIR/.env.production" <<ENV_PROD
API_HOST=https://$HOST:8000
API_NAMESPACE=int/v1
API_SECURE=true
SOCKETCLUSTER_PATH=/socketcluster/
SOCKETCLUSTER_HOST=$HOST
SOCKETCLUSTER_SECURE=true
SOCKETCLUSTER_PORT=38000
OSRM_HOST=https://router.project-osrm.org
ENV_PROD
echo "✔ Console environment files updated"
###############################################################################
# 7. Start stack, wait for DB, then run deploy
###############################################################################