Description
I've encountered a bug in Nango where the UI becomes dysfunctional when the CI
environment variable is set to false
. This issue arises when using Flightcontrol for deployments as it automatically sets this variable to false
.
I've identified 3 instances of the CI
environment variable within Nango's codebase. However, none of these instances involve a direct comparison of the variable's value. Instead, they merely check for its existence. This approach seems suboptimal, as it could lead to unintended consequences in certain scenarios (like a broken UI).
Steps to Reproduce:
- Create a Docker Compose file (see below) that sets the
CI
environment variable tofalse
for the Nango container. - Start the Nango container using the Docker Compose file (
docker-compose up
). - Access the Nango UI (http://localhost:3003).
# docker-compose.yaml
services:
nango-db:
container_name: nango-db
image: postgres:16
environment:
POSTGRES_USER: nango
POSTGRES_PASSWORD: nango
POSTGRES_DB: nango
nango-server:
container_name: nango-server
image: nangohq/nango-server:hosted
platform: linux/amd64
environment:
CI: false # That's breaking the UI
FLAG_AUTH_ENABLED: false
NANGO_DASHBOARD_USERNAME: nango
NANGO_DASHBOARD_PASSWORD: nango
NANGO_DATABASE_URL: postgres://nango:nango@nango-db:5432/nango
ports:
- 3003:3003
depends_on:
- nango-db
Expected Behavior:
The Nango UI should function normally regardless of the CI environment variable's value (or at least when it's set to anything but true
).
Actual Behavior:
The Nango UI displays errors and becomes unresponsive when CI
is set to false
.
Proposed Solution:
Implement a more robust check for the CI
environment variable, comparing its value to ensure correct behavior.