Skip to content

Add configuration for production.#41

Merged
nut1414 merged 6 commits into
mainfrom
prod-deploy-env
Apr 24, 2025
Merged

Add configuration for production.#41
nut1414 merged 6 commits into
mainfrom
prod-deploy-env

Conversation

@nut1414
Copy link
Copy Markdown
Owner

@nut1414 nut1414 commented Apr 24, 2025

https://cloudboi.pnnp.cc

  • add build configuration for prod
  • remove unused component

@nut1414
Copy link
Copy Markdown
Owner Author

nut1414 commented Apr 24, 2025

@jinnaWan @Dulyarat455 please help review/test -> https://cloudboi.pnnp.cc

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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.'

Comment on lines +4 to +17
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'
Copy link

Copilot AI Apr 24, 2025

Choose a reason for hiding this comment

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

The environment detection logic assumes any non-development environment is production. Consider explicitly handling additional environments (e.g., staging) if applicable.

Copilot uses AI. Check for mistakes.
}

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
Copy link

Copilot AI Apr 24, 2025

Choose a reason for hiding this comment

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

Consider using a more precise replacement (e.g., replacing 'https://' with 'wss://') to ensure correct transformation of the protocol, especially for secure connections.

Suggested change
export const WS_URL = `${baseURL.replace('http', 'ws')}`
export const WS_URL = baseURL.startsWith('https://')
? baseURL.replace('https://', 'wss://')
: baseURL.replace('http://', 'ws://');

Copilot uses AI. Check for mistakes.
Comment thread Makefile
Comment thread docker/app/docker-compose.yaml
Comment thread frontend/Dockerfile.prod
@jinnaWan
Copy link
Copy Markdown
Collaborator

one more thing, do we not need to change the database url?

@nut1414 nut1414 merged commit ab06f22 into main Apr 24, 2025
1 check passed
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.

3 participants