Skip to content

fix(security): CodeQL #196 XSS + post-PR #865 dashboard - #866

Closed
POWERFULMOVES wants to merge 2 commits into
mainfrom
fix/post-865-validation
Closed

POWERFULMOVES wants to merge 2 commits into
mainfrom
fix/post-865-validation

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented Mar 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

Test plan

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Strengthened URL validation in the Chrome extension so only well-formed HTTP/HTTPS links are accepted, improving security and stability.
  • Documentation

    • Updated production audit/dashboard notes to reflect recent merges, resolved alerts, and post-merge status updates.
  • Tests

    • Expanded search window in supabase realtime smoke tests to reduce timing-related failures.
  • Chores

    • Adjusted host port binding for the realtime service in local configuration.

Strengthen URL sanitization in chrome-extension options.js from regex
to URL constructor with strict protocol allowlist (http:/https: only).
Update production audit dashboard with Supabase unification milestone
and CodeQL alert resolution status.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Replaced regex URL scheme check in the Chrome extension options with URL constructor validation and try/catch; updated production audit docs to reflect Supabase unification and CodeQL #196 sanitization; adjusted Supabase realtime host port mapping in docker-compose; widened test search window in two smoke tests.

Changes

Cohort / File(s) Summary
Chrome Extension URL Validation
pmoves/chrome-extension/options/options.js
Replaced inline regex check with URL constructor parsing; enforces http:/https: protocols and wraps href assignment in try/catch to skip invalid URLs.
Production Audit Documentation
pmoves/docs/PRODUCTION_AUDIT_DASHBOARD.md
Reworded and expanded "Latest Changes" to reflect post-PR #865 Supabase unification, CodeQL #196 URL sanitization, related fixes, and updated executive/status narratives.
Docker Compose: Supabase Realtime Port
pmoves/docker-compose.yml
Changed host-to-container port mapping for Supabase realtime from host port 4000 to 4010 (container port remains 4000).
Tests: Supabase Realtime Smoke
pmoves/tests/smoke/test_supabase_realtime_tenant.py
Extended grep_context search window in two tests (from after=30 to after=55) to broaden lookup area for JWT secret and healthcheck checks.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I nibble at links, sniff each scheme,
I parse with care, no broken dream.
Docs updated, ports gently shifted,
Tests stretched thin so checks are gifted.
A tidy hop — the code feels bright!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning Significant mismatch: PR addresses CodeQL #196 XSS/URL sanitization and post-PR #865 dashboard updates, but linked issue #196 describes adding cloudflared service with Makefile targets—an unrelated objective. Verify correct issue is linked. If CodeQL #196 is the actual target, update linked issues. If cloudflared is required, implement cloudflared service and Makefile targets per #196 objectives.
Out of Scope Changes check ❓ Inconclusive URL sanitization fix, dashboard documentation update, and docker-compose port remapping are in-scope. However, test window adjustments in smoke tests appear to support docker-compose changes rather than #196's stated cloudflared objectives. Clarify whether changes address CodeQL security issue or cloudflared service objective. If CodeQL-focused, document why docker-compose realtime port change is necessary and scope-appropriate.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed Title directly addresses the main change: CodeQL #196 security fix for URL sanitization and post-PR #865 dashboard updates.
Description check ✅ Passed Description includes summary of key changes, test plan with checkboxes, and smoke test results, but lacks detailed testing documentation with commands and review coordination checkboxes as required by template.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/post-865-validation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
pmoves/chrome-extension/options/options.js (1)

262-268: URL validation logic is correct and addresses CodeQL #196.

The new URL() constructor with protocol allowlist is the proper approach for breaking the taint chain. Using parsed.href ensures normalization.

However, when validation fails (invalid URL or disallowed protocol), the link element is still rendered with "View SVG" text but no href. Consider either hiding the link or providing visual feedback when the URL is invalid.

🛠️ Optional: Hide link when URL is invalid
       const link = document.createElement('a');
       const gatewayBase = $('#url-gateway')?.value || 'http://localhost:8085';
       const vizUrl = `${gatewayBase}/viz/shape/${encodeURIComponent(s.shape_id)}.svg`;
       // Validate URL via constructor to prevent XSS (CodeQL `#194`, `#196`)
+      let validUrl = false;
       try {
         const parsed = new URL(vizUrl);
         if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {
           link.href = parsed.href;
+          validUrl = true;
         }
       } catch { /* invalid URL — skip href assignment */ }
