Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 8 additions & 28 deletions api/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ services:
restart: unless-stopped
environment:
- NODE_ENV=${NODE_ENV:-production}
- REACT_APP_API_URL=${REACT_APP_API_URL:-http://localhost:5001}
- REACT_APP_UPLOAD_API_URL=${REACT_APP_UPLOAD_API_URL:-http://localhost:4002}
- VITE_BASE_API_URL=${VITE_BASE_API_URL:-http://localhost:5001/}
- VITE_UPLOAD_SERVER=${VITE_UPLOAD_SERVER:-http://localhost:4002/}
networks:
- migration-network
security_opt:
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs');
const path = require('path');

const apiEnvContent = `APP_TOKEN_KEY=MIGRATION_V2\nPORT=5001\n`;
const uiEnvContent = `REACT_APP_WEBSITE_BASE_URL="http://localhost:3000/"\nREACT_APP_BASE_API_URL="http://localhost:5001/"\nREACT_APP_API_VERSION=v2\nREACT_APP_HOST="http://localhost:3000"\nREACT_APP_UPLOAD_SERVER="http://localhost:4002/"\nREACT_APP_OFFLINE_CMS=true\n`;
const uiEnvContent = `VITE_WEBSITE_BASE_URL="http://localhost:3000/"\nVITE_BASE_API_URL="http://localhost:5001/"\nVITE_API_VERSION=v2\nVITE_HOST="http://localhost:3000"\nVITE_UPLOAD_SERVER="http://localhost:4002/"\nVITE_OFFLINE_CMS=true\n`;
const uploadAPIEnvContent = `PORT=4002\nNODE_BACKEND_API=http://localhost:5001\n`;

const envFilePaths = {
Expand Down
12 changes: 6 additions & 6 deletions ui/.env.local
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
REACT_APP_WEBSITE_BASE_URL="http://localhost:3000/"
REACT_APP_BASE_API_URL="http://localhost:5001/"
REACT_APP_API_VERSION=v2
REACT_APP_HOST="http://localhost:3000"
REACT_APP_UPLOAD_SERVER="http://localhost:4002/"
REACT_APP_OFFLINE_CMS=true
VITE_WEBSITE_BASE_URL="http://localhost:3000/"
VITE_BASE_API_URL="http://localhost:5001/"
VITE_API_VERSION=v2
VITE_HOST="http://localhost:3000"
VITE_UPLOAD_SERVER="http://localhost:4002/"
VITE_OFFLINE_CMS=true
Comment on lines +1 to +6
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

ui/.env.local is committed with localhost defaults, but Vite loads .env.local even in production builds. This risks baking machine-specific URLs into the bundle and can also conflict with docker-provided env at build time. Remove this file from version control (keep it developer-local), and instead commit a .env.example (or .env) with safe placeholder values.

Suggested change
VITE_WEBSITE_BASE_URL="http://localhost:3000/"
VITE_BASE_API_URL="http://localhost:5001/"
VITE_API_VERSION=v2
VITE_HOST="http://localhost:3000"
VITE_UPLOAD_SERVER="http://localhost:4002/"
VITE_OFFLINE_CMS=true
VITE_WEBSITE_BASE_URL="https://frontend.example.com/"
VITE_BASE_API_URL="https://api.example.com/"
VITE_API_VERSION=v2
VITE_HOST="https://frontend.example.com"
VITE_UPLOAD_SERVER="https://upload.example.com/"
VITE_OFFLINE_CMS=false

Copilot uses AI. Check for mistakes.
4 changes: 1 addition & 3 deletions ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,4 @@ yarn-error.log*


# .npmrc
.npmrc

!.env.local
.npmrc
3 changes: 2 additions & 1 deletion ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ USER nodeapp

EXPOSE 3000

CMD [ "npm", "run", "start" ]
# Build at container startup so VITE_* env vars from docker-compose
CMD [ "sh", "-c", "npm run build && npx vite preview --port 3000 --host" ]
8 changes: 4 additions & 4 deletions ui/public/index.html → ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
name="description"
content="Contentstack Migrations tool for easily migrate content between stacks or from other CMS platforms to Contentstack."
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="apple-touch-icon" href="/logo192.png" />

<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="manifest" href="/manifest.json" />

<title>Contentstack Migration Tool</title>

Expand All @@ -24,9 +24,8 @@
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="preload"
as="style"
href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap"
rel="stylesheet"
/>
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:wght@100..900&display=swap"
Expand Down Expand Up @@ -71,5 +70,6 @@
<a href="#root" class="skip-to-main-content-link">Skip to main content</a>

<div id="root"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading