Skip to content

Add Render deployment configuration - #3

Closed
OMCHOKSI108 wants to merge 2 commits into
mainfrom
deploy/render-services
Closed

Add Render deployment configuration#3
OMCHOKSI108 wants to merge 2 commits into
mainfrom
deploy/render-services

Conversation

@OMCHOKSI108

@OMCHOKSI108 OMCHOKSI108 commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds Render Dockerfiles for API, dashboard, and review UI services
  • Adds render.yaml blueprint defining all 3 services
  • Adds Render deployment documentation with blueprint and manual options
  • Adds Render smoke test script (scripts/check_render_deployment.py)
  • Updates ui/app.py to read CODESEC_API_URL from env (was hardcoded localhost)
  • Adds render_entrypoint.sh dispatching to correct service via RENDER_SERVICE env var
  • Root Dockerfile updated with ENTRYPOINT for multi-service dispatch
  • Updates README with Render deployment section and smoke test command
  • RAG service remains on Hugging Face Space

Live Services (Deployed via Render CLI + API)

Service URL Status
API https://codesec-api.onrender.com Live
Dashboard https://codesec-dashboard.onrender.com Live
Review UI https://codesec-review-ui.onrender.com Live

Verification

  • python scripts/evaluate_reviewer.py — 12/12 passing
  • python scripts/review_code.py --code "eval(user_input)" --json — works with RAG
  • python scripts/check_remote_rag_service.py — RAG service healthy (2,833 chunks)
  • smoke test: 6/6 checks pass (health, root, review, stats, dashboard, review-ui)
  • docker build -f deploy/render/api.Dockerfile — builds successfully
  • docker build -f deploy/render/dashboard.Dockerfile — builds successfully

Notes

  • SQLite on Render Free is demo-only and ephemeral (/tmp/reviews.db)
  • CODESEC_RAG_API_KEY secret set on both Render API and HF Space
  • Free services may spin down after inactivity; first request may be slow
  • MongoDB Atlas persistence is next

Copilot AI review requested due to automatic review settings June 22, 2026 08:13
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: b8ff5230-b33b-4b1e-a28c-e3ec29eea56b

📥 Commits

Reviewing files that changed from the base of the PR and between 2079503 and 37e217e.

📒 Files selected for processing (1)
  • README.md
✅ Files skipped from review due to trivial changes (1)
  • README.md

📝 Walkthrough

Walkthrough

Adds a complete Render deployment setup for CodeSecAudit AI: three Dockerfiles and startup scripts for the API, Dashboard, and Review UI services; a render.yaml blueprint wiring them together; a smoke-test script (scripts/check_render_deployment.py); and supporting documentation in docs/render_deployment.md, deploy/render/README.md, and an updated README.md. ui/app.py is updated to read CODESEC_API_URL from the environment.

Changes

Render Deployment Infrastructure

Layer / File(s) Summary
Service container definitions and API URL env var
ui/app.py, deploy/render/api.Dockerfile, deploy/render/api_start.sh, deploy/render/dashboard.Dockerfile, deploy/render/dashboard_start.sh, deploy/render/review-ui.Dockerfile, deploy/render/review_ui_start.sh
Three python:3.11-slim Dockerfiles build the API (port 8003), Dashboard (port 8502), and Review UI (port 8501) images with editable installs and paired set -e bash start scripts. ui/app.py changes API_URL from a hardcoded string to os.getenv("CODESEC_API_URL", "http://localhost:8003").
Render blueprint wiring
render.yaml
Defines codesec-api, codesec-dashboard, and codesec-review-ui web services on the free plan, references their Dockerfiles, sets a /health check on the API, and wires environment variables (RAG settings, SQLite path, CODESEC_API_URL).
Deployment smoke-test script
scripts/check_render_deployment.py
Reads RENDER_API_URL, RENDER_DASHBOARD_URL, and RENDER_REVIEW_UI_URL; runs GET /health, GET /, POST /review/code, GET /stats against the API; conditionally checks the two UI base URLs; exits 0 on all-pass or 1 otherwise.
Deployment documentation
docs/render_deployment.md, deploy/render/README.md, README.md
docs/render_deployment.md covers Blueprint and manual deployment options, required env vars, smoke-test expected output, architecture diagram, Render Free limitations, and production next steps. deploy/render/README.md adds a services table. README.md adds a Render Deployment subsection with environment variable setup and verification command.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 Hippity-hop, three services deploy,
Dockerfiles built with containerized joy!
render.yaml bundles the API and views,
A smoke-test script reports all the good news.
The rabbit checks /health — it passes with glee,
CodeSecAudit hops live for the world to see! 🚀


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