-      link.target = '_blank';
-      link.style.cssText = 'margin-left:8px;color:`#667eea`;';
-      link.textContent = 'View SVG';
-      div.appendChild(link);
+      if (validUrl) {
+        link.target = '_blank';
+        link.style.cssText = 'margin-left:8px;color:`#667eea`;';
+        link.textContent = 'View SVG';
+        div.appendChild(link);
+      }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pmoves/chrome-extension/options/options.js` around lines 262 - 268, When URL
validation fails in the block that parses vizUrl with new URL() (where parsed is
checked for parsed.protocol and link.href is assigned), hide or disable the link
element instead of rendering a "View SVG" anchor with no href: update the logic
around link (the link element created/used for the SVG preview) so that if the
try/catch falls through or the protocol is not http/https you either remove the
link from the DOM, set link.hidden = true, or add a disabled/aria-disabled state
and alternative text so users get clear visual feedback when vizUrl is invalid;
ensure any change is applied wherever link and vizUrl are handled so no empty
anchor is shown.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pmoves/chrome-extension/options/options.js`:
- Around line 262-268: In popup.js, before calling chrome.tabs.create({ url:
r.url }) (the place using r.url returned from shapeSvgUrl() in pmoves-api.js),
validate r.url by constructing new URL(r.url) inside a try/catch and ensure its
protocol is 'http:' or 'https:'; only pass the parsed.href to chrome.tabs.create
when the check succeeds, otherwise skip opening the tab or handle the error.
This mirrors the URL validation used in options.js and ensures untrusted
_services.gateway values (including 'javascript:' or 'data:') are not opened.

---

Nitpick comments:
In `@pmoves/chrome-extension/options/options.js`:
- Around line 262-268: When URL validation fails in the block that parses vizUrl
with new URL() (where parsed is checked for parsed.protocol and link.href is
assigned), hide or disable the link element instead of rendering a "View SVG"
anchor with no href: update the logic around link (the link element created/used
for the SVG preview) so that if the try/catch falls through or the protocol is
not http/https you either remove the link from the DOM, set link.hidden = true,
or add a disabled/aria-disabled state and alternative text so users get clear
visual feedback when vizUrl is invalid; ensure any change is applied wherever
link and vizUrl are handled so no empty anchor is shown.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2faa0c0b-de47-4ec0-9016-c7dd3597b449

📥 Commits

Reviewing files that changed from the base of the PR and between 65c3efd and cb531a6.

📒 Files selected for processing (2)
  • pmoves/chrome-extension/options/options.js
  • pmoves/docs/PRODUCTION_AUDIT_DASHBOARD.md

Comment on lines +262 to +268
// Validate URL via constructor to prevent XSS (CodeQL #194, #196)
try {
const parsed = new URL(vizUrl);
if (parsed.protocol === 'http:' || parsed.protocol === 'https:') {
link.href = parsed.href;
}
} catch { /* invalid URL — skip href assignment */ }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check for other unvalidated URL usages in the chrome extension

echo "=== Checking popup.js for URL handling ==="
rg -n -C3 'chrome\.tabs\.create' pmoves/chrome-extension/

echo ""
echo "=== Checking for direct href assignments without URL validation ==="
rg -n '\.href\s*=' pmoves/chrome-extension/ --type js

echo ""
echo "=== Checking pmoves-api.js for URL construction ==="
rg -n -C3 '_services\.gateway' pmoves/chrome-extension/

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 1372


🏁 Script executed:

#!/bin/bash
# Examine the msg() function and where r.url originates
echo "=== Examining popup.js msg function and getShapeSvgUrl action ==="
rg -n -B5 -A10 "getShapeSvgUrl" pmoves/chrome-extension/

echo ""
echo "=== Looking for message handler in popup.js or background script ==="
rg -n -B5 -A10 "getShapeSvgUrl" pmoves/chrome-extension/ --type js

echo ""
echo "=== Checking if pmoves-api.js exists ==="
find pmoves -name "*api*" -o -name "*pmoves*api*" 2>/dev/null

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 5368


🏁 Script executed:

#!/bin/bash
# Get more context around the msg() function in popup.js
echo "=== Finding msg function definition ==="
rg -n "msg\s*=" pmoves/chrome-extension/popup/popup.js -A3

echo ""
echo "=== Looking for background script or service worker ==="
find pmoves/chrome-extension -name "*.js" | grep -E "(background|service|worker)" | head -5

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 201


🏁 Script executed:

#!/bin/bash
# Find shapeSvgUrl function definition
echo "=== Finding shapeSvgUrl function ==="
rg -n "shapeSvgUrl" pmoves/chrome-extension/background.js -B2 -A5

echo ""
echo "=== Looking at pmoves-api.js for URL construction ==="
head -50 pmoves/chrome-extension/lib/pmoves-api.js

echo ""
echo "=== Searching for _services.gateway in pmoves-api.js ==="
rg -n "_services\\.gateway\|gateway" pmoves/chrome-extension/lib/pmoves-api.js -C2

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 2179


🏁 Script executed:

#!/bin/bash
# Find shapeSvgUrl function in pmoves-api.js
echo "=== Finding shapeSvgUrl implementation ==="
rg -n "shapeSvgUrl" pmoves/chrome-extension/lib/pmoves-api.js -B2 -A8

echo ""
echo "=== Full pmoves-api.js to see all exports ==="
wc -l pmoves/chrome-extension/lib/pmoves-api.js

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 488


URL validation missing in popup.js: chrome.tabs.create() passes unvalidated URLs.

At popup.js:188, the code passes r.url directly to chrome.tabs.create({ url: r.url }) without validation. This URL originates from shapeSvgUrl() (pmoves-api.js:319), which constructs it from the configurable _services.gateway without protocol validation:

return `${_services.gateway}/viz/shape/${encodeURIComponent(shapeId)}.svg`;

If _services.gateway is set to a javascript: or data: URL, the extension would attempt to open it, bypassing the protocol validation now applied in options.js.

Apply the same new URL() constructor + protocol check before calling chrome.tabs.create() to ensure consistent security posture.

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

In `@pmoves/chrome-extension/options/options.js` around lines 262 - 268, In
popup.js, before calling chrome.tabs.create({ url: r.url }) (the place using
r.url returned from shapeSvgUrl() in pmoves-api.js), validate r.url by
constructing new URL(r.url) inside a try/catch and ensure its protocol is
'http:' or 'https:'; only pass the parsed.href to chrome.tabs.create when the
check succeeds, otherwise skip opening the tab or handle the error. This mirrors
the URL validation used in options.js and ensures untrusted _services.gateway
values (including 'javascript:' or 'data:') are not opened.

- Remap supabase-realtime default host port 4000→4010 to avoid collision with tensorzero-ui
- Increase grep_context window from 30→55 lines in realtime healthcheck/JWT tests
  to capture healthcheck block below long env var sections

Local-only (gitignored) fixes applied separately:
- Add NATS_URL to env.tier-agent and env.tier-worker
- Remove duplicate SUPABASE_JWT_SECRET from env.shared and env.tier-api

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Docker Hardening Validation

Hardening Validation Report

Validated: Wed Mar 11 17:51:30 UTC 2026

Services Checked

PMOVES.AI Docker Hardening Validation

[INFO] Checking: pmoves/docker-compose.hardened.yml

[INFO] Validating: hi-rag-gateway-v2
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: extract-worker
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: langextract
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: presign
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: render-webhook
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: retrieval-eval
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: pdf-ingest
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: jellyfin-bridge
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: invidious-companion-proxy
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: ffmpeg-whisper
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: media-video
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: media-audio
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: hi-rag-gateway-v2-gpu
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: hi-rag-gateway-gpu
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: deepresearch
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: supaserch
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: publisher-discord
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: mesh-agent
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: nats-echo-req
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: nats-echo-res
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: publisher
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: analysis-echo
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: graph-linker
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: comfy-watcher
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: grayjay-plugin-host
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: agent-zero
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: archon
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: channel-monitor
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: pmoves-yt
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: notebook-sync
[PASS] Non-root user: 65532:65532
[PASS] Read-only filesystem
[PASS] All capabilities dropped
[PASS] No-new-privileges enabled
[WARN] No resource limits

[INFO] Validating: supabase_service_role_key
[WARN] No user directive
[WARN] No read_only directive
[WARN] No cap_drop: ["ALL"]
[WARN] No no-new-privileges
[WARN] No resource limits

[INFO] Validating: supabase_jwt_secret
[WARN] No user directive
[WARN] No read_only directive
[WARN] No cap_drop: ["ALL"]
[WARN] No no-new-privileges
[WARN] No resource limits

======================================
Summary: 120 passed, 40 warnings, 0 errors

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pmoves/tests/smoke/test_supabase_realtime_tenant.py (1)

27-30: ⚠️ Potential issue | 🟡 Minor

Update default port to 4010 to match docker-compose change.

The default fallback URL uses port 4000, but pmoves/docker-compose.yml (line 712) now defaults the host port to 4010. Tests running against the default compose configuration will fail to connect.

