Compare commits

...
Sign in to create a new pull request.

5 commits

Author SHA1 Message Date
Manish Tanwar
4122f03ef7 Merged new-branch into main 2025-11-26 21:56:28 +00:00
michael
56a7251b47 feat: allow backend URL override via env var 2025-11-20 09:01:14 -06:00
michael
502cf5b61b fix: remove video-query references and update config.js 2025-11-20 08:40:14 -06:00
michael
b57cbfc3ae chore: stop tracking .env file 2025-11-20 08:18:23 -06:00
michael
4d5154c915 feat: allow MSAL redirect URL override via env var 2025-11-20 08:13:33 -06:00
6 changed files with 23 additions and 13 deletions

3
.gitignore vendored
View file

@ -391,3 +391,6 @@ temp/
# Local development configuration (DO NOT COMMIT)
frontend/public/config.local.js
# Environment variables
.env

View file

@ -1,8 +0,0 @@
# Removed hardcoded PUBLIC_URL to enable flexible deployment paths
# The app now uses runtime configuration from config.json for base path detection
# Optional: Set this if you want to override the runtime base path detection
# REACT_APP_BASE_PATH_OVERRIDE=/your-custom-path
# Temporarily disable Azure AD authentication for testing
REACT_APP_DISABLE_AUTH=true

View file

@ -20,7 +20,7 @@ echo "1. Copy build files to your web server at any path:"
echo " Example: scp -r build/* user@server:/var/www/html/your-app-path/"
echo ""
echo "2. Update config.json on your server:"
echo " - Set 'basePath' to match your deployment path (e.g., '/video_query', '/video-query')"
echo " - Set 'basePath' to match your deployment path (e.g., '/video_query')"
echo " - Set 'domain' to your server's domain"
echo " - Update MSAL and API endpoints as needed"
echo ""

View file

@ -1,12 +1,12 @@
window.__APP_CONFIG__ = {
"_comment": "PRODUCTION CONFIG - Dynamic base path configuration - set basePath to override auto-detection",
"basePath": "/video-query",
"basePath": "/video_query",
"domain": "https://brandtechsandbox.oliver.solutions",
"msal": {
"clientId": "9079054c-9620-4757-a256-23413042f1ef",
"authority": "https://login.microsoftonline.com/e519c2e6-bc6d-4fdf-8d9c-923c2f002385",
"redirectUri": "https://brandtechsandbox.oliver.solutions/video-query/",
"postLogoutRedirectUri": "https://brandtechsandbox.oliver.solutions/video-query/",
"redirectUri": "https://brandtechsandbox.oliver.solutions/video_query/",
"postLogoutRedirectUri": "https://brandtechsandbox.oliver.solutions/video_query/",
"tenantId": "e519c2e6-bc6d-4fdf-8d9c-923c2f002385"
},
"api": {

View file

@ -137,6 +137,16 @@ export const getApiConfig = () => {
throw new Error('Configuration not loaded. Call loadConfig() first.');
}
// Check for environment variable override
if (process.env.REACT_APP_BACKEND_URL) {
const backendUrl = process.env.REACT_APP_BACKEND_URL.replace(/\/$/, ''); // Remove trailing slash if present
console.log('ConfigLoader: Using backend URL from env:', backendUrl);
return {
videoProcessingEndpoint: `${backendUrl}/api/process`,
chunkedUploadEndpoint: backendUrl
};
}
return cachedConfig.api || {};
};

View file

@ -42,7 +42,7 @@ const detectBasePath = () => {
// Common patterns for where React apps are deployed
const commonAppPaths = [
'video_query', 'video-query', 'videoquery',
'video_query', 'videoquery',
'app', 'frontend', 'client', 'ui', 'web'
];
@ -193,6 +193,11 @@ export const getFullPath = (path = '/') => {
* @returns {string} Full redirect URI
*/
export const getRedirectUri = (path = '/') => {
// Allow override via environment variable
if (process.env.REACT_APP_MSAL_REDIRECT_URL) {
console.log('PathUtils: Using configured redirect URL from env:', process.env.REACT_APP_MSAL_REDIRECT_URL);
return process.env.REACT_APP_MSAL_REDIRECT_URL;
}
return getFullUrl(path);
};