CodeSecAudit AI Review

Verdict: REQUEST_CHANGES

Summary

Reviewed 2 changed code file(s) and found 4 potential issue(s). Highest severity: Critical.

Risk Score

100/100

Only the first 1 inline comment(s) were posted. See table below for the full list of 4 issue(s).

Issues Found

Location CWE Severity Issue Suggested Fix
scripts/check_render_deployment.py:102 CWE-94 Critical Code Injection via eval() Replace eval()/exec() with a safe alternative:
- For JSON: use JSON.parse() instead of eval().
- For arithmetic: use a proper expression parser like expr-eval.
- For dynamic property ac
ui/app.py:23 CWE-94 Critical Code Injection via eval() Replace eval()/exec() with a safe alternative:
- For JSON: use JSON.parse() instead of eval().
- For arithmetic: use a proper expression parser like expr-eval.
- For dynamic property ac
ui/app.py:28 CWE-89 Critical SQL Injection via String Concatenation Use parameterized queries (prepared statements) instead of string concatenation:
- SQLite: cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,))
- Node.js: `db.execute("SELECT * FROM
ui/app.py:38 CWE-94 Critical Code Injection via eval() Replace eval()/exec() with a safe alternative:
- For JSON: use JSON.parse() instead of eval().
- For arithmetic: use a proper expression parser like expr-eval.
- For dynamic property ac

Notes

  • This is an AI-assisted defensive security review.
  • It does not replace manual review or professional SAST tools.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CodeSecAudit AI Review

Verdict: REQUEST_CHANGES

Summary

Reviewed 2 changed code file(s) and found 4 potential issue(s). Highest severity: Critical.

Risk Score

100/100

Only the first 1 inline comment(s) were posted. See table below for the full list of 4 issue(s).

Issues Found

Location CWE Severity Issue Suggested Fix
scripts/check_render_deployment.py:102 CWE-94 Critical Code Injection via eval() Replace eval()/exec() with a safe alternative:
- For JSON: use JSON.parse() instead of eval().
- For arithmetic: use a proper expression parser like expr-eval.
- For dynamic property ac
ui/app.py:23 CWE-94 Critical Code Injection via eval() Replace eval()/exec() with a safe alternative:
- For JSON: use JSON.parse() instead of eval().
- For arithmetic: use a proper expression parser like expr-eval.
- For dynamic property ac
ui/app.py:28 CWE-89 Critical SQL Injection via String Concatenation Use parameterized queries (prepared statements) instead of string concatenation:
- SQLite: cursor.execute("SELECT * FROM users WHERE id = ?", (user_id,))
- Node.js: `db.execute("SELECT * FROM
ui/app.py:38 CWE-94 Critical Code Injection via eval() Replace eval()/exec() with a safe alternative:
- For JSON: use JSON.parse() instead of eval().
- For arithmetic: use a proper expression parser like expr-eval.
- For dynamic property ac

Notes

  • This is an AI-assisted defensive security review.
  • It does not replace manual review or professional SAST tools.

"3/6 API /review/code",
f"{api}/review/code",
method="POST",
data={"code": "eval(user_input)", "file_path": "test.py"},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CodeSecAudit AI: CWE-94 Code Injection via eval()

Severity: Critical

Using eval(), exec(), or new Function() executes arbitrary code from strings. An attacker who controls any part of the evaluated string can execute arbitrary commands, leading to full compromise of the application.

Suggested fix: Replace eval()/exec() with a safe alternative:

  • For JSON: use JSON.parse() instead of eval().
  • For arithmetic: use a proper expression parser like expr-eval.
  • For dynamic property access: use bracket notation with an allowlist.
  • Never trust user input as executable code.

@OMCHOKSI108
OMCHOKSI108 deleted the deploy/render-services branch June 22, 2026 09:43
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