Skip to content
Open
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
4 changes: 4 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ services:
- reverse-proxy
environment:
- ENVIRONMENT=development
# Running platform version, surfaced on the profile page. Reuses the same
# ${VERSION} that tags the image, so it always matches what's deployed
# (and updates on RC->stable promotion, which only retags — doesn't rebuild).
- UNSTRACT_APPS_VERSION=${VERSION}
labels:
- traefik.enable=true
- traefik.http.routers.frontend.rule=Host(`frontend.unstract.localhost`) && !PathPrefix(`/api/v1`) && !PathPrefix(`/deployment`) && !PathPrefix(`/public`)
Expand Down
11 changes: 10 additions & 1 deletion frontend/generate-runtime-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,21 @@

# Generate the runtime-config.js file with the current environment variables
# Note: Using VITE_ prefix for Vite compatibility, fallback to REACT_APP_ for backward compatibility

# Escape backslashes and double quotes so values stay valid inside JS strings
js_escape() {
printf '%s' "$1" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g'
}

APP_VERSION=$(js_escape "${UNSTRACT_APPS_VERSION:-}")

cat > /usr/share/nginx/html/config/runtime-config.js << EOF
// This file is auto-generated at runtime. Do not modify manually.
window.RUNTIME_CONFIG = {
faviconPath: "${VITE_FAVICON_PATH:-${REACT_APP_FAVICON_PATH}}",
logoUrl: "${VITE_CUSTOM_LOGO_URL:-${REACT_APP_CUSTOM_LOGO_URL}}",
enablePosthog: "${VITE_ENABLE_POSTHOG:-${REACT_APP_ENABLE_POSTHOG}}"
enablePosthog: "${VITE_ENABLE_POSTHOG:-${REACT_APP_ENABLE_POSTHOG}}",
version: "${APP_VERSION}"
};
EOF

Expand Down
13 changes: 13 additions & 0 deletions frontend/src/components/profile/Profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useNavigate } from "react-router-dom";
import "./Profile.css";

import { OrganizationIcon } from "../../assets";
import config from "../../config";
import { useAxiosPrivate } from "../../hooks/useAxiosPrivate";
import { useAlertStore } from "../../store/alert-store.js";
import { useSessionStore } from "../../store/session-store.js";
Expand Down Expand Up @@ -234,6 +235,18 @@ function Profile() {
</Typography.Text>
</div>
)}
{config.version && (
<div className="field-group">
<Typography.Text type="secondary" className="field-label">
Platform Version
</Typography.Text>
<div className="field-box">
<Typography.Text className="field-value">
{config.version}
</Typography.Text>
</div>
</div>
)}
</Space>
</Card>
</Col>
Expand Down
1 change: 1 addition & 0 deletions frontend/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const config = {
import.meta.env.VITE_FAVICON_PATH ||
"/favicon.ico",
logoUrl: runtimeConfig.logoUrl || import.meta.env.VITE_CUSTOM_LOGO_URL,
version: runtimeConfig.version || import.meta.env.VITE_VERSION,
// Add more values as OR case, if needed for fallback.
};

Expand Down