-
Notifications
You must be signed in to change notification settings - Fork 5
Fix startup failures from missing modules and incorrect serve syntax #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: bufanoc <4837231+bufanoc@users.noreply.github.com>
Co-authored-by: bufanoc <4837231+bufanoc@users.noreply.github.com>
…et commands Co-authored-by: bufanoc <4837231+bufanoc@users.noreply.github.com>
Co-authored-by: bufanoc <4837231+bufanoc@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds a comprehensive web interface and backend API for managing Open Virtual Network (OVN) components. It introduces a React frontend with Material-UI, Flask backend with REST API endpoints, and implements security improvements including input sanitization to prevent command injection attacks.
- Adds frontend pages for Dashboard, Settings, Logical Routers, Load Balancers, and ACLs
- Implements backend controllers and services for managing OVN resources (switches, routers, ports, ACLs, load balancers)
- Introduces input validation and sanitization to prevent command injection
- Updates the start script to use a different serve command syntax
Reviewed Changes
Copilot reviewed 19 out of 22 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| start.sh | Updates frontend serve command to use -l tcp:// flag syntax |
| frontend/package.json | Adds serve package as devDependency |
| frontend/src/pages/*.js | Creates placeholder pages for Dashboard, Settings, Routers, Load Balancers, and ACLs |
| frontend/public/* | Adds HTML entry point, manifest, and favicon |
| backend/services/ovn_client.py | Implements OVN client with CRUD operations and security improvements |
| backend/controllers/*.py | Adds REST API controllers for all OVN resources |
| backend/utils/validators.py | Implements input validation functions |
| .gitignore | Adds comprehensive ignore patterns for Python and Node |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| api.getLogicalSwitches(), | ||
| api.getLogicalRouters(), | ||
| api.getPorts(), | ||
| api.getACLs() |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Dashboard component calls methods on the api object (getLogicalSwitches(), getLogicalRouters(), getPorts(), getACLs()) that are not defined in the imported api module. The api module in services/api.js only exports an axios instance without these methods defined. These API methods need to be implemented in the api.js file, or the Dashboard should use direct axios calls like api.get('/logical-switches').
| api.getLogicalSwitches(), | |
| api.getLogicalRouters(), | |
| api.getPorts(), | |
| api.getACLs() | |
| api.get('/logical-switches'), | |
| api.get('/logical-routers'), | |
| api.get('/ports'), | |
| api.get('/acls') |
| routers = ovn_client.get_logical_routers() | ||
| return jsonify(routers) | ||
| except Exception as e: | ||
| return jsonify({"error": "An error occurred processing your request"}), 500 |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message 'An error occurred processing your request' is generic and unhelpful for debugging. Unlike the logical_switch.py controller which returns str(e) to provide specific error details, this controller hides the actual error. Consider returning more specific error information (at least in development mode) to aid troubleshooting.
| ports = ovn_client.get_all_ports() | ||
| return jsonify(ports) | ||
| except Exception as e: | ||
| return jsonify({"error": "An error occurred processing your request"}), 500 |
Copilot
AI
Nov 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message 'An error occurred processing your request' is generic and unhelpful for debugging. Unlike the logical_switch.py controller which returns str(e) to provide specific error details, this controller hides the actual error. Consider returning more specific error information (at least in development mode) to aid troubleshooting.
bufanoc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge
Application failed to start due to missing backend controller modules and incorrect frontend serve command syntax.
Backend Fixes
Missing modules: Created controller modules imported by
app.pybut never defined:controllers/logical_router.pycontrollers/acl.pycontrollers/load_balancer.pycontrollers/port.pyutils/validators.pyOVN command issues: Fixed non-existent OVN commands (
lr-get,lb-get,lsp-get) by using list-based lookups:Security hardening: Added input sanitization to prevent command injection and eliminated stack trace exposure in error responses:
All user-provided identifiers, enum values (direction, action, protocol), and numeric ranges (priority) are now validated before use in subprocess commands.
Frontend Fixes
Serve command syntax: Changed from
-l 0.0.0.0:3000to-l tcp://0.0.0.0:3000instart.sh. The serve package requires explicit protocol specification.Missing structure: Created required files:
public/directory with HTML template, manifest, faviconsrc/index.jsentry pointAdded
.gitignoreto exclude build artifacts and Python cache files.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Note
Scaffolds the frontend with basic pages and fixes start.sh to use the correct serve listen syntax.
public/index.html,public/manifest.json, and entrysrc/index.js.src/pages/{Dashboard,LogicalRouters,LoadBalancers,ACLs,Settings}.jswith a functionalDashboardthat fetches counts viaapi.getLogicalSwitches/getLogicalRouters/getPorts/getACLsand displays stats.serveas a dev dependency inpackage.json.servelisten flag to-l tcp://0.0.0.0:3000and retain CORS and logging.Written by Cursor Bugbot for commit a23b35f. This will update automatically on new commits. Configure here.