🔧 Proposed fix
 SUPABASE_REALTIME_URL = os.getenv(
     "SUPABASE_REALTIME_URL",
-    "ws://localhost:4000/socket/websocket"
+    "ws://localhost:4010/socket/websocket"
 )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pmoves/tests/smoke/test_supabase_realtime_tenant.py` around lines 27 - 30,
The default fallback URL for SUPABASE_REALTIME_URL in the test uses port 4000
which no longer matches the docker-compose change; update the default value in
the SUPABASE_REALTIME_URL declaration to use
"ws://localhost:4010/socket/websocket" so tests using the fallback will connect
to the compose service (modify the constant where SUPABASE_REALTIME_URL is set
in pmoves/tests/smoke/test_supabase_realtime_tenant.py).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pmoves/docker-compose.yml`:
- Around line 711-712: Update the SUPABASE_REALTIME_PORT default in
pmoves/env.supabase (change SUPABASE_REALTIME_PORT from 4000 to 4010) and update
the hardcoded websocket URLs in pmoves/tests/smoke/test_supabase_selfhosted.py
(line with "ws://localhost:4000/socket/websocket") and
pmoves/tests/smoke/test_supabase_realtime_tenant.py (line with
"ws://localhost:4000/socket/websocket") to use port 4010 or derive the host URL
from SUPABASE_REALTIME_PORT so tests follow the new docker-compose host port;
leave the internal container port (4000) references unchanged.

---

Outside diff comments:
In `@pmoves/tests/smoke/test_supabase_realtime_tenant.py`:
- Around line 27-30: The default fallback URL for SUPABASE_REALTIME_URL in the
test uses port 4000 which no longer matches the docker-compose change; update
the default value in the SUPABASE_REALTIME_URL declaration to use
"ws://localhost:4010/socket/websocket" so tests using the fallback will connect
to the compose service (modify the constant where SUPABASE_REALTIME_URL is set
in pmoves/tests/smoke/test_supabase_realtime_tenant.py).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b53bc4e9-2d45-48bb-90b8-617ac4fd55b0

📥 Commits

Reviewing files that changed from the base of the PR and between cb531a6 and ea6f851.

📒 Files selected for processing (2)
  • pmoves/docker-compose.yml
  • pmoves/tests/smoke/test_supabase_realtime_tenant.py

Comment thread pmoves/docker-compose.yml
Comment on lines 711 to +712
ports:
- ${SUPABASE_REALTIME_PORT:-4000}:4000
- ${SUPABASE_REALTIME_PORT:-4010}:4000

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify env files and test defaults for port consistency

echo "=== Checking env.supabase for SUPABASE_REALTIME_PORT ==="
rg -n "SUPABASE_REALTIME_PORT" pmoves/env.supabase pmoves/env.tier-supabase 2>/dev/null || echo "Files not found or no matches"

echo ""
echo "=== Checking test files for hardcoded port 4000 references ==="
rg -n "localhost:4000" pmoves/tests/

Repository: POWERFULMOVES/PMOVES.AI

Length of output: 460


Update env.supabase and test file defaults to match the new 4010 host port.

The docker-compose change from port 4000→4010 avoids a port collision, but pmoves/env.supabase (line 167) still sets SUPABASE_REALTIME_PORT=4000, which will override this default. Additionally, test files at pmoves/tests/smoke/test_supabase_selfhosted.py:31 and test_supabase_realtime_tenant.py:29 use hardcoded ws://localhost:4000/socket/websocket, causing test failures against the new compose default.

The internal container port (4000) correctly remains unchanged, so container-to-container references continue working.

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

In `@pmoves/docker-compose.yml` around lines 711 - 712, Update the
SUPABASE_REALTIME_PORT default in pmoves/env.supabase (change
SUPABASE_REALTIME_PORT from 4000 to 4010) and update the hardcoded websocket
URLs in pmoves/tests/smoke/test_supabase_selfhosted.py (line with
"ws://localhost:4000/socket/websocket") and
pmoves/tests/smoke/test_supabase_realtime_tenant.py (line with
"ws://localhost:4000/socket/websocket") to use port 4010 or derive the host URL
from SUPABASE_REALTIME_PORT so tests follow the new docker-compose host port;
leave the internal container port (4000) references unchanged.

@POWERFULMOVES

Copy link
Copy Markdown
Owner Author

Superseded by atomic PRs: #867 (security/CodeQL #196), #868 (smoke/realtime port), #869 (docs/dashboard). Merge order: #868 → #867 → #869.

@POWERFULMOVES
POWERFULMOVES deleted the fix/post-865-validation branch March 11, 2026 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants