Skip to content

_⚠️ Potential issue_ | _🔴 Critical_ #29

@Neuro-Rift

Description

@Neuro-Rift

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find and examine the web-ui Dockerfile
find . -path "*docker/web-ui/Dockerfile*" -type f
echo "---"
# Search for the build args in the codebase
rg -n "NEURORIFT_BRIDGE_URL|OPENCLAW_WS_URL" --type-list | head -20
echo "---"
# Check the docker-compose.yml for context
rg -B 5 -A 2 "NEURORIFT_BRIDGE_URL|OPENCLAW_WS_URL" docker-compose.yml

Repository: demonking369/NeuroRift

Length of output: 1632


🏁 Script executed:

cat -n ./docker/web-ui/Dockerfile

Repository: demonking369/NeuroRift

Length of output: 1865


🏁 Script executed:

# Search for how these variables are used in the web-ui source code
find ./web-ui -type f \( -name "*.js" -o -name "*.jsx" -o -name "*.ts" -o -name "*.tsx" -o -name "*.json" \) | head -30
echo "---"
# Search for usage of these env vars in web-ui
rg "NEURORIFT_BRIDGE_URL|OPENCLAW_WS_URL" ./web-ui --type-list | head -5
echo "---"
rg "NEURORIFT_BRIDGE_URL|OPENCLAW_WS_URL" ./web-ui 2>/dev/null | head -20

Repository: demonking369/NeuroRift

Length of output: 1854


🏁 Script executed:

cat -n ./web-ui/next.config.js

Repository: demonking369/NeuroRift

Length of output: 1075


Build args are baked into the compiled Next.js application at build time.

NEURORIFT_BRIDGE_URL and OPENCLAW_WS_URL are used in next.config.js within the rewrites() function (lines 10–11), which executes during the npm run build step in the Dockerfile's builder stage. These values are compiled into the Next.js standalone output and cannot be overridden at runtime by environment variables. This prevents the web-ui from running outside Docker or in a different network context without rebuilding the image.

To make these configurable at runtime, the proxy routing should be moved from build-time configuration to a runtime mechanism that reads environment variables when requests are processed.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docker-compose.yml` around lines 128 - 129, The docker envs
NEURORIFT_BRIDGE_URL and OPENCLAW_WS_URL are being baked into the Next.js build
via next.config.js rewrites() (executed during npm run build), so make the proxy
routing dynamic at runtime: remove or revert the rewrites() entries that
reference those build-time envs and instead implement a runtime proxy that reads
process.env (or platform env) when handling requests — for example add a
lightweight proxy API route or middleware (e.g., /api/proxy or Next.js
middleware/edge function) that forwards requests to
process.env.NEURORIFT_BRIDGE_URL and process.env.OPENCLAW_WS_URL; update the
Dockerfile/compose to only set runtime envs and point the front-end to the
runtime proxy endpoints rather than embedding the URLs at build time.

Originally posted by @coderabbitai in #27 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions