Add configuration for production.#41
Conversation
|
@jinnaWan @Dulyarat455 please help review/test -> https://cloudboi.pnnp.cc |
There was a problem hiding this comment.
Pull Request Overview
This PR configures the application for production by adjusting environment handling, updating UI navigation, and removing temporary support page features.
- Removed support-related navigation and page routes.
- Updated production API URL and WebSocket URL resolution.
- Refined UI copy and adjusted docker-compose deployment settings.
Reviewed Changes
Copilot reviewed 12 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/e2e/pages/common/side_nav_bar.py | Removed support nav item and updated user menu item indices. |
| frontend/src/router.tsx | Removed the temporary support page route. |
| frontend/src/pages/User/SupportPage.tsx | Removed the support page component implementation. |
| frontend/src/pages/Landing/App.tsx | Updated landing page copy and feature descriptions. |
| frontend/src/pages/Instance/InstanceListPage.tsx | Removed the NotificationBadge component from the instance list page. |
| frontend/src/contexts/userContext.tsx | Updated session check failure error message. |
| frontend/src/config/api.ts | Adjusted environment detection and production API/WS URL configuration. |
| frontend/src/components/Public/PublicNavbar.tsx | Commented out deprecated dropdown items for the About section. |
| frontend/src/components/Common/Navbar/NavUser.tsx | Commented out Profile and Settings options from the user dropdown. |
| frontend/index.html | Updated the document title to “Cloudboi”. |
| docker/app/docker-compose.yaml | Added restart policies and updated environment variable usage. |
Files not reviewed (7)
- Makefile: Language not supported
- backend/Dockerfile: Language not supported
- backend/Makefile: Language not supported
- frontend/Dockerfile.dev: Language not supported
- frontend/Dockerfile.prod: Language not supported
- frontend/tsconfig.app.json: Language not supported
- frontend/tsconfig.node.json: Language not supported
Comments suppressed due to low confidence (1)
frontend/src/contexts/userContext.tsx:118
- Verify that the updated error message aligns with the overall error messaging strategy and localization practices across the application.
payload: 'Unauthorized. Please sign in or register.'
| const app_env = !import.meta.env.DEV ? "prod": import.meta.env.VITE_APP_ENV || import.meta.env.APP_ENV || 'dev' | ||
|
|
||
| // In test APP_ENV, use docker proxy | ||
| if (app_env === 'test') { | ||
| return 'proxy/api' | ||
| return 'http://proxy/api' | ||
| } | ||
|
|
||
| if (app_env === 'prod') { | ||
| // workaround for not being able to pass environment variables to the production container | ||
| return 'https://cloudboi.pnnp.cc/api' | ||
| } | ||
|
|
||
| return import.meta.env.VITE_API_URL || 'localhost:80/api' | ||
| // Development fallback | ||
| return import.meta.env.VITE_API_URL || 'http://localhost:80/api' |
There was a problem hiding this comment.
The environment detection logic assumes any non-development environment is production. Consider explicitly handling additional environments (e.g., staging) if applicable.
| } | ||
|
|
||
| export const WS_URL = `ws://${baseURL}` No newline at end of file | ||
| export const WS_URL = `${baseURL.replace('http', 'ws')}` No newline at end of file |
There was a problem hiding this comment.
Consider using a more precise replacement (e.g., replacing 'https://' with 'wss://') to ensure correct transformation of the protocol, especially for secure connections.
| export const WS_URL = `${baseURL.replace('http', 'ws')}` | |
| export const WS_URL = baseURL.startsWith('https://') | |
| ? baseURL.replace('https://', 'wss://') | |
| : baseURL.replace('http://', 'ws://'); |
fb022b8 to
f841ad1
Compare
|
one more thing, do we not need to change the database url? |
https://cloudboi.pnnp.cc